/* ludofax.com — page layout.
   All colour, type and elevation comes from tokens.css. Nothing here invents a
   value; it only arranges. Radius 0, hard offsets, no blur — see the system doc. */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--lf-ground);
  color: var(--lf-ink);
  font-family: var(--lf-font-body);
  font-size: 13px;
  line-height: 1.8;
  transition: background var(--lf-motion-cut), color var(--lf-motion-cut);
}

/* Optional paper grain — grounds only, never on text or controls (§3). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

a { color: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* ── masthead ─────────────────────────────────────────────────────────── */

.masthead {
  border-bottom: 1px solid var(--lf-hairline);
}
.masthead .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 62px;
}
.masthead__mark { width: 22px; height: 22px; color: var(--lf-ink); flex: none; }
.masthead__mark svg { display: block; width: 100%; height: 100%; }
.masthead__name {
  font-family: var(--lf-font-display);
  font-variation-settings: 'wdth' 92, 'wght' 700;
  font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--lf-ink);
}
.masthead__spacer { flex: 1; }

/* mode toggle — two hard segments in one bordered box (§5). No pill, no knob. */
.toggle { display: flex; border: 1px solid var(--lf-border-strong); }
.toggle button {
  font-family: var(--lf-font-mono); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; padding: 6px 11px; border: 0; border-radius: 0;
  background: transparent; color: var(--lf-ink-muted); cursor: pointer;
  transition: background var(--lf-motion-detent), color var(--lf-motion-detent);
}
.toggle button + button { border-left: 1px solid var(--lf-border-strong); }
.toggle button[aria-pressed="true"] { background: var(--lf-ink); color: var(--lf-ground); }
[data-mode="panel"] .toggle button[aria-pressed="true"] { background: var(--lf-brass); color: var(--lf-walnut); }

/* ── hero ─────────────────────────────────────────────────────────────── */

.hero { padding: 84px 0 72px; }
.hero__lockup { display: flex; align-items: center; gap: 34px; }
.hero__mark { width: 150px; height: 150px; color: var(--lf-ink); flex: none; }
.hero__mark svg { display: block; width: 100%; height: 100%; }

.hero__wordmark {
  margin: 0;
  font-family: var(--lf-font-display);
  font-variation-settings: 'wdth' 120, 'wght' 800;
  font-size: clamp(46px, 8.5vw, 78px); line-height: .92; letter-spacing: -.015em;
  text-transform: uppercase; color: var(--lf-ink);
}
.hero__rule { width: 46px; height: 3px; background: var(--lf-brass); margin: 18px 0 14px; }
.hero__eyebrow { margin: 0 0 7px; }
.hero__jp { margin: 0; font-size: 13px; color: var(--lf-ink-secondary); }

.hero__statement {
  margin: 56px 0 0;
  font-family: var(--lf-font-display);
  font-variation-settings: 'wdth' 84, 'wght' 700;
  font-size: clamp(26px, 3.4vw, 36px); line-height: 1.12;
  max-width: 17ch; color: var(--lf-ink); text-wrap: balance;
}
.hero__lede {
  margin: 26px 0 0; max-width: 58ch;
  font-size: 14px; line-height: 1.85; color: var(--lf-ink-secondary);
  text-wrap: pretty;
}

/* ── spec strip — mono label left, value right, dotted separators (§5) ─── */

.spec { border-top: 1px solid var(--lf-hairline); border-bottom: 1px solid var(--lf-hairline); }
.spec dl {
  margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.spec div {
  padding: 18px 0 18px 20px;
  border-left: 1px dotted var(--lf-hairline);
}
.spec div:first-child { border-left: 0; padding-left: 0; }
.spec dt {
  font-family: var(--lf-font-mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--lf-ink-muted);
}
.spec dd {
  margin: 7px 0 0;
  font-family: var(--lf-font-mono); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--lf-ink);
}

/* ── generic section furniture ────────────────────────────────────────── */

.section { padding: 78px 0; }
.section__head { margin-bottom: 34px; }
.section__title {
  margin: 0;
  font-family: var(--lf-font-display);
  font-variation-settings: 'wdth' 84, 'wght' 700;
  font-size: 30px; line-height: 1.1; color: var(--lf-ink);
}
.section__title + .section__rule { width: 100%; height: 3px; background: var(--lf-brass); margin-top: 16px; }
.section__note { margin: 16px 0 0; max-width: 56ch; color: var(--lf-ink-secondary); }

/* ── divisions — grid whose 1px gaps read as brass rules (§5) ──────────── */

.divisions {
  display: grid; gap: 1px; grid-template-columns: repeat(2, 1fr);
  background: var(--lf-brass);
  border: 1px solid var(--lf-border-strong);
  box-shadow: var(--lf-elev-1);
  margin-bottom: 3px; margin-right: 3px; /* offset needs matching margin (§3) */
}
.division { background: var(--lf-surface); padding: 30px 28px 34px; }
.division__index {
  font-family: var(--lf-font-display);
  font-variation-settings: 'wdth' 100, 'wght' 700;
  font-size: 22px; line-height: 1; color: var(--lf-brass);
}
.division__name {
  margin: 14px 0 0;
  font-family: var(--lf-font-display);
  font-variation-settings: 'wdth' 88, 'wght' 700;
  font-size: 19px; line-height: 1.15; color: var(--lf-ink);
  text-transform: uppercase; letter-spacing: .01em;
}
.division__jp {
  margin-top: 5px; font-size: 11px; font-weight: 500; letter-spacing: .12em;
  color: var(--lf-ink-muted);
}
.division__body { margin: 16px 0 0; color: var(--lf-ink-secondary); text-wrap: pretty; }

/* ── practice — numbered data rows ────────────────────────────────────── */

.practice { border-top: 1px solid var(--lf-hairline); }
.practice__item {
  display: grid; grid-template-columns: 62px 1fr; gap: 0 24px;
  padding: 26px 0;
  border-bottom: 1px dotted var(--lf-hairline);
}
.practice__num {
  font-family: var(--lf-font-mono); font-size: 12px; letter-spacing: .16em;
  color: var(--lf-brass); padding-top: 3px;
}
.practice__name {
  margin: 0;
  font-family: var(--lf-font-display);
  font-variation-settings: 'wdth' 88, 'wght' 700;
  font-size: 19px; line-height: 1.15; color: var(--lf-ink);
}
.practice__body { margin: 9px 0 0; max-width: 62ch; color: var(--lf-ink-secondary); text-wrap: pretty; }

/* ── contact ──────────────────────────────────────────────────────────── */

.contact { padding: 78px 0 84px; }
.contact__body { margin: 18px 0 0; max-width: 54ch; color: var(--lf-ink-secondary); text-wrap: pretty; }
.contact__actions { margin-top: 34px; }

.contact__btn {
  display: inline-block; text-decoration: none;
  font-family: var(--lf-font-mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; padding: 13px 22px;
  background: var(--lf-oxide); color: var(--lf-on-action);
  box-shadow: 3px 3px 0 0 var(--lf-shade);
  transition: transform var(--lf-motion-detent), box-shadow var(--lf-motion-detent);
}
.contact__btn:active { transform: translate(3px, 3px); box-shadow: none; }

/* the quiet door — a spec row, not a second call to action */
.contact__rows { margin-top: 44px; border-top: 1px solid var(--lf-hairline); max-width: 620px; }
.contact__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 15px 0; border-bottom: 1px dotted var(--lf-hairline);
}
.contact__row dt {
  font-family: var(--lf-font-mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--lf-ink-muted);
}
.contact__row dd {
  margin: 0;
  font-family: var(--lf-font-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--lf-ink);
}
.contact__row a { text-decoration: none; border-bottom: 1px solid var(--lf-brass); }
.contact__row a:hover { border-bottom-width: 3px; }

/* ── footer ───────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--lf-hairline); padding: 34px 0 56px; }
.footer .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer__mark { width: 18px; height: 18px; color: var(--lf-ink-muted); flex: none; }
.footer__mark svg { display: block; width: 100%; height: 100%; }
.footer__meta {
  font-family: var(--lf-font-mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--lf-ink-muted);
}
.footer__spacer { flex: 1; }
.footer__ipa {
  font-family: var(--lf-font-mono); font-size: 10px; letter-spacing: .08em;
  color: var(--lf-ink-muted); text-transform: none;
}

/* ── responsive ───────────────────────────────────────────────────────── */

@media (max-width: 820px) {
  .wrap { padding: 0 22px; }
  .hero { padding: 58px 0 52px; }
  .hero__lockup { gap: 18px; }
  .hero__mark { width: 104px; height: 104px; }
  .hero__statement { margin-top: 42px; max-width: none; }
  .spec dl { grid-template-columns: repeat(2, 1fr); }
  .spec div:nth-child(3) { border-left: 0; padding-left: 0; }
  .spec div:nth-child(-n+2) { border-bottom: 1px dotted var(--lf-hairline); }
  .divisions { grid-template-columns: 1fr; }
  .section { padding: 58px 0; }
}

@media (max-width: 520px) {
  .hero__lockup { flex-direction: column; gap: 20px; }
  .practice__item { grid-template-columns: 1fr; gap: 8px; }
  .practice__num { padding-top: 0; }
  .contact__row { flex-direction: column; gap: 4px; }
}

/* ── print — paper mode always, no offsets ────────────────────────────── */

@media print {
  body::before { display: none; }
  .toggle { display: none; }
  .divisions { box-shadow: none; }
  .contact__btn { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  body, .toggle button, .contact__btn { transition: none; }
}

/* ── document pages (support, privacy) ────────────────────────────────── */

.doc { max-width: 660px; padding: 62px 0 84px; }
.doc h1 {
  margin: 0;
  font-family: var(--lf-font-display);
  font-variation-settings: 'wdth' 84, 'wght' 700;
  font-size: 30px; line-height: 1.1; color: var(--lf-ink);
}
.doc .doc__rule { width: 100%; height: 3px; background: var(--lf-brass); margin: 16px 0 34px; }
.doc h2 {
  margin: 38px 0 0;
  font-family: var(--lf-font-display);
  font-variation-settings: 'wdth' 88, 'wght' 700;
  font-size: 19px; line-height: 1.15; color: var(--lf-ink);
}
.doc p, .doc li { color: var(--lf-ink-secondary); text-wrap: pretty; }
.doc p { margin: 14px 0 0; }
.doc ul { margin: 14px 0 0; padding-left: 18px; }
.doc li { margin: 6px 0; }
.doc a { color: var(--lf-ink); text-decoration: none; border-bottom: 1px solid var(--lf-brass); }
.doc__updated {
  margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--lf-hairline);
  font-family: var(--lf-font-mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--lf-ink-muted);
}

/* Mark as a tintable mask — lets doc pages reuse the external SVG without
   inlining the path again. Falls back to nothing if mask is unsupported. */
.mark-mask {
  display: inline-block; width: 22px; height: 22px; flex: none;
  background: currentColor;
  -webkit-mask: url(/assets/ludofax-mark.svg) no-repeat center / contain;
          mask: url(/assets/ludofax-mark.svg) no-repeat center / contain;
}
.doc h3 {
  margin: 26px 0 0;
  font-family: var(--lf-font-body); font-weight: 700;
  font-size: 14px; line-height: 1.5; color: var(--lf-ink);
}

/* ── hero mark intro — the mark prints itself ─────────────────────────────
   Stripe print: each concentric stripe wipes in left to right in hard steps,
   staggered outer to inner, so the reveal traces the mark's own construction.
   Stepped, never eased; no slide, scale, bounce or spring; does not loop —
   see the system doc §4. Replays on load and on tap/Enter/Space.
   `both` fill keeps the stripes clipped during their stagger delay, so there
   is no flash of the finished mark before the animation starts. */

.hero__mark { cursor: pointer; }
.hero__mark:focus-visible { outline: 3px solid var(--lf-brass); outline-offset: 6px; }

.hero__mark.is-printing .hero__stripe {
  animation: lf-print 520ms steps(9) both;
  animation-delay: calc(var(--i) * 90ms);
}
@keyframes lf-print {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__mark { cursor: default; }
  .hero__mark.is-printing .hero__stripe { animation: none; }
}
