/* phobos landing site — docs/UI-STYLE.md, re-expressed. Tokens once, here. */
:root {
  --primary: #FFC11E;
  --primary-muted: #FFD95A;
  --primary-dusk: #FFE192;
  --white: #FFFFFF;
  --text-black: #121212;
  --bg-dark: #1A1B1C;
  --black: #000000;
  --bg-grey: #232425;
  --dusk: #27282A;
  --text-grey: #313234;
  --grey-active: #46474C;
  --light-grey: #909090;
  --disabled-grey: #7B7D83;
  --error: #FF5252;
  --violet: #9747FF;
  --orange: #FB8E00;
  --cyan: #00F3FB;
  --lime: #B8FF47;
  --warn: var(--orange);
  --note: var(--cyan);
  --ok: var(--lime);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-button: 16px;
  --radius-panel: 8px;
  --shadow-raised: 4px 4px 12px rgb(0 0 0 / 0.25);
  --shadow-header: 0 2px 4px rgb(0 0 0 / 0.2);
  --gutter: 16px;
  --content: 1080px;
  --ease: 150ms ease;
}

@font-face {
  font-family: "NAMU-Pro";
  src: url("fonts/NAMU-Pro.woff2") format("woff2");
  font-weight: normal; /* a static face: a range here would disable bold */
  font-display: swap;
}

/* ---- base ---- */
html { background: var(--bg-grey); color: var(--white); font: 500 16px/1.4 "NAMU-Pro", system-ui, sans-serif; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
h1, h2, h3 { font-weight: 800; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 6vw, 4rem); letter-spacing: .02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--primary-muted); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.wrap { max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--light-grey); }
svg { max-width: 100%; height: auto; }

/* ---- header ---- */
.top { position: sticky; top: 0; z-index: 10; background: var(--dusk); box-shadow: var(--shadow-header); }
.top .row { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .12em; color: var(--white); }
.wordmark img { width: 24px; height: 24px; display: block; }
nav.main { display: flex; gap: 16px; margin-left: auto; }
nav.main a { color: var(--light-grey); font-weight: 800; transition: color var(--ease); }
nav.main a.current, nav.main a:focus-visible { color: var(--white); }
@media (hover: hover) and (pointer: fine) { nav.main a:hover { color: var(--white); } }
.lang { display: flex; gap: 4px; margin-left: auto; }
nav.main + .lang { margin-left: 0; }
.lang button { background: none; border: 1px solid var(--primary-dusk); color: var(--white); border-radius: var(--radius-button); padding: 4px 12px; font: inherit; font-weight: 800; cursor: pointer; transition: background var(--ease), color var(--ease); }
.lang button[aria-pressed="true"] { background: var(--primary); color: var(--text-black); border-color: var(--primary); }

/* ---- controls and panels ---- */
.btn { display: inline-block; background: var(--primary); color: var(--text-black); font-weight: 800; border-radius: var(--radius-button); padding: 12px 24px; box-shadow: var(--shadow-raised); transition: filter var(--ease), background var(--ease); }
.btn:active { filter: brightness(.85); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--primary-muted); } }
.status { border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--dusk)); border-radius: 0 var(--radius-panel) var(--radius-panel) 0; padding: 12px 16px; margin: 1em 0; }
.status::before { content: attr(data-level); font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; color: var(--warn); display: block; margin-bottom: 4px; }
.status p:last-child { margin-bottom: 0; }
.status.error { border-color: var(--error); background: color-mix(in srgb, var(--error) 8%, var(--dusk)); }
.status.error::before { color: var(--error); }
.status.note { border-color: var(--note); background: color-mix(in srgb, var(--note) 8%, var(--dusk)); }
.status.note::before { color: var(--note); }
.status.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--dusk)); }
.status.ok::before { color: var(--ok); }

/* ---- footer ---- */
.foot { padding: 32px 0; color: var(--light-grey); border-top: 1px solid var(--text-grey); margin-top: 48px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.foot-nav { display: flex; gap: 16px; margin-left: auto; }
.foot-nav a { color: var(--light-grey); font-weight: 800; }

/* ---- home ---- */
.hero { display: grid; gap: 24px; padding: 48px 0 32px; position: relative; }
.hero-art { margin: 0; min-height: 220px; position: relative; }
.hero-text .btn { margin-top: 8px; }
.tagline { font-size: 1.25rem; font-weight: 800; }
section { padding: 32px 0; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--dusk); border-radius: var(--radius-panel); padding: 24px 20px 20px; position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--hue, var(--grey-active)); }
.card p { margin-bottom: 0; }
.card[data-hue="violet"] { --hue: var(--violet); }
.card[data-hue="cyan"] { --hue: var(--cyan); }
.card[data-hue="orange"] { --hue: var(--orange); }
.card[data-hue="lime"] { --hue: var(--lime); }
.glyph { width: 48px; height: 48px; margin: 0 0 12px; color: var(--hue); }
.split { display: grid; gap: 24px; grid-template-columns: 1fr; }
.split .art { margin: 0; color: var(--light-grey); }
.strip { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.strip li { background: var(--dusk); border-radius: var(--radius-panel); padding: 20px; position: relative; }
.strip li p { margin-bottom: 0; }
.strip .n { font-family: var(--mono); color: var(--primary); font-weight: 800; display: block; margin-bottom: 4px; }
.notfound { padding: 48px 0; }
@media (min-width: 600px) {
  .hero { grid-template-columns: 1fr 1fr; align-items: center; padding: 72px 0 48px; }
  .hero-art { order: 2; }
  .split { grid-template-columns: 1fr 1.4fr; align-items: center; }
}

/* ---- instructions ---- */
main > h1 { margin-top: 32px; }
.lead { font-size: 1.125rem; }
.chapters { display: flex; gap: 8px; position: sticky; top: 56px; z-index: 5; background: var(--bg-grey); padding: 8px 0; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); overflow-x: auto; }
.chapters a { color: var(--light-grey); font-weight: 800; padding: 6px 12px; border-radius: var(--radius-button); border: 1px solid var(--text-grey); white-space: nowrap; transition: background var(--ease), color var(--ease); }
.chapters a.current { color: var(--text-black); background: var(--primary); border-color: var(--primary); }
.chapter { padding-top: 24px; }
.chapter > h2 { scroll-margin-top: 120px; }
.step { display: grid; gap: 16px; padding: 24px 0; border-top: 1px solid var(--text-grey); scroll-margin-top: 120px; }
.step .n { color: var(--primary); font-weight: 800; display: block; margin-bottom: 4px; }
.step h3 { font-size: 1.25rem; }
.shot { margin: 0; background: var(--dusk); border-radius: var(--radius-panel); padding: 8px; display: grid; gap: 8px; }
.shot img { display: block; width: 100%; height: auto; border-radius: 4px; }
.step-art { margin: 0; color: var(--light-grey); background: var(--dusk); border-radius: var(--radius-panel); padding: 12px; }
.checklist ul { margin: 0; padding-left: 1.2em; }
.checklist li { margin: 4px 0; }
@media (min-width: 600px) {
  .step { grid-template-columns: 1fr 1fr; align-items: start; }
  .step:nth-of-type(even) .step-text { order: 2; }
}

/* ---- contacts ---- */
.channels { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; max-width: 560px; }
.channel { display: flex; flex-direction: column; gap: 4px; min-height: 64px; justify-content: center; background: var(--dusk); border-radius: var(--radius-panel); padding: 14px 18px; color: var(--white); border: 1px solid transparent; transition: border-color var(--ease); }
.channel .label { color: var(--light-grey); font-weight: 800; font-size: .875rem; }
.channel .value { font-size: 1.05rem; }
.channel.pending { pointer-events: none; }
.channel.pending .value { color: var(--light-grey); font-family: inherit; }
@media (hover: hover) and (pointer: fine) { .channel:hover { border-color: var(--primary-dusk); } }

/* ---- drawings ---- */
.art svg { display: block; width: 100%; height: auto; }
.topology { color: var(--light-grey); }
.hero-art { overflow: visible; }
.grid-bg { position: absolute; inset: -24px; z-index: -1; opacity: .35; pointer-events: none;
  background-image: linear-gradient(var(--text-grey) 1px, transparent 1px), linear-gradient(90deg, var(--text-grey) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, var(--black) 20%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 50%, var(--black) 20%, transparent 72%); }
.art text { font-family: var(--mono); font-size: 9px; fill: currentColor; stroke: none; letter-spacing: .04em; }
.draw path, .draw circle, .draw line, .draw rect, .draw polyline { stroke-dasharray: 600; stroke-dashoffset: 600; }
.draw.in path, .draw.in circle, .draw.in line, .draw.in rect, .draw.in polyline { animation: draw 1200ms ease forwards; }
.draw.in g:nth-child(2) * { animation-delay: 120ms; }
.draw.in g:nth-child(3) * { animation-delay: 240ms; }
.draw.in g:nth-child(4) * { animation-delay: 360ms; }
.draw.in g:nth-child(5) * { animation-delay: 480ms; }
.draw.in g:nth-child(n+6) * { animation-delay: 600ms; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.packet { opacity: 0; }
.draw.in .packet { animation: packet-in 300ms ease 1500ms forwards; }
@keyframes packet-in { to { opacity: 1; } }

/* ---- motion ---- */
[data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity 400ms ease, transform 400ms ease; }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .draw path, .draw circle, .draw line, .draw rect, .draw polyline { stroke-dashoffset: 0 !important; animation: none !important; }
  .packet { display: none; }
}

/* ---- phone ---- */
@media (max-width: 599px) { nav.main { display: none; } }
