/* Shared shell, loaded last on every page: one header, one type system, smooth page changes. */

/* ---------- Page changes: the header stays put while the page underneath crossfades ---------- */
@view-transition { navigation: auto; }
body.jd .site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: shell-out .22s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: shell-in .38s cubic-bezier(.16, 1, .3, 1) both; }
::view-transition-group(site-header) { animation-duration: 0s; }
@keyframes shell-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes shell-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Sections flow into each other: no hard rules or cut-off light ---------- */
body.jd .section + .section { border-top: 0; }
body.jd .finale { background: var(--paper, #17130f); }
body.jd .finale .contact-optics { -webkit-mask-image: linear-gradient(transparent, #000 38%); mask-image: linear-gradient(transparent, #000 38%); }
/* ---------- Type: Inter everywhere, tuned like a display face at large sizes ---------- */
body.jd { font-family: var(--body); font-optical-sizing: auto; text-rendering: optimizeLegibility; }
body.jd h1 { font-weight: 650; letter-spacing: -.045em; line-height: 1.02; }
body.jd h2 { font-weight: 620; letter-spacing: -.04em; line-height: 1.06; }
body.jd h3 { font-weight: 600; letter-spacing: -.025em; }
/* Accent words: Georgia italic in the warm gradient. */
body.jd h1 em, body.jd h2 em, body.jd .finale-type em, body.jd .reveal-line em {
  font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 400; letter-spacing: -.03em;
  background: linear-gradient(100deg, #f0b08f 0%, #e07c57 45%, #c9603e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .04em; }
body.jd p, body.jd li { font-size: inherit; }

/* ---------- Header: the same liquid-glass bar on every page ---------- */
body.jd .site-header { position: sticky; top: 0; z-index: 30;
  background: linear-gradient(120deg, #ffffff10, #ffffff03 35%, #df987c10 85%), rgb(23 19 15 / 72%);
  backdrop-filter: blur(28px) saturate(1.7); -webkit-backdrop-filter: blur(28px) saturate(1.7);
  border-bottom: 1px solid #ffffff1c; box-shadow: inset 0 1px #ffffff26, 0 8px 30px #0002; }
body.jd .site-header::after { content: ''; position: absolute; bottom: -1px; left: 8%; width: 84%; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #fff5, #df987c88, transparent); }
body.jd .site-header .wrap.bar { max-width: 1240px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 64px);
  min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: nowrap; }
body.jd .site-header .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 600 18px/1 var(--head); letter-spacing: -.02em; text-decoration: none; }
body.jd .site-header .brand img { width: 32px; height: 32px; }
body.jd .site-header .nav { width: auto; }
body.jd .site-header .nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; justify-content: flex-end; }
body.jd .site-header .nav a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px;
  color: var(--soft); font: 500 14px/1 var(--body); letter-spacing: -.005em; text-decoration: none; white-space: nowrap; transition: color .2s; }
body.jd .site-header .nav a:hover, body.jd .site-header .nav a[aria-current="page"] { color: var(--ink); }
body.jd .site-header .nav a::before { display: none; }

/* The gliding pill: placed instantly on load, springs only when you move between links. */
body.jd .jd-pill { height: 38px; margin-top: -19px; background: linear-gradient(135deg, #ffffff1c, #ffffff08 45%, #df987c1a);
  box-shadow: inset 0 1px #ffffff30, inset 0 -1px #00000030; transition: none; }
body.jd .jd-pill-nav.jd-ready .jd-pill { transition: transform .45s var(--jd-spring), width .45s var(--jd-spring), opacity .2s; }

/* ---------- Phone menu on every page ---------- */
.phone-menu { display: none; }
@media (max-width: 640px) {
  body.jd .site-header { padding-top: env(safe-area-inset-top, 0px); }
  body.jd .site-header .wrap.bar { min-height: 60px; padding-inline: max(16px, env(safe-area-inset-left, 0px)); }
  body.jd .site-header .bar > .nav { display: none; }
  body.jd .phone-menu { display: block; margin-left: auto; }
  body.jd .phone-menu summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px; border-radius: 28px; cursor: pointer; list-style: none; font: 500 14px/1 var(--body); color: var(--ink);
    background: linear-gradient(135deg, #ffffff29, #ffffff08 45%, #df987c1a 80%, #ffffff1a); backdrop-filter: blur(2px) saturate(1.8); -webkit-backdrop-filter: blur(2px) saturate(1.8);
    box-shadow: inset 0 1px 1px #ffffffb3, inset 0 -1px 1px #ffffff59, inset -1px 0 5px #df987c4d, 0 5px 15px #0003; }
  body.jd .phone-menu summary::-webkit-details-marker { display: none; }
  body.jd .phone-menu summary span { display: inline-block; transition: transform .4s var(--jd-spring); }
  body.jd .phone-menu[open]:not(.is-closing) summary span { transform: rotate(135deg); }
  body.jd .phone-nav { position: absolute; top: calc(100% + 8px); left: 12px; right: 12px; padding: 8px; border-radius: 22px;
    background: linear-gradient(140deg, #ffffff24, #ffffff08 40%, #df987c17 80%, #ffffff14), rgb(23 19 15 / 86%);
    backdrop-filter: blur(16px) saturate(1.9) brightness(.8); -webkit-backdrop-filter: blur(16px) saturate(1.9) brightness(.8);
    box-shadow: inset 0 1px 1px #ffffffb3, inset 0 -1px 1px #ffffff4d, 0 18px 40px #0006; }
  body.jd .phone-nav ul { list-style: none; display: grid; gap: 4px; margin: 0; padding: 0; }
  body.jd .phone-nav a { display: flex; align-items: center; min-height: 48px; padding: 10px 16px; border-radius: 14px; color: var(--ink); text-decoration: none; font-size: 16px; }
  body.jd .phone-nav a[aria-current="page"] { background: #ffffff12; }
  body.jd .site-header:has(.phone-menu[open]) { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgb(24 20 16 / 95%); }
  body.jd .phone-menu[open] .phone-nav { transform-origin: calc(100% - 40px) -12px; animation: jd-menu-in .5s var(--jd-spring) both; }
  body.jd .phone-menu[open] .phone-nav li { animation: jd-menu-link .45s var(--jd-ease) both; animation-delay: calc(80ms + var(--k, 0) * 45ms); }
  body.jd .phone-menu.is-closing .phone-nav { animation: jd-menu-out .26s var(--jd-ease) both; }
}
@supports (backdrop-filter: url("#jd-lens")) {
  body.jd .phone-menu summary { backdrop-filter: url("#jd-lens") blur(1px) saturate(1.8); }
}

@media (prefers-reduced-motion: reduce) and (max-width: 0px) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  body.jd .jd-pill-nav.jd-ready .jd-pill { transition: none; }
}

/* ---------- Statues: ASCII / pixel art behind sections. Blend on the statue (not the image) over a solid
   section colour, so the art's black melts into the page instead of showing as a box. ---------- */
body.jd :is(.has-statue, .jd-hero, .jd-trailer, .finale) { position: relative; isolation: isolate; overflow-x: clip; background-color: var(--paper, #17130f); }
body.jd .jd-statue { position: absolute; z-index: -1; pointer-events: none; mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent); mask-image: radial-gradient(closest-side, #000 50%, transparent); }
body.jd .jd-statue img { mix-blend-mode: normal !important; }
body.jd .jd-statue.st { width: min(36vw, 440px); aspect-ratio: 9 / 16; top: 50%; translate: 0 -50%; opacity: .26; }
body.jd .jd-statue.st.at-right { right: -3%; }
body.jd .jd-statue.st.at-left { left: -5%; }
body.jd .jd-statue.st img { position: absolute; inset: 0; width: 100%; height: 100%; }
body.jd .jd-statue.st img:first-child { image-rendering: pixelated; opacity: 0; }
/* As a section scrolls in, its statue resolves from chunky pixels into ASCII and drifts a little. */
@supports (animation-timeline: view()) {
  body.jd .jd-statue.st { animation: st-drift linear both; animation-timeline: view(); }
  body.jd .jd-statue.st img:first-child { animation: st-px linear both; animation-timeline: view(); animation-range: entry 10% cover 50%; }
  body.jd .jd-statue.st img:last-child { animation: st-ascii linear both; animation-timeline: view(); animation-range: entry 10% cover 50%; }
  @keyframes st-drift { from { transform: translateY(60px); } to { transform: translateY(-60px); } }
  @keyframes st-px { from { opacity: 1; } 60% { opacity: 1; } to { opacity: 0; } }
  @keyframes st-ascii { from { opacity: 0; } 45% { opacity: 0; } to { opacity: 1; } }
}
@media (max-width: 820px) {
  body.jd .jd-statue.st { width: 64vw; opacity: .14; }
  body.jd .jd-statue.st.at-right { right: -22%; } body.jd .jd-statue.st.at-left { left: -24%; }
}

/* ---------- Trailer: autoplays silently; one tap brings the sound in ---------- */
body.jd .jd-trailer-phone { position: relative; }
body.jd .jd-sound { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; cursor: pointer; color: #fff7f0; font: 500 13px/1 var(--body);
  background: linear-gradient(135deg, #ffffff2e, #ffffff0a 50%, #df987c26), rgb(23 19 15 / 45%);
  backdrop-filter: blur(14px) saturate(1.6); -webkit-backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: inset 0 1px #ffffff55, inset 0 -1px #0004, 0 8px 24px #0006; transition: transform .35s var(--jd-spring), background .25s; }
body.jd .jd-sound:hover { transform: scale(1.05); }
body.jd .jd-sound:focus-visible { outline: 2px solid #f0b08f; outline-offset: 3px; }
body.jd .jd-sound svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.jd .jd-sound .on, body.jd .jd-sound[aria-pressed="true"] .off { display: none; }
body.jd .jd-sound[aria-pressed="true"] .on { display: block; }
body.jd .jd-sound[aria-pressed="true"] { background: linear-gradient(135deg, #f0b08f55, #d9775733), rgb(23 19 15 / 45%); }
body.jd .jd-sound[aria-pressed="true"] .jd-sound-label { display: none; }
body.jd .jd-sound[aria-pressed="true"] { padding: 0 12px; }
body.jd .jd-trailer-bar { position: absolute; left: 18px; right: 18px; bottom: 10px; height: 3px; border-radius: 3px; background: #ffffff22; overflow: hidden; z-index: 2; }
body.jd .jd-trailer-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f0b08f, #d97757); transform-origin: left; transform: scaleX(var(--t, 0)); }
/* The first screen's statue is already resolved on arrival. */
body.jd main > section:first-of-type .jd-statue.st img:first-child { animation: none; opacity: 0; }
body.jd main > section:first-of-type .jd-statue.st img:last-child { animation: none; opacity: 1; }
body.jd .me .jd-statue.st.at-right { right: auto; left: 52%; opacity: .3; }

/* ---------- ASCII sky: faint mono stars over the whole page, mostly in the margins so text stays clean ---------- */
.jd-sky { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 25; pointer-events: none; mix-blend-mode: screen; opacity: .7;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 14%, rgb(0 0 0 / 25%) 32%, rgb(0 0 0 / 25%) 68%, #000 86%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 14%, rgb(0 0 0 / 25%) 32%, rgb(0 0 0 / 25%) 68%, #000 86%, #000 100%); }
@media (max-width: 640px) { .jd-sky { opacity: .45; } }

/* ---------- Pixel → ASCII: statues breathe with a slow scanline sweep ---------- */
body.jd .jd-statue.st::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0 46%, rgb(240 176 143 / 35%) 50%, transparent 54% 100%); background-size: 100% 220%;
  animation: st-scan 7s linear infinite; mix-blend-mode: screen; }
@keyframes st-scan { from { background-position: 0 120%; } to { background-position: 0 -120%; } }

/* A closed phone menu takes no space (it was pushing the page sideways on phones). */
body.jd .phone-menu:not([open]) .phone-nav { display: none; }
body.jd .utility-row { flex-wrap: wrap; } body.jd .utility-row p { white-space: normal; min-width: 0; }
/* 16:9 trailer: copy on top, wide player under it. */
body.jd .jd-trailer-grid:has(.jd-trailer-wide) { grid-template-columns: 1fr; }
body.jd .jd-trailer-phone.jd-trailer-wide { width: 100%; max-width: 1100px; aspect-ratio: 16 / 9; border-radius: clamp(16px, 2vw, 28px); }
/* Featured trailer: headline centred over a big player with a clear play button. */
body.jd .jd-trailer { padding-block: clamp(40px, 6vw, 88px) clamp(56px, 8vw, 110px); }
body.jd .jd-trailer-grid:has(.jd-trailer-wide) { justify-items: center; text-align: center; gap: clamp(24px, 3vw, 40px); }
body.jd .jd-trailer-wide ~ .jd-trailer-cap, body.jd .jd-trailer-cap { margin: -8px 0 0; font-size: 13px; color: var(--soft); }
body.jd .jd-trailer-grid:has(.jd-trailer-wide) .jd-trailer-copy p { margin-inline: auto; }
body.jd .jd-trailer-wide { box-shadow: 0 40px 120px -30px #d9775755, 0 0 0 1px #ffffff14; }
body.jd .jd-play { position: absolute; inset: 0; margin: auto; z-index: 3; width: max-content; height: max-content; display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 24px 14px 16px; border: 1px solid #ffffff30; border-radius: 999px; color: #fff; font: 600 16px/1 Inter, system-ui, sans-serif; cursor: pointer;
  background: #1f1913a8; backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); transition: transform .3s cubic-bezier(.2,.9,.3,1.3), opacity .35s, background .3s; }
body.jd .jd-play svg { width: 40px; height: 40px; padding: 10px; border-radius: 50%; background: linear-gradient(135deg, #f0b08f, #d97757); fill: #1f1913; }
body.jd .jd-play:hover { transform: scale(1.05); background: #1f1913d0; }
body.jd .jd-trailer-wide.is-sound .jd-play { opacity: 0; pointer-events: none; transform: scale(.9); }
@media (max-width: 700px) {
  body.jd .jd-trailer-phone.jd-trailer-wide { aspect-ratio: 9 / 16; max-width: 360px; border-radius: 28px; }
}
/* Hero screenshot melts into the page instead of ending on a hard edge. */
body.jd .jd-shot-hero { border: 0 !important; box-shadow: none !important; background: none !important; }
body.jd .jd-shot-hero img { -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 98%); mask-image: linear-gradient(180deg, #000 55%, transparent 98%); }
body.jd .jd-trailer-wide:not(.is-sound) .jd-sound { opacity: 0; pointer-events: none; }
/* Header wordmark: the J monogram is the first letter, followed by "ener" sized to its cap height and baseline. */
body.jd .site-header .brand { gap: 0; align-items: flex-end; }
body.jd .site-header .brand img { width: 34px; height: 34px; margin: 0 -5px 1px -5px; }
body.jd .site-header .brand span { font: 700 30px/1 var(--head); letter-spacing: -.04em; color: var(--ink); }
body.jd .site-header .brand picture { display: block; flex: none; line-height: 0; margin: 0 -5px 1px -5px; }
body.jd .site-header .brand picture img { width: 34px !important; height: 34px !important; max-width: none; margin: 0; }
/* "ener" is drawn in the J monogram's own geometry, so the wordmark reads as one word. */
body.jd .site-header .brand-ener { display: none; }

/* full screen button: bottom-right corner of the trailer, same glass as the sound button */
body.jd .jd-full { position: absolute; right: 16px; bottom: 22px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 999px; cursor: pointer; color: #fff7f0;
  background: linear-gradient(135deg, #ffffff2e, #ffffff0a 50%, #df987c26), rgb(23 19 15 / 45%); backdrop-filter: blur(14px) saturate(1.6); -webkit-backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: inset 0 1px #ffffff55, inset 0 -1px #0004, 0 8px 24px #0006; transition: transform .35s var(--jd-spring); }
body.jd .jd-full:hover { transform: scale(1.08); }
body.jd .jd-full:active { transform: scale(.94); }
body.jd .jd-full:focus-visible { outline: 2px solid #f0b08f; outline-offset: 3px; }
body.jd .jd-full svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
