/* ============================================================
   CAVALLO — Variant D · Editorial
   Premium B&W + gold, photo essay, oversized Playfair
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-2: #131313;
  --bg-3: #1c1c1c;
  --paper: #f5f5f0;
  --paper-2: #e8e8e0;
  --ink: #f5f5f0;
  --ink-2: #b8b8b0;
  --ink-3: #6a6a62;
  --rule: rgba(245, 245, 240, 0.1);
  --rule-2: rgba(245, 245, 240, 0.2);
  --gold: #b8941f;
  --gold-2: #d4af37;

  --sans: 'Inter', -apple-system, sans-serif;
  --display: 'Playfair Display', Georgia, serif;
  --body-serif: 'Playfair Display', Georgia, serif;
  --mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; filter: grayscale(1) contrast(1.05); }
ul { list-style: none; }
button { background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--bg); }

html.lenis, html.lenis body { height: auto; }

/* Loader */
.loader { position: fixed; inset: 0; background: var(--bg); z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column; transition: opacity 0.7s 0.2s, visibility 0s 0.9s; }
.loader.is-done { opacity: 0; visibility: hidden; }
.loader-mark { font-family: var(--display); font-size: 80px; font-weight: 900; line-height: 1; color: var(--ink); letter-spacing: -0.04em; font-style: italic; }
.loader-mark em { color: var(--gold); font-style: italic; }
.loader-bar { width: 220px; height: 1px; background: var(--rule-2); margin: 24px 0 16px; position: relative; overflow: hidden; }
.loader-bar::after { content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--gold); animation: loader 1.1s 0.2s ease-out forwards; }
@keyframes loader { to { width: 100%; } }
.loader-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-3); }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 22px 0; background: rgba(10, 10, 10, 0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: background 0.3s, padding 0.3s, border-color 0.3s; border-bottom: 1px solid transparent; }
.nav.is-stuck { padding: 14px 0; background: rgba(10, 10, 10, 0.95); border-bottom-color: var(--rule); }
.nav-inner { max-width: 1600px; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: flex; align-items: baseline; gap: 8px; font-family: var(--display); font-size: 24px; font-weight: 900; font-style: italic; letter-spacing: -0.04em; color: var(--ink); }
.brand-c { color: var(--gold); font-size: 32px; line-height: 1; }
.brand-meta { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); border-left: 1px solid var(--rule-2); padding-left: 10px; margin-left: 4px; font-style: normal; }
.primary-nav { display: flex; align-items: center; gap: 32px; }
.nav-link { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); padding: 8px 0; transition: color 0.2s; }
.nav-link:hover { color: var(--gold); }
.nav-cta { background: var(--gold); color: var(--bg); padding: 12px 22px; font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; transition: transform 0.2s, background 0.2s; }
.nav-cta:hover { background: var(--gold-2); transform: translateY(-1px); }
.nav-toggle { display: none; }
@media (max-width: 900px) {
  .primary-nav { display: none; }
  .nav-toggle { display: flex; width: 40px; height: 40px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; border: 1px solid var(--rule-2); }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); }
  .primary-nav.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: rgba(10, 10, 10, 0.97); backdrop-filter: blur(20px); padding: 24px 32px 32px; border-bottom: 1px solid var(--rule); gap: 16px; align-items: flex-start; }
}

/* Hero */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; padding: 140px 0 100px; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1) brightness(0.7); }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 10, 10, 0.4) 0%, rgba(10, 10, 10, 0.7) 50%, var(--bg) 100%); }
.hero-inner { position: relative; z-index: 2; max-width: 1600px; margin: 0 auto; padding: 0 32px; width: 100%; }
.hero-meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); margin-bottom: 32px; display: inline-flex; align-items: center; gap: 12px; opacity: 0; transform: translateY(20px); animation: fadeUp 0.8s 0.2s forwards; }
.hero-meta::before { content: ''; width: 32px; height: 1px; background: var(--gold); }
.hero-headline { font-family: var(--display); font-size: clamp(56px, 9.5vw, 170px); line-height: 0.9; letter-spacing: -0.04em; font-weight: 900; font-style: italic; color: var(--ink); margin-bottom: 32px; max-width: 1400px; opacity: 0; transform: translateY(40px); animation: fadeUp 1s 0.4s forwards; }
.hero-headline em { color: var(--gold); font-style: italic; }
.hero-headline .stroke { -webkit-text-stroke: 2px var(--ink); color: transparent; font-style: italic; }
.hero-deck { font-family: var(--body-serif); font-size: 22px; line-height: 1.5; font-weight: 400; color: var(--ink-2); max-width: 640px; margin-bottom: 40px; font-style: italic; opacity: 0; transform: translateY(30px); animation: fadeUp 1s 0.6s forwards; }
.hero-deck strong { color: var(--ink); font-weight: 600; }
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; opacity: 0; transform: translateY(30px); animation: fadeUp 1s 0.8s forwards; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 18px 32px; font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; transition: transform 0.2s, background 0.2s, color 0.2s; border: 0; }
.btn-primary { background: var(--gold); color: var(--bg); }
.btn-primary:hover { background: var(--gold-2); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.hero-side { position: absolute; right: 32px; bottom: 60px; z-index: 3; background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(20px); border: 1px solid var(--rule-2); border-radius: 0; padding: 18px 22px; display: flex; align-items: center; gap: 14px; max-width: 320px; opacity: 0; transform: translateY(20px); animation: fadeUp 1s 1.1s forwards; }
.hero-side-icon { width: 40px; height: 40px; background: var(--gold); color: var(--bg); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-style: italic; font-size: 18px; font-weight: 900; flex-shrink: 0; }
.hero-side-h { font-family: var(--display); font-size: 14px; font-weight: 700; font-style: italic; color: var(--ink); display: block; margin-bottom: 2px; }
.hero-side-p { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; }
@media (max-width: 900px) { .hero-side { display: none; } }

/* Sections */
.section { padding: 140px 0; position: relative; }
.section-wide { max-width: 1600px; margin: 0 auto; padding: 0 32px; }
.section-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); display: inline-flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.section-kicker::before { content: ''; width: 32px; height: 1px; background: var(--gold); }
.section-headline { font-family: var(--display); font-size: clamp(48px, 7vw, 120px); line-height: 0.92; letter-spacing: -0.04em; font-weight: 900; font-style: italic; color: var(--ink); margin-bottom: 24px; max-width: 1200px; }
.section-headline em { color: var(--gold); font-style: italic; }
.section-deck { font-family: var(--body-serif); font-size: 20px; line-height: 1.5; font-weight: 400; font-style: italic; color: var(--ink-2); max-width: 720px; margin-bottom: 80px; }
.section-head { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; margin-bottom: 80px; align-items: end; }
.section-head .section-deck { margin-bottom: 0; }
@media (max-width: 900px) { .section-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 48px; } }

/* Stats */
.stats { background: var(--bg-2); padding: 80px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.stat { padding: 0 28px; border-right: 1px solid var(--rule-2); }
.stat:last-child { border-right: 0; }
.stat-lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 12px; }
.stat-num { font-family: var(--display); font-size: clamp(48px, 5vw, 84px); font-weight: 900; font-style: italic; line-height: 1; color: var(--ink); display: block; margin-bottom: 16px; letter-spacing: -0.04em; }
.stat-num em { color: var(--gold); font-style: italic; }
.stat-p { font-family: var(--sans); font-size: 14px; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: 1fr 1fr; } .stat { border-right: 0; border-bottom: 1px solid var(--rule-2); padding: 24px 0; } }

/* Photo essay */
.essay { padding: 140px 0; background: var(--bg); }
.essay-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.essay-img { position: relative; overflow: hidden; aspect-ratio: 3/4; }
.essay-img:nth-child(odd) { margin-top: 64px; }
.essay-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1); }
.essay-img:hover img { transform: scale(1.04); }
.essay-caption { position: absolute; bottom: 16px; left: 16px; z-index: 2; background: var(--bg); padding: 12px 16px; max-width: 80%; }
.essay-caption-no { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 4px; }
.essay-caption-h { font-family: var(--display); font-size: 18px; font-weight: 700; font-style: italic; color: var(--ink); }
.essay-text { display: flex; flex-direction: column; justify-content: center; }
.essay-text p { font-family: var(--body-serif); font-size: 20px; line-height: 1.55; color: var(--ink-2); margin-bottom: 20px; font-style: italic; }
.essay-text p:first-of-type::first-line { font-variant-caps: small-caps; letter-spacing: 0.05em; color: var(--ink); }
.essay-text strong { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) { .essay-grid { grid-template-columns: 1fr; gap: 24px; } .essay-img:nth-child(odd) { margin-top: 0; } }

/* Service cards */
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.svc-card { position: relative; overflow: hidden; background: var(--bg-2); aspect-ratio: 4/3; display: block; }
.svc-card-bg { position: absolute; inset: 0; z-index: 0; }
.svc-card-bg img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(0.6) contrast(1.1); transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s; }
.svc-card:hover .svc-card-bg img { transform: scale(1.08); filter: grayscale(0.5) brightness(0.7); }
.svc-card-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 10, 10, 0.4) 0%, rgba(10, 10, 10, 0.92) 100%); }
.svc-card-body { position: relative; z-index: 1; height: 100%; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; }
.svc-card-no { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--gold); display: block; margin-bottom: 8px; }
.svc-card-title { font-family: var(--display); font-size: 40px; font-weight: 900; line-height: 0.95; letter-spacing: -0.03em; color: var(--ink); font-style: italic; margin-bottom: 12px; }
.svc-card-blurb { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 380px; margin-bottom: 24px; }
.svc-card-link { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; transition: gap 0.2s, color 0.2s; }
.svc-card:hover .svc-card-link { gap: 14px; color: var(--ink); }
@media (max-width: 700px) { .svc-grid { grid-template-columns: 1fr; } }

/* Pull quote */
.pq { padding: 160px 0; text-align: center; position: relative; background: var(--bg-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.pq-text { font-family: var(--display); font-size: clamp(28px, 4vw, 56px); line-height: 1.15; font-weight: 900; font-style: italic; letter-spacing: -0.02em; color: var(--ink); max-width: 1000px; margin: 0 auto 32px; }
.pq-text em { color: var(--gold); font-style: italic; }
.pq-cite { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }

/* Gallery — photo essay */
.gallery { padding: 140px 0; background: var(--bg); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.gallery-item { position: relative; overflow: hidden; background: var(--bg-2); aspect-ratio: 4/5; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-cap { position: absolute; inset: auto 0 0 0; padding: 16px; background: linear-gradient(180deg, transparent, rgba(10, 10, 10, 0.95)); z-index: 2; }
.gallery-cap-no { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 4px; }
.gallery-cap-h { font-family: var(--display); font-size: 18px; font-weight: 700; font-style: italic; color: var(--ink); line-height: 1.1; }
@media (max-width: 900px) { .gallery-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .gallery-grid { grid-template-columns: 1fr; } }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.split-img { position: relative; aspect-ratio: 4/5; overflow: hidden; }
.split-img img { width: 100%; height: 100%; object-fit: cover; }
.split-img-badge { position: absolute; bottom: 20px; left: 20px; z-index: 2; background: var(--gold); color: var(--bg); padding: 8px 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; }
.split-body h2 { font-family: var(--display); font-size: clamp(40px, 5vw, 72px); line-height: 1; font-weight: 900; font-style: italic; letter-spacing: -0.04em; color: var(--ink); margin-bottom: 24px; }
.split-body h2 em { color: var(--gold); font-style: italic; }
.split-body p { font-family: var(--body-serif); font-size: 18px; line-height: 1.65; color: var(--ink-2); margin-bottom: 20px; font-style: italic; }
.split-body strong { color: var(--ink); font-weight: 700; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 40px; } }

/* CTA */
.cta { padding: 160px 0; text-align: center; position: relative; overflow: hidden; background: var(--bg); }
.cta::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 50% 40% at 50% 50%, rgba(184, 148, 31, 0.1) 0%, transparent 60%); pointer-events: none; }
.cta-inner { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 0 32px; }
.cta-headline { font-family: var(--display); font-size: clamp(48px, 8vw, 140px); line-height: 0.9; font-weight: 900; font-style: italic; letter-spacing: -0.05em; color: var(--ink); margin-bottom: 32px; }
.cta-headline em { color: var(--gold); font-style: italic; }
.cta-deck { font-family: var(--body-serif); font-size: 21px; line-height: 1.5; font-style: italic; color: var(--ink-2); max-width: 620px; margin: 0 auto 40px; }
.cta-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }
.cta-meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink-3); }
.cta-meta strong { color: var(--gold); font-weight: 600; }

/* Footer */
.footer { background: var(--bg); border-top: 1px solid var(--rule); padding: 80px 0 32px; }
.footer-inner { max-width: 1600px; margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 60px; }
.footer-brand .brand { margin-bottom: 20px; }
.footer-line { font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--ink-2); max-width: 320px; }
.footer-h { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; display: block; }
.footer-list li { margin-bottom: 8px; }
.footer-list a { font-family: var(--sans); font-size: 14px; color: var(--ink-2); border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.footer-list a:hover { color: var(--gold); border-color: var(--gold); }
.footer-base { max-width: 1600px; margin: 0 auto; padding: 24px 32px 0; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; flex-wrap: wrap; gap: 12px; }
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 600px) { .footer-inner { grid-template-columns: 1fr; } }

/* Reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.is-in { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(40px); transition: opacity 0.8s, transform 0.8s; }
.reveal-stagger.is-in > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-in > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-in > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-stagger.is-in > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-stagger.is-in > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-stagger.is-in > *:nth-child(5) { transition-delay: 0.45s; }
.reveal-stagger.is-in > *:nth-child(6) { transition-delay: 0.55s; }
@media (prefers-reduced-motion: reduce) { .reveal, .reveal-stagger > * { opacity: 1; transform: none; transition: none; } }
