@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=optional');

:root {
  --ink: #131a23;
  --sky: #b8d7f6;
  --gold: #8b5d19;
  --edge: clamp(18px, 6vw, 108px);
  --nav-height: 66px;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--sky);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-snap-type: y mandatory; scroll-behavior: smooth; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid #614216; outline-offset: 4px; }
img { display: block; max-width: 100%; }
header {
  position: fixed; inset: 0 0 auto; z-index: 10; min-height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px clamp(16px, 4vw, 70px);
  background: linear-gradient(#e0effbe8, #d8e9f8ad 74%, transparent);
}
.wordmark { font-size: clamp(1.4rem, 2.5vw, 2rem); font-weight: 900; letter-spacing: -.065em; }
header nav { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(8px, 2vw, 32px); }
header nav a, #menu { font-size: .83rem; font-weight: 650; }
header nav a:hover { text-decoration: underline; text-underline-offset: .3em; }
#main-nav a:last-child {
  background: #151b23; color: white; padding: .55em 1em; border-radius: 2rem;
}
#languages { gap: .2rem; }
#languages a { padding: .4em .5em; }
#languages [aria-current] { background: #fff9; border-radius: 1rem; }
#menu, .quick { display: none; }

#story {
  isolation: isolate; overflow: clip;
  background:
    radial-gradient(ellipse 50% 12% at 12% 21%, #e2edf9, transparent),
    radial-gradient(ellipse 60% 14% at 82% 63%, #d7e8fb, transparent),
    linear-gradient(#b0d2f4, #c9e0f7 53%, #b5d2ef 88%, #8fa9c6);
}
.screen {
  position: relative; min-height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; align-items: center; gap: clamp(18px, 3vw, 54px);
  padding: calc(var(--nav-height) + 20px) var(--edge) clamp(24px, 7dvh, 72px);
}
h1, h2 {
  font-weight: 900; line-height: 1.01; letter-spacing: -.055em; text-wrap: balance;
  margin: 0 0 .3em;
}
h1 { font-size: clamp(2rem, 5.2vw, 5.35rem); max-width: 18ch; margin-inline: auto; }
h2 { font-size: clamp(2rem, 4.8vw, 5rem); }
p { margin: 0 0 1rem; line-height: 1.55; text-wrap: pretty; }
.pill, summary {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .6rem 1.15rem; min-height: 44px; border: 1px solid #92601d45;
  border-radius: 99px; background: linear-gradient(#ffdf99, #d49d41); color: #1c170d;
  font-weight: 800; cursor: pointer;
}

.hero { grid-template-rows: auto minmax(0, 1fr); gap: 12px; text-align: center; padding-bottom: 0; }
.hero-text { position: relative; z-index: 3; }
.hero-text p { max-width: 65ch; margin-inline: auto; }
.hero-cloud {
  position: absolute; z-index: 0; top: -31%; left: -17%; width: 86%;
  opacity: .67; pointer-events: none;
}
.hero-stage { position: relative; place-self: end center; width: min(108%, 1500px, 164dvh); z-index: 2; }
.hero-architecture { width: 100%; max-height: 54dvh; object-fit: fill; }
.hero-projects {
  position: absolute; width: 57%; bottom: 12%; left: 50%; transform: translateX(-50%);
}
.hero-projects > :nth-child(2) { scale: 1.13; z-index: 1; }
.hero-projects span { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }

.chapter { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.chapter-content { position: relative; z-index: 3; max-width: 38rem; }
.chapter-content h2::before {
  content: ""; display: block; width: 45px; height: 3px; background: #b27e29; margin-bottom: .36em;
}
.scene-art { position: relative; z-index: 1; width: 100%; max-height: 66dvh; object-fit: contain; }
#budget .scene-art, #support .scene-art { grid-column: 1; grid-row: 1; }
#budget .chapter-content, #support .chapter-content { grid-column: 2; grid-row: 1; }
#timeline { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
#timeline .scene-art { max-height: 54dvh; width: min(100%, 1000px); justify-self: center; }
.evidence { color: #593e17; }
.evidence ul { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.evidence li { font-size: .88rem; font-weight: 650; }

.cloud-transition { position: relative; height: 20dvh; z-index: 2; pointer-events: none; }
.cloud-bank {
  position: absolute; width: min(116vw, 1900px); max-width: none; height: clamp(170px, 40dvh, 520px);
  left: -7%; top: 50%; transform: translateY(-50%); object-fit: fill;
}
[data-cloud="1"] .cloud-bank { left: -11%; rotate: -4deg; }
[data-cloud="2"] .cloud-bank { left: 2%; rotate: 5deg; }
@supports (animation-timeline: view()) {
  .cloud-bank { animation: cloud-drift linear both; animation-timeline: view(); }
  @keyframes cloud-drift { from { translate: -3% -10%; } to { translate: 3% 10%; } }
}

#portfolio { grid-template-columns: 1fr; text-align: center; }
#portfolio .chapter-content { width: min(100%, 1100px); max-width: none; justify-self: center; }
#portfolio h2::before { margin-inline: auto; }
#portfolio .evidence ul { justify-content: center; }
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: clamp(6px, 2vw, 32px); }
.projects > * { position: relative; min-width: 0; font-size: .88rem; font-weight: 700; }
.projects img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #151b21;
  border: clamp(2px, .48vw, 7px) solid #151b21; border-radius: 5px 5px 3px 3px;
  box-shadow: 0 5px 0 -1px #73695d, 0 10px 20px #181c2438;
}
.projects span { display: block; padding-top: .6em; overflow-wrap: anywhere; }
.lead-projects { margin-top: 1.5rem; }
details { margin-top: 1.3rem; }
.all-projects { gap: 1.5rem; margin-top: 1.5rem; }
summary { list-style: none; }
summary::after { content: '⌄'; margin-inline-start: .15em; }

.contact form { display: grid; gap: .75rem; }
.contact label { display: grid; gap: .35rem; font-weight: 700; }
.contact input:not([type="checkbox"]) {
  width: 100%; min-height: 44px; padding: .6em .85em;
  border: 1px solid #5b6c80; border-radius: .6em; background: #fff9f0e8;
}
.contact .privacy { display: flex; align-items: center; gap: .55rem; font-size: .9rem; }
.contact .privacy input { width: 1.1rem; height: 1.1rem; accent-color: var(--gold); }
.contact form p { margin: 0; font-size: .85rem; }
.contact form a { text-decoration: underline; }
.contact button { justify-self: start; }

footer {
  position: relative; isolation: isolate; overflow: clip; scroll-snap-align: end;
  background: linear-gradient(#3c526f, #172232 70%); color: #fff8ee;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem;
  padding: clamp(32px, 7vw, 92px) var(--edge);
}
footer .footer-cloud { position: absolute; bottom: -48%; width: 100%; opacity: .23; z-index: -1; }
footer p { margin-top: .7rem; }
footer nav, footer ul { display: grid; align-content: start; gap: .65rem; }
footer ul { padding: 0; list-style: none; }

@media (max-width: 760px) {
  :root { --nav-height: 58px; }
  header { gap: 6px; }
  #menu { display: block; background: #ffffffaa; border: 1px solid #6a83a4; border-radius: 99px; min-height: 38px; }
  header #main-nav {
    display: none; position: absolute; top: 100%; inset-inline: 12px;
    background: #f0f7ff; padding: 14px 20px; border-radius: .8rem;
  }
  #menu[aria-expanded="true"] + #main-nav { display: grid; }
  .screen { padding-top: calc(var(--nav-height) + 16px); }
  .chapter, #timeline { grid-template-columns: 1fr; align-content: center; }
  #budget .chapter-content, #support .chapter-content, #budget .scene-art, #support .scene-art { grid-column: auto; grid-row: auto; }
  .scene-art { max-height: 36dvh; }
  #timeline .scene-art { max-height: 39dvh; }
  .hero-stage { width: min(112%, 1000px); align-self: center; }
  .hero-architecture { max-height: none; }
  .hero-projects { width: 69%; }
  .hero-cloud { left: -38%; width: 128%; top: -8%; }
  .evidence ul { gap: .3rem .75rem; }
  .evidence li { font-size: .82rem; }
  .projects span { font-size: .72rem; }
  .all-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .quick {
    display: inline-flex; position: fixed; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 9; font-size: .78rem; box-shadow: 0 4px 18px #18253748;
  }
  footer { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 75px; }
  footer > div:first-of-type { grid-column: 1/-1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: y proximity; }
  .cloud-bank { animation: none; }
}
.hero-stage { width: min(108%, 1500px, 110dvh); }
.hero-architecture { width: 100%; aspect-ratio: 1440/715; max-height: none; object-fit: contain; }
.cloud-bank { height: auto; max-height: 56dvh; object-fit: contain; }
@media (max-width: 760px) {
  .hero-stage { width: min(112%, 940px); }
  .hero:has(.hero-stage) { padding-bottom: 18px; }
}
.quick[hidden] { display: none; }
@media (min-width: 761px) {
  .hero h1 { max-width: 26ch; font-size: clamp(2.5rem, 5.1vw, min(5.2rem, 8.8dvh)); }
  .hero-stage { width: min(108%, 1500px, 110dvh); }
}
.hero-projects { width: 69%; bottom: 19%; }
.hero-projects > :nth-child(2) { transform: translateY(-9%); }
@media (min-width: 761px) and (max-aspect-ratio: 1/1) {
  .hero { padding-bottom: 7dvh; }
  .hero::before {
    content: ""; position: absolute; pointer-events: none;
    width: 67%; height: 35%; top: 28%; right: -20%;
    background: url(assets/scenes/cloud-a.webp) center/contain no-repeat;
    opacity: .6;
  }
}

/* Stable section geometry keeps image decoding and mobile browser chrome from moving snap points. */
html { scroll-behavior: auto; overflow-anchor: none; }
.screen { min-height: 100svh; isolation: isolate; }
.scene-art, .hero-architecture, .hero-cloud, .cloud-bank, .footer-cloud { height: auto; }
.cloud-transition { height: 20svh; z-index: 0; }
.cloud-bank { width: 120vw; max-height: 48svh; filter: drop-shadow(0 12px 32px #7f9bc83b); }
#story {
  background:
    radial-gradient(ellipse 62% 6% at 0 0, #f5ece1 0, transparent 76%),
    radial-gradient(ellipse 88% 12% at 110% 16%, #ecf3fc 0, transparent 74%),
    radial-gradient(ellipse 94% 15% at -15% 57%, #f1eafa 0, transparent 73%),
    linear-gradient(#9dc7f3, #bad7f6 36%, #a8ccf1 72%, #adb6cf 93%, #607491);
}
.hero-stage { width: min(116%, 1500px, 110svh); }
.hero-cloud { opacity: .5; top: -23%; left: -24%; width: 77%; }
.hero::after, .chapter::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: min(78vw, 1040px); height: 53%; right: -16%; bottom: 1%;
  background: url(assets/scenes/cloud-a.webp) center bottom/contain no-repeat;
  opacity: .63;
}
.hero::after { bottom: 15%; right: -20%; }
.chapter:nth-of-type(even)::before { right: auto; left: -19%; transform: scaleX(-1); }
.chapter .scene-art { width: 112%; max-width: none; max-height: 66svh; }
#timeline .scene-art { width: min(100%, 1100px); max-height: 54svh; }
#portfolio .lead-projects { padding: 1rem 0 2rem; }
#portfolio .lead-projects > *::after {
  content: ""; display: block; border-radius: 50%; margin-top: .4rem; height: clamp(10px, 2.5vw, 32px);
  background: linear-gradient(110deg, #c99c64, #fff3df 32%, #e2c9a6 76%, #a87943);
  box-shadow: 0 8px 13px #55708b36;
}

header {
  --nav-ink: #141b24; --nav-surface: #eff6fe;
  color: var(--nav-ink);
  background: linear-gradient(#f6faffdc, #eef6feb3 65%, transparent);
}
header[data-dark-surface] {
  --nav-ink: #fff9f0; --nav-surface: #182637;
  background: linear-gradient(#162333f5, #172637cb 65%, transparent);
}
header #main-nav a:last-child { background: var(--nav-ink); color: var(--nav-surface); }
#language-picker { position: relative; margin: 0; }
#language-trigger, #menu {
  min-height: 40px; border: 1px solid currentColor; color: inherit; background: transparent;
  padding: .35rem .68rem; border-radius: 99px; font-size: .84rem;
}
#language-trigger::-webkit-details-marker { display: none; }
#language-picker[open] > summary { margin: 0; }
#languages {
  position: absolute; top: calc(100% + .45rem); right: 0; min-width: 9rem;
  display: grid; gap: .2rem; padding: .4rem; background: var(--nav-surface);
  border: 1px solid currentColor; border-radius: .65rem;
}
#languages a { padding: .45rem .6rem; }
#languages [aria-current] { background: #9cb9d74f; }
@media (max-width: 850px) {
  #menu { display: grid; place-items: center; width: 44px; padding: 0; }
  #menu span, #menu span::before, #menu span::after {
    display: block; width: 18px; height: 2px; border-radius: 1px; background: currentColor;
  }
  #menu span { position: relative; }
  #menu span::before, #menu span::after { content: ""; position: absolute; left: 0; }
  #menu span::before { top: -6px; }
  #menu span::after { top: 6px; }
  #menu[aria-expanded="true"] span { background: transparent; }
  #menu[aria-expanded="true"] span::before { top: 0; rotate: 45deg; }
  #menu[aria-expanded="true"] span::after { top: 0; rotate: -45deg; }
  header #main-nav {
    display: none; position: absolute; top: 100%; inset-inline: 12px;
    background: var(--nav-surface); padding: 14px 20px; border-radius: .8rem;
  }
  #menu[aria-expanded="true"] + #main-nav { display: grid; }
  header #main-nav a { min-height: 44px; display: flex; align-items: center; }
}
@media (max-width: 760px) {
  .screen { padding-bottom: clamp(23px, 5svh, 48px); }
  .hero-stage { width: min(130%, 940px); align-self: center; }
  .hero-cloud { width: 115%; top: -11%; left: -36%; }
  .hero::after { right: -25%; bottom: 4%; width: 110%; opacity: .85; }
  .chapter { align-content: space-evenly; }
  .chapter .scene-art { justify-self: center; width: 112%; max-height: 42svh; }
  .chapter::before { width: 128%; right: -44%; bottom: 2%; }
  .chapter:nth-of-type(even)::before { left: -44%; }
  #timeline .scene-art { width: 110%; max-height: 42svh; }
  .cloud-bank { width: 151vw; left: -19%; min-height: 20svh; object-fit: cover; }
}

/* Keep the interactive project previews in front of the adjacent cloud bank. */
.hero { z-index: 1; }
.hero + .cloud-transition { margin-top: -2svh; height: 22svh; }

