:root {
  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 0; background: var(--paper); }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--pink); color: var(--navy); }
.skip-link { position: fixed; z-index: 100; top: -5rem; left: 1rem; padding: .8rem 1rem; background: white; color: var(--navy); }
.skip-link:focus { top: 1rem; }
.site-shell { overflow: clip; }

.story-hero { position: relative; height: 300svh; }
.hero-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.hero-sheet { position: absolute; inset: 0; overflow: hidden; color: white; background: var(--navy); }
.hero-grid { position: absolute; inset: 0; opacity: .14; background-image: linear-gradient(90deg, transparent calc(25% - 1px), rgba(255,255,255,.2) 25%, transparent calc(25% + 1px)), linear-gradient(90deg, transparent calc(75% - 1px), rgba(255,255,255,.2) 75%, transparent calc(75% + 1px)); pointer-events: none; }
.under-page { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 8vw, 9rem); color: var(--ink); background: var(--paper); opacity: var(--under-opacity, 0); pointer-events: none; }
.under-page__eyebrow, .eyebrow { margin: 0 0 2rem; font-size: .88rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.under-page__title { margin: 0; font-size: clamp(5rem, 11vw, 12rem); line-height: .98; font-weight: 800; letter-spacing: -.08em; }
.under-page__line { width: min(16vw, 10rem); height: 5px; margin-top: 3rem; background: var(--pink); }

.hero-header { position: absolute; z-index: 15; top: 0; right: 0; display: flex; justify-content: flex-end; padding: clamp(1.2rem, 2.6vw, 2.8rem) clamp(1.2rem, 3.2vw, 4rem); opacity: var(--hero-ui-opacity, 1); }
.header-index { color: white; font-size: .84rem; font-weight: 650; letter-spacing: .16em; text-decoration: none; }
.header-index span { margin-left: .6rem; color: var(--pink); font-size: 1.2rem; }
.story-hero[data-loading="true"] .header-index { opacity: 0; }
.loading-counter { position: absolute; z-index: 20; top: clamp(1rem, 2vw, 2rem); right: clamp(1.2rem, 3.2vw, 4rem); display: flex; align-items: baseline; gap: .15em; margin: 0; color: var(--pink); font-size: clamp(2rem, 3.4vw, 3.5rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.07em; opacity: 1; transition: opacity 200ms var(--ease-out); }
.loading-counter__unit { font-size: .38em; letter-spacing: 0; }
.story-hero[data-loading="false"] .loading-counter { opacity: 0; }

.hero-title { position: absolute; z-index: 6; top: clamp(2.6rem, 4.5svh, 5rem); left: clamp(1.25rem, 3.4vw, 5rem); right: 1rem; margin: 0; color: var(--pink); font-size: clamp(3.5rem, 7vw, 8rem); font-weight: 800; line-height: 1.08; letter-spacing: -.07em; white-space: nowrap; opacity: 0; transform: translateY(24px) scale(.96); transform-origin: left center; pointer-events: none; }
.hero-title span { letter-spacing: -.08em; }
.story-hero[data-title-visible="true"] .hero-title { opacity: var(--title-opacity, 1); transform: translateY(0) scale(1); transition: opacity 400ms var(--ease-out), transform 650ms var(--ease-out); }

.portrait-rig { position: absolute; z-index: 5; left: 50%; bottom: -33svh; height: min(115svh, 1040px); aspect-ratio: 1159 / 1358; width: auto; opacity: var(--portrait-opacity, 1); transform: translate3d(-50%, var(--portrait-rise, 0px), 0) rotate(var(--portrait-tilt, 0deg)); transform-origin: 52% 26%; will-change: transform, opacity; }
.portrait-layer, .portrait-complete, .portrait-curl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.portrait-layer { object-fit: contain; }
.portrait-layer--torn { z-index: 1; clip-path: inset(0 100% 0 0); }
.portrait-layer--lower { z-index: 2; clip-path: inset(30.7% 0 0 0); }
.portrait-complete { z-index: 4; clip-path: inset(0 0 68.5% 0); }
.portrait-complete img { width: 100%; height: 100%; object-fit: contain; }
.portrait-layer--face-lock { z-index: 5; -webkit-mask-image: radial-gradient(ellipse 27% 25% at 50% 55%, #000 78%, transparent 100%); mask-image: radial-gradient(ellipse 27% 25% at 50% 55%, #000 78%, transparent 100%); }
.portrait-layer--gaze { z-index: 6; opacity: 0; -webkit-mask-image: radial-gradient(ellipse 9% 5.5% at 38% 42%, #000 77%, transparent 85%), radial-gradient(ellipse 9% 5.5% at 58% 42%, #000 77%, transparent 85%); mask-image: radial-gradient(ellipse 9% 5.5% at 38% 42%, #000 77%, transparent 85%), radial-gradient(ellipse 9% 5.5% at 58% 42%, #000 77%, transparent 85%); }
.portrait-layer--surprise { z-index: 7; opacity: 0; -webkit-mask-image: radial-gradient(ellipse 13% 8% at 38% 42%, #000 78%, transparent 84%), radial-gradient(ellipse 13% 8% at 58% 42%, #000 78%, transparent 84%), radial-gradient(ellipse 17% 9% at 49% 61.5%, #000 78%, transparent 84%); mask-image: radial-gradient(ellipse 13% 8% at 38% 42%, #000 78%, transparent 84%), radial-gradient(ellipse 13% 8% at 58% 42%, #000 78%, transparent 84%), radial-gradient(ellipse 17% 9% at 49% 61.5%, #000 78%, transparent 84%); }
.portrait-curl { z-index: 8; background: linear-gradient(120deg, #fff 12%, #f7f7f5 48%, #d8dce0 100%); clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); filter: drop-shadow(-12px -7px 9px rgba(11, 16, 31, .18)); }

.icon-tray { position: absolute; z-index: 3; top: 1%; left: 10%; width: 80%; height: 39%; clip-path: inset(0 100% 0 0); opacity: 0; transform: translateY(9%); transition: opacity 450ms var(--ease-out), transform 750ms var(--ease-out); pointer-events: none; }
.story-hero[data-tearing="true"] .icon-tray, .story-hero[data-open="true"] .icon-tray { opacity: 1; transform: translateY(0); }
.icon-link { position: absolute; display: flex; flex-direction: column; align-items: center; color: white; text-decoration: none; font-size: clamp(.75rem, 1vw, .95rem); font-weight: 700; letter-spacing: .03em; pointer-events: none; }
.story-hero[data-open="true"] .icon-link { pointer-events: auto; }
.icon-link--about { z-index: 4; left: -2%; top: 25%; width: 29%; }
.icon-link--campus { z-index: 3; left: 23%; top: 1%; width: 30%; }
.icon-link--internship { z-index: 6; left: 47%; top: 27%; width: 33%; }
.icon-link--projects { z-index: 2; left: 75%; top: 20%; width: 25%; }
.icon-link img { width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 .45rem .35rem rgba(6, 9, 24, .24)); transform-origin: 50% 75%; }
.icon-link span { position: relative; z-index: 7; margin-top: -.1rem; padding: .3rem .65rem; border-radius: 1rem; background: rgba(25, 33, 54, .9); white-space: nowrap; }
.icon-link:focus-visible { outline: 2px solid white; outline-offset: 4px; border-radius: 1rem; }
.icon-decor { position: absolute; height: auto; pointer-events: none; }
.icon-decor--star { z-index: 5; left: 8%; top: 0; width: 16%; transform: rotate(-12deg); }
.icon-decor--orb { z-index: 5; left: 74%; top: 69%; width: 11%; }
@media (hover: hover) and (pointer: fine) { .icon-link:hover img { filter: drop-shadow(0 .75rem .8rem rgba(5, 8, 19, .42)); } .icon-link:hover span { background: var(--pink); color: var(--navy); } }

.hero-hint { position: absolute; z-index: 12; left: clamp(1.2rem, 3.3vw, 4rem); bottom: clamp(1.3rem, 3vw, 2.7rem); display: flex; align-items: center; gap: .65rem; margin: 0; color: rgba(255,255,255,.8); font-size: .84rem; letter-spacing: .13em; opacity: var(--hero-ui-opacity, 1); }
.hero-hint__line { width: 2rem; height: 1px; background: rgba(255,255,255,.7); }
.hero-hint__arrow { font-size: 1.1rem; }
.hero-counter { position: absolute; z-index: 12; right: clamp(1.2rem, 3.3vw, 4rem); bottom: clamp(1.3rem, 3vw, 2.7rem); margin: 0; color: rgba(255,255,255,.72); font-size: .8rem; letter-spacing: .15em; opacity: var(--hero-ui-opacity, 1); }

.chapters { position: relative; z-index: 2; color: var(--ink); background: var(--paper); }
.chapters-intro { min-height: 72svh; padding: clamp(5rem, 11vw, 12rem) clamp(1.5rem, 8vw, 9rem) 6rem; }
.chapters-intro h2 { margin: 0; font-size: clamp(4rem, 9vw, 10rem); line-height: 1.05; font-weight: 800; letter-spacing: -.08em; }
.chapters-intro h2 em { color: #bf6278; font-style: normal; }
.chapters-intro__note { margin: 2.6rem 0 0; max-width: 28rem; font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.7; }
.chapter { display: grid; grid-template-columns: 15% minmax(0, 1fr) minmax(10rem, 24%); align-items: center; min-height: 27rem; padding: 2rem clamp(1.5rem, 8vw, 9rem); border-top: 1px solid rgba(32,40,64,.2); scroll-margin-top: 2rem; }
.chapter__number { align-self: start; margin-top: 2rem; font-size: .84rem; font-weight: 750; letter-spacing: .12em; }
.chapter__body h2 { margin: 0; font-size: clamp(3.6rem, 7vw, 8rem); line-height: 1; letter-spacing: -.08em; }
.chapter__en { display: block; margin-top: .5rem; color: #b56579; font-size: clamp(1.25rem, 2vw, 2rem); font-weight: 650; letter-spacing: -.05em; }
.chapter__body p { max-width: 31rem; margin: 2rem 0 0; color: #464b59; font-size: clamp(1rem, 1.4vw, 1.16rem); line-height: 1.8; }
.chapter img { justify-self: center; width: min(100%, 19rem); height: auto; object-fit: contain; filter: drop-shadow(0 1.4rem 1.5rem rgba(32,40,64,.12)); }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 3rem clamp(1.5rem, 8vw, 9rem); color: white; background: var(--navy); }
.site-footer a { font-size: 1.4rem; font-weight: 750; text-decoration: none; }
.site-footer span { font-size: .76rem; letter-spacing: .13em; }

@media (max-width: 750px) {
  .hero-title { top: 9svh; left: 1rem; font-size: clamp(2.65rem, 10.2vw, 5rem); letter-spacing: -.065em; }
  .portrait-rig { height: auto; width: min(128vw, 640px); bottom: -5svh; }
  .icon-tray { top: 2%; left: 13%; width: 74%; }
  .icon-link--campus { top: 7%; }
  .icon-decor--star { top: 17%; }
  .icon-link { font-size: .7rem; }
  .icon-link span { padding: .25rem .45rem; margin-top: -.35rem; }
  .under-page__title { font-size: clamp(4rem, 16vw, 7rem); }
  .chapters-intro { min-height: 58svh; padding-top: 7rem; }
  .chapter { grid-template-columns: 1fr 7rem; gap: .5rem; min-height: 23rem; }
  .chapter__number { grid-column: 1 / -1; margin: 0; }
  .chapter__body h2 { font-size: clamp(3.2rem, 12vw, 5rem); }
  .chapter__body p { margin-top: 1.2rem; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 390px) {
  .hero-title { font-size: 9.8vw; }
  .portrait-rig { width: 134vw; }
  .icon-link span { font-size: .62rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .story-hero { height: 140svh; }
  .hero-title { opacity: 1; transform: none; }
  .portrait-rig { transform: translateX(-50%) !important; }
  .icon-tray { transition: opacity 200ms var(--ease-out); transform: none; }
  .icon-link img { animation: none !important; transform: none !important; }
}
