/* Jacob Sandler Media: one stylesheet, no framework. Dark by design so photographs carry the color. */
:root {
  --bg: #0f0f0d;
  --surface: #171714;
  --surface-2: #1f1f1b;
  --line: #2c2c27;
  --text: #ecebe4;
  --muted: #a7a59a;
  --accent: #cdc48c;        /* olive-gold, lifted from the backdrop in my headshots */
  --accent-strong: #e0d79e;
  --accent-ink: #12120f;
  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --row-h: 250px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg { max-width: 100%; display: block; }
picture img { width: 100%; height: auto; background-size: cover; background-position: center; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3, .h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0; }
.eyebrow { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 1rem; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #d6d4cb; max-width: 62ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 0.8em 1.35em; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: 600 0.95rem/1 var(--font-body);
  text-decoration: none; cursor: pointer; transition: background .2s, transform .2s;
}
.btn:hover { background: var(--accent-strong); color: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.btn-small { padding: 0.6em 1.05em; font-size: 0.875rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6rem 0 1rem; }
.link-arrow { font-weight: 500; text-decoration: none; white-space: nowrap; }
.link-arrow::after { content: " →"; }

/* Masthead */
.masthead { position: sticky; top: 0; z-index: 50; background: rgba(15, 15, 13, 0.82); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid rgba(255,255,255,0.06); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 1.05rem/1 var(--font-display); letter-spacing: -0.01em; }
.wordmark-mark { width: 22px; height: 22px; border-radius: 50%; border: 4px solid var(--accent); position: relative; }
.wordmark-mark::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 0.95rem; font-weight: 500; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav .btn { margin-left: 8px; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 0; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 22px; height: 2px; background: var(--text); margin: auto; position: relative; transition: transform .2s, background .2s; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; } .nav-toggle-bars::after { top: 7px; }
.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav { position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; }
  .nav-open .nav { transform: none; opacity: 1; visibility: visible; }
  .nav a:not(.btn) { padding: 12px; font-size: 1.05rem; }
  .nav .btn { margin: 10px 0 0; }
}

/* Sections */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-head h2 { margin: 0 0 .25em; }
.section-head p { margin: 0; max-width: 64ch; }
.count { color: var(--muted); white-space: nowrap; }
.page-head { padding-top: clamp(48px, 7vw, 96px); padding-bottom: 24px; }

/* Hero */
.hero { padding-block: clamp(40px, 6vw, 80px) clamp(40px, 6vw, 72px); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto 40%; height: 120%; background: radial-gradient(closest-side, rgba(205,196,140,0.10), transparent 70%); pointer-events: none; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.5rem); }
.hero-media { display: flex; flex-direction: column; align-items: center; }
.hero-media .phone { width: min(320px, 100%); }
.hero-photo { display: block; width: min(380px, 100%); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7); }
.hero-photo img { aspect-ratio: 4 / 5; object-fit: cover; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media .phone { width: min(260px, 70vw); }
  .hero-photo { width: min(320px, 80vw); }
}

/* Phone frames for vertical video */
.phone { margin: 0; }
.phone-frame { position: relative; border-radius: 30px; padding: 8px; background: linear-gradient(160deg, #2b2b26, #121210); box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.07); }
.phone-video, .phone-frame picture img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 23px; background: #000; }
.phone-frame-static picture img { aspect-ratio: auto; object-fit: initial; }

/* Three doors */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-bottom: 8px; }
.door { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; color: var(--text); text-decoration: none; background: var(--surface); isolation: isolate; }
.door-img, .door-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.door-img-shot img { object-position: 30% 50%; }
.door::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10,10,8,.88)); z-index: 1; }
.door:hover .door-img img, .door:hover > .door-img > img { transform: scale(1.04); }
.door-label { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 2; font: 600 1.6rem/1.1 var(--font-display); display: grid; gap: 6px; }
.door-num { color: var(--accent); font-size: .75rem; }
.door-sub { font: 400 .92rem/1.4 var(--font-body); color: #cfcdc4; }
@media (max-width: 800px) {
  .doors, .doors-two { grid-template-columns: 1fr; }
  .door { aspect-ratio: 16 / 10; }
}

.doors.doors-two { grid-template-columns: repeat(2, 1fr); }
.doors-two .door { aspect-ratio: 16 / 10; }
@media (max-width: 800px) { .doors.doors-two { grid-template-columns: 1fr; } }

/* Justified gallery: tiles grow by aspect ratio so each row shares one height */
.jg { display: flex; flex-wrap: wrap; gap: 6px; }
.jg::after { content: ""; flex-grow: 999999; }
.jg-item { flex-grow: calc(var(--ar) * 100); flex-basis: calc(var(--ar) * var(--row-h)); position: relative; overflow: hidden; border-radius: 4px; background: var(--surface); }
.jg-item picture, .jg-item img { width: 100%; height: 100%; }
.jg-item img { aspect-ratio: var(--ar); object-fit: cover; transition: transform .5s ease, opacity .3s; }
.jg-item:hover img { transform: scale(1.03); }
@media (max-width: 1100px) { :root { --row-h: 200px; } }
@media (max-width: 640px) { :root { --row-h: 120px; } .jg { gap: 4px; } }

/* Home mosaic */
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; grid-auto-flow: dense; gap: 6px; }
.mosaic-item { position: relative; overflow: hidden; border-radius: 4px; background: var(--surface); }
.mosaic-item.tall { grid-row: span 2; }
.mosaic-item.wide { grid-column: span 2; }
.mosaic-item.feature { grid-column: span 2; grid-row: span 2; }
.mosaic-item picture, .mosaic-item img { width: 100%; height: 100%; }
.mosaic-item img { object-fit: cover; transition: transform .5s ease; }
.mosaic-item:hover img { transform: scale(1.03); }
@media (max-width: 900px) { .mosaic { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 180px; } }
@media (max-width: 640px) { .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; gap: 4px; } }

/* Galleries page */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 0.9rem; background: var(--surface); }
.chip:hover { border-color: var(--accent); color: var(--text); }
.gallery-section { padding-block: 40px; }
.gallery-section + .gallery-section { border-top: 1px solid var(--line); }

/* Before / after */
.compare { margin: 0; }
.compare-stage { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: var(--ar); background: var(--surface); user-select: none; }
.compare-stage picture, .compare-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-before-wrap { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
.compare-handle::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 18px; box-shadow: 0 4px 20px rgba(0,0,0,.5); }
.compare-tag { position: absolute; top: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(10,10,8,.72); font: 500 .75rem/1 var(--font-mono); pointer-events: none; }
.compare-tag-before { left: 12px; } .compare-tag-after { right: 12px; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; -webkit-appearance: none; appearance: none; }
.compare { position: relative; }
.compare:has(.compare-range:focus-visible) .compare-handle::after { outline: 2px solid var(--text); outline-offset: 3px; }

.crossover { background: var(--surface); border-block: 1px solid var(--line); }
.crossover-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 900px) { .crossover-inner { grid-template-columns: 1fr; } }

/* About strip / about page */
.about-strip { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.about-strip-img img, .about-img img, .eng-portrait img { border-radius: var(--radius); }
@media (max-width: 800px) { .about-strip { grid-template-columns: 1fr; } .about-strip-img { max-width: 300px; } }
.about { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); padding-block: clamp(48px, 7vw, 96px) 40px; align-items: start; }
.about-img { position: sticky; top: 96px; }
.gear { color: var(--muted); line-height: 1.9; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } .about-img { position: static; max-width: 360px; } }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); padding-block: 56px 96px; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.9rem; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(205,196,140,.18); }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }

/* Video page */
.reels { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: clamp(24px, 3vw, 40px); padding-bottom: 96px; }

/* Engineering */
.eng-head { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(48px, 7vw, 96px) 32px; }
.h1-sub { display: block; font-size: 0.55em; color: var(--accent); margin-top: .35em; letter-spacing: -0.01em; }
@media (max-width: 860px) { .eng-head { grid-template-columns: 1fr; } .eng-portrait { max-width: 280px; order: -1; } }
.toc { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 24px; position: sticky; top: 68px; z-index: 10; background: linear-gradient(var(--bg) 75%, transparent); padding-top: 12px; }
.toc a { font-size: .85rem; color: var(--muted); text-decoration: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.toc a:hover { color: var(--text); border-color: var(--muted); }
@media (max-width: 640px) { .toc { position: static; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .toc a { white-space: nowrap; } }
.case { padding-block: clamp(48px, 6vw, 80px); border-top: 1px solid var(--line); }
.case-head { margin-bottom: 28px; max-width: 820px; }
.case-meta { color: var(--muted); margin-bottom: .6rem; }
.case-claim { font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: #d6d4cb; }
.case-lede { max-width: 70ch; color: #d6d4cb; margin-bottom: 24px; }
.case-claim strong { color: var(--accent); font-weight: 600; }
.case-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.case-body-phone { grid-template-columns: minmax(0, 1fr) 320px; }
.case-body-solo { grid-template-columns: minmax(0, 820px); }
.case-text h3 { margin-top: 1.6em; color: var(--text); }
.case-text h3:first-child { margin-top: 0; }
.case-text .phone, .case-body > .phone { max-width: 320px; }
@media (max-width: 900px) { .case-body, .case-body-phone { grid-template-columns: 1fr; } .case-body > .phone, .shot-phone { max-width: 300px; } }
.stack { color: var(--accent); margin-top: 1.4em; line-height: 1.9; }
.ticks { padding: 0; list-style: none; margin: 0 0 1em; display: grid; gap: .6em; }
.ticks li { padding-left: 1.4em; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .62em; width: .55em; height: .55em; border-radius: 50%; border: 2px solid var(--accent); }
.plain { padding-left: 1.1em; margin: 0; display: grid; gap: .6em; }
.diagram { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.diagram svg { width: 100%; height: auto; }
.d-box rect { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.5; }
.d-box text { fill: var(--text); font: 600 13px var(--font-body); text-anchor: middle; }
.d-box .d-small { fill: var(--muted); font: 400 11px var(--font-mono); }
.d-accent rect { fill: rgba(205,196,140,.12); stroke: var(--accent); }
.d-line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; }
figcaption { color: var(--muted); font-size: .88rem; margin-top: 12px; }
.diagram-stack { margin: 0; }
.shot-phone { margin: 0; }
.shot-wide { margin: 0 0 8px; }
.shot-wide img { border-radius: var(--radius); border: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.cards-tight { margin-top: 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; }
.card h3 { margin-bottom: .35em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.timeline { display: grid; gap: 28px; }
.tl-item { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; }
.tl-when { color: var(--accent); padding-top: .25em; }
@media (max-width: 640px) { .tl-item { grid-template-columns: 1fr; gap: 4px; } }
.toolkit { margin-top: 40px; }
.toolkit dl { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 10px 24px; margin: 0; }
.toolkit dt { font-weight: 600; }
.toolkit dd { margin: 0; color: #d6d4cb; }
@media (max-width: 640px) { .toolkit dl { grid-template-columns: 1fr; gap: 2px; } .toolkit dd { margin-bottom: 12px; } }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: 40px 56px; margin-top: 24px; }
.footer-inner p { margin: 0 0 .4em; }
.footer-name { font-family: var(--font-display); font-weight: 600; }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(8,8,7,.96); display: grid; grid-template-rows: 1fr auto; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.lb[open], .lb.is-open { opacity: 1; visibility: visible; }
.lb-stage { position: relative; display: grid; place-items: center; padding: 56px 64px 8px; min-height: 0; }
.lb-img { max-width: calc(100vw - 150px); max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); width: auto; height: auto; object-fit: contain; border-radius: 4px; touch-action: pan-y; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--gutter) 20px; }
.lb-caption { display: grid; gap: 4px; min-width: 0; }
.lb-caption .mono { color: var(--accent); }
.lb-count { color: var(--muted); white-space: nowrap; }
.lb-btn { position: absolute; background: rgba(255,255,255,.08); border: 0; color: var(--text); width: 48px; height: 48px; border-radius: 50%; cursor: pointer; font-size: 22px; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255,255,255,.16); }
.lb-close { top: 10px; right: 12px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lb-img { max-width: 100vw; max-height: calc(100dvh - 190px); } .lb-stage { padding: 56px 0 0; } .lb-prev, .lb-next { top: auto; bottom: -58px; transform: none; } .lb-prev { left: auto; right: 70px; } .lb-bar { padding-right: 130px; } }
.lb-lock { overflow: hidden; }
