/* ==========================================================================
   Lacet — lacet.app static site
   One hand-written stylesheet. No frameworks, no build step.
   Tokens derived from the shipped app theme:
     Lacet/Theme/LacetColors.swift, LacetTypography.swift, LacetSpacing.swift
     Lacet/Screens/Onboarding/SignInView.swift (masthead / topo hero)
   ========================================================================== */

:root {
  /* Paper palette (LacetColors.paper / paperDeep / card) */
  --paper: #F2F0EC;
  --paper-deep: #E9E4DD;
  --card: #FBFAF7;

  /* Ink hierarchy (LacetColors.ink / ink2 / ink3 / ink4 / line) */
  --ink: #201914;
  --ink-2: #524C47;
  --ink-3: #7F7974;
  --ink-4: #BBB6B2;
  --line: #D4D0CB;

  /* Accent (LacetColors.amber / amberWash / stamp) */
  --amber: #B85300;
  --amber-wash: #FFE4CA;
  --stamp: #BB061E;

  /* Category colours used for the col signs (LacetColors) */
  --cat-hc: #A72900;   /* deep red  */
  --cat-1: #633481;    /* purple    */
  --cat-2: #17653C;
  --cat-3: #406981;

  /* Masthead — dark warm brown-black (SignInView.MapColors) */
  --masthead: #302A22;
  --masthead-center: #423A32;
  --masthead-edge: #241F18;
  --masthead-road: #D49545;  /* amber-on-dark: route line, wordmark period, amber sign */
  --on-dark: #FFFFFF;

  /* Geometry (LacetSpacing) */
  --card-radius: 8px;
  --screen-pad: 18px;

  /* Type */
  --font-display: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --maxw: 1060px;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

h1, h2, h3 { font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; margin: 0; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Shared primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
}

.mono { font-family: var(--font-mono); }

/* Hairline dashed section divider */
.rule {
  height: 0;
  border: 0;
  border-top: 1px dashed var(--ink-4);
  margin: 0;
}

.section {
  padding-block: 72px;
}

.section > .container > .rule {
  margin-bottom: 40px;
}

/* --------------------------------------------------------------------------
   1. Masthead (full-bleed dark)
   -------------------------------------------------------------------------- */
.masthead {
  position: relative;
  color: var(--on-dark);
  background:
    radial-gradient(120% 100% at 35% 40%, var(--masthead-center) 0%, var(--masthead-edge) 78%),
    var(--masthead);
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
}

.masthead__inner {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 20px 24px 56px;
}

.masthead__coords {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  padding-bottom: 20px;
}

.masthead__scene {
  position: relative;
  margin: 4px 0 26px;
}

.masthead__scene svg { width: 100%; height: auto; }

.masthead__label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  margin: 0 0 6px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(72px, 15vw, 148px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0;
  color: var(--on-dark);
}

.wordmark .period { color: var(--masthead-road); }

.tagline {
  font-size: clamp(20px, 3.4vw, 30px);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.015em;
  max-width: 24ch;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.94);
}

.masthead__sub {
  font-size: clamp(14px, 2vw, 17px);
  line-height: 1.45;
  max-width: 46ch;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

/* --------------------------------------------------------------------------
   2. Signature — the collection card stack (the one bold moment)
   -------------------------------------------------------------------------- */
.signature .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.signature__copy p {
  font-size: 19px;
  color: var(--ink-2);
  margin: 0 0 16px;
  max-width: 42ch;
}

.signature__copy p:last-child { margin-bottom: 0; }
.signature__copy strong { color: var(--ink); font-weight: 600; }

/* The fanned stack */
.card-stack {
  position: relative;
  width: 340px;
  max-width: 100%;
  margin-inline: auto;
  aspect-ratio: 340 / 300;
}

.col-card {
  position: absolute;
  inset: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow: 0 12px 28px -18px rgba(32, 25, 20, 0.5);
  transition: transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1);
  transform-origin: bottom center;
}

.col-card--b2 { transform: rotate(-5.5deg) translate(-10px, 8px); }
.col-card--b1 { transform: rotate(4.5deg) translate(10px, 4px); }
.col-card--front { transform: rotate(-1.5deg); padding: 18px; }

/* Fan out on hover / keyboard focus */
.card-stack:hover .col-card--b2,
.card-stack:focus-within .col-card--b2 { transform: rotate(-11deg) translate(-30px, 12px); }
.card-stack:hover .col-card--b1,
.card-stack:focus-within .col-card--b1 { transform: rotate(9deg) translate(30px, 8px); }
.card-stack:hover .col-card--front,
.card-stack:focus-within .col-card--front { transform: rotate(-1.5deg) translateY(-6px); }

/* Front card contents */
.cc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.cc-ed {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cc-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}

.cc-name {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 14px 0 6px;
}

.cc-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cat-hc);
  margin: 0;
}

.cc-profile { margin: 16px 0 14px; }
.cc-profile svg { width: 100%; height: auto; }

.cc-stats {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  border-top: 1px dashed var(--ink-4);
  padding-top: 10px;
  margin: 0;
}

/* The stamp — settles once on load */
.stamp {
  position: absolute;
  right: 14px;
  bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  border-radius: 5px;
  padding: 5px 9px;
  transform: rotate(-8deg);
  opacity: 0.92;
  animation: stamp-settle 0.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

@keyframes stamp-settle {
  from { transform: rotate(-8deg) scale(1.45); opacity: 0; }
  to   { transform: rotate(-8deg) scale(1);    opacity: 0.92; }
}

/* --------------------------------------------------------------------------
   3. How it fills — passport-stamp numbered steps
   -------------------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  counter-reset: step;
}

.step { position: relative; }

.step__no {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--amber);
  border: 1.5px solid var(--amber);
  border-radius: 5px;
  padding: 4px 8px;
  display: inline-block;
  transform: rotate(-3deg);
  margin-bottom: 18px;
}

.step h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
}

.step p {
  font-size: 16px;
  color: var(--ink-2);
  margin: 0;
}

/* --------------------------------------------------------------------------
   4. The book — 2×2 quiet tiles
   -------------------------------------------------------------------------- */
.book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px dashed var(--ink-4);
  border-left: 1px dashed var(--ink-4);
}

.tile {
  border-right: 1px dashed var(--ink-4);
  border-bottom: 1px dashed var(--ink-4);
  padding: 34px 32px;
  background: transparent;
}

.tile__glyph {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--amber);
  display: inline-block;
  margin-bottom: 16px;
}

.tile h3 {
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 8px;
}

.tile p {
  font-size: 16px;
  color: var(--ink-2);
  margin: 0;
}

/* --------------------------------------------------------------------------
   5. Privacy stance — bordered card
   -------------------------------------------------------------------------- */
.stance {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 40px;
  box-shadow: 0 10px 30px -24px rgba(32, 25, 20, 0.55);
}

.stance ul {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  columns: 2;
  column-gap: 40px;
}

.stance li {
  font-size: 16px;
  color: var(--ink-2);
  padding-left: 22px;
  margin-bottom: 12px;
  position: relative;
  break-inside: avoid;
}

.stance li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--amber);
  font-family: var(--font-mono);
  font-weight: 700;
}

.stance li strong { color: var(--ink); font-weight: 600; }

.stance__links {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px dashed var(--ink-4);
  padding-top: 20px;
}

.stance__links a { margin-right: 20px; }

/* --------------------------------------------------------------------------
   6. Footer (dark, mirrors masthead)
   -------------------------------------------------------------------------- */
.site-footer {
  background:
    radial-gradient(120% 140% at 35% 0%, var(--masthead-center) 0%, var(--masthead-edge) 80%),
    var(--masthead);
  color: var(--on-dark);
  padding-block: 56px;
  border-top: 1px solid var(--ink);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
}

.footer__lead {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.footer__bib {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.footer__links {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.footer__links a { color: rgba(255, 255, 255, 0.82); }
.footer__links a:hover { color: var(--on-dark); }
.footer__links span { color: rgba(255, 255, 255, 0.3); margin-inline: 8px; }

.footer__note {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* --------------------------------------------------------------------------
   [[FILL]] highlight — makes unfinished fields findable
   -------------------------------------------------------------------------- */
mark.fill {
  background: var(--amber-wash);
  color: var(--cat-hc);
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0 4px;
  border-radius: 3px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Legal pages — quiet shared shell
   -------------------------------------------------------------------------- */
.legal-header {
  background:
    radial-gradient(120% 200% at 35% 0%, var(--masthead-center) 0%, var(--masthead-edge) 85%),
    var(--masthead);
  color: var(--on-dark);
  padding-block: 22px;
}

.legal-header .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.legal-header .wordmark-sm {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.03em;
  color: var(--on-dark);
}

.legal-header .wordmark-sm .period { color: var(--masthead-road); }
.legal-header a.wordmark-sm:hover { text-decoration: none; }

.legal-header .legal-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.legal-main {
  max-width: 68ch;
  margin: 56px auto;
  padding-inline: 24px;
}

.legal-main h1 {
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.legal-main .updated {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 40px;
}

.legal-main h2 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  border-top: 1px dashed var(--ink-4);
  padding-top: 28px;
  margin: 44px 0 16px;
}

.legal-main h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 8px;
}

.legal-main p,
.legal-main li {
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--ink-2);
}

.legal-main p { margin: 0 0 16px; }
.legal-main strong { color: var(--ink); font-weight: 600; }

.legal-main ul { margin: 0 0 16px; padding-left: 22px; }
.legal-main li { margin-bottom: 8px; }

.legal-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 14.5px;
}

.legal-main th,
.legal-main td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.legal-main th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper-deep);
}

.legal-main .back-home {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-block;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .signature .container { grid-template-columns: 1fr; gap: 40px; }
  .signature__copy { order: 1; }
  .card-stack { order: 2; }
  .steps { grid-template-columns: 1fr; gap: 34px; }
  .stance ul { columns: 1; }
}

@media (max-width: 620px) {
  .container { padding-inline: 20px; }
  .section { padding-block: 52px; }
  .book-grid { grid-template-columns: 1fr; }
  .tile { padding: 28px 24px; }
  .stance { padding: 28px 22px; }
  .masthead__inner { padding: 18px 20px 44px; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
  body { font-size: 16px; }
  .card-stack { width: 100%; }
}

/* --------------------------------------------------------------------------
   Reduced motion — disable the fan + the settle
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  .col-card { transition: none; }
  .card-stack:hover .col-card,
  .card-stack:focus-within .col-card { transform: none; }
  .col-card--b2 { transform: rotate(-5.5deg) translate(-10px, 8px); }
  .col-card--b1 { transform: rotate(4.5deg) translate(10px, 4px); }
  .col-card--front { transform: rotate(-1.5deg); }
  .stamp { animation: none; opacity: 0.92; }
}
