/* Story hero v3: code deep in the background, the life-page building as a
   modal, hero text on the dark overlay from the first frame. Warm ink only.
   Default (no JS / reduced motion) = final composed state, fully readable. */

/* the hero owns exactly one screen: cancel the body's header offset and the
   generic section padding, run under the glass header like the classic hero */
/* The ground is a real sky now, not a black room: the code is written while
   we fly, so the story reads as altitude rather than a terminal. The ink
   stays as the deep base beneath the photograph, which is what keeps the
   warm code legible where the clouds thin out. */
.hstory { background: #123a66; color: #faf9f5; height: 180vh; position: relative;
  margin-top: -72px; padding: 0 !important; }
.hstory .hs-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: linear-gradient(180deg, #0f2f57 0%, #17497f 22%, #2364a5 48%, #2f79bd 74%, #3f8bc9 100%); }
/* a touch of atmosphere top and bottom, so the warm code keeps contrast on the blue */
.hs-pin::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,24,44,.34) 0%, rgba(10,24,44,.20) 45%, rgba(11,26,47,.44) 100%); }

/* real cloud cutouts drifting across the flight, behind everything; each one
   also breathes toward the viewer, so the sky reads as depth, not wallpaper */
.hs-cloud { position: absolute; z-index: 0; pointer-events: none; opacity: .82;
  will-change: transform; }
.hs-cloud img { display: block; width: 100%; height: auto; will-change: transform;
  transform-origin: 50% 50%; }
.hs-c1 { width: 46vw; min-width: 420px; top: 8%;  left: -18vw; animation: hsdrift1 92s linear infinite; }
.hs-c2 { width: 34vw; min-width: 320px; top: 46%; left: -14vw; animation: hsdrift2 128s linear infinite; opacity: .6; }
.hs-c3 { width: 54vw; min-width: 480px; top: 68%; left: -22vw; animation: hsdrift3 74s linear infinite; opacity: .5; }
.hs-c1 img { animation: hszoom 46s ease-in-out infinite; }
.hs-c2 img { animation: hszoom 62s ease-in-out -14s infinite; }
.hs-c3 img { animation: hszoom 54s ease-in-out -31s infinite; }
@keyframes hsdrift1 { from { transform: translateX(0); } to { transform: translateX(140vw); } }
@keyframes hsdrift2 { from { transform: translateX(0); } to { transform: translateX(132vw); } }
@keyframes hsdrift3 { from { transform: translateX(0); } to { transform: translateX(150vw); } }
@keyframes hszoom { 0% { transform: scale(1); } 50% { transform: scale(1.16); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .hs-cloud, .hs-cloud img { animation: none; } }

/* layer 0: the source */
.hs-code {
  position: absolute; inset: 0; margin: 0; padding: 10vh 4vw;
  font: 400 clamp(13.5px, 1.3vw, 17px)/1.62 ui-monospace, "SF Mono", Menlo, monospace;
  color: #e2dbcd; white-space: pre-wrap; overflow: hidden; opacity: 1;
}
.hs-code .tk-c { color: #a39c8d; font-style: italic; }
.hs-code .tk-t { color: #ef9d74; }
.hs-code .tk-a { color: #cdc5b5; }
.hs-caret { display: none; width: .62em; height: 1.08em; background: #ff8a5c; vertical-align: text-bottom; }

/* layer 0.5: the dark overlay the hero text rides on */
.hs-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(25,25,23,.18) 0%, rgba(25,25,23,.08) 45%, rgba(25,25,23,.02) 75%, rgba(25,25,23,.08) 100%),
    linear-gradient(180deg, rgba(25,25,23,.14) 0%, rgba(25,25,23,0) 16%, rgba(25,25,23,0) 80%, rgba(25,25,23,.2) 100%);
}

/* layer 1: the page being built, mobile-first, inside a minimal phone skin */
.hs-modal {
  position: absolute; top: calc(50% + 22px); right: 7vw; transform: translateY(-50%);
  width: 316px; height: min(640px, calc(100svh - 150px)); overflow: hidden;
  background: #24211b; color: #ddd6c9;
  border: 9px solid #0f0e0c; border-radius: 40px; box-sizing: content-box;
  z-index: 2;
}
.hs-mhead {
  display: flex; justify-content: center; align-items: center;
  padding: 12px 14px 10px;
  font: 400 11px/1 ui-monospace, "SF Mono", Menlo, monospace; color: #9a9385;
}
.hs-urlpill {
  background: rgba(250,249,245,.08); border-radius: 999px; padding: 7px 18px;
  letter-spacing: .02em;
}
.hs-mbody { padding: 16px 22px 24px; }

/* raw document: dark-mode from birth, just unstyled */
.hs-kicker { font: 400 11px/1.4 Georgia, serif; color: #a29b8d; margin: 0 0 4px; }
.hs-name   { font: 700 21px/1.2 Georgia, serif; color: #f2ede2; margin: 0 0 10px; }
.hs-photos { display: flex; gap: 8px; margin: 0 0 12px; }
.hs-photos img { width: 50%; height: 84px; object-fit: cover; }
.hs-leg { font: 400 12.5px/1.45 Georgia, serif; color: #d8d2c5; margin: 0 0 8px; }
.hs-leg .y { font-weight: 700; margin-right: 8px; color: #f2ede2; }
.hs-run { font-size: 11px; }
.hs-run { font: 400 12px/1 ui-monospace, "SF Mono", Menlo, monospace; color: #999; margin: 14px 0 0; }

/* the style block builds in three visible stages as its lines complete:
   fonts land, then color and voice, then layout and the dark theme */
.hs-frame.st1 .hs-name { font: 500 26px/1.12 'Newsreader', Georgia, serif; }
.hs-frame.st1 .hs-leg { font-family: 'Newsreader', Georgia, serif; font-size: 13.5px; line-height: 1.5; }
.hs-frame.st1 .hs-kicker { font-family: 'Inter', sans-serif; font-size: 10px; }
.hs-frame.st2 .hs-kicker { letter-spacing: .14em; text-transform: uppercase; color: #8a7268; font-weight: 500; }
.hs-frame.st2 .hs-leg .y { color: #d97757; font: 500 11px/1.7 ui-monospace, "SF Mono", Menlo, monospace; }
.hs-frame.styled { background: rgba(25,25,23,.78); border-color: rgba(250,249,245,.14); }
.hs-frame.styled .hs-mhead { border-color: rgba(250,249,245,.10); color: #8f8779; }
.hs-frame.styled .hs-kicker { color: #b8ad9b; }
.hs-frame.styled .hs-name { color: #faf9f5; }
.hs-frame.styled .hs-urlpill { background: rgba(217,119,87,.14); color: #d9a289; }
.hs-frame.styled .hs-photos img { border-radius: 9px; height: 92px; }
.hs-frame.styled .hs-leg { color: #d5cfc2; display: grid; grid-template-columns: 40px 1fr; gap: 8px; }
.hs-frame.styled .hs-leg .y { color: #d97757; }
.hs-frame.styled .hs-run { color: #7a7468; }
.hs-modal, .hs-mbody * { transition: font .5s ease, color .5s ease, background .6s ease, border-radius .5s ease, letter-spacing .5s ease; }

/* layer 2: the hero text, present from the first frame; its own deep
   dark ground fades out long before it reaches the modal */
.hs-display {
  position: absolute; left: 6vw; top: calc(50% + 30px); transform: translateY(-50%);
  width: min(640px, 50vw); z-index: 3;
}
.hs-display::before { content: none; }
.hs-textground {
  position: absolute; left: -18vw; top: -12vh; bottom: -12vh; width: 78vw;
  z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 62% 58% at 44% 50%,
    rgba(9,24,45,.90) 0%, rgba(9,24,45,.82) 30%, rgba(9,24,45,.64) 46%,
    rgba(9,24,45,.42) 60%, rgba(9,24,45,.22) 72%, rgba(9,24,45,.07) 84%, rgba(9,24,45,0) 94%);
}
.hs-display .eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #b8ad9b; margin: 0 0 14px; }
.hs-display h1 {
  font-family: 'Newsreader', Georgia, serif; font-weight: 500;
  font-size: clamp(42px, 5vw, 72px); line-height: 1.06; letter-spacing: -.01em;
  color: #faf9f5; margin: 0 0 18px;
}
.hs-display h1 em { font-style: italic; color: #d97757; }
.hs-idline { font-family: 'Newsreader', Georgia, serif; font-size: clamp(21px, 1.9vw, 27px); color: #e8e2d6; margin: 0 0 16px; }
.hs-idline .pre { color: #b8ad9b; }
.hs-idline .hs-rot { font-style: italic; color: #d97757; display: inline-block; }
.hs-idline .hs-rot.swap { animation: hs-swap .5s ease; }
@keyframes hs-swap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hs-lede { font-size: clamp(15px, 1.25vw, 17.5px); line-height: 1.6; color: #cfc8bb; margin: 0 0 26px; max-width: 52ch; }
.hs-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* no-JS / reduced-motion default: composed, styled, readable */
.hs-el { opacity: 1; }
.hs-modal { border-color: #3c3831; }

/* JS drives the build */
.js-hstory .hs-caret { display: inline-block; }
.js-hstory .hs-el { opacity: 0; transform: translateY(10px); }
.js-hstory .hs-el.on { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease, font .5s ease, color .5s ease; }

@media (prefers-reduced-motion: reduce) {
  .js-hstory .hs-el { opacity: 1 !important; transform: none !important; transition: none; }
  .hstory { height: auto; min-height: 100vh; }
  .hstory .hs-pin { position: relative; height: 100vh; }
}


/* the paper-hero ghost button needs its dark-ground variant here */
/* No outline on the secondary CTA: the accent button carries the shape, and a
   second ring beside it competes for the same attention. The border stays in
   the box model as transparent so both buttons keep one baseline and height. */
.hs-ctas .btn-ghost { color: #e8e2d6; border-color: transparent; background: transparent; }
.hs-ctas .btn-ghost:hover { color: #191917; background: #e8e2d6; border-color: #e8e2d6; }


/* one-screen fit on shorter windows */
@media (max-height: 840px) {
  .hs-display h1 { font-size: clamp(30px, 7vh, 52px); margin-bottom: 12px; }
  .hs-idline { font-size: 19px; margin-bottom: 10px; }
  .hs-lede { font-size: 14px; margin-bottom: 16px; }
  .hs-display .eyebrow { margin-bottom: 8px; }
  .hs-mbody { padding: 20px 26px 22px; }
  .hs-photos img { width: 110px; height: 80px; }
}

/* life.run(): the typed script fires and the story lines cascade */
.hs-frame.alive .hs-leg { animation: hs-cascade .55s ease both; }
.hs-frame.alive .hs-leg:nth-of-type(4) { animation-delay: .05s; }
.hs-frame.alive .hs-leg:nth-of-type(5) { animation-delay: .17s; }
.hs-frame.alive .hs-leg:nth-of-type(6) { animation-delay: .29s; }
.hs-frame.alive .hs-leg:nth-of-type(7) { animation-delay: .41s; }
.hs-frame.alive .hs-leg:nth-of-type(8) { animation-delay: .53s; }
.hs-frame.alive .hs-leg:nth-of-type(9) { animation-delay: .65s; }
@keyframes hs-cascade {
  from { opacity: .15; transform: translateX(-12px); }
  to   { opacity: 1;  transform: none; }
}
.hs-frame.alive .hs-photos img { animation: hs-settle 1.1s ease both; }
@keyframes hs-settle { from { transform: scale(1.04); } to { transform: none; } }


/* mobile: stacked story, code as quiet backdrop, header stays stock */


/* act two: the phone becomes a native app */
.hs-appbody {
  position: absolute; inset: 42px 0 0 0; padding: 8px 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  opacity: 0; pointer-events: none; transition: opacity .5s ease;
}
.hs-modal.app .hs-appbody { opacity: 1; }
.hs-modal.app .hs-mbody { opacity: 0; transition: opacity .45s ease; }
.hs-modal.app .hs-mhead .hs-urlpill { opacity: 0; transition: opacity .4s ease; }
.hs-appbar { font-size: 13px; font-weight: 600; color: #b8ad9b; letter-spacing: .02em;
  display: flex; align-items: center; gap: 7px; margin: 2px 0 18px; }
.hs-appmark { width: 16px; height: 7px; border-radius: 4px; background: #d97757; display: inline-block; transform: rotate(-12deg); }
.hs-apptitle { font-size: 24px; font-weight: 700; color: #faf9f5; margin: 0 0 4px; }
.hs-appday { font-size: 13px; color: #a29b8d; margin: 0 0 16px; }
.hs-appslots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 0 0 18px; }
.hs-appslots span {
  border: 1px solid rgba(250,249,245,.16); border-radius: 10px; text-align: center;
  padding: 11px 0; font-size: 13.5px; font-variant-numeric: tabular-nums;
  color: transparent; background: rgba(250,249,245,.05); transition: color .4s ease, border-color .4s ease;
}
.hs-modal.dataful .hs-appslots span { color: #e8e2d6; }
.hs-modal.dataful .hs-appslots span:first-child { border-color: #d97757; color: #d97757; }
.hs-appcta {
  background: #d97757; color: #fff; border-radius: 12px; text-align: center;
  padding: 13px 0; font-size: 14.5px; font-weight: 600; margin: 0 0 12px;
  opacity: .45; transition: opacity .4s ease;
}
.hs-modal.dataful .hs-appcta { opacity: 1; }
.hs-apptabs {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex;
  border-top: 1px solid rgba(250,249,245,.10); background: rgba(15,14,12,.6);
  padding: 12px 0 16px;
}
.hs-apptabs span { flex: 1; text-align: center; font-size: 11.5px; color: #8f8779; }
.hs-apptabs span.on { color: #d97757; font-weight: 600; }


/* the desktop render of the same page (wide screens only) */
.hs-desk {
  display: none;
  position: absolute; top: calc(50% + 10px); right: 11vw; transform: translateY(-50%);
  width: min(520px, 36vw); max-height: calc(100svh - 190px); overflow: hidden;
  background: #24211b; color: #ddd6c9; border: 1px solid rgba(250,249,245,.13);
  border-radius: 12px; z-index: 2;
}
.hs-dhead {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px; border-bottom: 1px solid rgba(250,249,245,.09);
  font: 400 11px/1 ui-monospace, "SF Mono", Menlo, monospace; color: #9a9385;
}
.hs-dhead .hs-urlpill { padding: 5px 14px; }
.hs-dnav { display: flex; gap: 13px; }
.hs-dbody { padding: 24px 28px 26px; }
.hs-dbody .hs-name { font-size: 26px; }
.hs-dbody .hs-photos img { height: 104px; }
.hs-dbody .hs-leg { font-size: 13.5px; }
.hs-frame.st1 .hs-dbody-name-fix { display: none; }
.hs-desk.st1 .hs-name { font-size: 30px; }
.hs-modal { z-index: 3; }
@media (min-width: 1001px) and (max-width: 1500px) {
  .hs-modal { top: calc(50% + 22px); right: 8vw; width: 300px; height: min(600px, calc(100svh - 170px)); }
  .hs-mbody { padding: 16px 22px 20px; }
}
@media (min-width: 1501px) {
  .hs-desk { display: block; }
  .hs-modal { top: calc(50% + 96px); right: 6vw; width: 250px; height: min(500px, calc(100svh - 230px)); }
  .hs-mbody { padding: 12px 18px 20px; }
}

/* the typed stylesheet earns its finish: shared polish for both frames */
.hs-frame.styled .hs-kicker::before {
  content: ""; display: inline-block; width: 15px; height: 6px; border-radius: 4px;
  background: #d97757; margin-right: 8px; transform: rotate(-12deg) translateY(-1px);
}
.hs-frame.styled .hs-leg + .hs-leg { border-top: 1px solid rgba(250,249,245,.07); padding-top: 9px; }
.hs-frame.styled .hs-photos img { border: 1px solid rgba(250,249,245,.12); }
.hs-frame.styled .hs-name { letter-spacing: -.01em; }


/* the app is a solid device: nothing bleeds through a phone */
.hs-modal.app { background: #1d1b17; }


/* mobile: one pinned screen, hero text always on, code dim behind,
   the demo a small corner phone that only exists once it has content */
@media (max-width: 1000px) {
  .hs-desk, .hs-textground { display: none; }
  .hs-code { padding: 11vh 5vw 20vh; opacity: .5 !important; font-size: 12px; }
  .hs-scrim { background:
    linear-gradient(180deg, rgba(9,24,45,.60) 0%, rgba(9,24,45,.44) 30%, rgba(9,24,45,.44) 70%, rgba(9,24,45,.66) 100%); }
  .hs-display { left: 0; right: 0; width: auto; padding: 0 22px; }
  .hs-display h1 { font-size: clamp(30px, 8.6vw, 42px); }
  .hs-idline { font-size: 19px; }
  .hs-lede { font-size: 13.5px; max-width: none; }
  .hs-modal {
    top: auto; bottom: 16px; right: 12px;
    width: 210px; height: 372px; border-width: 6px; border-radius: 26px;
    transform: translate(24%, calc(100% - 118px)) rotate(-10deg) !important;
    transform-origin: top left;
    transition: transform .55s cubic-bezier(.3,.9,.3,1), border-color .4s ease, bottom .55s cubic-bezier(.3,.9,.3,1);
    border-color: #4a453c;
  }
  .hs-modal.peeked {
    transform: translate(0, 0) rotate(0) !important;
    z-index: 60; border-color: #0f0e0c; bottom: 104px;
  }
  .hs-mhead { padding: 9px 10px 7px; }
  .hs-urlpill { font-size: 9.5px; padding: 5px 13px; }
  .hs-mbody { padding: 10px 16px 14px; }
  .hs-mbody .hs-kicker { font-size: 9px; margin-bottom: 3px; }
  .hs-mbody .hs-name { font-size: 16px; margin-bottom: 8px; }
  .hs-frame.st1 .hs-mbody .hs-name { font-size: 17px; }
  .hs-mbody .hs-photos { gap: 4px; margin-bottom: 6px; }
  .hs-mbody .hs-photos img { height: 46px; border-radius: 5px; }
  .hs-mbody .hs-leg { font-size: 9.5px; line-height: 1.4; margin-bottom: 5px; }
  .hs-frame.st1 .hs-mbody .hs-leg { font-size: 9.5px; }
  .hs-frame.styled .hs-mbody .hs-leg { grid-template-columns: 26px 1fr; gap: 5px; padding-top: 5px; }
  .hs-frame.st2 .hs-mbody .hs-leg .y { font-size: 8.5px; }
  .hs-mbody .hs-run { font-size: 8.5px; margin-top: 8px; }
  .hs-appbody { inset: 36px 0 0 0; padding: 6px 16px 0; }
  .hs-appbar { font-size: 11px; margin: 0 0 12px; }
  .hs-appmark { width: 12px; height: 5px; }
  .hs-apptitle { font-size: 16px; }
  .hs-appday { font-size: 10.5px; margin-bottom: 11px; }
  .hs-appslots { gap: 6px; margin-bottom: 11px; }
  .hs-appslots span { font-size: 9.5px; padding: 7px 0; border-radius: 6px; }
  .hs-appcta { font-size: 10.5px; padding: 9px 0; border-radius: 9px; margin: 0; }
  .hs-apptabs { padding: 8px 0 10px; }
  .hs-apptabs span { font-size: 8.5px; }
}


/* hover-capable small screens: hovering the sliver reveals it too */
@media (max-width: 1000px) and (hover: hover) {
  .hs-modal:hover { transform: translate(0, 0) rotate(0) !important; z-index: 60; }
}
@media (prefers-reduced-motion: reduce) {
  .hs-modal { transition: none; }
}


/* the scrub has a pulse: a hairline of terracotta along the screen bottom */
.hs-progress {
  position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: #d97757; transform: scaleX(0); transform-origin: left center;
  z-index: 6;
}

/* real-phone fit: type scales with the small viewport height, never past it */
@media (max-width: 1000px) {
  .hs-display { padding: 0 20px; max-height: calc(100svh - 92px); }
  .hs-display h1 { font-size: clamp(24px, min(8.4vw, 5.6svh), 42px); }
}
@media (max-width: 1000px) and (max-height: 740px) {
  .hs-display .eyebrow { font-size: 10.5px; margin-bottom: 8px; }
  .hs-idline { font-size: 16px; margin-bottom: 8px; }
  .hs-lede { font-size: 12.5px; margin-bottom: 14px; }
  .hs-ctas { gap: 8px; }
  .hs-ctas .btn { padding: 11px 18px; font-size: .88rem; }
}


/* Over the flight the header is glass, not a black bar: the sky and the
   clouds keep moving behind it. A solid slab across the top of a hero whose
   whole point is altitude simply cut the sky off. */
body.has-story header.site:not(.past-hero) {
  background: rgba(14, 32, 58, .28);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  backdrop-filter: blur(14px) saturate(135%);
  border-bottom: 1px solid rgba(250,249,245,.10);
}
/* where backdrop-filter is missing, lean on a slightly deeper tint instead of
   letting the type sit unreadable on bright cloud */
@supports not (backdrop-filter: blur(2px)) {
  body.has-story header.site:not(.past-hero) { background: rgba(14, 32, 58, .62); }
}
body.has-story header.site:not(.past-hero) .brand .name,
body.has-story header.site:not(.past-hero) .nav-links a:not(.btn) { color: #f2ede2; }
body.has-story header.site:not(.past-hero) .nav-links a:not(.btn):hover { color: #d97757; }
body.has-story header.site:not(.past-hero) .nav-toggle span { background: #f2ede2; }
body.has-story header.site:not(.past-hero) .btn-solid {
  background: #faf9f5; border-color: #faf9f5; color: #191917;
}
body.has-story header.site:not(.past-hero) .btn-solid:hover {
  background: #d97757; border-color: #d97757; color: #fff;
}
body.has-story header.site:not(.past-hero) .nav-links.open a:not(.btn) { color: #191917; }
/* mobile menu open: the drawer/header go white, so the wordmark must go black too
   (it stays cream over the dark hero when the menu is closed, which reads fine) */
body.has-story header.site:not(.past-hero):has(.nav-links.open) .brand .name { color: #191917; }
body.has-story header.site.past-hero {
  background: rgba(250,249,245,.28);
  -webkit-backdrop-filter: blur(16px) saturate(1.05); backdrop-filter: blur(16px) saturate(1.05);
  border-bottom: 1px solid rgba(25,25,23,.06);
}

/* once the app runs, the phone invites a click */
.hs-frame.app { cursor: pointer; }
