/* Hallmark · macrostructure: Split Studio · H2 split-diptych knobs: ratio=6/6, right=visual, divider=negative-space
 * theme: custom (tuned) · vibe: "trade house, warm confident, amber accent" · paper: oklch(97% 0.014 70) · accent: oklch(62% 0.15 45)
 * display: Fraunces · body: Inter Tight · axes: light / roman-serif / chromatic-amber
 * Layout: BOXED (content within 1200px frame on white outer shell)
 * Pre-emit critique: P5 H5 E5 S4 R5 V5 · studied: no · context: explicit · v0.8.0
 * slop: pass (42-45) · contrast: pass (40-41) · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · mobile: pass (34, 49, 50-57)
 */

:root {
  --color-paper:      oklch(97% 0.014 70);
  --color-paper-2:    oklch(93% 0.020 65);
  --color-paper-3:    oklch(88% 0.026 60);
  --color-ink:        oklch(23% 0.035 50);
  --color-ink-2:      oklch(42% 0.030 50);
  --color-rule:       oklch(85% 0.020 60);
  --color-rule-2:     oklch(90% 0.018 60);
  --color-muted:      oklch(52% 0.024 55);
  --color-accent:     oklch(62% 0.150 45);
  --color-accent-hover: oklch(55% 0.155 42);
  --color-accent-ink: oklch(99% 0.010 70);
  --color-accent-soft:  oklch(62% 0.150 45 / 0.14);
  --color-accent-wash:   oklch(62% 0.150 45 / 0.10);
  --color-accent-bloom:  oklch(62% 0.150 45 / 0.07);
  --color-accent-line:  oklch(62% 0.150 45 / 0.30);
  --color-shell:      oklch(100% 0 0);            /* outer white shell */
  --color-paper-glass:  oklch(97% 0.014 70 / 0.80);
  --color-focus:      oklch(58% 0.190 45);
  --shadow-soft:      0 1px 2px oklch(23% 0.03 50 / 0.06), 0 10px 30px oklch(23% 0.03 50 / 0.10);
  --shadow-boxed:     0 1px 3px oklch(23% 0.03 50 / 0.08), 0 18px 50px oklch(23% 0.03 50 / 0.10);

  --font-display: "Fraunces", "Inter Tight", Georgia, serif;
  --font-body:    "Inter Tight", system-ui, -apple-system, sans-serif;

  --text-xs:   0.78rem;
  --text-sm:   0.92rem;
  --text-base: 1.06rem;
  --text-lg:   1.32rem;
  --text-xl:   1.65rem;
  --text-2xl:  2.2rem;
  --text-3xl:  clamp(2.4rem, 5vw + 1rem, 4rem);
  --text-display: clamp(2.8rem, 7vw + 1rem, 5.6rem);

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;
  --space-3xl: 9rem;

  --radius-card: 16px;
  --radius-pill: 999px;
  --radius-input: 10px;
  --radius-box: 22px;
  --lh-tight: 1.04;
  --lh-base: 1.6;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-base: 240ms;
  --dur-slow: 320ms;

  --z-sticky: 200;
  --z-sticky-nav: 300;
  --banner-height: 80px;
  --measure: 64ch;
  --boxed-w: 1200px;
}

[data-theme="dark"] {
  --color-paper:      oklch(18% 0.020 55);
  --color-paper-2:    oklch(22% 0.024 55);
  --color-paper-3:    oklch(27% 0.028 55);
  --color-ink:        oklch(95% 0.012 70);
  --color-ink-2:      oklch(78% 0.016 65);
  --color-rule:       oklch(34% 0.022 55);
  --color-rule-2:     oklch(29% 0.020 55);
  --color-muted:      oklch(68% 0.018 60);
  --color-accent:     oklch(72% 0.145 50);
  --color-accent-hover: oklch(80% 0.150 52);
  --color-accent-ink: oklch(18% 0.03 55);
  --color-accent-soft:  oklch(72% 0.145 50 / 0.18);
  --color-accent-wash:   oklch(72% 0.145 50 / 0.14);
  --color-accent-bloom:  oklch(72% 0.145 50 / 0.08);
  --color-accent-line:  oklch(72% 0.145 50 / 0.34);
  --color-shell:      oklch(12% 0.015 55);       /* outer dark shell */
  --color-paper-glass:  oklch(18% 0.020 55 / 0.80);
  --color-focus:      oklch(76% 0.190 50);
  --shadow-soft:      0 1px 2px oklch(0% 0 0 / 0.4), 0 10px 34px oklch(0% 0 0 / 0.5);
  --shadow-boxed:     0 1px 3px oklch(0% 0 0 / 0.5), 0 18px 50px oklch(0% 0 0 / 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* Outer white (or dark) shell + subtle texture */
body {
  margin: 0;
  background-color: var(--color-shell);
  background-image:
    radial-gradient(60% 50% at 100% 0%, var(--color-accent-wash), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, var(--color-accent-bloom), transparent 70%);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-base);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
  padding-block: var(--space-md);
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--color-rule-2) 1px, transparent 1px);
  background-size: 22px 22px; opacity: 0.4;
  mask-image: linear-gradient(180deg, oklch(0% 0 0 / 0.5), transparent 45%);
  -webkit-mask-image: linear-gradient(180deg, oklch(0% 0 0 / 0.5), transparent 45%);
}

/* The boxed frame that holds all content */
.boxed {
  width: min(100% - 2rem, var(--boxed-w));
  margin-inline: auto;
  background-color: var(--color-paper);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-box);
  box-shadow: var(--shadow-boxed);
  overflow: clip;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--lh-tight); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-sm); max-width: var(--measure); }
ul { margin: 0; padding-inline-start: var(--space-md); }

.container { width: min(100% - 2rem, var(--boxed-w) - 4rem); margin-inline: auto; }
.eyebrow {
  font-family: var(--font-body); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--color-accent); font-weight: 700; margin: 0 0 var(--space-2xs);
}
.section { padding-block: var(--space-xl); }
.section__head { margin-bottom: var(--space-lg); }

/* ============ N9 Edge-aligned minimal nav (inside boxed) ============ */
.nav {
  position: sticky; top: 0; z-index: var(--z-sticky-nav);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) clamp(1rem, 3vw, 2rem);
  background-color: var(--color-paper-glass);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.nav__brand { display: flex; align-items: center; gap: var(--space-2xs); line-height: 1; }
.nav__logo {
  height: 64px; width: 64px;
  border: 1px solid var(--color-rule);
  border-radius: 1px;
  background-color: var(--color-ink);
  box-shadow: var(--shadow-soft);
}
.nav__wordmark { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); letter-spacing: -0.01em; }
.nav__links { display: flex; align-items: center; gap: var(--space-md); }
.nav__link {
  font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2);
  padding: var(--space-2xs) 0; line-height: 1; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.nav__link:hover { color: var(--color-ink); }
.nav__link[aria-current="page"] { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.nav__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; border-radius: 2px; }

.nav__tools { display: flex; align-items: center; gap: var(--space-3xs); }
.toggle {
  appearance: none; border: 1px solid var(--color-rule);
  background-color: var(--color-paper-2); color: var(--color-ink);
  font-family: var(--font-body); font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.04em; padding: var(--space-2xs) var(--space-xs);
  border-radius: var(--radius-pill); cursor: pointer; line-height: 1;
  min-height: 44px; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.toggle:hover { background-color: var(--color-paper-3); }
.toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.toggle:active { transform: translateY(1px); }
.nav__sheet-toggle { display: none; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-3xs);
  font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm);
  line-height: 1; padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-pill); cursor: pointer; white-space: nowrap;
  min-height: 44px; border: 1px solid transparent;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background-color: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { background-color: var(--color-accent-hover); }
.btn--outline { background-color: transparent; border-color: var(--color-rule); color: var(--color-ink); }
.btn--outline:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ============ Split Studio hero / sections ============ */
.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center;
  gap: var(--space-xl);
  padding: calc(var(--space-2xl) + var(--space-md)) clamp(1rem, 3vw, 2rem) var(--space-2xl);
}
.hero__display { font-size: var(--text-display); font-weight: 600; letter-spacing: -0.02em; max-width: 16ch; overflow-wrap: anywhere; }
.hero__lede { font-size: var(--text-lg); color: var(--color-ink-2); max-width: 46ch; margin-top: var(--space-md); }
.hero__cta { margin-top: var(--space-lg); display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.hero__visual {
  position: relative; border-radius: var(--radius-card);
  background: var(--color-paper-2); border: 1px solid var(--color-rule);
  padding: 0; overflow: hidden; min-height: 360px; box-shadow: var(--shadow-soft);
}
.hero__visual img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; object-position: center; display: block; }
.hero__visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, var(--color-accent-wash)); pointer-events: none; }

/* split rows (services/products alternating) */
.split {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  gap: var(--space-xl); padding-block: var(--space-lg);
}
.split + .split { border-top: 1px solid var(--color-rule); }
.split__media {
  border-radius: var(--radius-card); background-color: var(--color-paper-2);
  border: 1px solid var(--color-rule); padding: var(--space-md);
  display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden;
}
.split__media img { width: 100%; height: 100%; object-fit: contain; }
.split__body h2 { font-size: var(--text-2xl); margin-bottom: var(--space-xs); }
.split__body p { color: var(--color-ink-2); }
.split--flip .split__media { order: 2; }
.split__index { font-family: var(--font-display); font-size: var(--text-sm); color: var(--color-accent); font-weight: 700; letter-spacing: 0.1em; }

/* ============ Product / service cards ============ */
.card-list { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.detail-card {
  background-color: var(--color-paper-2); border: 1px solid var(--color-rule);
  border-radius: var(--radius-card); padding: var(--space-md);
  display: flex; flex-direction: column; gap: var(--space-xs);
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.detail-card:hover { border-color: var(--color-accent); }
.detail-card img { width: 100%; max-height: 200px; object-fit: contain; background: var(--color-paper-3); border-radius: 10px; padding: var(--space-xs); }
.detail-card h3 { font-size: var(--text-xl); }
.detail-card p, .detail-card ul, .detail-card li { color: var(--color-ink-2); font-size: var(--text-base); margin: 0; }
.detail-card ul { padding-inline-start: var(--space-md); display: grid; gap: var(--space-3xs); }

/* Services page: 4 across (1 row on desktop) */
.services-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(4, 1fr); }

/* page hero (full-width inside boxed) */
.page-hero { padding: calc(var(--space-2xl) + var(--space-md)) clamp(1rem, 3vw, 2rem) var(--space-lg); }
.page-hero__title { font-size: var(--text-3xl); }
.page-hero__lede { color: var(--color-ink-2); font-size: var(--text-lg); margin-top: var(--space-sm); max-width: 52ch; }

/* spec table */
.spec { width: 100%; border-collapse: collapse; max-width: 640px; }
.spec th, .spec td { text-align: start; padding: var(--space-xs) var(--space-sm); border-bottom: 1px solid var(--color-rule); }
.spec th { color: var(--color-muted); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.spec td { font-variant-numeric: tabular-nums; }

/* contact */
.contact-grid { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.contact-block { background-color: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-card); padding: var(--space-md); }
.contact-block h3 { font-size: var(--text-lg); margin-bottom: var(--space-xs); color: var(--color-accent); }
.contact-block a { color: var(--color-accent); font-weight: 600; }
.contact-block a:hover { text-decoration: underline; }
.link-list { list-style: none; padding: 0; display: grid; gap: var(--space-2xs); }

/* ============ Ft5 Statement footer (inside boxed) ============ */
.footer {
  margin-top: var(--space-2xl);
  padding: var(--space-xl) clamp(1rem, 3vw, 2rem);
  border-top: 1px solid var(--color-rule);
}
.footer__statement {
  font-family: var(--font-display); font-size: clamp(1.6rem, 3.5vw + 1rem, 3rem);
  font-weight: 600; letter-spacing: -0.01em; max-width: 22ch; line-height: 1.1; margin-bottom: var(--space-lg);
}
.footer__statement .dot { color: var(--color-accent); }
.footer__meta {
  display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: center; justify-content: space-between;
  font-size: var(--text-sm); color: var(--color-muted);
  padding-top: var(--space-md); border-top: 1px solid var(--color-rule-2);
}
.footer__links { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.footer__links a { color: var(--color-ink-2); white-space: nowrap; }
.footer__links a:hover { color: var(--color-accent); }
.footer__sep { color: var(--color-rule); }
.footer__brandline { display: flex; align-items: center; gap: var(--space-2xs); }
.footer__brandline img { height: 40px; width: 40px; border: 1px solid var(--color-rule); border-radius: 4px; background-color: var(--color-ink); }

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: var(--space-sm); top: var(--space-sm); z-index: 400; background: var(--color-paper); padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-pill); border: 1px solid var(--color-rule); }

/* ============ Responsive ============ */
@media (max-width: 60rem) {
  .hero { grid-template-columns: 1fr; gap: var(--space-lg); }
  .hero__visual { order: -1; min-height: 240px; }
  .split { grid-template-columns: 1fr; gap: var(--space-md); }
  .split--flip .split__media { order: 0; }
  .split__media { aspect-ratio: 16 / 10; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 40rem) {
  body { padding-block: 0; }
  .boxed { border-radius: 0; border-inline: none; width: 100%; }
  .nav__links { display: none; }
  .nav__sheet-toggle { display: inline-flex; }
  .services-grid { grid-template-columns: 1fr; }
  .footer__statement { font-size: var(--text-xl); }
  .footer__meta { flex-direction: column; align-items: flex-start; }
}

.sheet {
  position: fixed; inset-block-end: 0; inset-inline: 0;
  background-color: var(--color-paper-2); border-top: 1px solid var(--color-rule);
  border-radius: var(--radius-card) var(--radius-card) 0 0; padding: var(--space-md);
  display: flex; flex-direction: column; gap: var(--space-3xs);
  transform: translateY(110%); transition: transform var(--dur-base) var(--ease-out);
  z-index: var(--z-sticky);
}
.sheet[data-open="true"] { transform: translateY(0); }
.sheet a { padding: var(--space-sm); border-radius: var(--radius-input); font-weight: 600; color: var(--color-ink); }
.sheet a:hover, .sheet a[aria-current="page"] { background-color: var(--color-paper-3); color: var(--color-accent); }

/* Unified body copy: p, ul, li share one size everywhere (override card-only rule above) */
.section p, .section ul, .section li,
.detail-card p, .detail-card ul, .detail-card li,
.contact-block p, .contact-block ul, .contact-block li,
.split__body p, .split__body ul, .split__body li { font-size: var(--text-base); line-height: var(--lh-base); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
