/* ==========================================================================
   Motion layer — loader, curtain, cursor, pinned hero, waves, flight route,
   scrub text, glass journey. Loaded after style.css.
   ========================================================================== */

:root { --sand: #f6e7cf; --sea-1: #ffb48a; --sea-2: #f07d8e; --sea-3: #7a5fc4; --sea-4: #24497e; }
:root[data-theme="dark"] { --sand: #2a2236; --sea-1: #5b2e5e; --sea-2: #3b2560; --sea-3: #1d2456; --sea-4: #0b1433; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sand: #2a2236; --sea-1: #5b2e5e; --sea-2: #3b2560; --sea-3: #1d2456; --sea-4: #0b1433; } }

/* ---------- boarding-pass loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: linear-gradient(180deg, #7b8fe0, #c59bd8 45%, #ffad8a);
  transition: transform 1s cubic-bezier(.76, 0, .24, 1);
}
#loader.done { transform: translateY(-100%); }
#loader.gone { display: none; }
.pass {
  width: min(560px, 100% - 40px); background: #fffdf8; color: #1d1a2c; border-radius: 22px; padding: 26px 30px;
  box-shadow: 0 40px 80px -30px rgba(60, 20, 60, .5); position: relative;
  transition: transform .8s cubic-bezier(.76, 0, .24, 1), opacity .5s;
}
#loader.done .pass { transform: translateY(-40px) rotate(-2deg); opacity: 0; }
.pass::before, .pass::after { content: ""; position: absolute; top: 62%; width: 26px; height: 26px; border-radius: 50%; background: #e9b4a6; }
.pass::before { left: -13px; } .pass::after { right: -13px; }
.pass-top, .pass-bottom { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #857c90; }
.pass-bottom { margin-top: 22px; padding-top: 18px; border-top: 2px dashed #e5ddd2; gap: 12px; line-height: 1.6; }
.pass-bottom b { color: #1d1a2c; font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; }
.pass-route { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-top: 18px; }
.pass-route > div:not(.pass-track) b { display: block; font-family: var(--serif); font-size: 52px; font-weight: 400; line-height: 1; letter-spacing: -.02em; }
.pass-route small { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #857c90; }
.pass-route > div:last-child { text-align: right; }
.pass-track { position: relative; height: 2px; background: repeating-linear-gradient(90deg, #cfc6bb 0 6px, transparent 6px 12px); }
.pass-fill { position: absolute; left: 0; top: 0; height: 2px; width: 0; background: var(--coral); }
.pass-plane { position: absolute; top: -12px; left: 0; width: 34px; height: 24px; fill: var(--coral); translate: -50% 0; }

/* ---------- page curtain ---------- */
#curtain {
  position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; pointer-events: none;
  background: linear-gradient(135deg, var(--coral), var(--pink) 55%, var(--violet));
  transform: translateY(100%); transition: transform .7s cubic-bezier(.76, 0, .24, 1);
}
#curtain svg { width: 64px; fill: #fff; transform: translateX(-30vw); opacity: 0; transition: transform .9s cubic-bezier(.5, 0, .2, 1), opacity .3s; }
#curtain.cover { transform: translateY(0); }
#curtain.cover svg { transform: translateX(0); opacity: 1; }
#curtain.enter { transform: translateY(0); transition: none; }
#curtain.enter svg { opacity: 1; transform: none; transition: none; }
#curtain.leave { transform: translateY(-100%); }
#curtain.leave svg { transform: translateX(30vw); opacity: 0; }

/* ---------- custom cursor ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 9998; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--coral); pointer-events: none; transition: width .25s, height .25s, margin .25s, background .25s, opacity .3s; opacity: 0; mix-blend-mode: multiply; }
:root[data-theme="dark"] .cursor { mix-blend-mode: screen; }
.cursor.on { opacity: 1; }
.cursor.big { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: color-mix(in srgb, var(--coral) 35%, transparent); }
.cursor.view::after { content: "View"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 12px var(--sans); color: #fff; }
.cursor.view { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--ink); mix-blend-mode: normal; }
.cursor.view::after { color: var(--bg); }
@media (hover: none) { .cursor { display: none; } }
@media (hover: hover) { html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; } }

/* ---------- nav availability pulse ---------- */
.nav .cta { display: inline-flex; align-items: center; gap: 8px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }

/* ---------- pinned hero + intro animation ---------- */
.hero { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 620px; padding-bottom: 30vh; z-index: 0; }
.hero-copy { will-change: transform, opacity; }
html.intro .hero h1 .line { animation: lineUp 1.1s cubic-bezier(.2, .8, .2, 1) both; }
html.intro .hero h1 .line:nth-child(2) { animation-delay: .12s; }
html.intro .hero .hello, html.intro .hero-copy p, html.intro .hero-cta { animation: fadeUp .9s cubic-bezier(.2, .8, .2, 1) both; }
html.intro .hero-copy p { animation-delay: .3s; } html.intro .hero-cta { animation-delay: .42s; }
html.intro .hero .city svg { animation: cityRise 1.4s cubic-bezier(.2, .8, .2, 1) both; }
html.intro .hero .sunball { animation: sunRise 1.6s cubic-bezier(.2, .8, .2, 1) both; }
html.is-loading .hero-copy, html.is-loading .hero .city svg { opacity: 0; }
@keyframes lineUp { from { transform: translateY(105%) rotate(2deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cityRise { from { transform: translateY(18%); } to { transform: none; } }
@keyframes sunRise { from { translate: -50% 40%; opacity: .2; } to { translate: -50% 0; opacity: 1; } }

.scroll-hint { position: absolute; left: 50%; bottom: 9vh; translate: -50% 0; z-index: 3; display: grid; justify-items: center; gap: 8px; color: #fff; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.scroll-hint i { width: 1px; height: 40px; background: linear-gradient(#fff, transparent); animation: hint 1.8s infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* shooting stars (night) */
.shooting { position: absolute; top: 12%; left: 70%; width: 140px; height: 2px; border-radius: 2px; z-index: -2; opacity: 0;
  background: linear-gradient(90deg, #fff, transparent); transform: rotate(-24deg); }
:root[data-theme="dark"] .shooting { animation: shoot 7s 2s infinite; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .shooting { animation: shoot 7s 2s infinite; } }
.shooting.s2 { top: 22%; left: 30%; animation-delay: 5.5s !important; animation-duration: 9s !important; }
@keyframes shoot { 0% { opacity: 0; translate: 0 0; } 3% { opacity: 1; } 12% { opacity: 0; translate: -340px 150px; } 100% { opacity: 0; translate: -340px 150px; } }

/* palms sway (hero + journey) */
.sway { transform-box: fill-box; transform-origin: 50% 85%; animation: sway var(--d, 5s) ease-in-out var(--dl, 0s) infinite alternate; }
@keyframes sway { from { transform: rotate(-3.5deg); } to { transform: rotate(3.5deg); } }

/* ---------- everything that slides over the hero ---------- */
.over { position: relative; z-index: 2; background: var(--bg); transition: background .5s; }
.wave { position: absolute; left: 0; width: 100%; height: 140px; pointer-events: none; }
.wave-top { top: -139px; }
.wave-top .wave-back { fill: var(--sand); opacity: .9; animation: drift 9s ease-in-out infinite alternate; }
.wave-top .wave-front { fill: var(--bg); transition: fill .5s; animation: drift 7s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
.wave path { transform-box: view-box; }
.wave { overflow: visible; }

/* ---------- flight zone ---------- */
.flight-zone { position: relative; }
.route-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
.route-dash { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 6 9; opacity: .55; }
.route-reveal { fill: none; stroke: #fff; stroke-width: 14; stroke-linecap: round; }
.route-jet path { fill: var(--coral); }
.route-jet { filter: drop-shadow(0 4px 6px rgba(240, 100, 63, .35)); }

/* statement with scroll-scrubbed words */
.statement { padding: clamp(80px, 12vw, 160px) 0 clamp(40px, 6vw, 80px); max-width: 980px; text-align: center; position: relative; z-index: 2; }
.scrub { font-family: var(--sans); font-size: clamp(24px, 3vw, 38px); line-height: 1.35; letter-spacing: -.01em; margin: 0 0 28px; font-weight: 500; }
.scrub.strong { font-weight: 800; }
.scrub .w { color: color-mix(in srgb, var(--ink) 22%, transparent); transition: color .35s; }
.scrub .w.lit { color: var(--ink); }

/* staggered postcards with room for the route */
.works-sec { padding-top: 40px; }
/* horizontal postcards: the section pins and the cards slide in from the right */
.hscroll { position: relative; }
.hscroll-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; z-index: 4; background: var(--bg); transition: background .5s; }
.works-sec .postcards { display: flex; gap: clamp(28px, 4vw, 60px); width: max-content; padding: 30px max(24px, (100vw - 1180px) / 2) 40px; will-change: transform; }
.works-sec .postcard { flex: none; width: min(460px, 78vw); margin-top: 0; }
.works-sec .postcard:nth-child(even) { translate: 0 36px; }
.h-route { position: relative; height: 2px; margin: 0 max(24px, (100vw - 1180px) / 2) 10px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink) 30%, transparent) 0 8px, transparent 8px 16px); }
.h-route-done { position: absolute; left: 0; top: 0; height: 100%; width: calc(var(--hp, 0) * 100%); background: var(--coral); }
.h-jet { position: absolute; top: 50%; left: calc(var(--hp, 0) * 100%); width: 40px; height: 20px; translate: -50% -50%; scale: -1 1; fill: var(--coral); }
.works-sec .postcard .pic img { transform: scale(1.12) translateY(var(--py, 0px)); transition: transform .2s linear; }
.works-sec .postcard:hover .pic img { transform: scale(1.16) translateY(var(--py, 0px)); }
.works-sec .postcard.reveal .pic { clip-path: inset(12% 10% 12% 10% round 10px); transition: clip-path 1.2s cubic-bezier(.2, .8, .2, 1); }
.works-sec .postcard.reveal.in .pic { clip-path: inset(0 0 0 0 round 10px); }
/* more projects: compact cards under the main postcards */
.more { padding-top: 110px; position: relative; z-index: 4; }
.more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.more-head p { margin: 0; color: var(--ink-2); }
.minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.mini { display: block; text-decoration: none; color: var(--ink); background: var(--paper); border-radius: 16px; padding: 10px 10px 16px; border: 1px solid var(--line); transition: transform .4s var(--ease), border-color .4s; }
.mini:hover { transform: translateY(-6px); border-color: var(--coral); }
.mini .pic { border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: #ddd; }
.mini .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.mini:hover .pic img { transform: scale(1.06); }
.mini h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 14px 6px 4px; letter-spacing: -.01em; }
.mini p { margin: 0 6px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.mini span { display: inline-block; margin: 10px 6px 0; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.landing { text-align: center; padding: 100px 0 90px; font-family: var(--serif); font-size: clamp(30px, 4vw, 52px); color: var(--muted); }
.landing span { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 8px; color: var(--coral); }
.landing b { font-weight: 400; font-style: italic; color: var(--ink); }

/* ---------- journey: glass cards over the Pacific ---------- */
.journey-sea {
  position: relative; padding: 160px 0 220px; color: #fff; isolation: isolate;
  background: linear-gradient(180deg, var(--sea-1) 0%, var(--sea-2) 30%, var(--sea-3) 62%, var(--sea-4) 100%);
  transition: background .8s;
}
.wave-sea { top: -1px; transform: scaleY(-1); }
.wave-sea .wave-back { fill: var(--sand); opacity: .55; animation: drift 10s ease-in-out infinite alternate; }
.wave-sea .wave-front { fill: var(--bg); transition: fill .5s; animation: drift 8s ease-in-out infinite alternate-reverse; }
.wave-sand { bottom: -1px; }
.wave-sand .wave-front { fill: var(--bg); transition: fill .5s; animation: drift 9s ease-in-out infinite alternate; }
.sea-palms { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sea-palms svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; fill: color-mix(in srgb, var(--sea-4) 75%, #000); opacity: .85; }
.journey-sea .section-head { margin-bottom: 60px; }
.light-head .eyebrow, .light-head h2 em { color: #ffe0a8; }
.light-head p { color: rgba(255, 255, 255, .85); }
.glass-stops { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 18px; }
.glass { display: flex; flex-direction: column; min-height: 230px; }
.glass .where { margin-top: auto !important; align-self: flex-start; }
.glass p { margin-bottom: 14px !important; }
.glass a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .45); transition: border-color .3s; }
.glass a:hover { border-color: #fff; }
.glass-stops + .glass-group { margin-top: 80px; }
.glass-group { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: #ffe0a8; margin: 0 0 22px; display: flex; align-items: center; gap: 14px; }
.glass-group::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .3); }
.glass {
  padding: 22px; border-radius: 20px; color: #fff;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 20px 40px -20px rgba(20, 10, 40, .5), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .5s var(--ease), background .3s;
}
.glass:hover { transform: translateY(-6px) rotate(-.6deg); background: rgba(255, 255, 255, .22); }
.glass .yr { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: #ffe0a8; }
.glass h4 { margin: 8px 0 6px; font-size: 17px; line-height: 1.3; }
.glass p { margin: 0; font-size: 14.5px; line-height: 1.5; color: rgba(255, 255, 255, .88); }
.glass .where { display: inline-block; margin-top: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .16); }
.glass.reveal { transition: opacity .9s var(--ease), transform .9s var(--ease); }
.glass.reveal:nth-child(3n+2) { transition-delay: .08s; } .glass.reveal:nth-child(3n) { transition-delay: .16s; }

.on-bg { position: relative; background: var(--bg); }
footer.on-bg { padding-bottom: 50px; }

/* ---------- case study motion ---------- */
.cs-cover { position: relative; }
.cs-cover img { animation: kenburns 18s ease-in-out infinite alternate; transform-origin: 60% 40%; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }
.cs-hero h1 { overflow: hidden; }
.cs-hero h1, .cs-hero .one, .cs-hero .meta, .cs-hero .eyebrow, .back { animation: fadeUp .9s cubic-bezier(.2, .8, .2, 1) both; }
.cs-hero .eyebrow { animation-delay: .05s; } .cs-hero h1 { animation-delay: .12s; } .cs-hero .one { animation-delay: .22s; } .cs-hero .meta { animation-delay: .32s; }
.figure.reveal img, .fig-row.reveal img, .full-bleed.reveal img { clip-path: inset(8% 6% 8% 6% round 18px); transition: clip-path 1.1s cubic-bezier(.2, .8, .2, 1); }
.figure.reveal.in img, .fig-row.reveal.in img, .full-bleed.reveal.in img { clip-path: inset(0 round 18px); }

@media (max-width: 980px) {
  .minis { grid-template-columns: repeat(2, 1fr); }
  .glass-stops { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .minis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .mini h3 { font-size: 18px; }
  .works-sec .postcard:nth-child(even) { translate: none; }
  .glass-stops { grid-template-columns: 1fr; }
  .pass-route > div:not(.pass-track) b { font-size: 36px; }
  .pass-bottom { font-size: 9.5px; }
  .pass-bottom b { font-size: 12px; }
  .wave { height: 70px; } .wave-top { top: -69px; }
  .journey-sea { padding: 110px 0 150px; }
  .route-dash { stroke-width: 1.2; }
}
@media (prefers-reduced-motion: reduce) {
  #loader { display: none; }
  .scrub .w { color: var(--ink); }
  .hscroll { height: auto !important; }
  .hscroll-pin { position: static; height: auto; overflow-x: auto; }
  .works-sec .postcard.reveal .pic, .figure.reveal img, .fig-row.reveal img, .full-bleed.reveal img { clip-path: none; }
}
