/* nikit.org, linked as style.css?v=4. nginx caches .css and .svg for 7 days: after editing this file or favicon.svg, raise ?v= in all four HTML pages. */

/* Colours */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #5b5b5b;
  --rule: #e0e0e0;
  --accent: #0645ad;

  --sans: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI",
    system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Noto Sans",
    "Helvetica Neue", Arial, sans-serif;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #21201e;
    --text: #e6e4e0;
    --muted: #a9a59f;
    --rule: #3b3936;
    --accent: #8ab4f8;
  }
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* One left-aligned column */
body {
  max-width: 38rem;
  margin: 0 1rem 0 clamp(1rem, 10vw - 2rem, 8rem);
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.55;
  overflow-wrap: break-word;
}

h1,
h2,
p,
ul {
  margin: 0;
}

h1,
h2 {
  font-weight: 600;
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link */
main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background-color: var(--bg);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  padding: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}

/* Wordmark */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

a.wordmark:hover span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.mark {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}

.mark-tile {
  fill: currentColor;
}

.mark-glyph {
  stroke: var(--bg);
}

/* Main */

.intro {
  padding: 1.25rem 0;
}

main > h1 {
  margin-top: 2rem;
  font-size: 1.5rem;
}

.updated {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

main > h1 + .intro,
.updated + .intro {
  padding-top: 0.75rem;
}

section {
  padding: 1rem 0 1.25rem;
  border-top: 1px solid var(--rule);
}

/* Section labels */
h2 {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

section p + p {
  margin-top: 0.5rem;
}

.lines {
  padding: 0;
  list-style: none;
}

.status {
  color: var(--muted);
}

/* Contact */
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding-top: 0.25rem;
}

/* Button */
.button {
  display: inline-block;
  padding: 0.4375rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

@media (hover: hover) {
  .button:hover {
    background-color: var(--accent);
    color: var(--bg);
  }
}

/* Footer */

.site-footer {
  padding: 1rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

/* Small screens */

@media (max-width: 30rem) {
  .site-header {
    padding-top: 1.5rem;
  }

  main > h1 {
    margin-top: 1.5rem;
  }
}

/* Forced colours */

@media (forced-colors: active) {
  .mark-tile {
    fill: CanvasText;
  }

  .mark-glyph {
    stroke: Canvas;
  }
}

/* Print */

@page {
  margin: 2cm;
}

@media print {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --text: #000000;
    --muted: #333333;
    --rule: #999999;
    --accent: #000000;
  }

  body {
    max-width: none;
    margin: 0;
    font-size: 11pt;
  }

  .skip-link {
    display: none;
  }

  .site-header {
    padding-top: 0;
  }

  .button {
    padding: 0;
    border: 0;
    font-weight: 400;
    text-decoration: underline;
  }

  h2 {
    break-after: avoid;
  }

  section {
    break-inside: avoid;
  }
}

/* Tool front-doors */

.tools li + li {
  margin-top: 0.5rem;
}

.tools-files {
  margin-top: 1rem;
}

.desc + .desc {
  margin-top: 0.75rem;
}

/* Sign-in gate (not wired up: every submission is denied server-side) */

.gate-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.375rem;
  max-width: 20rem;
  margin-top: 0.5rem;
}

.gate-form label {
  color: var(--muted);
  font-size: 0.9375rem;
}

.gate-form label + input {
  margin-bottom: 0.5rem;
}

.gate-form input {
  padding: 0.4375rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background-color: var(--bg);
  color: var(--text);
  font: inherit;
}

.gate-form input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.gate-form button {
  margin-top: 0.25rem;
  align-self: start;
  cursor: pointer;
}
