/* =====================================================================
   Andrew Stuckey — site styles
   Cool teal / cool-gray palette. Editorial aesthetic, magazine-meets-
   field-science. Inspired by working wildlife/underwater cinematographer
   sites (Skerry, Gregory, Horrocks) without aping them.
   ===================================================================== */

:root {
  /* ----- Palette (user-supplied) ----- */
  --c-teal:        #0097B2;  /* bright teal */
  --c-teal-deep:   #0C454F;  /* deep teal — dark surfaces */
  --c-ice:         #C3D8DC;  /* light cool gray-blue */
  --c-fog:         #849DA1;  /* mid cool gray */
  --c-graphite:    #323536;  /* near-black */
  --c-rust:        #732209;  /* burnt sienna */
  --c-white:       #FFFFFF;

  /* ----- Semantic ----- */
  --bg:          var(--c-white);
  --bg-warm:     #F2F6F7;          /* very light blend of ice + white */
  --bg-deep:     var(--c-ice);
  --paper:       var(--c-white);
  --ink:         var(--c-graphite);
  --ink-soft:    #4A5256;
  --muted:       var(--c-fog);
  --rule:        #D9E3E5;
  --rule-strong: var(--c-fog);
  --primary:     var(--c-teal-deep);
  --primary-2:   var(--c-teal);
  --slate:       #4A5256;
  --accent:      var(--c-teal);
  --accent-soft: var(--c-ice);
  --danger:      var(--c-rust);
  --stable:      var(--c-teal-deep);
  --saddle:      var(--c-rust);
  --wolfonly:    var(--c-fog);
  --traj:        var(--c-teal);
  --shadow:      0 1px 0 rgba(12,69,79,0.04), 0 8px 24px -12px rgba(12,69,79,0.22);

  /* ----- Type system (50/30/20 pt — see CSS comments above each rule) -----
     Heading:   Code Bold (substitute: Archivo Black) — line-height 1, ls 0
     Accent:    Times New Roman italic                — line-height 1, ls 0
     Body:      Roboto                                 — line-height 1.4, ls 0
     Ratio 5:3:2  →  50pt : 30pt : 20pt  (66 / 40 / 26 px)
     If you license the real Code Pro / CODE Bold, replace "Archivo Black"
     in --ff-display below with "Code Pro" (after @font-face) and drop the
     Google Fonts link for Archivo Black.                                  */
  --ff-display: "Archivo Black", "Code Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ff-accent:  "Times New Roman", Times, "Tinos", Georgia, serif;
  --ff-body:    "Roboto", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --ff-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Type sizes — desktop ceilings honor the 50/30/20pt spec */
  --fs-heading:  clamp(2.1rem, 5.8vw, 4.15rem);   /* 50pt ≈ 66px */
  --fs-accent:   clamp(1.35rem, 2.4vw, 2.5rem);   /* 30pt ≈ 40px */
  --fs-body:     clamp(1.05rem, 1.35vw, 1.65rem); /* 20pt ≈ 26px */

  /* Layout */
  --maxw: 1180px;
  --maxw-wide: 1380px;
  --maxw-narrow: 720px;
  --pad: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }

html { font-size: 16px; }   /* anchor rem to 16px so UI chrome stays stable */

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: var(--fs-body);  /* 20pt body per spec */
  line-height: 1.4;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

a {
  color: var(--primary);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--accent); }

/* ----- Typography (per spec: Code Bold / TNR italic / Roboto, 5:3:2) ----- */
h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 400;           /* Archivo Black is single-weight */
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1;
  margin: 0 0 .5em;
  text-transform: none;
}
h1 { font-size: var(--fs-heading); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }   /* between 30 and 50pt */
h3 { font-size: clamp(1.2rem, 1.8vw, 1.6rem); }
p  { margin: 0 0 1em; line-height: 1.4; }

.eyebrow {
  font-family: var(--ff-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 .9em;
  font-weight: 500;
}
.eyebrow-light { color: var(--accent); }

/* Subheading & Accent — Times New Roman italic, 30pt */
.lede {
  font-family: var(--ff-accent);
  font-size: var(--fs-accent);
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1;
  font-style: italic;
  letter-spacing: 0;
}

.page-lede {
  font-family: var(--ff-accent);
  font-style: italic;
  font-size: clamp(1.2rem, 1.8vw, 1.7rem);
  color: var(--ink-soft);
  max-width: 60ch;
  margin-top: .6em;
  line-height: 1.15;
  letter-spacing: 0;
}

/* ----- Layout helpers ----- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.wide      { max-width: var(--maxw-wide); margin-left: auto; margin-right: auto; }
.narrow    { max-width: var(--maxw-narrow); margin-left: auto; margin-right: auto; }

main { display: block; }

/* ============================ Header / Nav ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header-dark {
  background: rgba(12,69,79,0.92);
  border-bottom-color: rgba(255,255,255,0.08);
}
.site-header-dark .brand { color: var(--c-white); }
.site-header-dark .brand:hover { color: var(--accent); }
.site-header-dark .nav-links a { color: rgba(255,255,255,0.78); }
.site-header-dark .nav-links a:hover { color: var(--c-white); }
.site-header-dark .nav-links a[aria-current="page"] { color: var(--c-white); }
.site-header-dark .nav-toggle span { background: var(--c-white); }

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0;
  text-transform: uppercase;
}
.brand:hover { color: var(--primary); }
.nav-links {
  display: flex;
  gap: 28px;
  margin: 0; padding: 0;
  list-style: none;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  font-family: var(--ff-body);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a[aria-current="page"] { color: var(--primary); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .site-header-dark .nav-links { background: var(--c-teal-deep); }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 16px var(--pad);
    border-top: 1px solid var(--rule);
    font-size: 1.05rem;
  }
  .site-header-dark .nav-links a { border-top-color: rgba(255,255,255,0.08); }
  .nav.open .nav-links { max-height: 400px; }
  .nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ============================ Hero (landing) ============================ */
.hero-landing {
  position: relative;
  padding: clamp(80px, 14vh, 160px) 0 clamp(60px, 10vh, 120px);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(80% 60% at 18% 18%, rgba(0,151,178,0.16) 0%, transparent 60%),
    radial-gradient(60% 70% at 95% 95%, rgba(12,69,79,0.10) 0%, transparent 65%),
    linear-gradient(180deg, #F4F8F9 0%, var(--c-ice) 100%);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(12,69,79,0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.45;
  mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
}
.hero-content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.hero-name {
  font-family: var(--ff-display);
  font-size: clamp(2.6rem, 8.5vw, 5.6rem);
  font-weight: 400;
  line-height: 1;
  margin: 0 0 .3em;
  letter-spacing: 0;
  color: var(--c-teal-deep);
  text-transform: uppercase;
}
.hero-tag {
  font-family: var(--ff-accent);
  font-style: italic;
  font-size: clamp(1.25rem, 2.2vw, 1.9rem);
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0 0 1.5em;
  line-height: 1.15;
  letter-spacing: 0;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 14px 26px;
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--primary);
  color: var(--c-white);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--c-white);
  border-color: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-reset {
  align-self: end;
  white-space: nowrap;
}
.btn-flash {
  background: var(--accent) !important;
  color: var(--c-white) !important;
  border-color: var(--accent) !important;
}

/* ----- Intro block (landing) ----- */
.intro-block {
  padding: clamp(40px, 7vh, 80px) 0;
  background: var(--bg);
  border-top: 1px solid var(--rule);
}

/* ----- Feature cards ----- */
.feature-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-bottom: clamp(60px, 10vh, 120px);
}
@media (max-width: 760px) {
  .feature-cards { grid-template-columns: 1fr; }
}
.feature-card {
  display: block;
  position: relative;
  padding: 32px 28px 60px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.feature-card-wide {
  display: grid;
  grid-template-columns: 1fr;
}
.feature-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.feature-card h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  margin: 0 0 .5em;
}
.feature-card p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin: 0;
}
.feature-arrow {
  position: absolute;
  bottom: 22px;
  right: 28px;
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform 0.2s ease;
}
.feature-card:hover .feature-arrow { transform: translateX(4px); color: var(--accent); }

/* ============================ Page header (non-landing) ============================ */
.page-header {
  padding: clamp(60px, 10vh, 100px) var(--pad) clamp(28px, 5vh, 60px);
}
.page-header h1 {
  max-width: 20ch;
  margin: 0 0 .3em;
}

/* ============================ Post-style (red wolf model) ============================ */
.page-post .post-header {
  padding: clamp(40px, 7vh, 80px) var(--pad) 28px;
}
.post-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 22ch;
}
.post-byline {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
  font-family: var(--ff-mono);
  letter-spacing: 0.04em;
}
.post-body { padding: 0 var(--pad); }
.post-body p { color: var(--ink-soft); }
.post-body .vimeo-wrap { margin: 0 0 28px; }
.post-footer {
  padding: 40px var(--pad) 60px;
  border-top: 1px solid var(--rule);
  margin-top: 40px;
}
.post-footer a { color: var(--primary); }

/* ============================ About page ============================ */
.about-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(28px, 5vw, 72px);
  padding-bottom: clamp(60px, 10vh, 120px);
}
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
}
.about-side { position: sticky; top: 100px; align-self: start; }
@media (max-width: 800px) { .about-side { position: static; } }

.headshot {
  width: 100%;
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(135deg, rgba(12,69,79,0.85), rgba(0,151,178,0.55)),
    repeating-linear-gradient(45deg, var(--c-teal) 0 22px, var(--c-teal-deep) 22px 44px);
  border-radius: 2px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.quick-facts {
  margin: 0;
  font-size: 0.92rem;
}
.quick-facts > div {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.quick-facts dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 2px;
}
.quick-facts dd { margin: 0; color: var(--ink); }
.quick-facts dd a { color: var(--ink); }
.quick-facts dd a:hover { color: var(--accent); }

.about-body h2 {
  margin-top: 2em;
  padding-top: 0.6em;
  border-top: 1px solid var(--rule);
}
.about-body h2:first-of-type { margin-top: 1.5em; }
.cv-list {
  list-style: none;
  padding: 0; margin: 0;
}
.cv-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
}
.cv-list li:last-child { border-bottom: 0; }
.cv-list strong { color: var(--ink); }
.cv-note {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================ Research page ============================ */
.section-title {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  margin: 0 0 1.2em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--rule);
}

.publications { padding-bottom: clamp(40px, 6vh, 80px); }

.pub-list {
  list-style: none;
  counter-reset: pub;
  padding: 0;
  margin: 0;
}
.pub {
  position: relative;
  padding: 22px 0 22px 56px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
}
.pub:first-child { border-top-color: var(--rule-strong); }
.pub::before {
  counter-increment: pub;
  content: counter(pub, decimal-leading-zero);
  position: absolute;
  left: 0; top: 24px;
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}
.pub-title {
  grid-column: 1 / 2;
  grid-row: 1;
  margin: 0;
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  line-height: 1.05;
  text-transform: none;
}
.pub-title a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(transparent 95%, var(--accent) 95%);
  background-size: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease;
}
.pub-title a:hover { background-size: 100% 100%; }
.pub-status {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
}
.pub-meta {
  grid-column: 1 / -1;
  margin: 4px 0 6px;
  font-size: 0.92rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.pub-authors { font-weight: 500; }
.pub-doi a, .pub-issn a { color: var(--ink-soft); }
.pub-doi a:hover, .pub-issn a:hover { color: var(--accent); }
.pub-summary {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
  max-width: 68ch;
}

.related-work {
  padding-bottom: clamp(60px, 10vh, 120px);
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-published { background: rgba(0,151,178,0.13); color: var(--c-teal-deep); }
.badge-review    { background: rgba(132,157,161,0.18); color: var(--slate); }
.badge-prep      { background: rgba(132,157,161,0.18); color: var(--slate); }
.badge-interview { background: rgba(0,151,178,0.13); color: var(--c-teal-deep); }
.badge-feature   { background: rgba(0,151,178,0.13); color: var(--c-teal-deep); }
.badge-talk      { background: rgba(115,34,9,0.13); color: var(--c-rust); }
.badge-podcast   { background: rgba(132,157,161,0.18); color: var(--slate); }

/* Model section */
.model-section {
  background: var(--bg-warm);
  border-top: 1px solid var(--rule);
  padding: clamp(36px, 6vh, 64px) 0 clamp(48px, 8vh, 90px);
  margin-top: 28px;
}
.model-intro { margin: 28px auto 28px; color: var(--ink-soft); }

.vimeo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--c-teal-deep);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.vimeo-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}

/* Controls */
.model-controls-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 20px;
  align-items: end;
  margin-bottom: 24px;
}
@media (max-width: 760px) {
  .model-controls-bar { grid-template-columns: 1fr; }
  .btn-reset { justify-self: end; }
}

.model-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 18px 20px;
  border-radius: 3px;
}
.model-controls-large {
  padding: 22px 24px;
  gap: 22px;
}
.model-controls-large .control label { font-size: 0.92rem; }
.model-controls-large .ctl-name { font-size: 1.05rem; }
.model-controls-large .ctl-desc { font-size: 0.85rem; }
.model-controls-large .ctl-val  { font-size: 0.95rem; }

/* Two semantic groups stacked vertically — management on top,
   sensitivity probes on the bottom. A thin rule separates them. */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.control-group + .control-group {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}
.control-group-label {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.control-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 28px;
}

@media (max-width: 720px) { .control-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .control-row { grid-template-columns: 1fr; } }

.control {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.control label {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "name val"
    "desc desc";
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}
.ctl-name {
  grid-area: name;
  font-family: var(--ff-mono);
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
  line-height: 1;
}
.ctl-val  {
  grid-area: val;
  justify-self: end;
  font-family: var(--ff-mono);
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  background: var(--bg-deep);
  padding: 2px 8px;
  border-radius: 2px;
  line-height: 1.2;
}
.ctl-desc {
  grid-area: desc;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
  min-height: 2.4em;  /* reserve 2 lines so all 5 columns align */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--primary);
}
input[type="range"]::-webkit-slider-thumb:hover { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); transform: scale(1.1); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg);
}
input[type="range"]:focus { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Panels */
.model-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 899px) { .model-panels { grid-template-columns: 1fr; } }

.model-panels-large {
  gap: 28px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 22px 24px 26px;
  border-radius: 3px;
}
.panel-title {
  font-size: 1rem;
  font-family: var(--ff-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 18px;
}
.chart-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}
.chart-wrap-large {
  aspect-ratio: 5 / 4;
  min-height: 420px;
}
.phase-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  cursor: crosshair;
}
.phase-wrap-large {
  aspect-ratio: 5 / 4;
  min-height: 420px;
}
.phase-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.panel-legend {
  list-style: none;
  padding: 14px 0 0;
  margin: 16px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--muted);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
}
.panel-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.panel-legend .legend-pair {
  gap: 14px;
}
.panel-legend .legend-sub {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lg {
  display: inline-block;
  width: 14px; height: 2px;
  vertical-align: middle;
  margin-right: 4px;
  background: currentColor;
}
.lg-stable   { background: var(--stable); }
.lg-saddle   { background: var(--saddle); border-top: 1px dashed var(--saddle); height: 0; }
.lg-wolfonly { background: var(--wolfonly); height: 0; border-top: 1px dashed var(--wolfonly); }
.lg-danger   { background: rgba(115,34,9,0.18); height: 10px; width: 18px; }
.lg-nw       { background: var(--c-teal-deep); }
.lg-nc       { background: var(--c-rust); }
.lg-traj     { background: var(--c-teal); }
.lg-eq-stable, .lg-eq-saddle {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--stable);
  vertical-align: middle;
}
.lg-eq-saddle { background: transparent; border: 1.5px solid var(--saddle); }

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}
@media (max-width: 700px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
.metric {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 16px 18px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.m-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.m-val {
  font-family: var(--ff-mono);
  font-size: 1.08rem;
  color: var(--ink);
  font-weight: 500;
}
.m-val.outcome-persist { color: var(--primary); }
.m-val.outcome-collapse { color: var(--danger); }

/* ============================ Cinematography (redesigned) ============================ */
.cine-main { background: var(--bg); }

.reel-hero {
  background: var(--c-teal-deep);
  padding: 0;
}
.reel-hero .vimeo-wrap {
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: 21 / 9;
  max-height: 80vh;
}
@media (max-width: 760px) {
  .reel-hero .vimeo-wrap { aspect-ratio: 16 / 9; }
}

.cine-intro {
  padding: clamp(40px, 7vh, 80px) var(--pad);
}

.film-grid-section {
  padding: clamp(40px, 6vh, 70px) 0;
}
.film-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 12px;
}
@media (max-width: 900px) { .film-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 240px; } }
@media (max-width: 500px) { .film-grid { grid-template-columns: 1fr; } }

.film-tile {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  text-decoration: none;
  color: var(--c-white);
  display: block;
  background: var(--c-teal-deep);
}
.film-tile-tall { grid-row: span 2; }
.film-tile-wide { grid-column: span 2; }
@media (max-width: 500px) {
  .film-tile-tall, .film-tile-wide { grid-row: auto; grid-column: auto; }
}
.film-img {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0,151,178,0.14), rgba(0,0,0,0)),
    repeating-linear-gradient(135deg, #0E5562 0 24px, #0C454F 24px 48px);
  transition: filter 0.4s ease, transform 0.5s ease;
}
.film-tile:hover .film-img {
  filter: brightness(1.1) saturate(1.1);
  transform: scale(1.03);
}
.film-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(0deg, rgba(12,69,79,0.85) 0%, rgba(12,69,79,0) 100%);
  color: var(--c-white);
}
.film-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.film-tag {
  margin: 2px 0 0;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}

/* Stock footage callout */
.stock-section {
  background: var(--bg-warm);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: clamp(50px, 8vh, 90px) 0;
}
.stock-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 760px) { .stock-grid { grid-template-columns: 1fr; gap: 28px; } }
.stock-h {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  margin: 0 0 0.5em;
}
.social-list {
  list-style: none;
  padding: 0; margin: 0;
}
.social-list li {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.social-list li:first-child { border-top: 0; padding-top: 0; }
.social-list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.social-list a:hover { color: var(--accent); }

/* Equipment (collapsible) */
.equipment {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
  margin: clamp(40px, 7vh, 70px) 0 clamp(40px, 7vh, 80px);
}
.equipment summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 600;
  padding-right: 30px;
  position: relative;
  color: var(--ink);
}
.equipment summary::-webkit-details-marker { display: none; }
.equipment summary::after {
  content: "+";
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  font-family: var(--ff-body);
  font-weight: 300;
  font-size: 1.5rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}
.equipment[open] summary::after { content: "−"; }
.equipment-grid {
  columns: 4 220px;
  column-gap: 36px;
  margin-top: 26px;
}
.equipment-grid > div {
  break-inside: avoid;
  margin-bottom: 26px;
}
.equipment-grid .qty {
  font-size: 0.78em;
  white-space: nowrap;
  color: var(--ink-soft);
}
.equipment-grid ul { padding-left: 1.1em; margin: 0; color: var(--ink-soft); }
.equipment-grid h3 { margin-bottom: .4em; color: var(--primary); }

/* ============================ Media list ============================ */
.media-list {
  list-style: none;
  padding: 0;
  margin: 0 0 clamp(60px, 10vh, 120px);
}
.media-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.media-item:first-child { border-top-color: var(--rule-strong); }
@media (max-width: 700px) {
  .media-item {
    grid-template-columns: 1fr auto;
  }
  .media-date {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .media-body { grid-column: 1; grid-row: 2; }
  .media-type { grid-column: 2; grid-row: 2; }
}
.media-date {
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 500;
  padding-top: 3px;
}
.media-outlet {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0 0 4px;
}
.media-body h3 {
  font-size: 1.15rem;
  margin: 0 0 .3em;
}
.media-body h3 a { color: var(--ink); text-decoration: none; }
.media-body h3 a:hover { color: var(--accent); }
.media-desc {
  color: var(--ink-soft);
  font-size: 0.97rem;
  margin: 0;
  max-width: 60ch;
}

/* ============================ Footer ============================ */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 30px 0;
  background: var(--bg-warm);
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-name {
  font-family: var(--ff-display);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.footer-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.footer-meta a { color: var(--ink-soft); text-decoration: none; }
.footer-meta a:hover { color: var(--accent); }
.dot { color: var(--rule-strong); }

/* ============================ Print ============================ */
@media print {
  .site-header, .site-footer, .nav-toggle, .hero-ctas { display: none; }
  body { background: #fff; color: #000; }
  .pub-title a, .pub-meta, .pub-summary { color: #000; }
  .badge { border: 1px solid #888; background: transparent !important; color: #000 !important; }
  .model-section, .model-controls, .model-panels, .vimeo-wrap, .metrics { display: none; }
  .hero-bg { display: none; }
  a { color: #000; text-decoration: underline; }
}

/* ============================ Reduced motion ============================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
