/* ==========================================================================
   HAMIT, hamanit.org (redesign v2 "Gallery", 2026-10-07)

   Order: fonts, tokens, base, buttons, nav, hero (x-ray), work, services,
   about, pricing (estimator), faq, contact (guided intake), footer,
   legal pages, motion + reveal system, reduced motion.

   Shape rule: interactive controls = pill. Containers = var(--r) 16px.
   Images inside containers = 10px.
   ========================================================================== */

/* ---------- FONTS (self-hosted, Fontshare ITF Free Font License) ------- */
@font-face { font-family: 'Gambetta'; src: url('../fonts/gambetta-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gambetta'; src: url('../fonts/gambetta-400i.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Gambetta'; src: url('../fonts/gambetta-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('../fonts/general-sans-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('../fonts/general-sans-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

/* ---------- TOKENS ------------------------------------------------------ */
:root {
  --bg:        #f3f3f0;
  --bg-2:      #e9e9e4;
  --card:      #fafaf8;
  --ink:       #121311;
  --ink-2:     #34362f;
  --muted:     #5d605b;
  --line:      rgba(18, 19, 17, 0.11);
  --line-2:    rgba(18, 19, 17, 0.2);
  --accent:    #1f3b2d;
  --accent-2:  #2b5040;
  --accent-soft: #dfe7df;
  --on-accent: #f3f3f0;
  --deep:      #1a3226;
  --deep-ink:  #eef0ea;
  --deep-muted:#a9b8ad;
  --shadow:    0 1px 2px rgba(18, 19, 17, .04), 0 24px 60px -28px rgba(31, 44, 36, .28);

  --display: 'Gambetta', Georgia, serif;
  --body:    'General Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1320px;
  --gut: clamp(16px, 4vw, 48px);
  --sec: clamp(6rem, 11vw, 10.5rem);
  --r: 16px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-move: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-soft: cubic-bezier(0.19, 1, 0.22, 1);

  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg:        #101211;
  --bg-2:      #171a18;
  --card:      #1a1d1b;
  --ink:       #ecebe6;
  --ink-2:     #c9cac3;
  --muted:     #979a93;
  --line:      rgba(236, 235, 230, 0.1);
  --line-2:    rgba(236, 235, 230, 0.2);
  --accent:    #a9c4a1;
  --accent-2:  #bed6b6;
  --accent-soft: #223029;
  --on-accent: #101211;
  --deep:      #18241e;
  --deep-ink:  #ecebe6;
  --deep-muted:#9aab9f;
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 24px 60px -28px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ---------- BASE -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* Anchor jumps land with the section's top edge under the nav: every section
   already has 6-10rem of top padding, which is the breathing room. One offset
   source only (Lenis reads scroll-padding too, so don't add an offset there). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 0; overflow-x: clip; }
@media (max-width: 760px) { html { scroll-padding-top: 28px; } }
html:not(.lenis) { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.125rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
/* Paper grain (docs-pack surfaces recipe): static, fixed, no blend mode
   (blend modes on a fixed layer flicker on iOS). */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::after { opacity: .06; filter: invert(1); }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, dl, dd, blockquote { margin: 0; }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; }
h1 em, h2 em, h3 em { font-style: italic; color: var(--accent); }
h2 { font-size: clamp(2.5rem, 5.2vw, 4.6rem); line-height: 1.04; letter-spacing: -0.022em; }
h3 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); line-height: 1.12; letter-spacing: -0.015em; }
p { text-wrap: pretty; }

.wrap { width: min(100% - 2 * var(--gut), var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--bg); border-radius: 999px; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.sec { padding-block: var(--sec); position: relative; }
.sec-head { display: grid; gap: 1.5rem; margin-bottom: clamp(3.5rem, 6vw, 5.5rem); max-width: 820px; }
.lede { font-size: clamp(1.15rem, 1.45vw, 1.35rem); line-height: 1.6; color: var(--muted); max-width: 52ch; }

/* ---------- BUTTONS ------------------------------------------------------ */
.btn {
  --h: 52px;
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: var(--h); padding: 0 1.6rem;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 1.0625rem/1 var(--body);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 300ms var(--ease-out), color 300ms var(--ease-out), border-color 300ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 17px; height: 17px; flex: none; transition: transform 300ms var(--ease-out); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn-sm { --h: 44px; padding: 0 1.2rem; font-size: 1rem; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-2); }
  .btn-ghost:hover { border-color: var(--ink); }
  .btn:hover svg { transform: translateX(3px); }
}

.link-arrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-weight: 500; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size 400ms var(--ease-out), color 200ms var(--ease-out);
}
.link-arrow svg { width: 14px; height: 14px; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover { background-size: 0% 1px; background-position: 100% 100%; color: var(--accent); }
  .link-arrow:hover svg { transform: translate(2px, -2px); }
}

/* ---------- NAV ------------------------------------------------------------ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: 76px;
  border-bottom: 1px solid transparent;
  transition: background-color 400ms var(--ease-out), border-color 400ms var(--ease-out);
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-color: var(--line);
}
.nav-in { height: 100%; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; margin-right: auto; min-height: 44px; }
.brand svg { width: 22px; height: 17px; }
.brand svg .b3 { fill: var(--accent); }
.brand-word { font: 500 1.3rem/1 var(--display); letter-spacing: 0.01em; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { text-decoration: none; font-size: 1rem; color: var(--ink-2); padding: .75rem 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0% 1px no-repeat; transition: color 300ms var(--ease-out), background-size 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--ink); background-size: 100% 1px; } }
.nav-links a[aria-current] { color: var(--ink); background-size: 100% 1px; }
.nav-actions { display: flex; align-items: center; gap: .6rem; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 300ms var(--ease-out);
}
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 17px; height: 17px; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { border-color: var(--ink); } }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
.menu-btn { display: none; }

.mobile-menu {
  position: fixed; inset: 76px 0 0 0; z-index: 49;
  background: var(--bg);
  padding: 2.5rem var(--gut) 3rem;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity 300ms var(--ease-out), visibility 0s linear 300ms;
}
.mobile-menu a:not(.btn) {
  font: 400 clamp(2.4rem, 11vw, 3.2rem)/1.15 var(--display); letter-spacing: -0.02em;
  text-decoration: none; padding: .5rem 0; border-bottom: 1px solid var(--line);
  transform: translateY(14px); opacity: 0;
  transition: transform 500ms var(--ease-soft), opacity 400ms var(--ease-out);
}
.mobile-menu.open { opacity: 1; visibility: visible; transition-delay: 0s; }
.mobile-menu.open a:not(.btn) { transform: none; opacity: 1; }
.mobile-menu.open a:nth-child(2) { transition-delay: 40ms; }
.mobile-menu.open a:nth-child(3) { transition-delay: 80ms; }
.mobile-menu.open a:nth-child(4) { transition-delay: 120ms; }
.mobile-menu .btn { margin-top: 2.25rem; align-self: flex-start; }

@media (max-width: 900px) {
  .nav-links, .nav-actions .btn { display: none; }
  .menu-btn { display: grid; }
}

/* ---------- HERO ------------------------------------------------------------ */
.hero { position: relative; isolation: isolate; padding-top: calc(76px + clamp(2.5rem, 7vh, 5rem)); padding-bottom: clamp(5rem, 9vw, 8rem); }
/* A faint wash of the accent behind the frame, so the cream reads as lit
   paper rather than a flat fill. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 55% at 72% 62%, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent 70%);
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.4vw, 32px);
  row-gap: clamp(2.5rem, 4.5vw, 4rem);
  align-items: start;
}
.hero-title {
  grid-column: 1 / -1;
  font-size: clamp(2.3rem, 5vw, 5.1rem);
  line-height: 1.05;
  letter-spacing: -0.026em;
  max-width: 27ch;
}
.hero-title .w { display: inline-block; overflow: clip; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.hero-title .w > span { display: inline-block; }
.hero-copy { grid-column: 1 / span 4; display: grid; gap: 2rem; }
.hero-sub { font-size: clamp(1.15rem, 1.45vw, 1.35rem); color: var(--muted); max-width: 34ch; line-height: 1.6; }
.hero-sub strong { color: var(--ink); font-weight: 500; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .7rem; }

/* X-RAY: drag compare between a page's own wireframe and the live site */
.xray { grid-column: 5 / -1; }
.browser { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.browser-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; border-bottom: 1px solid var(--line); }
.site-tabs { display: flex; gap: .2rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.site-tabs::-webkit-scrollbar { display: none; }
.site-tab {
  height: 40px; padding: 0 .9rem; border-radius: 999px; flex: none;
  border: 0; background: transparent; cursor: pointer;
  font: 400 .875rem/1 var(--body); color: var(--muted); white-space: nowrap;
  transition: background-color 300ms var(--ease-out), color 300ms var(--ease-out), transform 160ms var(--ease-out);
}
.site-tab:active { transform: scale(0.97); }
.site-tab[aria-selected="true"] { background: var(--bg); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .site-tab:hover { color: var(--ink); } }
.browser-visit { margin-left: auto; flex: none; font-size: .875rem; color: var(--muted); text-decoration: none; padding: .8rem .7rem; }
@media (pointer: coarse) { .site-tab { height: 44px; } }
@media (hover: hover) and (pointer: fine) { .browser-visit:hover { color: var(--accent); } }

@property --pos { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
/* Same value as a plain number, for the handle's transform (cqw units), so
   the handle moves on the compositor instead of animating 'left'. */
@property --p { syntax: '<number>'; inherits: true; initial-value: 50; }
.xray-stage {
  --pos: 50%; --p: 50;
  container-type: inline-size;
  position: relative; aspect-ratio: 1440 / 900; overflow: hidden;
  background: var(--bg-2); cursor: ew-resize;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.xray-stage.is-intro { transition: --pos 1600ms var(--ease-move), --p 1600ms var(--ease-move); }
.xray-stage.is-snap { transition: --pos 500ms var(--ease-out), --p 500ms var(--ease-out); }
.xray-site { position: absolute; inset: 0; opacity: 0; transition: opacity 500ms var(--ease-out); }
.xray-site.is-on { opacity: 1; }
.xray-site img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; pointer-events: none; -webkit-user-drag: none; }
.xray-site .wire { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.xray-handle {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 44px;
  transform: translateX(calc(var(--p) * 1cqw - 22px));
  display: grid; place-items: center; cursor: ew-resize; touch-action: none; outline: none;
}
.xray-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.25); }
.xray-grip {
  position: relative; width: 44px; height: 44px; border-radius: 999px;
  background: rgba(250, 250, 248, .92); color: #121311;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.4);
  transition: transform 300ms var(--ease-out);
}
.xray-grip svg { width: 18px; height: 18px; }
.xray-stage.is-dragging .xray-grip, .xray-handle:focus-visible .xray-grip { transform: scale(1.1); }
.xray-handle:focus-visible .xray-grip { box-shadow: 0 0 0 3px var(--accent); }
.xray-tip {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .75rem .45rem .6rem; border-radius: 999px;
  background: var(--ink); color: var(--bg); font: 500 .875rem/1 var(--body);
  opacity: 0; scale: .9; transition: opacity 250ms var(--ease-out), scale 250ms var(--ease-out);
  will-change: transform;
}
.xray-tip svg { width: 14px; height: 14px; }
.xray-tip.show { opacity: 1; scale: 1; }
.xray-tip.gone { opacity: 0 !important; }
@media (hover: none), (pointer: coarse) { .xray-tip { display: none; } }
.xray-cap { margin-top: 1rem; font-size: .9375rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; }
.xray-cap em { font-family: var(--display); font-size: 1.05em; color: var(--ink); }

@media (max-width: 1023px) {
  .hero-copy, .xray { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .browser-visit { display: none; }
  .xray-cap { flex-direction: column; gap: .2rem; }
}

/* ---------- WORK: staggered gallery ---------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 4vw, 4.5rem);
  row-gap: clamp(4rem, 7vw, 6.5rem);
}
.gallery > :nth-child(even) { margin-top: clamp(4rem, 12vw, 11rem); }
.project { display: grid; gap: 1.5rem; align-content: start; }
.project-frame {
  position: relative; aspect-ratio: 4 / 3;
  border-radius: var(--r); overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--shadow);
}
.project-frame .shot { position: absolute; inset: 0; overflow: hidden; }
.project-frame img {
  width: 100%;
  transform: translateY(0);
  transition: transform 1.2s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .project-frame { cursor: ns-resize; }
  .project-frame:hover img, .project-frame:focus-visible img {
    transform: translateY(var(--travel, 0px));
    transition: transform var(--travel-dur, 7s) cubic-bezier(0.45, 0, 0.25, 1);
  }
}
@media (hover: none), (pointer: coarse) {
  .project-frame .shot { overflow-y: auto; overscroll-behavior: contain; }
  .project-frame img { transition: none; }
}
.project-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.project h3 { font-size: clamp(1.8rem, 2.8vw, 2.5rem); }
.project-kind { font-size: 1rem; color: var(--muted); }
.project p { color: var(--ink-2); max-width: 46ch; }
.project-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: 1rem; }
.project-tags { color: var(--muted); }
.work-hint { margin-top: clamp(3rem, 5vw, 4rem); font-size: .9375rem; color: var(--muted); }
.work-hint .touch { display: none; }
@media (hover: none), (pointer: coarse) { .work-hint .fine { display: none; } .work-hint .touch { display: inline; } }

/* Depth: the two columns drift at different speeds as they pass through
   the viewport. CSS scroll-driven, so browsers without it just stay still. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 761px) {
    .gallery > .project { animation: drift-a linear both; animation-timeline: view(); animation-range: cover; }
    .gallery > .project:nth-child(even) { animation-name: drift-b; }
    @keyframes drift-a { from { transform: translateY(36px); } to { transform: translateY(-36px); } }
    @keyframes drift-b { from { transform: translateY(96px); } to { transform: translateY(-96px); } }
  }
}
@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery > :nth-child(even) { margin-top: 0; }
}

/* ---------- SERVICES ------------------------------------------------------------ */
.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-2);
}
.service {
  display: grid; grid-template-columns: 3.5rem 1fr; gap: 0 1.25rem;
  padding: clamp(2rem, 3.5vw, 3rem) clamp(0rem, 3vw, 3rem) clamp(2rem, 3.5vw, 3rem) 0;
  border-bottom: 1px solid var(--line-2);
}
.service:nth-child(odd) { border-right: 1px solid var(--line-2); }
.service:nth-child(even) { padding-left: clamp(1.5rem, 3vw, 3rem); }
.service-n { font: italic 400 1.35rem/1.4 var(--display); color: var(--accent); }
.service h3 { margin-bottom: .9rem; }
.service p { color: var(--ink-2); max-width: 44ch; }
.service ul { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.service li { font-size: .875rem; color: var(--ink-2); padding: .45rem .8rem; border-radius: 999px; background: var(--bg-2); }
@media (max-width: 860px) {
  .services { grid-template-columns: 1fr; }
  .service:nth-child(odd) { border-right: 0; }
  .service:nth-child(even) { padding-left: 0; }
  .service { padding-right: 0; grid-template-columns: 2.5rem 1fr; }
}

/* ---------- ABOUT ---------------------------------------------------------------- */
.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2.5rem, 6vw, 7rem); align-items: start; }
.about-say { font: 400 clamp(1.55rem, 3.4vw, 3rem)/1.24 var(--display); letter-spacing: -0.018em; text-wrap: pretty; }
.about-say em { font-style: italic; color: var(--accent); }
.about-sign { margin-top: 2rem; font-size: 1rem; color: var(--muted); }
.promises { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line-2); }
.promises li { padding: 1.4rem 0; border-bottom: 1px solid var(--line-2); display: grid; gap: .35rem; }
.promises strong { font: 400 1.45rem/1.25 var(--display); letter-spacing: -0.01em; }
.promises span { color: var(--muted); font-size: 1.0625rem; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }

/* ---------- PRICING: estimator ------------------------------------------------ */
.est { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 3.5vw, 3.5rem); align-items: start; }
.est-groups { display: grid; gap: clamp(2.75rem, 4vw, 3.75rem); }
.est fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.est legend { padding: 0; margin-bottom: 1.1rem; font: 400 1.6rem/1.2 var(--display); display: flex; align-items: baseline; gap: .8rem; width: 100%; }
.est legend small { font: 400 .9375rem/1 var(--body); color: var(--muted); }
.opts { display: grid; gap: .6rem; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt-body {
  display: grid; grid-template-columns: 20px 1fr auto; gap: .3rem 1rem; align-items: baseline;
  padding: 1.15rem 1.3rem; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--card);
  transition: border-color 300ms var(--ease-out), background-color 300ms var(--ease-out), transform 160ms var(--ease-out);
}
.opt:active .opt-body { transform: scale(0.99); }
.opt-radio { width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid var(--line-2); align-self: center; display: grid; place-items: center; transition: border-color 300ms var(--ease-out); }
.opt-radio::after { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); transform: scale(0); transition: transform 300ms var(--ease-out); }
.opt-name { font-weight: 500; font-size: 1.125rem; }
.opt-price { font: 400 1.45rem/1 var(--display); white-space: nowrap; }
.opt-price small { font: 400 .875rem/1 var(--body); color: var(--muted); }
.opt-desc { grid-column: 2 / -1; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.opt input:checked + .opt-body { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--card)); }
.opt input:checked + .opt-body .opt-radio { border-color: var(--accent); }
.opt input:checked + .opt-body .opt-radio::after { transform: scale(1); }
.opt input:focus-visible + .opt-body { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .opt:hover .opt-body { border-color: var(--ink-2); } }

.est-sum {
  position: sticky; top: 104px;
  border-radius: var(--r); background: var(--deep); color: var(--deep-ink);
  padding: clamp(1.75rem, 2.8vw, 2.5rem);
  display: grid; gap: 1.6rem;
}
.sum-title { font: italic 400 1.4rem/1.2 var(--display); color: var(--deep-ink); }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .95rem 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.sum-row:last-child { border-bottom: 0; }
.sum-row dt { color: var(--deep-muted); font-size: 1rem; }
.sum-row dd { font: 400 1.75rem/1 var(--display); font-variant-numeric: tabular-nums lining-nums; }
.sum-row.total dd { font-size: clamp(2.8rem, 4.6vw, 3.8rem); letter-spacing: -0.02em; }
.sum-note { font-size: .9375rem; line-height: 1.6; color: var(--deep-muted); }
.sum-note strong { color: var(--deep-ink); font-weight: 500; }
.est-sum .btn-primary { background: var(--deep-ink); color: #121311; }
@media (hover: hover) and (pointer: fine) { .est-sum .btn-primary:hover { background: #fff; } }

/* odometer (docs-pack/effects/recipes/odometer-sweep-mask.html) */
.odo { display: inline-flex; align-items: flex-start; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.odo-d, .odo-s { display: inline-block; height: 1em; line-height: 1; }
.odo-d { overflow: clip; }
.odo-col { display: flex; flex-direction: column; transition: transform 900ms var(--ease-soft); }
.odo-col > span { display: block; height: 1em; line-height: 1; text-align: center; }

.est-mini { display: none; }
@media (max-width: 900px) {
  .est { grid-template-columns: 1fr; }
  .est-sum { position: relative; top: 0; }
  /* Phones: the summary sits below eight options, so a slim bar keeps the
     total in view while choosing. Slides up from the bottom edge and back. */
  .est-mini {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40;
    padding: .85rem 1.1rem; border-radius: 14px;
    background: var(--deep); color: var(--deep-ink);
    box-shadow: 0 18px 40px -16px rgba(0,0,0,.5);
    font-size: .9375rem;
    transform: translateY(calc(100% + 24px)); transition: transform 450ms var(--ease-out);
  }
  .est-mini.show { transform: none; }
  .est-mini strong { font: 400 1.35rem/1 var(--display); margin-left: .35rem; }
  .est-mini span:last-child { color: var(--deep-muted); text-align: right; }
}

/* ---------- FAQ ------------------------------------------------------------ */
.faq-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 6rem); align-items: start; }
.faq-head { position: sticky; top: 120px; display: grid; gap: 1.25rem; }
.faq-head p { color: var(--muted); max-width: 34ch; }
.faq-list { border-top: 1px solid var(--line-2); }
.faq-item { border-bottom: 1px solid var(--line-2); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.6rem 0;
  font: 400 clamp(1.25rem, 1.8vw, 1.55rem)/1.3 var(--display); letter-spacing: -0.01em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-plus { position: relative; flex: none; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line-2); transition: transform 400ms var(--ease-out), background-color 300ms var(--ease-out), border-color 300ms var(--ease-out), color 300ms var(--ease-out); }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; margin: -.75px 0 0 -5.5px; background: currentColor; }
.faq-plus::after { transform: rotate(90deg); }
.faq-item[open] .faq-plus { transform: rotate(45deg); background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.faq-a { padding: 0 3.5rem 1.7rem 0; color: var(--ink-2); max-width: 62ch; }
.faq-a p + p { margin-top: .8rem; }
@media (hover: hover) and (pointer: fine) { .faq-item summary:hover .faq-plus { border-color: var(--ink); } }
@supports (interpolate-size: allow-keywords) {
  .faq-item { interpolate-size: allow-keywords; }
  .faq-item::details-content { block-size: 0; overflow: clip; transition: block-size 450ms var(--ease-out), content-visibility 450ms allow-discrete; }
  .faq-item[open]::details-content { block-size: auto; }
}
@media (max-width: 900px) {
  .faq-grid { grid-template-columns: 1fr; }
  .faq-head { position: static; }
  .faq-a { padding-right: 0; }
}

/* ---------- CONTACT: guided intake ---------------------------------------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2.5rem, 5vw, 6rem); align-items: start; }
.contact-intro { display: grid; gap: 1.5rem; position: sticky; top: 120px; }
.contact-lines { list-style: none; padding: 0; margin: .75rem 0 0; border-top: 1px solid var(--line-2); }
.contact-lines li { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line-2); align-items: baseline; }
.contact-lines span { font-size: .9375rem; color: var(--muted); }
.contact-lines a, .contact-lines p { text-decoration: none; font-size: 1.0625rem; }
@media (hover: hover) and (pointer: fine) { .contact-lines a:hover { color: var(--accent); } }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.copy-btn {
  min-height: 36px; padding: 0 .9rem; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  font: 500 .875rem/1 var(--body); color: var(--ink-2);
  transition: border-color 300ms var(--ease-out), background-color 300ms var(--ease-out), color 300ms var(--ease-out), transform 160ms var(--ease-out);
}
.copy-btn:active { transform: scale(0.96); }
.copy-btn.is-done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) and (pointer: fine) { .copy-btn:hover { border-color: var(--ink); } }
@media (pointer: coarse) { .copy-btn { min-height: 44px; } }

.intake {
  position: relative;
  border-radius: var(--r); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 3.4vw, 3rem);
}
.intake-head { display: flex; align-items: center; gap: 1.25rem; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.intake-count { font-size: .9375rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.intake-bar { flex: 1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.intake-bar span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(.3333); transition: transform 700ms var(--ease-soft); }
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step-q { padding: 0; margin-bottom: 1.6rem; font: 400 clamp(1.8rem, 3vw, 2.5rem)/1.12 var(--display); letter-spacing: -0.018em; outline: none; }
.step-q em { font-style: italic; color: var(--accent); }
html.js .step:not(.is-on) { display: none; }
html.js .step.is-entering { animation: step-in 600ms var(--ease-soft) both; }
html.js .step.is-entering.from-back { animation-name: step-back; }
@keyframes step-in { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes step-back { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
html:not(.js) .step + .step { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.choice { position: relative; cursor: pointer; display: block; }
.choice:last-child:nth-child(odd) { grid-column: 1 / -1; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice-body {
  display: grid; gap: .25rem; height: 100%;
  padding: 1.2rem 1.3rem 1.25rem;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg);
  transition: border-color 300ms var(--ease-out), background-color 300ms var(--ease-out), transform 160ms var(--ease-out);
}
.choice-body strong { font: 400 1.4rem/1.2 var(--display); }
.choice-body small { font-size: .9375rem; color: var(--muted); }
.choice:active .choice-body { transform: scale(0.985); }
.choice input:checked + .choice-body { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--bg)); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .choice:hover .choice-body { border-color: var(--ink-2); } }

.mini-q { font-weight: 500; font-size: 1.0625rem; margin: 1.8rem 0 .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); font-size: 1rem;
  transition: border-color 300ms var(--ease-out), background-color 300ms var(--ease-out), color 300ms var(--ease-out), transform 160ms var(--ease-out);
}
.chip:active span { transform: scale(0.97); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .chip:hover span { border-color: var(--ink-2); } }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1rem; }
.field { display: grid; gap: .45rem; align-content: start; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 500; font-size: 1rem; }
.field label .opt-note { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: .85rem 1rem;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg);
  font-size: 1.0625rem;
  transition: border-color 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
}
.field textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.err { font-size: .875rem; color: #a3261d; }
.err:empty { display: none; }
:root[data-theme="dark"] .err { color: #ff8f85; }
.field.invalid input, .field.invalid textarea { border-color: #a3261d; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.intake-nav { display: flex; align-items: center; gap: .7rem; margin-top: clamp(2rem, 3vw, 2.5rem); }
.intake-nav [data-next], .intake-nav [data-submit] { margin-left: auto; }
html:not(.js) .intake-nav [data-back], html:not(.js) .intake-nav [data-next] { display: none; }
.intake-nav [hidden] { display: none; }
.form-status { margin-top: 1rem; font-size: 1rem; color: var(--muted); }
.form-status:empty { display: none; }
.form-status[data-state="err"] { color: #a3261d; }
:root[data-theme="dark"] .form-status[data-state="err"] { color: #ff8f85; }
.intake.is-loading [data-submit] { opacity: .6; pointer-events: none; }

.intake-done { display: grid; gap: 1.2rem; padding: clamp(.5rem, 2vw, 1.5rem) 0; animation: step-in 700ms var(--ease-soft) both; }
.intake-done h3 { font-size: clamp(2rem, 3.4vw, 2.8rem); }
.intake-done p { color: var(--ink-2); max-width: 46ch; }
.done-mark { width: 52px; height: 52px; border-radius: 999px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.done-mark svg { width: 24px; height: 24px; stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 700ms var(--ease-out) 250ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-intro { position: static; }
}
@media (max-width: 560px) {
  .choices, .fields { grid-template-columns: 1fr; }
  .intake-nav .btn { flex: 1; }
}

/* ---------- FOOTER ------------------------------------------------------------ */
/* The one deliberate colour block on the page: the closing panel. */
.foot {
  padding-top: clamp(5rem, 10vw, 9rem); padding-bottom: 2.5rem;
  background: var(--deep); color: var(--deep-ink);
  --line: rgba(255, 255, 255, .13); --ink-2: var(--deep-ink); --muted: var(--deep-muted);
  --accent-on-deep: #a9c4a1;
}
.foot .brand svg .b3 { fill: var(--accent-on-deep); }
/* Pages without the big closing CTA (legal, 404, thanks) get a slim footer. */
.foot:not(:has(.foot-cta)) { padding-top: 0; }
.foot:not(:has(.foot-cta)) .foot-row { border-top: 0; }
.foot-cta { display: grid; gap: 1.5rem; margin-bottom: clamp(4rem, 8vw, 7rem); }
.foot-cta p { color: var(--deep-muted); font-size: 1.125rem; }
.foot-big {
  display: inline-flex; align-items: baseline; gap: .35em; flex-wrap: wrap;
  font: 400 clamp(3.2rem, 10vw, 9.5rem)/1 var(--display); letter-spacing: -0.035em;
  text-decoration: none; width: fit-content;
}
.foot-big em { font-style: italic; color: var(--accent-on-deep); }
.foot-big svg { width: .5em; height: .5em; align-self: center; transition: transform 500ms var(--ease-soft); }
@media (hover: hover) and (pointer: fine) { .foot-big:hover svg { transform: translate(.08em, -.08em); } }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem 2rem; align-items: center; padding-top: 2rem; border-top: 1px solid var(--line); font-size: 1rem; color: var(--muted); }
.foot-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.6rem; }
.foot-nav a { text-decoration: none; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .foot-nav a:hover { color: var(--accent-on-deep); } .foot-row a:hover { color: var(--accent-on-deep); } }
.foot :focus-visible { outline-color: var(--accent-on-deep); }

/* ---------- LEGAL / SIMPLE PAGES -------------------------------------------- */
.doc { padding-top: calc(76px + clamp(3rem, 8vw, 6rem)); padding-bottom: var(--sec); }
.doc h1 { font-size: clamp(3rem, 7vw, 5.6rem); line-height: 1.02; letter-spacing: -0.028em; margin-bottom: 1rem; }
.doc .updated { font-size: 1rem; color: var(--muted); margin-bottom: 3rem; }
.doc-body { max-width: 66ch; }
.doc-body h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin: 2.75rem 0 .9rem; line-height: 1.15; }
.doc-body p, .doc-body li { color: var(--ink-2); }
.doc-body p + p { margin-top: 1rem; }
.doc-body ul { padding-left: 1.2rem; margin: .75rem 0 0; }
.doc-body li + li { margin-top: .45rem; }
.doc-body a:not(.btn) { color: var(--accent); }
a[href^="tel:"] { white-space: nowrap; }

/* Theme switch: the JS animates the new snapshot's clip-path; turn off the
   default cross-fade so only the circle shows. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ==========================================================================
   MOTION + REVEAL SYSTEM (from _starter; keep the failsafe)

   html.js gate: no-JS visitors see everything. .reveal-fallback is set by
   the JS timeout when IntersectionObserver never fires (hidden panes, some
   webviews) and also kills transitions, since a suspended page won't
   advance them either.
   ========================================================================== */
html.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-soft); }
html.js .reveal.in { opacity: 1; transform: none; }

/* Headings rise out of their own line box (docs-pack mask-rise) */
html.js .rise { overflow: clip; padding-bottom: .08em; margin-bottom: -.08em; }
html.js .rise > span { display: block; transform: translateY(102%); transition: transform 1200ms var(--ease-soft); }
html.js .rise.in > span { transform: none; }

/* About statement: words arrive in reading order (docs-pack text-effects
   "blur-in by word", without the blur: transform/opacity only) */
html.js [data-words] .wd { display: inline-block; opacity: 0; transform: translateY(.35em); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-soft); transition-delay: calc(var(--i) * 18ms); }
html.js [data-words].in .wd { opacity: 1; transform: none; }

/* Project images settle from a slight zoom inside their frame */
html.js .project .shot { opacity: 0; transform: scale(1.05); transition: opacity 900ms var(--ease-out), transform 1300ms var(--ease-soft); }
html.js .project.in .shot { opacity: 1; transform: none; }
html.js .project .project-body { opacity: 0; transform: translateY(18px); transition: opacity 800ms var(--ease-out) 150ms, transform 1000ms var(--ease-soft) 150ms; }
html.js .project.in .project-body { opacity: 1; transform: none; }

html.js .stagger > * { opacity: 0; transform: translateY(24px); transition: opacity 800ms var(--ease-out), transform 1000ms var(--ease-soft); }
html.js .stagger.in > * { opacity: 1; transform: none; }
html.js .stagger.in > *:nth-child(2) { transition-delay: 80ms; }
html.js .stagger.in > *:nth-child(3) { transition-delay: 160ms; }
html.js .stagger.in > *:nth-child(4) { transition-delay: 240ms; }

/* Hero entrance: words rise one after another, then copy and the frame */
html.js .hero-title .w > span { transform: translateY(110%); transition: transform 1300ms var(--ease-soft); transition-delay: calc(var(--i, 0) * 55ms + 80ms); }
html.js .hero-copy { opacity: 0; transform: translateY(24px); transition: opacity 1000ms var(--ease-out) 500ms, transform 1300ms var(--ease-soft) 500ms; }
/* The frame only slides (no fade from 0) so its screenshot counts as painted
   the moment it loads: it is the page's LCP element. */
html.js .xray { transform: translateY(32px); transition: transform 1400ms var(--ease-soft) 300ms; }
html.js.is-ready .hero-title .w > span { transform: none; }
html.js.is-ready .hero-copy, html.js.is-ready .xray { opacity: 1; transform: none; }

html.reveal-fallback .reveal,
html.reveal-fallback [data-words] .wd,
html.reveal-fallback .rise > span,
html.reveal-fallback .stagger > *,
html.reveal-fallback .project .shot,
html.reveal-fallback .project .project-body,
html.reveal-fallback .hero-title .w > span,
html.reveal-fallback .hero-copy,
html.reveal-fallback .xray { opacity: 1 !important; transform: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal, html.js [data-words] .wd, html.js .rise > span, html.js .stagger > *, html.js .project .shot, html.js .project .project-body,
  html.js .hero-title .w > span, html.js .hero-copy, html.js .xray { opacity: 1; transform: none; transition: none; }
  .xray-stage.is-intro, .xray-stage.is-snap { transition: none; }
  .project-frame img, .odo-col { transition: none !important; }
  .faq-item::details-content { transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; }
  .done-mark svg { stroke-dashoffset: 0; }
}
