/* Tartan Advisory — Scroll (cinematic) home variant.
   PROTOTYPE. Reuses all brand tokens/fonts from site.css. Adds only the
   fixed full-bleed photo "stage" that cross-fades per section on scroll.
   Nothing here overrides site.css component styles. */

/* ---------- Fixed photo stage (behind all content) ---------- */
.scroll-page { background: var(--ink); }

.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; }

.stage .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.1s ease;
  will-change: opacity, transform;
}
/* Each layer stacks a tuned darkening gradient over its photo so every
   image lands at the same effective exposure under the shared scrim.
   Photos: Unsplash (free license) — see /scroll prototype notes. */
.stage .bg.b0 {  /* hero — skyscrapers at dusk, lit windows */
  background-image:
    linear-gradient(rgba(10, 10, 10, 0.40), rgba(10, 10, 10, 0.40)),
    url("/assets/img/bg/hero-towers.webp");
  background-position: center 35%;
}
.stage .bg.b1 {  /* how i think — towers in fog */
  background-image:
    linear-gradient(rgba(10, 10, 10, 0.52), rgba(10, 10, 10, 0.52)),
    url("/assets/img/bg/think-fog.webp");
  background-position: center 45%;
}
.stage .bg.b2 {  /* writing — fountain pen on paper */
  background-image:
    linear-gradient(rgba(10, 10, 10, 0.48), rgba(10, 10, 10, 0.48)),
    url("/assets/img/bg/writing-pen.webp");
  background-position: center 60%;
}
.stage .bg.b3 {  /* closing — city at night */
  background-image:
    linear-gradient(100deg, rgba(10, 10, 10, 0.55) 20%, rgba(10, 10, 10, 0.15) 65%),
    url("/assets/img/bg/closing-night.webp");
  background-position: center 70%;
}

.stage .bg.is-active { opacity: 1; animation: kenburns 18s linear forwards; }

@keyframes kenburns {
  from { transform: scale(1.06); }
  to   { transform: scale(1.16); }
}

/* Scrim: dark bias for legibility + red brand warmth + tartan + grain */
.scrim { position: absolute; inset: 0; pointer-events: none; }
.scrim::before {           /* darkening + red vignette */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 12% 100%, rgba(198, 40, 30, 0.18), transparent 55%),
    linear-gradient(to bottom,
      rgba(15, 15, 15, 0.62) 0%,
      rgba(15, 15, 15, 0.30) 34%,
      rgba(15, 15, 15, 0.52) 72%,
      rgba(15, 15, 15, 0.86) 100%);
}
.scrim::after {            /* woven tartan whisper, matches site.css .texture */
  content: ""; position: absolute; inset: 0;
  background-image: url("/assets/img/tartan.svg");
  background-size: 240px 240px; opacity: 0.05;
}
/* Fine film grain (inline SVG noise) */
.grain { position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Content panels (scroll flow above the stage) ---------- */
.panels { position: relative; z-index: 1; }
.panel {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: clamp(6rem, 14vh, 9rem) 0 clamp(3rem, 8vh, 5rem);
}
.panel .wrap { width: 100%; }

/* Legibility helper for text sitting on photography */
.panel h1, .panel h2, .panel .lede, .panel .conv .p-name {
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.45);
}
/* Small label/eyebrow text needs a tighter, denser shadow to stay legible
   over the lighter regions of the photos (a11y contrast). */
.panel .label, .panel .eyebrow {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 2px 14px rgba(0, 0, 0, 0.75);
}

/* ---- Hero panel ---- */
.panel--hero .eyebrow { display: block; margin-bottom: 1.75rem; }
.panel--hero h1 { max-width: 20ch; font-size: clamp(2.5rem, 6.2vw, 4.6rem); margin: 0 0 1.4rem; }
.panel--hero .lede { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--text); max-width: 46ch; opacity: 0.92; }
.panel--hero .cta-row { margin-top: 2.25rem; display: flex; gap: 1rem; flex-wrap: wrap; }

/* Scroll cue */
.scroll-cue {
  position: absolute; left: 50%; bottom: clamp(1.5rem, 4vh, 2.5rem); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}
.scroll-cue .bar { width: 1px; height: 42px; background: linear-gradient(var(--red), transparent); animation: cue 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0%, 100% { transform: scaleY(0.4); opacity: 0.5; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---- Shared panel head ---- */
.panel .panel-head { display: flex; align-items: baseline; gap: 1.5rem; margin-bottom: 2.5rem; }
.panel .panel-head::after { content: ""; flex: 1; border-top: 1px solid var(--line); position: relative; top: -0.2em; }
/* Section titles are h2.label — strip default heading margins, keep the label look */
.panel-head .label { margin: 0; }

/* ---- Convictions accordion (expand in place) ---- */
.acc { max-width: 54rem; }
.acc details { border-top: 1px solid var(--line); scroll-margin-top: 6.5rem; }
.acc details:last-child { border-bottom: 1px solid var(--line); }
.acc summary {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem;
  padding: 1.4rem 0.25rem; cursor: pointer; list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { background: rgba(0, 0, 0, 0.25); }
.acc .n { font-size: 2rem; font-weight: 700; line-height: 1; color: transparent; -webkit-text-stroke: 1.3px var(--stroke); }
@supports not (-webkit-text-stroke: 1px black) { .acc .n { color: var(--stroke); } }
.acc summary:hover .n, .acc details[open] .n { -webkit-text-stroke-color: var(--red-bright); }
.acc .p-name { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; color: var(--text); text-shadow: 0 2px 26px rgba(0, 0, 0, 0.45); }
.acc .acc-plus { position: relative; width: 16px; height: 16px; margin-right: 0.25rem; transition: transform 0.3s ease; }
.acc .acc-plus::before, .acc .acc-plus::after {
  content: ""; position: absolute; background: var(--muted);
}
.acc .acc-plus::before { left: 0; right: 0; top: 7px; height: 2px; }
.acc .acc-plus::after { top: 0; bottom: 0; left: 7px; width: 2px; }
.acc summary:hover .acc-plus::before, .acc summary:hover .acc-plus::after { background: var(--red-bright); }
.acc details[open] .acc-plus { transform: rotate(45deg); }
.acc .acc-body { padding: 0.25rem 0.25rem 1.75rem calc(2rem + 1.5rem + 0.25rem); }
.acc .acc-body p { margin: 0; max-width: 58ch; color: var(--text); opacity: 0.92; text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5); }
/* Smooth expand where supported (Chromium); instant elsewhere */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .acc details::details-content {
    block-size: 0; overflow-y: clip;
    transition: block-size 0.35s ease, content-visibility 0.35s allow-discrete;
  }
  .acc details[open]::details-content { block-size: auto; }
}
@media (max-width: 700px) {
  .acc summary { padding: 1.1rem 0.25rem; }
  .acc .acc-body { padding-left: 0.25rem; }
}

/* ---- Writing panel ---- */
.essays { margin: 0; padding: 0; list-style: none; max-width: 52rem; }
.essays li { border-top: 1px solid var(--line); }
.essays a {
  display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 1.5rem;
  padding: 1.4rem 0.25rem; text-decoration: none;
}
.essays a:hover { background: rgba(0, 0, 0, 0.25); }
.essays .n {
  font-size: 2rem; font-weight: 700; line-height: 1.1;
  color: transparent; -webkit-text-stroke: 1.3px var(--stroke);
}
@supports not (-webkit-text-stroke: 1px black) { .essays .n { color: var(--stroke); } }
.essays a:hover .n { -webkit-text-stroke-color: var(--red-bright); }
.essays .e-title {
  display: block; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em;
  color: var(--text); text-shadow: 0 2px 26px rgba(0, 0, 0, 0.45);
}
.essays .e-teaser {
  display: block; margin-top: 0.4rem; color: var(--muted); font-size: 0.98rem;
  max-width: 58ch; text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5);
}
@media (max-width: 700px) {
  .essays a { padding: 1.1rem 0.25rem; }
  .essays .e-teaser { display: none; }  /* keep the panel scannable on phones */
}

/* ---- About panel ---- */
.about-grid { display: grid; grid-template-columns: minmax(0, 46rem) auto; gap: 3.5rem 5rem; align-items: start; }

/* Lead block: the thesis statement, set in the display style above body copy */
.about-lead { margin-bottom: 2.75rem; }
.about-lead .lead-statement {
  font-size: clamp(1.3rem, 2vw, 1.7rem); font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.42; color: var(--text); margin: 0 0 1.3rem;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.45);
}
.about-lead .lead-close {
  display: flex; align-items: baseline; gap: 1.5rem; flex-wrap: wrap;
  font-size: clamp(1.3rem, 2vw, 1.7rem); font-weight: 700; letter-spacing: -0.01em;
  margin: 0; color: var(--text); text-shadow: 0 2px 26px rgba(0, 0, 0, 0.45);
}

/* Trigger + in-dialog back button share the site's underlined-CTA look */
.lv-trigger, .lv-back {
  background: none; border: none; cursor: pointer; font-family: var(--sans);
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text); text-align: left;
  padding: 0 0 0.45em; border-bottom: 2px solid var(--red);
}
.lv-trigger:hover, .lv-back:hover { color: var(--red-bright); }
.lv-trigger:focus-visible, .lv-back:focus-visible, .lv-close:focus-visible {
  outline: 2px solid var(--red-bright); outline-offset: 3px;
}

/* ---- "The longer view" dialog: modal card on desktop, sheet on mobile ---- */
.lv-dialog {
  background: var(--ink-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px;
  width: min(92vw, 590px); max-height: min(84vh, 46rem);
  padding: 0; margin: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.lv-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.lv-dialog[open] { animation: lv-in 0.22s ease; }
@keyframes lv-in { from { opacity: 0; transform: translateY(10px); } }
.lv-inner {
  position: relative; overflow-y: auto; max-height: inherit;
  padding: clamp(1.9rem, 4vw, 2.75rem);
}
.lv-inner .label { margin: 0 0 1.6rem; }
.lv-inner p { margin: 0 0 1.25rem; }
.lv-display {
  font-size: clamp(1.15rem, 1.7vw, 1.4rem); font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.4;
}
.lv-inner p:last-of-type { margin-bottom: 1.75rem; }
.lv-close {
  position: absolute; top: 0.9rem; right: 1.1rem;
  background: none; border: none; cursor: pointer;
  font-size: 1.6rem; line-height: 1; color: var(--muted); font-family: var(--sans);
  padding: 0.25rem;
}
.lv-close:hover { color: var(--red-bright); }
body.lv-open { overflow: hidden; }
@media (max-width: 640px) {
  /* Full-screen sheet instead of a floating modal */
  .lv-dialog {
    width: 100vw; height: 100dvh; max-width: none; max-height: none;
    margin: 0; border: none; border-radius: 0;
  }
  .lv-inner { max-height: 100dvh; padding-top: 3.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lv-dialog[open] { animation: none; }
}
.about-portrait { margin: 0.35rem 0 0; }
.about-portrait img {
  display: block; width: clamp(200px, 19vw, 272px); height: auto;
  border-radius: 2px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.about-portrait figcaption { margin-top: 1rem; font-weight: 700; color: var(--text); }
.about-portrait .dash { display: block; width: 34px; height: 3px; background: var(--red); margin-bottom: 0.7rem; }
.about-portrait .role { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
/* Official LinkedIn "in" bug: kept in LinkedIn blue, min 24px, standing alone
   with clear space per brand.linkedin.com guidelines. Hover = subtle lift only. */
.about-portrait .li-badge {
  display: inline-flex; margin-top: 1rem; line-height: 0; border-radius: 4.5px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.about-portrait .li-badge:hover { opacity: 0.85; transform: translateY(-1px); }
.about-portrait .li-badge:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 3px; }
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-portrait { order: -1; }
  .about-portrait img { width: 176px; }
}
.about-copy { max-width: 46rem; }
.about-copy p { text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5); }
.about-copy .lede { color: var(--text); opacity: 0.94; }
.about-copy .network { margin-top: 2.25rem; }
.about-copy .network .label { display: block; margin-bottom: 0.6rem; }

/* ---- Contact panel ---- */
.panel--contact .contact-headline { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 700; letter-spacing: -0.01em; max-width: 24ch; margin: 0 0 1rem; text-shadow: 0 2px 26px rgba(0, 0, 0, 0.45); }
.panel--contact .lede { max-width: 46ch; text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5); }
.panel--contact form { margin-top: 2rem; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.4em; margin: 1rem 0 0; color: var(--muted); text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5); }
.form-status a { color: var(--red-bright); }

/* ---------- Header: transparent, fixed over imagery ---------- */
.scroll-page .site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  border-bottom-color: transparent;
  /* Keep the nav zone opaque enough that scrolling body text passing underneath
     doesn't collide with the labels, while the tail still fades cinematically. */
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.85) 0%, rgba(10, 10, 10, 0.6) 60%, transparent 100%);
  backdrop-filter: saturate(120%) blur(6px);
}

/* ---------- Footer sits on solid ground, covering the stage ---------- */
.scroll-page .site-footer { position: relative; z-index: 1; background: var(--ink); margin-top: 0; }

/* ---------- Motion / accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .stage .bg { transition: opacity 0.2s ease; transform: scale(1.06) !important; animation: none !important; }
  .scroll-cue .bar { animation: none; }
}

@media (max-width: 700px) {
  .conv a { padding: 1.15rem 0.25rem; }
  .panel--hero h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
}
