/* Hypoidal's site. Plain CSS.
   The design is CopperWorks' (copperworks-site/static/site.css), which shares
   this server: the same structure of tokens, type and parts, so the two read
   as one family. The accent is Hypoidal's own - steel blue, the colour of
   the bright steel its parts are and of the blueprint its drawings come from.
   Theme: dark only. Every colour is a token on :root. Mostly charcoal, cool
   neutrals in the text, steel as the accent and in the hero's sweep. Type:
   Geist and Geist Mono, served from /static/fonts. Where CopperWorks draws
   routed traces, Hypoidal draws a bolt and a nut as a technical drawing. */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #0e1013;
  --bg-alt: #13161a;
  --surface: #171a1f;
  --fg: #e9ecf0;
  --muted: #9aa3ad;
  --line: #252a31;
  --accent: #7fa7d9;
  --accent-strong: #a9c6ea;
  --accent-soft: #16202c;
  --fine-line: #93a0b0;
  --on-accent: #08111c;

  /* Hero: base colour sweeping into steel. */
  --hero-a: #0e1013;
  --hero-b: #17171a;
  --hero-c: #1d2a3a;
  --hero-d: #3c5f8a;
  --ink-a: #6f97c8;
  --ink-b: #d6e6f8;
  --pad: #a9c6ea;

  --code-bg: #0a0b0d;
  --code-fg: #e6e2dc;
  --code-comment: #868d98;
  --code-keyword: #8fb6e6;
  --code-string: #a9c98f;
  --code-number: #f0c674;

  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3),
    0 12px 32px rgb(0 0 0 / 0.4);

  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}

main { flex: 1; }

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

h1, h2, h3 { line-height: 1.12; text-wrap: balance; font-weight: 600; }
h1 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.9rem); letter-spacing: -0.035em; margin: 0 0 1.1rem; }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.1rem); letter-spacing: -0.025em; margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.08rem; letter-spacing: -0.01em; margin: 0 0 0.4rem; }
p { margin: 0 0 1rem; }

code {
  font: 0.88em/1.5 var(--mono);
  background: var(--accent-soft);
  padding: 0.12em 0.35em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.wrap.narrow { max-width: 46rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(1.4) blur(10px);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem 1rem; min-height: 3.75rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--fg); text-decoration: none; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em;
}
.brand:hover { color: var(--fg); }
.site-header nav { display: flex; align-items: center; gap: 0.25rem 1.25rem; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.93rem; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--fg); }
.site-header nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 5rem; padding: 1.5rem 0;
  color: var(--muted); font-size: 0.85rem;
}
.footer-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-row p { margin: 0; }
.site-footer .company { margin: 0.75rem auto 0; font-size: 0.8rem; }

/* Buttons */

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }
.button {
  display: inline-block; padding: 0.7rem 1.2rem; border-radius: 9px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--fg); text-decoration: none; font-weight: 550; font-size: 0.97rem;
}
.button:hover { border-color: var(--accent); color: var(--fg); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
button.button { font: inherit; cursor: pointer; }

/* Hero: the steel sweep, with a bolt and a nut drawn in. */

.hero {
  position: relative; overflow: hidden;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem);
  background:
    radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--hero-d) 55%, transparent), transparent 60%),
    linear-gradient(112deg, var(--hero-a) 0%, var(--hero-b) 42%, var(--hero-c) 74%, var(--hero-d) 100%);
  border-bottom: 1px solid var(--line);
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 15ch; }
.hero .lede { max-width: 36rem; }
.hero .drawing {
  position: absolute; z-index: 0; right: max(-4rem, calc(50% - 46rem)); top: 50%;
  width: min(48rem, 64vw); transform: translateY(-50%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 42%);
}
.eyebrow {
  color: var(--accent-strong); font-weight: 550; font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1rem;
}
.lede { font-size: 1.16rem; color: var(--muted); max-width: 40rem; }

/* The drawing's line work: the part's outline in the steel ink, its hidden
   and construction lines finer, dimensions dashed. */
.drawing .ink-a { stop-color: var(--ink-a); }
.drawing .ink-b { stop-color: var(--ink-b); }
.drawing .lines path {
  fill: none; stroke: url(#drawing-ink); stroke-width: 5;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0.88;
  stroke-dasharray: 1; stroke-dashoffset: 0;
}
.drawing .lines path.fine { stroke-width: 2.5; opacity: 0.6; }
.drawing .centre { fill: none; stroke: var(--ink-b); stroke-opacity: 0.35; stroke-width: 1.5; stroke-dasharray: 14 5 3 5; }
.drawing .dimension { fill: none; stroke: var(--pad); stroke-width: 2; stroke-opacity: 0.8; }
.drawing .ends circle { fill: var(--pad); }
.drawing text { fill: var(--pad); font: 500 15px var(--mono); letter-spacing: 0.04em; }

@media (prefers-reduced-motion: no-preference) {
  .drawing .lines path {
    stroke-dashoffset: 1;
    animation: draw 1.6s cubic-bezier(0.5, 0, 0.2, 1) forwards;
    animation-delay: 0.25s;
  }
  /* One stroke after another, as a hand draws: set here rather than on each
     path, because the site's policy allows no inline styles. */
  .drawing .lines path:nth-child(2) { animation-delay: 0.32s; }
  .drawing .lines path:nth-child(3) { animation-delay: 0.39s; }
  .drawing .lines path:nth-child(4) { animation-delay: 0.46s; }
  .drawing .lines path:nth-child(5) { animation-delay: 0.53s; }
  .drawing .lines path:nth-child(6) { animation-delay: 0.60s; }
  .drawing .lines path:nth-child(7) { animation-delay: 0.67s; }
  .drawing .lines path:nth-child(8) { animation-delay: 0.74s; }
  .drawing .lines path:nth-child(9) { animation-delay: 0.81s; }
  .drawing .lines path:nth-child(10) { animation-delay: 0.88s; }
  .drawing .lines path:nth-child(11) { animation-delay: 0.95s; }
  .drawing .lines path:nth-child(12) { animation-delay: 1.02s; }
  .drawing .lines path:nth-child(13) { animation-delay: 1.09s; }
  .drawing .lines path:nth-child(14) { animation-delay: 1.16s; }
  .drawing .lines path:nth-child(15) { animation-delay: 1.23s; }
  .drawing .lines path:nth-child(16) { animation-delay: 1.30s; }
  .drawing .lines path:nth-child(n+17) { animation-delay: 1.37s; }
  .drawing .notes { opacity: 0; animation: appear 0.8s ease 1.6s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes appear { to { opacity: 1; } }
}

@media (max-width: 52rem) {
  .hero .drawing { width: 120vw; right: -45vw; opacity: 0.18; }
}

/* Home */

.demo { padding: 3.5rem 0 3rem; }
.app-window {
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
.titlebar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--line);
  background: var(--bg-alt); font-size: 0.8rem; color: var(--muted);
}
.titlebar span { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--line); }
.titlebar b { font-weight: 500; margin-left: 0.6rem; }
.panes { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.pane { min-width: 0; }
.pane .code { margin: 0; border-radius: 0; height: 100%; }
.pane.part {
  display: grid; place-items: center; padding: 1.5rem; min-height: 14rem;
  background:
    radial-gradient(circle, var(--line) 1px, transparent 1.5px) 0 0 / 16px 16px,
    var(--bg-alt);
}
.pane.part svg { width: min(100%, 20rem); height: auto; }
.part-plan .outline { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.part-plan .fine { fill: none; stroke: var(--fine-line); stroke-width: 1.5; }
.part-plan .centre { fill: none; stroke: var(--fine-line); stroke-opacity: 0.5; stroke-width: 1; stroke-dasharray: 10 4 2 4; }
.part-plan .dimension { fill: none; stroke: var(--pad); stroke-width: 1.25; }
.part-plan .ends circle { fill: var(--pad); }
.part-plan text { fill: var(--pad); font: 500 11px var(--mono); }
.part-plan text.title { fill: var(--muted); font: 500 10.5px var(--sans); letter-spacing: 0.06em; }
.app-window figcaption {
  padding: 0.75rem 1rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.9rem;
}
@media (max-width: 52rem) {
  .panes { grid-template-columns: 1fr; }
}

.loop, .features, .audience { padding: 2.5rem 0; }
.loop h2, .features h2, .audience h2 { margin-top: 0; }

.steps {
  list-style: none; padding: 0; margin: 1.5rem 0 0; counter-reset: step;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.steps li {
  counter-increment: step; padding: 1.35rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.steps li::before {
  content: counter(step, decimal-leading-zero); display: block; margin-bottom: 0.9rem;
  font: 500 0.8rem/1 var(--mono); color: var(--accent-strong); letter-spacing: 0.04em;
}
.steps p, .grid p, .cards p { color: var(--muted); margin: 0; }

.grid {
  display: grid; gap: 1px; margin-top: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.grid article { padding: 1.5rem; background: var(--surface); }
.grid .standards { font: 500 0.8rem/1.5 var(--mono); color: var(--accent-strong); letter-spacing: 0.02em; margin-top: 0.6rem; }

.cards {
  list-style: none; padding: 0; margin: 1.5rem 0 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.cards li {
  padding: 1.35rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--surface) 55%, var(--accent-soft));
}

.pricing-note { padding: 3rem 0 0; text-align: center; }
.pricing-note .wrap {
  padding-top: 2.5rem; padding-bottom: 2.5rem; border-radius: var(--radius);
  background: linear-gradient(112deg, var(--hero-b), var(--accent-soft));
  border: 1px solid var(--line);
}
.pricing-note h2 { margin-top: 0; }
.pricing-note p { color: var(--muted); }
.pricing-note .actions { justify-content: center; margin-top: 1.5rem; }

/* Inner pages */

.page-head {
  padding: clamp(3rem, 7vw, 5rem) 0 1.5rem; margin-bottom: 1rem;
  background: linear-gradient(112deg, var(--hero-a) 30%, var(--hero-b) 65%, color-mix(in srgb, var(--hero-c) 55%, var(--hero-b)));
  border-bottom: 1px solid var(--line);
}
.page-head .lede { margin-bottom: 0; }
.prose { padding: 0.5rem 0; }
.prose p, .prose li { max-width: 42rem; color: var(--muted); }
.prose strong { color: var(--fg); font-weight: 550; }
.numbered ol { padding-left: 1.25rem; }
.numbered li { margin-bottom: 0.4rem; }
.note { color: var(--muted); font-size: 0.92rem; }

/* Code */

pre.code {
  margin: 1.25rem 0; padding: 1.1rem 1.25rem; overflow-x: auto;
  background: var(--code-bg); color: var(--code-fg);
  border-radius: var(--radius); font: 0.8rem/1.65 var(--mono);
}
pre.code code { background: none; padding: 0; color: inherit; font: inherit; }
pre.code .c { color: var(--code-comment); }
pre.code .k { color: var(--code-keyword); }
pre.code .s { color: var(--code-string); }
pre.code .n { color: var(--code-number); }

/* Download */

.platforms {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.platforms li { padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.platforms h2 { margin: 0 0 0.25rem; font-size: 1.25rem; color: var(--fg); }
.platforms .status { margin: 0 0 1rem; color: var(--muted); }
.platforms .actions { margin-top: 0; }
.checksum { font-size: 0.8rem; color: var(--muted); margin: 1rem 0 0; }

/* Back office */

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.filters a {
  padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); text-decoration: none; font-size: 0.88rem;
}
.filters a.on, .filters a:hover { color: var(--fg); border-color: var(--accent); }
.inbox { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.item { padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.item.new { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.item p { margin: 0 0 0.35rem; }
.item .meta { color: var(--muted); font-size: 0.85rem; }
.item .meta strong { color: var(--accent-strong); font-weight: 550; }
.item .message { white-space: pre-wrap; overflow-wrap: anywhere; }
.item .context { color: var(--muted); font-size: 0.88rem; }
.item form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.item select, .item input {
  font: inherit; font-size: 0.9rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg-alt); color: var(--fg);
}
.item input { flex: 1; min-width: 12rem; }
.item select:focus, .item input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.item .button { padding: 0.45rem 0.9rem; font-size: 0.9rem; }
