/* twisterfisters.com — look follows the WordPress "Jenn" theme it replaced: white, near-black ink, Plus Jakarta Sans
   text, Albert Sans headings. Motion: the storm video stays pinned while the page scrolls over it, and sections rise
   into place with CSS scroll-driven animations; all of it is off under Reduce Motion. */

@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/plus-jakarta-sans-latin-wght-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Albert Sans"; src: url("/fonts/albert-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --ink: #111111;
  --ink-soft: #46484b;
  --muted: #6c6f73;
  --paper: #ffffff;
  --mist: #f3f4f4;
  --rule: #e3e4e4;
  --link: #003cab;
  --storm: #1d2226;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --head: "Albert Sans", var(--font);
  --max: 1200px;
  --text: 44rem;
  --gutter: clamp(18px, 4vw, 40px);
  --space: clamp(64px, 9vw, 128px);
  --radius: 6px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.7 var(--font); text-rendering: optimizeLegibility; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 400; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
h4 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-text { max-width: calc(var(--text) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: calc(64rem + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 50; border-radius: 4px; }
.skip:focus { top: 8px; }

/* ── Header: white bar; on the home page clear over the storm, fading to white (--fade, set by site.js) ── */
.site-head { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, 0.97); border-bottom: 1px solid var(--rule); color: var(--ink); padding-top: env(safe-area-inset-top); -webkit-backdrop-filter: saturate(1.4) blur(8px); backdrop-filter: saturate(1.4) blur(8px); }
.site-head.over { --fade: 0; position: fixed; left: 0; right: 0; background: rgba(255, 255, 255, calc(var(--fade) * 0.97)); border-bottom-color: rgba(227, 228, 228, var(--fade)); color: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-head.over.solid { background: rgba(255, 255, 255, 0.97); color: var(--ink); border-bottom-color: var(--rule); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand img { width: 52px; height: 52px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25)); }
.brand-motto { font-weight: 600; font-size: 1rem; letter-spacing: 0.005em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 32px; }
.site-nav a { color: inherit; text-decoration: none; font-weight: 500; padding: 6px 0; }
.site-nav a:hover, .site-nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.45em; }
.site-head.over:not(.solid) .brand-motto, .site-head.over:not(.solid) .site-nav a { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }
.nav-toggle { display: none; font: 600 0.95rem/1 var(--font); color: inherit; background: transparent; border: 1.5px solid currentColor; border-radius: 4px; padding: 10px 14px; cursor: pointer; }
@media (max-width: 760px) {
  .head-row { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; row-gap: 0; }
  .brand img { width: 42px; height: 42px; }
  .brand-motto { font-size: 0.92rem; }
  .js .nav-toggle { display: block; }
  .js .site-nav { display: none; width: 100%; }
  .js .site-head.open .site-nav { display: block; }
  .site-head.over.open { background: rgba(255, 255, 255, 0.98); color: var(--ink); }
  .site-nav ul { flex-direction: column; gap: 0; padding: 6px 0 4px; }
  .site-nav a { display: block; padding: 13px 0; font-size: 1.1rem; border-top: 1px solid var(--rule); text-shadow: none !important; }
  .site-nav li:first-child a { border-top: 0; }
}

/* ── Home: pinned storm ───────────────────────────────────────────────────────────────────────────── */
.hero-bg { position: sticky; top: 0; z-index: 0; height: 100vh; height: 100lvh; margin-bottom: -100vh; margin-bottom: -100lvh; overflow: hidden; background: var(--storm) url("/video/hero-poster.webp") center / cover no-repeat; }
.hero-video { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10, 12, 14, 0.38), rgba(10, 12, 14, 0.18) 40%, rgba(10, 12, 14, 0.42)); }
.hero { position: relative; z-index: 1; min-height: 100vh; min-height: 100lvh; display: grid; place-items: center; color: #fff; text-align: center; --toolbar: 0px; }
@supports (height: 100lvh) { .hero { --toolbar: calc(100lvh - 100svh); } }
.hero-words { padding: 120px var(--gutter) calc(var(--toolbar) + 90px); width: min(100%, 52rem); }
.hero-mark { width: min(78vw, 560px); margin: 0 auto 22px; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.35)); }
.hero-lede { font-size: clamp(1.15rem, 2.2vw, 1.6rem); font-style: italic; font-weight: 400; line-height: 1.35; margin: 0; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5); text-wrap: balance; }
.scroll-cue { position: absolute; left: 50%; bottom: calc(var(--toolbar) + clamp(20px, 4vh, 40px) + env(safe-area-inset-bottom)); translate: -50% 0; color: #fff; padding: 8px; }
.scroll-cue svg { display: block; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.5)); }
.over-hero { position: relative; z-index: 1; background: var(--paper); }

/* ── Home sections ────────────────────────────────────────────────────────────────────────────────── */
.intro { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 88px); align-items: center; padding-top: var(--space); padding-bottom: var(--space); }
.intro h2 { margin-top: 0; }
.intro-text p { color: var(--ink-soft); font-size: 1.12rem; }
.intro-photo { margin: 0; }
.intro-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.button { display: inline-block; background: var(--ink); color: #fff; font: 600 1rem/1 var(--font); text-decoration: none; padding: 15px 26px; border-radius: 4px; border: 2px solid var(--ink); }
.button:hover { background: #fff; color: var(--ink); }
.text-link { font-weight: 600; color: var(--ink); }
.projects { padding-bottom: var(--space); }
.projects h2 { margin-top: 0; }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 40px); }
.project img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--mist); }
.project h3 { margin: 0.9em 0 0.15em; }
.project .when { color: var(--muted); margin: 0; }
.latest { background: var(--mist); padding: var(--space) 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
@media (max-width: 820px) { .intro, .project-grid { grid-template-columns: 1fr; } }

/* ── Cards ────────────────────────────────────────────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(18px, 2.5vw, 32px); }
.card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 24px rgba(0, 0, 0, 0.05); }
.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--storm); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card-text { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0.35em 0 0.45em; font-size: 1.35rem; }
.card-excerpt { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.6; }
.card .more { margin-top: auto; font-weight: 600; }
.card-link:hover .more, .card-link:focus-visible .more { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) { .card-link:hover .card-img img { transform: scale(1.04); } }
.listing { padding-bottom: var(--space); }
.listing .page-head { padding: clamp(40px, 6vw, 80px) 0 clamp(24px, 3vw, 40px); max-width: 48rem; }
.lede { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--ink-soft); line-height: 1.5; }

/* ── Posts and pages ──────────────────────────────────────────────────────────────────────────────── */
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 0.92rem; margin: 0; }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); background: var(--mist); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; }
.card .tag { background: var(--paper); }
.post-head, .page-head { padding-top: clamp(40px, 6vw, 84px); }
.post-head h1, .page-head h1 { margin: 0.35em 0 0.6em; }
.page-head h1 { margin-top: 0; }
.draft-note { background: #fff4c2; border: 1px solid #e6cf6a; padding: 8px 12px; border-radius: 4px; font-weight: 600; }
.post-cover { margin: 0 auto clamp(28px, 4vw, 48px); }
.post-cover img { width: 100%; max-height: 72vh; object-fit: cover; border-radius: var(--radius); }
.post-body { padding-bottom: clamp(40px, 6vw, 72px); }
.post-body > h2, .post-body > h3, .post-body > h4 { scroll-margin-top: 90px; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li { margin-bottom: 0.4em; }
.post-body figure { margin: 1.8em 0; }
/* Charts and photos may run a little wider than the text column on large screens. */
@media (min-width: 900px) { .post-body > figure { margin-left: -4rem; margin-right: -4rem; } }
.post-body figure img { width: 100%; border-radius: 4px; background: var(--mist); }
.post-body figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.6em; text-align: center; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 1.8em 0; }
.gallery figure { margin: 0; }
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; }
.video video { width: 100%; border-radius: 4px; background: #000; }
.table-wrap { overflow-x: auto; margin: 1.8em 0; -webkit-overflow-scrolling: touch; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.table-wrap th, .table-wrap td { border: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; }
.table-wrap tr:first-child td, .table-wrap th { background: var(--mist); font-weight: 600; }
.yt-lite { position: relative; display: block; aspect-ratio: 16 / 9; background: #000; border-radius: 4px; overflow: hidden; }
.yt-lite img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 72px; height: 50px; background: rgba(0, 0, 0, 0.75); border-radius: 12px; }
.yt-play::after { content: ""; position: absolute; left: 29px; top: 15px; border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent #fff; }
.yt iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 4px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: var(--space); }
.post-nav a { display: block; color: var(--ink); text-decoration: none; border-top: 2px solid var(--ink); padding-top: 12px; font-weight: 600; line-height: 1.35; }
.post-nav a span { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.post-nav .older { grid-column: 2; text-align: right; }
.post-nav a:hover { text-decoration: underline; }

/* About: team */
.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px); margin: 2em 0; }
@media (min-width: 900px) { .post-body .team { margin-left: -8rem; margin-right: -8rem; } }
.team figure { margin: 0 0 14px; }
.team img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.team h3 { margin: 0 0 0.4em; font-size: 1.3rem; }
.team p { color: var(--ink-soft); font-size: 0.97rem; line-height: 1.6; }
@media (max-width: 820px) { .team { grid-template-columns: 1fr; } }

/* ── Footer ───────────────────────────────────────────────────────────────────────────────────────── */
.site-foot { background: var(--storm); color: #d9dcde; padding: clamp(48px, 6vw, 72px) 0 28px; }
.foot-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; flex-wrap: wrap; }
.foot-brand img { width: 220px; height: auto; }
.foot-brand p { margin: 14px 0 0; font-style: italic; color: #b9bec2; }
.foot-nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px 28px; flex-wrap: wrap; }
.foot-nav a { color: #fff; text-decoration: none; font-weight: 500; }
.foot-nav a:hover { text-decoration: underline; }
.foot-small { color: #8f969b; font-size: 0.85rem; margin-top: 36px; }

/* ── Motion (only when welcome) ───────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue svg { animation: bob 2s ease-in-out infinite; }
  @keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
  /* Scroll-driven: sections rise into place, and the storm darkens as the page covers it. Browsers without
     animation-timeline simply show everything (no JavaScript involved). */
  @supports (animation-timeline: view()) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    @keyframes rise { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
    .hero-words { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
    @keyframes drift { to { opacity: 0; transform: translateY(-60px) scale(0.97); } }
    .hero-bg::before { content: ""; position: absolute; inset: 0; z-index: 1; background: #0a0c0e; opacity: 0; animation: dim linear both; animation-timeline: scroll(root); animation-range: 0 100vh; pointer-events: none; }
    @keyframes dim { to { opacity: 0.55; } }
  }
}
