/* Mani Rahnama · First-Year Residence Representative
   Mobile-first. Colours and fonts live in :root — change them in one place.
   Without JavaScript (or with "reduce motion" on) this is a clean static page;
   the .motion rules near the bottom switch on the pinned, scroll-driven version. */

:root {
  --navy: #0b1731;
  --blue: #1f5bd9;
  --blue-soft: #9dbcff;
  --mist: #eef2f8;
  --deep: #173a7a;    /* deep blue panel */
  --gold: #d7ae28;
  --ink: #0b1731;
  --muted: #5a6680;
  --line: rgba(11, 23, 49, 0.14);

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --vh: 1vh;
  --gutter: 20px;
  color-scheme: light;
}
@supports (height: 1svh) { :root { --vh: 1svh; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: #fff; -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; font: 400 17px/1.5 var(--sans); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
main { overflow-x: clip; } /* pieces fly in from off-screen; never let them widen the page on phones */
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
em { font-style: italic; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
::selection { background: var(--blue); color: #fff; }

/* condensed poster capitals */
.hero__mark, .hero__name, .party__row, .bar-step__word, .strike__new {
  font-family: var(--sans); font-stretch: 62%; font-weight: 850; text-transform: uppercase; line-height: 0.86; letter-spacing: -0.005em;
}

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--navy); color: #fff; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.label { margin-bottom: 1.4rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.7; }
.title { max-width: 11ch; margin-bottom: 1.3rem; font: 400 clamp(3rem, 13.5vw, 8.2rem)/0.95 var(--serif); letter-spacing: -0.02em; }
.lead { max-width: 36ch; font-size: clamp(1.08rem, 4.4vw, 1.4rem); line-height: 1.45; opacity: 0.88; }
.note { max-width: 46ch; margin-top: 1.8rem; font-size: 0.98rem; line-height: 1.55; opacity: 0.75; }

/* masked words (built by main.js) */
.m { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.04em 0.12em; margin: 0 -0.04em -0.12em; }
.mi { display: inline-block; }

/* ---------- floating bar ---------- */
.bar {
  position: fixed; z-index: 50; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top));
  max-width: 640px; margin: 0 auto; height: 46px; padding: 0 8px 0 18px; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 1px 0 rgba(11, 23, 49, 0.06), 0 8px 24px rgba(11, 23, 49, 0.08);
  transform: translateY(calc(-100% - 24px)); opacity: 0;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s;
}
.bar.is-on { transform: none; opacity: 1; }
.bar__name { font-weight: 800; font-size: 15px; font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.02em; text-decoration: none; }
.bar__where { font: italic 400 17px/1 var(--serif); color: var(--blue); white-space: nowrap; padding: 0 10px; }
.bar__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--blue); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- hero ---------- */
.hero {
  --name-fs: clamp(3rem, 15vw, 10rem);
  --d: min(84vw, calc(var(--vh) * 54));                                    /* photo circle diameter */
  --nb: calc(var(--name-fs) * 0.86 + 3.4rem);                              /* name + role under the photo */
  --lift: max(0px, calc((var(--vh) * 100 - var(--d) - var(--nb)) * 0.42 - var(--vh) * 6)); /* centres the group on tall phones */
  --pb: calc(var(--vh) * 6 + var(--lift) + var(--nb));
  --mark-fs: min(28vw, calc(var(--vh) * 30));
  position: relative; background: var(--mist);
}
.hero__stage { position: relative; height: calc(var(--vh) * 100); min-height: 560px; overflow: hidden; }
.hero__eyebrow { position: absolute; left: 0; right: 0; top: calc(22px + env(safe-area-inset-top)); text-align: center; font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.hero__mark {
  position: absolute; left: 0; right: 0; bottom: calc(var(--pb) + var(--d) * 0.8 - var(--mark-fs) * 0.86); /* centred on the circle's upper part */
  display: flex; flex-direction: column; align-items: center;
  font-size: var(--mark-fs); color: rgba(11, 23, 49, 0.065);
  white-space: nowrap; user-select: none; pointer-events: none;
}
.hero__photo { position: absolute; left: 0; right: 0; bottom: var(--pb); display: flex; justify-content: center; transform-origin: 50% 100%; pointer-events: none; }
.hero__photo img { width: var(--d); height: var(--d); max-width: none; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 24px 60px rgba(11, 23, 49, 0.18); }
.hero__id { position: absolute; left: 0; right: 0; bottom: calc(var(--vh) * 6 + var(--lift) + env(safe-area-inset-bottom)); padding: 0 var(--gutter); text-align: center; }
.hero__name { font-size: var(--name-fs); white-space: nowrap; }
.hero__role { margin-top: 0.5rem; font: italic 400 clamp(1.15rem, 5vw, 1.7rem)/1.2 var(--serif); color: var(--blue); }
.hero__msgs { display: none; }
.hero__cue { position: absolute; left: 50%; bottom: calc(var(--vh) * 1.8 + env(safe-area-inset-bottom)); width: 2px; height: 24px; margin-left: -1px; overflow: hidden; background: rgba(11, 23, 49, 0.12); }
.hero__cue i { display: block; width: 100%; height: 50%; background: var(--navy); animation: cue 1.8s cubic-bezier(0.6, 0, 0.4, 1) infinite; }
@keyframes cue { from { transform: translateY(-100%); } to { transform: translateY(200%); } }

/* ---------- about → focus ---------- */
.about { background: #fff; }
.about__stage { position: relative; max-width: 1120px; margin: 0 auto; padding: 16vh var(--gutter); display: grid; gap: 4rem; }
.about__text, .focus { position: relative; z-index: 1; }
.about__text { max-width: 20ch; margin: 0 auto; text-align: center; font: 400 clamp(2.3rem, 9.8vw, 4.6rem)/1.08 var(--serif); letter-spacing: -0.015em; }
.about__text .key { color: var(--blue); }

.focus__title { margin-bottom: 0.7rem; font: italic 400 clamp(1.3rem, 5.2vw, 2rem)/1.1 var(--serif); color: var(--blue); }
.focus__list { border-top: 1px solid var(--navy); }
.focus__list a { display: block; overflow: hidden; padding: 0.9rem 0 1rem; border-bottom: 1px solid var(--navy); text-decoration: none; }
.focus__word { display: block; font: 400 clamp(2.7rem, 11.5vw, 7rem)/1 var(--serif); letter-spacing: -0.02em; white-space: nowrap; transition: color 0.25s; }
.focus__cap { display: block; margin-top: 0.4rem; font-size: clamp(0.95rem, 3.9vw, 1.15rem); font-weight: 500; color: var(--muted); }
.focus__list a:hover .focus__word { color: var(--blue); }

/* ---------- 01 · events ---------- */
.events { position: relative; padding: calc(var(--vh) * 16) 0 calc(var(--vh) * 14); color: #fff; background: var(--navy); transform-origin: 50% 0; overflow: hidden; overflow: clip; }
.party { position: relative; height: min(130vw, calc(var(--vh) * 86)); margin: calc(var(--vh) * 7) 0 calc(var(--vh) * 5); overflow: hidden; }
.party__row { position: absolute; left: 0; font-size: clamp(4.6rem, 25vw, 15rem); white-space: nowrap; color: #fff; }
.party__row:nth-child(1) { top: 6%; }
.party__row:nth-child(2) { top: 37%; color: var(--blue); }
.party__row:nth-child(3) { top: 68%; }
.party__row span { display: inline-block; }
.party__photo { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 94%; width: auto; max-width: none; margin: 0 auto; -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%); mask-image: linear-gradient(to bottom, #000 80%, transparent 100%); }
.say { max-width: 22ch; font: italic 400 clamp(1.6rem, 6.6vw, 3rem)/1.1 var(--serif); opacity: 0.9; }

/* ---------- 02 · problems ---------- */
.problems { padding: calc(var(--vh) * 16) 0 calc(var(--vh) * 12); background: #fff; }
.small-head { margin: 3.2rem 0 0.8rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.concerns { display: flex; flex-wrap: wrap; gap: 0.2em 0.5em; margin-top: 1.6rem; max-width: 34ch; font: italic 400 clamp(1.35rem, 5.4vw, 2.2rem)/1.2 var(--serif); color: var(--muted); }
.concerns li:not(:last-child)::after { content: "\00a0\00a0·"; }

.bars { display: grid; gap: 10px; margin: calc(var(--vh) * 10) 0 calc(var(--vh) * 8); }
.bar-step { position: relative; width: 94%; padding: calc(var(--vh) * 4) var(--gutter) calc(var(--vh) * 3.6); color: #fff; border-radius: 0 22px 22px 0; overflow: hidden; }
.bar-step--r { margin-left: auto; text-align: right; border-radius: 22px 0 0 22px; }
.bar-step--navy { background: var(--navy); }
.bar-step--blue { background: var(--blue); }
.bar-step--deep { background: var(--deep); }
.bar-step--ink { background: #13244a; }
.bar-step__n { display: block; margin-bottom: 0.6rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em; opacity: 0.65; }
.bar-step__word { display: block; font-size: clamp(3rem, 13.4vw, 10rem); white-space: nowrap; }
.bar-step__line { display: block; max-width: 30ch; margin-top: 0.8rem; font-size: clamp(1.02rem, 4.3vw, 1.35rem); line-height: 1.35; opacity: 0.92; }
.bar-step--r .bar-step__line { margin-left: auto; }

/* ---------- 03 · change ---------- */
.change { padding: calc(var(--vh) * 16) 0; color: #fff; background: var(--deep); transform-origin: 50% 0; overflow: hidden; overflow: clip; }
.change .label { color: var(--gold); opacity: 1; }
.strike { margin-bottom: 2.6rem; }
.strike__old { position: relative; display: inline-block; font: 400 clamp(2.6rem, 11.5vw, 6.6rem)/1 var(--serif); opacity: 0.7; }
.strike__line { position: absolute; left: -3%; right: -3%; top: 54%; height: 0.07em; background: var(--gold); transform-origin: 0 50%; }
.strike__new { display: block; margin-top: 0.12em; font-size: clamp(3.6rem, 17vw, 12rem); }
.hike { overflow: hidden; aspect-ratio: 3 / 4; border-radius: 16px; background: #10295a; }
.hike img { width: 100%; height: 100%; object-fit: cover; }
.quote { margin-top: 3rem; }
.quote p { font: 400 clamp(1.9rem, 7.8vw, 3.6rem)/1.12 var(--serif); }
.quote__soft { opacity: 0.6; }

/* ---------- residences ---------- */
.res { background: #fff; }
.res__stage { max-width: 1180px; margin: 0 auto; padding: calc(var(--vh) * 12) var(--gutter); text-align: center; }
.res__title { margin-bottom: 2rem; font: 400 clamp(3.6rem, 17vw, 9rem)/0.92 var(--serif); letter-spacing: -0.025em; }
.res__title em { color: var(--blue); }
.res__title span { display: block; }
.res__deck { display: grid; gap: 14px; }
.res__card { position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 18px; background: var(--mist); box-shadow: 0 18px 44px rgba(11, 23, 49, 0.2); }
.res__card img { width: 100%; height: 100%; object-fit: cover; }
.res__card figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 20px 14px; color: #fff; font: 400 clamp(1.8rem, 7.5vw, 2.6rem)/1 var(--serif); letter-spacing: -0.01em; text-align: left; background: linear-gradient(transparent, rgba(11, 23, 49, 0.82)); }
.res__names { display: none; }
.res__line { max-width: 18ch; margin: 2rem auto 0; font-size: clamp(1.6rem, 7vw, 3rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.025em; color: var(--ink); }

/* ---------- sign-off ---------- */
.sign { position: relative; color: #fff; }
.sign__stage { position: relative; overflow: hidden; display: grid; place-items: center; align-content: center; gap: 2.4rem; min-height: calc(var(--vh) * 100); padding: calc(var(--vh) * 12) var(--gutter) calc(var(--vh) * 8 + env(safe-area-inset-bottom)); }
.sign__bg { position: absolute; inset: 0; background: var(--navy); }
.sign__content { position: relative; z-index: 1; text-align: center; }
.sign__quote p { font: 400 clamp(3.2rem, 14.5vw, 8.6rem)/0.98 var(--serif); letter-spacing: -0.015em; }
.sign__swoosh { display: block; width: min(76vw, 540px); height: 30px; margin: 0.4rem auto 2.2rem; overflow: visible; }
.sign__swoosh path { fill: none; stroke: var(--blue-soft); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; }
.sign__who { display: inline-flex; align-items: center; gap: 14px; text-align: left; }
.sign__avatar { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; }
.sign__name { display: block; font-size: 1.3rem; font-weight: 700; }
.sign__role { display: block; margin-top: 2px; font: italic 400 1.1rem/1.2 var(--serif); color: var(--blue-soft); }
.foot { padding: 26px var(--gutter) calc(30px + env(safe-area-inset-bottom)); text-align: center; background: var(--navy); border-top: 1px solid rgba(255, 255, 255, 0.1); }
.totop { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.3rem; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; color: #fff; font-size: 0.95rem; font-weight: 600; text-decoration: none; transition: background-color 0.25s, color 0.25s; }
.totop:hover { background: #fff; color: var(--navy); }
.sign__school { position: relative; z-index: 1; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }

/* =========================================================
   MOTION LAYOUT — only when the scroll animations run
   (no CSS translate on anything GSAP animates: GSAP owns those transforms)
   ========================================================= */
.motion .hero { height: calc(var(--vh) * 380); }
.motion .hero__stage { position: sticky; top: 0; }
.motion .hero__msgs { display: block; position: absolute; left: var(--gutter); right: var(--gutter); top: calc(var(--vh) * 15); text-align: center; }
.motion .hero__msg { position: absolute; left: 0; right: 0; top: 0; font: 400 clamp(2.5rem, min(11vw, calc(var(--vh) * 7.5)), 5.6rem)/1 var(--serif); letter-spacing: -0.015em; opacity: 0; visibility: hidden; }
.motion .hero__eyebrow, .motion .hero__cue { animation: fade-in 1s 0.9s backwards; }
@keyframes fade-in { from { opacity: 0; } }

.motion .about { height: calc(var(--vh) * 300); }
.motion .about__stage { position: sticky; top: 0; height: calc(var(--vh) * 100); min-height: 560px; padding: 0 var(--gutter); display: grid; place-items: center; }
.motion .focus { position: absolute; left: var(--gutter); right: var(--gutter); top: 50%; translate: 0 -50%; max-width: 1080px; margin: 0 auto; }
.motion .about__text .key { color: inherit; }

.motion .res { height: calc(var(--vh) * 360); }
.motion .res__stage { position: sticky; top: 0; height: calc(var(--vh) * 100); min-height: 560px; max-width: none; overflow: hidden; display: flex; flex-direction: column; padding: calc(64px + var(--vh) * 2) var(--gutter) calc(var(--vh) * 4); }
.motion .res__title { margin-bottom: 0; font-size: clamp(3.2rem, 15vw, 7.5rem); }
.motion .res__deck { --cw: min(80vw, 440px, calc(var(--vh) * 40)); --ch: calc(var(--cw) * 1.2); position: relative; flex: 1; display: block; }
.motion .res__card { position: absolute; left: 50%; top: 50%; width: var(--cw); height: var(--ch); aspect-ratio: auto; margin: calc(var(--ch) / -2) 0 0 calc(var(--cw) / -2); }
.motion .res__card:nth-child(1) { z-index: 3; }
.motion .res__card:nth-child(2) { z-index: 2; }
.motion .res__card:nth-child(3) { z-index: 1; }
.motion .res__card figcaption { text-align: center; }
.motion .res__names { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: absolute; left: 50%; width: min(100%, 1000px); translate: -50% 0; font: 400 clamp(1.1rem, 4.6vw, 1.7rem)/1.1 var(--serif); visibility: hidden; opacity: 0; }
.motion .res__line { margin-top: 0; }

.motion .sign { height: calc(var(--vh) * 240); }
.motion .sign__stage { position: sticky; top: 0; height: calc(var(--vh) * 100); min-height: 560px; }

/* hide hero pieces until the intro plays; safety net reveals them if scripts never run */
.js:not(.go) .hero__photo img, .js:not(.go) .hero__mark span, .js:not(.go) .hero__id > * { opacity: 0; animation: reveal 0s 2.5s forwards; }
@keyframes reveal { to { opacity: 1; } }

/* ---------- larger screens ---------- */
@media (min-width: 900px) {
  :root { --gutter: 56px; }
  .bar { top: 16px; }
  .hero { --name-fs: clamp(3.4rem, 11vw, 10rem); }
  .res__title span { display: inline; }
  .motion .res__title { font-size: clamp(3.4rem, 8vw, 7rem); }
  .res__deck { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .res__card { aspect-ratio: 4 / 5; }
  .party { height: calc(var(--vh) * 92); }
  .bar-step { width: 86%; }
  .change__grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6vw; align-items: end; }
  .quote { margin-top: 0; }
  .sign__avatar { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__cue i { animation: none; }
  .bar { transition: none; }
}
