/* What the C*rp*s — black and white, set in Space Grotesk.
   No framework, no build step. Relative links so the site works from a
   project path. The font is self-hosted: no request leaves for Google, which
   matters when half the people reading this are in the EU. */

/* Variable weight 300–700, split the way Google subsets it so a page that
   never prints "Kurtuluş" never downloads the extended set. */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('./fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('./fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --fg: #000000;
  --dim: #565656;
  --line: #cfcfcf;
  --box: #f4f4f2;
  --sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          Helvetica, Arial, sans-serif;
  /* Space Grotesk has a tall x-height, so the same nominal size reads larger
     than a system sans; the scale below is set for it, not inherited from it. */
  --step-0: 1.0625rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.3rem + 2vw, 2.4rem);
  --micro: 0.7rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #ffffff;
    --dim: #9a9a9a;
    --line: #333333;
    --box: #121212;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.58;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 43rem; margin: 0 auto; padding: 0 1.25rem 6rem; }

/* ---------- header ---------- */

header.site {
  border-bottom: 2px solid var(--fg);
  margin-bottom: 2.75rem;
  padding-top: 2.75rem;
}

.brand {
  display: block;
  font-size: var(--step-3);
  font-weight: 700;
  /* Grotesque display wants negative tracking; at 700 it closes up nicely. */
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-decoration: none;
  color: inherit;
  margin: 0 0 0.5rem;
}

.tagline {
  margin: 0 0 1.5rem;
  max-width: 40rem;
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.5;
}

nav.tabs { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }

nav.tabs a {
  display: block;
  padding: 0.55rem 0;
  color: var(--dim);
  text-decoration: none;
  font-size: var(--micro);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 100ms linear;
}

nav.tabs a:hover { color: var(--fg); }
nav.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }

/* ---------- text ---------- */

h1 {
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 1.25rem;
}

h2 {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 2.75rem 0 0.9rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 1.9rem 0 0.5rem;
}

p, ul, ol { margin: 0 0 1.15rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.45rem; }

a { color: inherit; }

.lead {
  font-size: var(--step-1);
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.dim { color: var(--dim); }
.small { font-size: 0.9rem; }

blockquote {
  margin: 1.35rem 0;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--fg);
  background: var(--box);
  font-size: 0.9375rem;
  line-height: 1.55;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--box);
  padding: 0.1em 0.32em;
}

/* ---------- spec list ---------- */

dl.spec { margin: 1.5rem 0; }
dl.spec > div { padding: 0.9rem 0; border-top: 1px solid var(--line); }

dl.spec dt {
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

dl.spec dd { margin: 0.3rem 0 0; }

@media (min-width: 34rem) {
  dl.spec > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1.25rem; }
  dl.spec dd { margin-top: 0; }
}

/* ---------- steps ---------- */

ol.steps { list-style: none; padding: 0; counter-reset: s; margin: 1.5rem 0; }

ol.steps li {
  counter-increment: s;
  padding: 0.9rem 0 0.9rem 3.25rem;
  border-top: 1px solid var(--line);
  position: relative;
}

ol.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.9rem;
  font-weight: 700;
  font-size: var(--micro);
  letter-spacing: 0.1em;
}

ol.steps b {
  display: block;
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

/* ---------- callout ---------- */

.note { border: 2px solid var(--fg); padding: 1.15rem 1.25rem; margin: 1.75rem 0; }
.note p:last-child { margin-bottom: 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border: 2px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 100ms linear, color 100ms linear;
}

.btn:hover { background: var(--bg); color: var(--fg); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn--ghost { background: var(--bg); color: var(--fg); }
.btn--ghost:hover { background: var(--fg); color: var(--bg); }

/* ---------- form ---------- */

form.submit label.field { display: block; margin: 1.5rem 0 0; }

form.submit .label {
  display: block;
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

form.submit .hint {
  display: block;
  color: var(--dim);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.45rem;
}

form.submit input[type="text"],
form.submit input[type="email"],
form.submit input[type="url"],
form.submit textarea,
form.submit select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: var(--step-0);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--fg);
  border-radius: 0;
}

form.submit textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }

form.submit :is(input, textarea, select):focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 1px;
}

form.submit input[type="file"] {
  width: 100%;
  padding: 1rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg);
  border: 2px dashed var(--fg);
  background: var(--box);
}

form.submit .check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0.7rem 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

form.submit .check input { margin-top: 0.3rem; flex: none; }

fieldset { border: 1px solid var(--line); padding: 1.1rem 1.25rem; margin: 1.75rem 0 0; }

legend {
  font-size: var(--micro);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0 0.45rem;
}

.req { font-weight: 400; color: var(--dim); letter-spacing: 0; text-transform: none; }

/* ---------- upload progress ---------- */

#status, #regStatus { margin-top: 1.75rem; }

.file-row { border-top: 1px solid var(--line); padding: 0.65rem 0; font-size: 0.9rem; }

.bar { height: 6px; background: var(--box); border: 1px solid var(--line); margin-top: 0.4rem; }
.bar > span { display: block; height: 100%; background: var(--fg); width: 0; transition: width 150ms linear; }

.ok::before { content: "\2713\00a0"; font-weight: 700; }
.fail::before { content: "\2717\00a0"; font-weight: 700; }

/* ---------- contributors ---------- */

ul.people { list-style: none; padding: 0; margin-top: 1.5rem; }

ul.people li {
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.85rem;
}

ul.people b { font-weight: 700; letter-spacing: -0.01em; }
ul.people span { color: var(--dim); font-size: 0.9rem; }

/* ---------- footer ---------- */

footer.site {
  border-top: 2px solid var(--fg);
  margin-top: 4.5rem;
  padding-top: 1.35rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--dim);
}
