/* Tailored Intelligence — ink cloth, tailor's chalk, one line of chalk-blue.
   Display: Bodoni Moda. Body: Instrument Sans. Measurements: JetBrains Mono. */

:root {
  --ink: #0a0a0e;
  --wool: #15151c;
  --seam: #262631;
  --chalk: #ecebe4;
  --chalk-70: rgba(236, 235, 228, .72);
  --chalk-45: rgba(236, 235, 228, .45);
  --chalk-20: rgba(236, 235, 228, .18);
  --blue: #a9bdff;
  --blue-glow: rgba(169, 189, 255, .38);
  --indigo: #3c4bd6;
  --steel: #7b7f8e;
  --tape: 56px;

  --display: "Bodoni Moda", "Didot", "Bodoni 72", "Times New Roman", serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --container: 1240px;
  --gutter: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; padding: 10px 14px; background: var(--chalk); color: var(--ink); z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- type ---------- */
.h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.1rem, 9.2vw, 8.6rem);
  line-height: .94;
  letter-spacing: -.012em;
  color: var(--chalk);
}
.h1 em { font-style: italic; font-weight: 400; color: var(--chalk); }
.h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  margin: 14px 0 26px;
  max-width: 14ch;
}
.body { color: var(--chalk-70); max-width: 56ch; }
.body-lg { font-size: clamp(1.05rem, 1.35vw, 1.25rem); color: var(--chalk); max-width: 50ch; line-height: 1.5; }
.body + .body, .body-lg + .body { margin-top: 16px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--steel); }
.eyebrow {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--chalk-70);
}
.eyebrow .tick { display: inline-block; width: 18px; height: 1px; background: var(--blue); box-shadow: 0 0 8px var(--blue-glow); }
.eyebrow .sep, .footer-legal .sep { margin: 0 8px; color: var(--steel); }
.eyebrow-ink { color: rgba(10, 10, 14, .7); }
.eyebrow-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.inline-link { border-bottom: 1px solid var(--chalk-45); transition: border-color .2s; }
.inline-link:hover { border-color: var(--blue); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; min-height: 46px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--chalk); border: 1px solid var(--chalk-45); border-radius: 3px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue-glow), 0 0 24px var(--blue-glow); transform: translateY(-1px); }
.btn-fill { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }
.btn-fill:hover { background: #fff; color: var(--ink); }

/* ---------- tape (signature) ---------- */
.tape { display: none; }
@media (min-width: 1100px) {
  body { padding-left: var(--tape); }
  .tape {
    display: block; position: fixed; left: 0; top: 0; bottom: 0; width: var(--tape);
    background: var(--ink); border-right: 1px solid var(--seam); z-index: 60;
    font-family: var(--mono);
  }
  .tape-ticks {
    position: absolute; inset: 0;
    background:
      repeating-linear-gradient(to bottom, var(--chalk-45) 0 1px, transparent 1px 40px) right 0 top 0 / 16px 100% no-repeat,
      repeating-linear-gradient(to bottom, var(--chalk-20) 0 1px, transparent 1px 8px) right 0 top 0 / 8px 100% no-repeat;
  }
  .tape-numbers span {
    position: absolute; right: 20px; transform: translateY(-50%);
    font-size: 9px; letter-spacing: .04em; color: var(--steel);
  }
  .tape-notches span {
    position: absolute; left: 6px; transform: translateY(-50%) rotate(-90deg); transform-origin: left center;
    font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--steel);
    transition: color .3s;
  }
  .tape-notches span::before { content: ""; position: absolute; left: -2px; top: 100%; width: 1px; height: 0; }
  .tape-notches span.current { color: var(--blue); text-shadow: 0 0 10px var(--blue-glow); }
  .tape-marker {
    position: absolute; left: 0; right: 0; top: 0; height: 2px;
    background: var(--blue); box-shadow: 0 0 12px var(--blue), 0 0 2px var(--blue);
    will-change: transform;
  }
  .tape-marker::after {
    content: ""; position: absolute; right: -1px; top: -4px;
    border: 5px solid transparent; border-right-color: var(--blue); border-left: 0;
  }
  .tape-reading {
    position: absolute; left: 60px; top: -7px; white-space: nowrap;
    font-size: 10px; letter-spacing: .12em; color: var(--blue);
    background: var(--ink); padding: 1px 6px; border: 1px solid var(--seam); border-radius: 2px;
    opacity: 0; transition: opacity .3s;
  }
  body.scrolling .tape-reading { opacity: 1; }
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; right: 0; left: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 18px var(--gutter);
  transition: background .35s var(--ease), border-color .35s var(--ease), padding .35s var(--ease);
  border-bottom: 1px solid transparent;
}
@media (min-width: 1100px) { .nav { left: var(--tape); } }
.nav.solid { background: rgba(10, 10, 14, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--seam); padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; }
.mark { width: 30px; height: 30px; color: var(--chalk); flex: none; }
.wordmark { font-family: var(--display); font-size: 1.15rem; letter-spacing: .01em; white-space: nowrap; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { font-size: 14px; color: var(--chalk-70); position: relative; padding: 4px 0; transition: color .2s; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--blue); transition: right .3s var(--ease); }
.nav-links a:hover, .nav-links a.current { color: var(--chalk); }
.nav-links a:hover::after, .nav-links a.current::after { right: 0; }
.nav-cta { padding: 11px 18px; min-height: 40px; }
.nav-toggle { display: none; width: 44px; height: 44px; margin-right: -10px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.nav-toggle span { width: 22px; height: 1.5px; background: var(--chalk); transition: transform .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.mobile-menu { position: fixed; inset: 0; z-index: 45; background: var(--ink); display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 100px var(--gutter) 40px; }
.mobile-menu a { font-family: var(--display); font-size: 2rem; }
.mobile-menu a.btn { font-family: var(--mono); font-size: 12px; align-self: flex-start; margin-top: 12px; }
@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -1; background: var(--ink); }
.hero-video, .hero-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero-poster { z-index: -1; }
.hero-video { opacity: 0; transition: opacity 1.4s ease; }
.hero-video.ready { opacity: 1; }
.hero-grade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 10, 14, .62) 0%, rgba(10, 10, 14, .10) 35%, rgba(10, 10, 14, .30) 60%, rgba(10, 10, 14, .96) 100%),
    linear-gradient(90deg, rgba(10, 10, 14, .45) 0%, rgba(10, 10, 14, 0) 55%);
}
.hero-inner { position: relative; width: 100%; max-width: var(--container); margin: 0 auto; padding: 120px var(--gutter) clamp(72px, 10vh, 120px); }
.hero-eyebrow { margin-bottom: clamp(20px, 3vh, 36px); }
.hero-foot { display: grid; grid-template-columns: minmax(0, 52ch) auto; align-items: end; gap: 32px 48px; margin-top: clamp(28px, 4vh, 48px); }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.3rem); color: var(--chalk-70); line-height: 1.5; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .hero-foot { grid-template-columns: 1fr; } }
.h1 .w { display: inline-block; opacity: 0; transform: translateY(.35em); animation: rise 1.1s var(--ease) forwards; animation-delay: calc(.25s + var(--i) * .13s); }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero-eyebrow, .hero-foot, .scroll-cue { opacity: 0; animation: fade 1.2s ease forwards; animation-delay: .9s; }
@keyframes fade { to { opacity: 1; } }
.scroll-cue {
  position: absolute; right: var(--gutter); bottom: 28px;
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--steel);
}
.cue-line { width: 40px; height: 1px; background: var(--chalk-45); position: relative; overflow: hidden; }
.cue-line::after { content: ""; position: absolute; inset: 0; background: var(--blue); transform: translateX(-100%); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@media (max-width: 760px) { .scroll-cue { display: none; } }

/* ---------- sections ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { position: relative; padding: clamp(84px, 11vw, 150px) 0; }
.section-head { margin-bottom: clamp(36px, 5vw, 64px); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.figure img { width: 100%; border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.figure figcaption { margin-top: 12px; }
.figure-sticky { position: sticky; top: 110px; align-self: start; }
.figure-tall img { aspect-ratio: 2 / 3; object-fit: cover; }

.chalk { position: absolute; left: var(--gutter); right: var(--gutter); top: 0; height: 12px; width: auto; overflow: visible; }
.chalk path { fill: none; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.2s var(--ease); }
.chalk-line { stroke: var(--chalk-45); stroke-width: 1; opacity: .7; }
.chalk-glow { stroke: var(--blue); stroke-width: 2.5; opacity: .14; filter: blur(3px); }
.chalk.in-view path { stroke-dashoffset: 0; }

/* the house */
.measurements { margin-top: 36px; border-top: 1px solid var(--seam); }
.measurements li { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--seam); font-size: 15px; }
.m-key { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--steel); padding-top: 3px; }
.m-val { color: var(--chalk); }

/* the collection */
.collection { isolation: isolate; overflow: hidden; }
.collection-bg { position: absolute; inset: 0; z-index: -1; }
.table-video, .table-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.table-poster { z-index: -1; }
.table-video { opacity: 0; transition: opacity 1.4s ease; }
.table-video.ready { opacity: 1; }
.collection-grade { position: absolute; inset: 0; background: linear-gradient(180deg, var(--ink) 0%, rgba(10, 10, 14, .78) 30%, rgba(10, 10, 14, .78) 70%, var(--ink) 100%); }
.cards { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: rgba(21, 21, 28, .82); border: 1px solid var(--seam); border-radius: 6px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color .3s var(--ease), transform .4s var(--ease);
}
.card:hover { border-color: rgba(169, 189, 255, .45); transform: translateY(-2px); }
.card-media { aspect-ratio: 16 / 8; overflow: hidden; border-bottom: 1px solid var(--seam); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.card:hover .card-media img { transform: scale(1.03); }
.card-body { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.card-title { font-family: var(--display); font-weight: 400; font-size: clamp(1.8rem, 2.6vw, 2.4rem); line-height: 1.1; display: flex; align-items: center; gap: 12px; }
.silk-mark { width: 28px; height: 28px; }
.card-tagline { font-family: var(--display); font-style: italic; font-size: 1.25rem; color: var(--chalk-70); margin-top: -6px; }
.card-next .card-title { max-width: 14ch; }
.card-next .btn { margin-top: 8px; }
.link-out { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.link-out svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform .3s var(--ease); }
.link-out:hover svg { transform: translate(2px, -2px); }
.pattern-notch { position: absolute; right: -6px; bottom: -10px; width: 140px; height: 140px; fill: none; stroke: var(--seam); stroke-width: 1.5; pointer-events: none; opacity: .9; }
.pattern-notch .pn-cut { stroke: var(--blue); stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s var(--ease) .3s; opacity: .8; }
.card-next.in-view .pn-cut { stroke-dashoffset: 0; }

/* method: chalk ground, the pattern paper */
.method { background: var(--chalk); color: var(--ink); }
.method .h2, .method .body-lg { color: var(--ink); }
.method .body { color: rgba(10, 10, 14, .72); }
.method .figure img { box-shadow: 0 30px 70px rgba(10, 10, 14, .28); }
.method .figure figcaption { color: rgba(10, 10, 14, .55); }
.method-grid { align-items: start; }
.steps { display: grid; gap: 0; border-top: 1px solid rgba(10, 10, 14, .18); margin-top: 8px; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 28px 0; border-bottom: 1px solid rgba(10, 10, 14, .18); }
.step-n { font-size: 13px; color: var(--indigo); padding-top: 8px; }
.step-title { font-family: var(--display); font-weight: 400; font-size: 1.75rem; line-height: 1.1; margin-bottom: 10px; }

/* house rules */
.rules-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-left: 1px solid var(--seam); }
.rule { padding: 10px 28px 10px 24px; border-right: 1px solid var(--seam); }
.rule-title { font-family: var(--display); font-weight: 400; font-style: italic; font-size: 1.85rem; line-height: 1.1; margin-bottom: 14px; }
@media (max-width: 1000px) { .rules-grid { grid-template-columns: repeat(2, 1fr); row-gap: 40px; } }
@media (max-width: 560px) { .rules-grid { grid-template-columns: 1fr; } }

/* fitting */
.fitting-grid { align-items: start; }
.form { margin-top: 36px; display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; }
.field span { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--steel); }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; font: inherit; color: var(--chalk);
  background: var(--wool); border: 1px solid var(--seam); border-radius: 3px;
  transition: border-color .25s, box-shadow .25s;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(236, 235, 228, .3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(169, 189, 255, .15); }
.field textarea { resize: vertical; min-height: 130px; }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.form-status { min-height: 1em; color: var(--chalk-70); letter-spacing: .04em; font-size: 13px; }
.form-status.ok { color: var(--blue); }
.form-status.err { color: #f0a3a3; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* footer */
.footer { border-top: 1px solid var(--seam); padding: 56px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-line { color: var(--steel); font-size: 14px; margin-top: 4px; max-width: 40ch; }
.footer-links { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--chalk-70); }
.footer-links a:hover { color: var(--chalk); }
.footer-legal { grid-column: 1 / -1; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--seam); }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-video, .table-video { display: none; }
  .h1 .w, .hero-eyebrow, .hero-foot, .scroll-cue { animation: none; opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .chalk path, .pattern-notch .pn-cut { stroke-dashoffset: 0; transition: none; }
  .cue-line::after { animation: none; }
  .card, .btn, .card-media img { transition: none; }
}

/* attribute hidden always wins */
[hidden] { display: none !important; }

/* review mode (?review=1): static full-page render for screenshots */
.review .hero { min-height: 900px; }
.review .reveal { opacity: 1; transform: none; transition: none; }
.review .chalk path, .review .pn-cut { stroke-dashoffset: 0; transition: none; }
.review .hero-video, .review .table-video { display: none; }
.review .h1 .w, .review .hero-eyebrow, .review .hero-foot, .review .scroll-cue { animation: none; opacity: 1; transform: none; }
.review .figure-sticky { position: static; }
