/* Eiderwerk. Tokens and rules live in DESIGN.md; keep this file in step with it. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-wdth125-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-stretch: 125%;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk-var-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ground: #E9E9E7;
  --surface: #F4F4F2;
  --text: #121212;
  --text-muted: #5E5E5B;
  --rule: #C4C4C0;
  --primary: #121212;

  --font-display: "Archivo", "Arial Narrow", sans-serif;
  --font-body: "Hanken Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 96px;

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #141413; --surface: #1C1C1A; --text: #E8E8E4;
    --text-muted: #9E9E98; --rule: #34342F; --primary: #E8E8E4;
  }
}
:root[data-theme="dark"] {
  --ground: #141413; --surface: #1C1C1A; --text: #E8E8E4;
  --text-muted: #9E9E98; --rule: #34342F; --primary: #E8E8E4;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 1px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--space-md); top: var(--space-md); background: var(--surface); padding: var(--space-sm) var(--space-md); z-index: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.sheet {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px var(--space-lg) 40px;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ---------- top bar ---------- */
.top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md); }
.theme-toggle {
  flex: none;
  min-height: 44px;
  margin: -12px 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: 400 0.875rem/1.5 var(--font-mono);
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.theme-toggle:hover { text-decoration-thickness: 2px; }
.theme-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 1px; }
.theme-toggle[hidden] { display: none; }

/* ---------- plate: legal facts first ---------- */
.plate {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) 14px;
  font: 400 0.875rem/1.5 var(--font-mono);
  font-feature-settings: "tnum";
  color: var(--text-muted);
}
.plate li + li::before { content: "·"; margin-right: 14px; color: var(--rule); }

/* ---------- mark ---------- */
main { padding-top: var(--space-2xl); }
.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.intro {
  max-width: 46ch;
  margin: 28px 0 0;
  font-size: 1.1875rem;
  line-height: 1.5;
}

/* ---------- register ---------- */
.register {
  list-style: none;
  margin: 88px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.register li { position: relative; border-bottom: 1px solid var(--rule); }
.entry {
  display: grid;
  grid-template-columns: minmax(180px, 3fr) 6fr 10.5rem;
  gap: var(--space-lg);
  align-items: baseline;
  padding: 20px 0;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}
a.entry::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms var(--ease-out);
}
a.entry:hover::after, a.entry:focus-visible::after { transform: scaleX(1); }
a.entry:focus-visible { outline: none; }
.entry-name { font: 600 1.375rem/1.2 var(--font-body); letter-spacing: -0.01em; }
.entry-desc { color: var(--text-muted); }
.entry-url {
  justify-self: end;
  font: 400 0.8125rem/1.5 var(--font-mono);
  color: var(--primary);
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a.entry:hover .entry-url, a.entry:focus-visible .entry-url { text-decoration-thickness: 2px; }

/* ---------- footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  padding-top: var(--space-xl);
  font-size: 0.9375rem;
}
.foot a { display: inline-block; padding: 10px 0; }

/* ---------- company details ---------- */
.page-title {
  margin: 0 0 32px;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -0.015em;
}
.facts {
  display: grid;
  grid-template-columns: 200px 1fr;
  max-width: 720px;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.facts dt, .facts dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--text-muted); font-size: 0.9375rem; }
.facts dd { font: 400 0.9375rem/1.5 var(--font-mono); font-feature-settings: "tnum"; }
.facts dd a { font: inherit; }
.notes { max-width: 62ch; margin-top: 40px; }
.notes p { margin: 0 0 var(--space-md); color: var(--text-muted); font-size: 0.9375rem; }

/* ---------- breakpoints ---------- */
@media (min-width: 1440px) {
  .sheet { padding-top: 64px; }
}
@media (max-width: 1024px) {
  .entry { grid-template-columns: minmax(160px, 2fr) 5fr 10.5rem; }
}
@media (max-width: 768px) {
  .sheet { padding: 28px var(--space-lg) 24px; min-height: 0; }
  main { padding-top: 56px; }
  .register { margin-top: 56px; }
  .entry { grid-template-columns: 1fr; gap: var(--space-xs); padding: 18px 0; }
  .entry-url { margin-top: var(--space-xs); justify-self: start; }
  .page-title { font-size: 2rem; }
}
@media (max-width: 600px) {
  .sheet { padding-left: var(--space-md); padding-right: var(--space-md); }
  .intro { font-size: 1.0625rem; }
  .plate { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 2px 20px; }
  .plate li + li::before { content: none; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  a.entry::after { transition: none; }
}
