/* ===========================================================================
   frontdesk - design system
   No hex values in this file. Every colour is a var() from tokens.css.
   Adjectives this is built to express: senior, proof-driven, quiet, precise.
   Generous space, strong hierarchy, accent as light on an edge - not as fill.
   =========================================================================== */

/* --- reset ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, fieldset, legend { margin: 0; }
ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; }
table { border-collapse: collapse; width: 100%; }

/* --- base ----------------------------------------------------------------- */

html { scroll-behavior: smooth; }

body {
  background: var(--surface);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: var(--lh-head);
  letter-spacing: -0.015em;
  color: var(--text-body);
  text-wrap: balance;
}

h1 { font-size: clamp(2.375rem, 1.6rem + 3.4vw, var(--fs-h1)); }
h2 { font-size: clamp(1.875rem, 1.4rem + 2vw, var(--fs-h2)); }
h3 { font-size: var(--fs-h3); font-weight: 500; }

p { text-wrap: pretty; }
p + p { margin-top: var(--sp-4); }

/* A lead sitting straight under a heading was crowding it - the heading's own
   line-height is 1.15 and the lead started immediately after. */
h1 + .lead, h2 + .lead, h3 + .lead,
h1 + p, h2 + p, h3 + p { margin-top: var(--sp-4); }

strong { font-weight: 500; color: var(--text-body); }
small { font-size: var(--fs-sm); }

/* --- accessibility -------------------------------------------------------- */

/* Visible focus everywhere. The ring is the graphic accent, which only needs
   3:1 - and Cedar clears that on every band this site uses. */
:focus-visible {
  outline: var(--focus-width) solid var(--accent-graphic);
  outline-offset: 2px;
  border-radius: var(--radius);
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: calc(var(--sp-3) * -6);
  z-index: 100;
  padding: var(--sp-3) var(--sp-4);
  background: var(--ds-ink);
  color: var(--ds-parchment);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-3); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- layout --------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

/* The section shell. Bands are the page's rhythm; padding is Fibonacci and
   scales with viewport so the quiet stays quiet on a phone. */
.band {
  position: relative;
  background: var(--surface);
  color: var(--text-body);
  padding-block: clamp(var(--sp-6), 8vw, var(--sp-7));
  overflow: hidden; /* contains the motif */
}
.band > .wrap { position: relative; z-index: 1; }

.band + .band { border-top: var(--border) solid var(--rule); }
.band-ink + .band-ink, .band-ink { border-top-color: var(--rule); }

.lead {
  font-size: var(--fs-lead);
  max-width: var(--measure);
  color: var(--text-body);
}
.muted { color: var(--text-muted); }
.prose { max-width: var(--measure-prose); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-5); }

/* --- eyebrow: the section signature --------------------------------------- */

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--sp-3);
}
/* The rule under an eyebrow is graphical - Cedar is allowed to be loud here. */
.eyebrow::after {
  content: '';
  display: block;
  width: var(--sp-6);
  height: 2px;
  margin-top: var(--sp-2);
  background: var(--accent-graphic);
}

/* --- motif ----------------------------------------------------------------
   Consciousness web, line work, one per section, 6-12% opacity. Decorative and
   therefore aria-hidden; never behind small text at full strength. */

.motif {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  width: min(62%, 40rem);   /* golden-ish, never dominant */
  opacity: var(--motif-opacity);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.motif img { width: 100%; height: auto; }

/* --- nav ------------------------------------------------------------------ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: var(--border) solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: var(--tap-min);
  padding-block: var(--sp-3);
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 2.5rem; width: auto; }  /* 40px - below this the wordmark stops being readable */

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  font-size: var(--fs-sm);
  color: var(--text-body);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.nav-links a:hover { border-bottom-color: var(--accent-graphic); }
.nav-links a[aria-current='page'] { border-bottom-color: var(--accent-graphic); }

@media (max-width: 40rem) {
  .nav-links { gap: var(--sp-4); }
  .nav-links .nav-secondary { display: none; }
}

/* --- hero: golden section -------------------------------------------------
   61.8 / 38.2, never 50/50. The minor column is deliberately allowed to be
   empty on the homepage - the negative space is the design. */

.hero { padding-block: clamp(var(--sp-6), 10vw, calc(var(--sp-7) * 1.4)); }

.hero-grid {
  display: grid;
  grid-template-columns: var(--golden-major) var(--golden-minor);
  gap: var(--sp-6);
  align-items: start;
}
.hero-major { min-width: 0; }
.hero-minor { min-width: 0; }

.hero h1 { margin-bottom: var(--sp-4); }
.hero .lead { margin-bottom: var(--sp-5); }

@media (max-width: 52rem) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
}

/* --- buttons --------------------------------------------------------------
   One primary per section. The eye should never have to choose between two
   equal buttons, so everything else is a ghost or a link. */

.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: var(--sp-3) var(--sp-5);
  background: var(--cta-bg);
  color: var(--cta-text);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: var(--fs-base);
  text-decoration: none;
  border: var(--border) solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-body);
  border-color: var(--rule-strong);
}
.btn-ghost:hover { border-color: var(--accent-graphic); filter: none; }

.lnk {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
.lnk:hover { text-decoration-thickness: 2px; }

/* --- cards / feature grid -------------------------------------------------- */

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }

@media (max-width: 52rem) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 34rem) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
  padding: var(--sp-5);
  background: transparent;
  border: var(--border) solid var(--rule);
  border-radius: var(--radius);
}
.card h3 { margin-bottom: var(--sp-3); }

/* Icon chip - the accent as a graphical element, 3:1 territory. */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sp-6);
  height: var(--sp-6);
  margin-bottom: var(--sp-4);
  border: var(--border) solid var(--accent-graphic);
  border-radius: var(--radius);
  color: var(--accent-graphic);
}
.chip svg { width: 50%; height: 50%; }

/* --- worksheet ------------------------------------------------------------
   The producer-hours worksheet. Numerals are mono because this brand reads
   data as data. Ships with NO values: a studio-asserted default IS a claim,
   and a claim without a substantiation file is deceptive under FTC s5 even
   when true. Every field starts empty and the arithmetic is shown on screen.
   State lives in memory only - no localStorage, no sessionStorage, ever. */

.worksheet {
  display: grid;
  grid-template-columns: var(--golden-major) var(--golden-minor);
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 52rem) { .worksheet { grid-template-columns: 1fr; } }

.ws-fields > * + * { margin-top: var(--sp-4); }

.field { display: grid; gap: var(--sp-2); }
.field label { font-size: var(--fs-sm); font-weight: 500; }
.field .hint { font-size: var(--fs-xs); color: var(--text-muted); }

.field input {
  min-height: var(--tap-min);
  padding: var(--sp-2) var(--sp-3);
  background: var(--ds-parchment);
  color: var(--ds-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  border: var(--border) solid var(--rule-strong);
  border-radius: var(--radius);
  /* A quantity field should be the size of the quantity. Full-bleed inputs for
     a two-digit number read as a wall of boxes and invite mis-entry. */
  width: 100%;
  max-width: 9rem;
}
.field input:hover { border-color: var(--accent-graphic); }
/* Never colour-only: the invalid state carries a text message too. */
.field input[aria-invalid='true'] { border-color: var(--ds-error); border-width: 2px; }
.field .err { font-size: var(--fs-xs); color: var(--ds-error); }
.band-ink .field .err { color: var(--ds-warn); }

/* The arithmetic, shown rather than asserted. */
.ws-output {
  padding: var(--sp-5);
  border: var(--border) solid var(--rule);
  border-radius: var(--radius);
}
.ws-math {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
}
.ws-math dl { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-4); margin: 0; }
.ws-math dt { color: var(--text-muted); }
.ws-math dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.ws-total {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 2px solid var(--accent-graphic);
  font-family: var(--font-mono);
  font-size: var(--fs-h3);
  font-variant-numeric: tabular-nums;
}

/* Not fine print. A projection has to be labelled as one, with its method
   visible, and that label has to be readable - hence --text-muted, which is
   AA on every band rather than a decorative grey. */
.ws-label {
  margin-top: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  border-left: 2px solid var(--accent-graphic);
  padding-left: var(--sp-3);
}

.ws-empty { color: var(--text-muted); font-size: var(--fs-sm); }

/* --- proof list ------------------------------------------------------------
   Used for constraints and commitments. Each item is marked by the accent as a
   graphical element rather than a bullet glyph, so the list reads as a spec
   sheet rather than marketing bullets. */

.proof { max-width: var(--measure-prose); }
.proof li {
  position: relative;
  padding-left: var(--sp-5);
  padding-block: var(--sp-3);
  border-top: var(--border) solid var(--rule);
}
.proof li:last-child { border-bottom: var(--border) solid var(--rule); }
.proof li::before {
  content: '';
  position: absolute;
  left: 0;
  top: calc(var(--sp-3) + 0.6em);
  width: var(--sp-4);
  height: 2px;
  background: var(--accent-graphic);
}

/* --- price -----------------------------------------------------------------
   Mono numerals, same as the worksheet: a number the reader is meant to weigh
   is set as data, not as a headline. */

.price { margin-block: var(--sp-3) var(--sp-4); }
.price-num {
  font-family: var(--font-mono);
  font-size: var(--fs-h3);
  font-variant-numeric: tabular-nums;
  color: var(--text-body);
}
.price-unit { font-size: var(--fs-sm); color: var(--text-muted); }

.ws-unit { font-size: var(--fs-sm); color: var(--text-muted); }

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

textarea {
  padding: var(--sp-2) var(--sp-3);
  background: var(--ds-parchment);
  color: var(--ds-ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  border: var(--border) solid var(--rule-strong);
  border-radius: var(--radius);
  width: 100%;
  resize: vertical;
}
textarea[aria-invalid='true'] { border-color: var(--ds-error); border-width: 2px; }

.field textarea + .err,
.field input + .err { margin-top: var(--sp-1); }

/* The honeypot. Removed from the accessibility tree and from view, but NOT
   display:none - some bots skip hidden inputs, and a person never reaches it
   because it is aria-hidden and out of the tab order. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The error summary doubles as the failure message, so it needs to read as a
   block of consequence rather than a caption. */
#form-errors:not([hidden]) {
  border-left-color: var(--ds-error);
  color: var(--text-body);
}
#form-errors:focus-visible { outline-offset: 4px; }

.steps-list {
  list-style: none;
  counter-reset: step;
  margin: var(--sp-4) 0 0;
  padding: 0;
}
.steps-list li {
  counter-increment: step;
  position: relative;
  padding-left: var(--sp-5);
  padding-block: var(--sp-2);
  font-size: var(--fs-sm);
}
.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent-text);
}

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

.footer { padding-block: var(--sp-6) var(--sp-5); }
.footer-grid {
  display: grid;
  grid-template-columns: var(--golden-major) var(--golden-minor);
  gap: var(--sp-5);
  align-items: start;
}
@media (max-width: 52rem) { .footer-grid { grid-template-columns: 1fr; } }

.footer-logo img { height: 2.5rem; width: auto; margin-bottom: var(--sp-3); }

.footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  font-size: var(--fs-sm);
  color: var(--text-body);
  text-decoration: none;
  border-bottom: var(--border) solid transparent;
}
.footer-links a:hover { border-bottom-color: var(--accent-graphic); }

.footer-legal { font-size: var(--fs-xs); color: var(--text-muted); }

/* The mission line is the ONE place the worldview appears in words on a
   surface - solomon-brand's whisper rule. Never stacked, never leading. */
.footer-mission {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
}
