/* Cinematic layer: original artwork, a restrained light field and suspended dust. */
.hero { height:100svh; min-height:720px; isolation:isolate; --light-x:65%; --light-y:38%; }
.hero-scene { position:absolute; inset:-6px; transform:translate(var(--pan-x,0px),var(--pan-y,0px)); transition:transform .7s ease-out; }
.hero-art { opacity:1; object-position:66% center; filter:none; animation:none; }
.hero::after { z-index:0; background:linear-gradient(90deg,#071215e8 0%,#071215a6 27%,#07121538 49%,transparent 73%),linear-gradient(0deg,#101b1a 0%,#101b1aeb 4%,#101b1a99 13%,#101b1a28 24%,transparent 36%); }
.hero-content { margin-left:9%; max-width:760px; }
.hero h1 { font-size:clamp(80px,8.6vw,136px); line-height:1.12; letter-spacing:.10em; margin:26px 0; text-shadow:0 4px 28px #02090c60; }
.title-line { display:block; }
.hero h1 em { font-size:.88em; padding-left:.65em; color:#bed1c5; }
.hero .eyebrow { font-size:11px; letter-spacing:.18em; }
.hero .tagline { font-size:clamp(18px,1.7vw,25px); }
.hero .actions { margin-top:35px; }
.hero.has-entered .title-line { animation:ink-arrival 1.25s ease-out both; }
.hero.has-entered .title-line:last-child { animation-delay:.17s; }
.hero.has-entered .tagline,.hero.has-entered .actions { animation:ink-arrival 1.1s .35s ease-out both; }
.hero-light { position:absolute; inset:0; z-index:1; pointer-events:none; background:radial-gradient(ellipse 34% 45% at var(--light-x) var(--light-y),#bddfc018,transparent 85%); }
.mist { z-index:1; opacity:.18; background:radial-gradient(ellipse at 62% 72%,#b5d5c629,transparent 45%),radial-gradient(ellipse at 20% 45%,#8fa9aa10,transparent 35%); animation-play-state:paused; }
.hero-dust { position:absolute; inset:0; z-index:1; overflow:hidden; pointer-events:none; }
.hero-dust i { position:absolute; left:var(--x); top:var(--y); width:2px; height:2px; border-radius:50%; background:#c6ded5; opacity:.24; animation:sediment-drift var(--duration,18s) linear infinite; animation-delay:var(--delay,0s); animation-play-state:paused; }
.hero.is-visible .hero-art,.hero.is-visible .mist,.hero.is-visible .hero-dust i { animation-play-state:running; }
.button { position:relative; overflow:hidden; isolation:isolate; }
.button::after { content:''; position:absolute; inset:-75%; z-index:-1; pointer-events:none; border-radius:50%; border:1px solid currentColor; opacity:0; transform:scale(.05); }
.button:hover::after,.button:focus-visible::after { animation:water-ring .9s ease-out; }

@keyframes ink-arrival { from { opacity:.25; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@keyframes sediment-drift { 0% { transform:translate(0,30px); opacity:0; } 20%,70% { opacity:.24; } 100% { transform:translate(26px,-100px); opacity:0; } }
@keyframes water-ring { 0% { opacity:.3; transform:scale(.05); } 100% { opacity:0; transform:scale(1); } }
.page-hidden *, .page-hidden *::before,.page-hidden *::after { animation-play-state:paused!important; }
.no-motion .hero-scene { transform:none; transition:none; }
.no-motion .hero-light { display:none; }
@media(max-width:760px) {
 .hero { min-height:730px; }
 .hero-content { margin:150px 7% 100px; }
 .hero h1 { font-size:clamp(74px,16vw,116px); }
 .hero-art { object-position:64% center; }
 .hero::after { background:linear-gradient(90deg,#071215a6,#07121508),linear-gradient(0deg,#101b1a 0%,#101b1ad9 12%,#101b1a70 35%,transparent 65%); }
 .hero-dust i:nth-child(n+6) { display:none; }
 .hero-light { display:none; }
}
@media(prefers-reduced-motion:reduce) { .hero-scene { transform:none; } .hero-light { display:none; } }
/* Paintings become an exhibition; original text remains available without JS. */
.gallery-ready { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:22px; padding:25px 0 45px; }
.gallery-ready .narrative-row { display:block; margin:0; padding:0; border:0; }
.gallery-ready .narrative-row:nth-child(even) { padding-top:54px; }
.gallery-ready .narrative-row > div { display:none; }
.gallery-ready figure { margin:0; }
.painting-trigger { width:100%; padding:0; border:0; background:#051016; color:#e2e9df; cursor:pointer; position:relative; overflow:hidden; text-align:left; }
.gallery-ready .painting-trigger img { display:block; width:100%; height:360px; object-fit:cover; transition:transform .7s ease,filter .7s ease; filter:brightness(.85) saturate(.8); }
.painting-trigger:hover img,.painting-trigger:focus-visible img { transform:scale(1.045); filter:brightness(1) saturate(1); }
.painting-label { position:absolute; inset:auto 0 0; padding:45px 16px 20px; background:linear-gradient(transparent,#030d11e8); font-size:14px; letter-spacing:.06em; }
#painting-dialog { width:min(1100px,92vw); max-height:90svh; padding:28px; background:#07161c; color:#dae4dd; border:1px solid #6d888955; overflow:auto; }
#painting-dialog::backdrop { background:#02090dec; }
.gallery-close { display:block; margin:0 0 18px auto; }
.gallery-full { display:block; width:100%; height:min(40svh,520px); object-fit:contain; background:#030b0f; }
.gallery-description { max-width:750px; padding:24px 0 16px; }
.gallery-description h3 { margin:8px 0; }
.gallery-description p { margin:8px 0; }
.gallery-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid #76988b33; padding-top:18px; }
.gallery-controls span { color:#a7bab7; font-size:12px; }
.gallery-open { overflow:hidden; }
.gallery-open .hero * { animation-play-state:paused!important; }
.puzzle-surface { position:relative; overflow:hidden; }
.restored .puzzle-surface::after { content:''; position:absolute; inset:0; pointer-events:none; background:linear-gradient(110deg,transparent 25%,#b8d4bd22 48%,transparent 70%); animation:painting-restored 1.7s ease-out both; }
@keyframes painting-restored { from { transform:translateX(-100%); } to { transform:translateX(100%); } }
#puzzle-result { padding:22px 0; border-bottom:1px solid #91b6aa44; }
#puzzle-result h4 { color:#c4dbcf; font-size:22px; margin:0; }
.depth-rail { position:fixed; right:16px; top:50%; transform:translateY(-50%); z-index:15; }
.depth-rail nav { display:flex; flex-direction:column; gap:0; align-items:flex-end; }
.depth-rail nav > span { color:#819894; font-size:10px; writing-mode:vertical-rl; letter-spacing:5px; margin:0 8px 18px; }
.depth-rail a { display:flex; align-items:center; height:44px; gap:8px; color:#8ba4a1; font-size:11px; position:relative; text-decoration:none; }
.depth-rail a::after { content:''; width:12px; height:1px; background:currentColor; transition:width .3s; }
.depth-rail a[aria-current] { color:#e1e9dd; }
.depth-rail a[aria-current]::after { width:24px; }
.depth-rail b { position:absolute; right:100%; white-space:nowrap; padding:7px 10px; background:#07161c; opacity:0; pointer-events:none; font-weight:400; }
.depth-rail a:hover b,.depth-rail a:focus-visible b { opacity:1; }
main { background:linear-gradient(#101b1a 0%,#0a191e 25%,#071720 48%,#06131c 72%,#040e16 100%); }
main > .section { background:transparent; }
.section { position:relative; }
.section-label { letter-spacing:.18em; color:#a1bcb4; }
#environment-change { position:relative; }
#environment-change::before { content:''; position:absolute; inset:-35px 0; pointer-events:none; background:radial-gradient(ellipse at 80% 50%,#9bb9a20b,transparent 65%); opacity:0; }
#environment-change.is-visible::before { animation:sea-shadow 5s ease-out both; }
@keyframes sea-shadow { 0%,100% { opacity:0; } 40% { opacity:1; } }
.hero:not(.is-visible) .title-line,.hero:not(.is-visible) .tagline,.hero:not(.is-visible) .actions { animation-play-state:paused; }
.no-motion *, .no-motion *::before,.no-motion *::after { animation:none!important; transition:none!important; }
.no-motion .painting-trigger:hover img,.no-motion .painting-trigger:focus-visible img { transform:none; }
@media(max-width:1300px) { .depth-rail { display:none; } }
@media(max-width:900px) { .gallery-ready { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; } .gallery-ready .painting-trigger img { height:320px; } }
@media(max-width:600px) { .gallery-ready { gap:12px; } .gallery-ready .narrative-row:nth-child(even) { padding-top:30px; } .gallery-ready .painting-trigger img { height:240px; } .painting-label { padding:35px 10px 14px; font-size:12px; } #painting-dialog { padding:16px; } .gallery-controls span { display:none; } .gallery-full { height:42svh; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; } .painting-trigger:hover img { transform:none; } }

/* Hero-only refinements: native artwork, local contrast, continuous section colour. */
.project-overview { background:#101b1a; }
.hero { background:#101b1a; }
.hero .button { min-height:48px; padding:12px 20px; border-color:#bed1c575; background:#c3d4c8; color:#102321; box-shadow:0 3px 14px #020a0c24; }
.hero .button.secondary { background:#0c1b1b8c; color:#e2e9df; border-color:#b7cbc459; }
.hero .button:hover { background:#d9e3d6; color:#102321; }
.hero .button.secondary:hover { background:#223932; color:#f0f3eb; }
.hero .tagline { color:#e2e9df; letter-spacing:.09em; }
.hero .eyebrow { color:#c0d2ca; }
@media(max-width:760px) {
 .hero { min-height:700px; }
 .hero-content { margin:140px 7% 120px; }
 .hero h1 { font-size:clamp(72px,16vw,110px); }
 .hero .actions { gap:12px; }
 .hero .button { font-size:13px; }
 .hero-scene { inset:0; transform:none; }
}

/* Fade every image/contrast layer to the exact overview colour at the seam. */
.hero-scene { -webkit-mask-image:linear-gradient(to bottom,#000 75%,transparent 100%); mask-image:linear-gradient(to bottom,#000 75%,transparent 100%); }
.hero::after { -webkit-mask-image:linear-gradient(to bottom,#000 85%,transparent 100%); mask-image:linear-gradient(to bottom,#000 85%,transparent 100%); }
.hero .mist,.hero-light { -webkit-mask-image:linear-gradient(to bottom,#000 70%,transparent 100%); mask-image:linear-gradient(to bottom,#000 70%,transparent 100%); }

/* Original game artwork under a quiet ocean veil. */
main {
  background:
    linear-gradient(180deg, #07151bd9, #07151be6 42%, #040e16ed),
    url("assets/tide-original/gallery-4.png") center top / 100% auto repeat-y;
}
main > .section, .project-overview > .overview { background: transparent; }
.puzzle-module {
  margin: 32px 0 72px;
  padding: clamp(14px, 3vw, 40px);
  border: 1px solid #9bbdb54d;
  background:
    linear-gradient(110deg, #06141bf2, #0c262cd9),
    url("assets/tide-original/painting.png") center / cover;
  box-shadow: 0 24px 70px #0005, inset 0 1px #c4d9cb12;
}
.puzzle-module .puzzle-experience {
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.6fr);
  gap: clamp(24px, 4vw, 54px);
  padding: 0;
  border: 0;
  background: transparent;
  align-items: center;
}
.puzzle-module .puzzle-copy { display: block; }
.puzzle-module .puzzle-copy > * + * { margin-top: 18px; }
.puzzle-module .puzzle-copy h3 { font-size: clamp(26px, 3vw, 36px); }
.puzzle-module .puzzle-copy .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.puzzle-module .puzzle-surface { border: 1px solid #b3c6af33; box-shadow: 0 14px 44px #0006; }
@media (max-width: 760px) {
  main { background-size: auto, auto 1100px; }
  .puzzle-module .puzzle-experience { grid-template-columns: 1fr; }
  .puzzle-module { margin-bottom: 40px; }
}

/* Continuous transition from game footage to personal contribution. */
.scene-change { padding-top: 60px; padding-bottom: 44px; }
.scene-change-grid { display: grid; grid-template-columns: .8fr 1.5fr; gap: 48px; align-items: center; }
.scene-change-grid h2 { margin-bottom: 20px; }
.scene-change-grid .media-slot { margin: 0; }
.scene-change-grid video { display: block; width: 100%; max-height: 360px; object-fit: contain; background: #040e16; }
.scene-change + .reflection { padding-top: 44px; }
.scene-change + .reflection .intro-grid { gap: 40px; }
@media (max-width: 760px) {
  .scene-change { padding-top: 40px; padding-bottom: 28px; }
  .scene-change-grid { grid-template-columns: 1fr; gap: 24px; }
  .scene-change + .reflection { padding-top: 28px; }
  .scene-change + .reflection .intro-grid { gap: 20px; }
}

/* Keep the ocean artwork continuous across chapter boundaries. */
main {
  background-size: auto, cover;
  background-repeat: no-repeat;
  background-attachment: scroll, fixed;
}
