/* ============================================================================
   CIIS public website — motion (2026-10-02). With js/ciis-motion.js.
   Everything here is switched on by the class .js-motion that layout.php puts on
   <html>, so without JavaScript every word and picture simply shows. Visitors who
   ask their device to reduce motion (.calm) get the still page.
   ========================================================================= */

:root { --spring: cubic-bezier(.16, 1, .3, 1); --hero-delay: 1.75s; }
.no-intro { --hero-delay: .15s; }

/* smooth fades between pages (Chrome, Edge, Safari 18.2+) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

/* ── Opening: the CIIS mark, then the page ───────────────────────────── */
.intro { display: none; }
.js-motion:not(.no-intro) .intro {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #FFFFFF; cursor: pointer;
  animation: intro-lift .8s var(--spring) 1.25s forwards;
}
.intro img { width: min(56vw, 360px); height: auto; opacity: 0; transform: scale(.72); filter: blur(14px);
  animation: intro-mark 1s var(--spring) .1s forwards; }
.intro p { margin: 6px 0 0; font-size: clamp(18px, 3vw, 26px); font-weight: 700; color: var(--ink); opacity: 0; transform: translateY(12px);
  animation: intro-text .7s var(--spring) .55s forwards; }
.intro small { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); opacity: 0;
  animation: intro-text .7s var(--spring) .7s forwards; }
.intro.skip { animation: intro-lift .45s var(--spring) forwards !important; }
@keyframes intro-mark { to { opacity: 1; transform: none; filter: none; } }
@keyframes intro-text { to { opacity: 1; transform: none; } }
@keyframes intro-lift { to { clip-path: inset(0 0 100% 0); visibility: hidden; } }
.js-motion:not(.no-intro) .intro { clip-path: inset(0 0 0 0); }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.is-home .nav { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; transition: background .3s ease, border-color .3s ease; }
.is-home .nav.is-scrolled { background: rgba(255, 255, 255, .86); border-bottom-color: var(--line); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.nav.is-scrolled { box-shadow: 0 1px 0 rgba(23, 23, 23, .02); }

.hero2 { position: relative; min-height: calc(100svh - var(--nav-h)); display: flex; align-items: center; padding: 40px 0 96px; margin-top: calc(var(--nav-h) * -1); padding-top: calc(var(--nav-h) + 40px); overflow: hidden; text-align: center; isolation: isolate; }
.hero2-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.mark-stage { perspective: 900px; margin-bottom: clamp(18px, 3vw, 30px); }
.hero-mark { display: block; width: clamp(220px, 34vw, 460px); height: auto; transform-style: preserve-3d; will-change: transform;
  filter: drop-shadow(0 22px 40px rgba(212, 20, 110, .16)); }
.hero-kh { margin: 0 0 6px; font-size: clamp(20px, 2.6vw, 30px); font-weight: 700; letter-spacing: 0; color: var(--ink); }
.hero-name { font-size: clamp(38px, 6.4vw, 88px); line-height: 1.02; letter-spacing: -.045em; margin: 0 0 22px; }
.hero-tag { max-width: 620px; margin: 0 auto 30px; }
.hero2 .hero-actions { margin-bottom: 0; }
.line { display: block; overflow: hidden; padding-bottom: .06em; }
.line > span { display: inline-block; }

.js-motion .hero-mark { opacity: 0; transform: translateY(24px) scale(.9); }
.js-motion .line > span { transform: translateY(105%); }
.js-motion .hero-step { opacity: 0; transform: translateY(18px); }
.js-motion .hero2.is-in .hero-mark { animation: rise 1.1s var(--spring) var(--hero-delay) forwards, float 7s ease-in-out calc(var(--hero-delay) + 1.1s) infinite; }
.js-motion .hero2.is-in .line > span { animation: line-up 1s var(--spring) forwards; }
.js-motion .hero2.is-in .hero-kh .line > span { animation-delay: calc(var(--hero-delay) + .15s); }
.js-motion .hero2.is-in .hero-name .line:nth-child(1) > span { animation-delay: calc(var(--hero-delay) + .25s); }
.js-motion .hero2.is-in .hero-name .line:nth-child(2) > span { animation-delay: calc(var(--hero-delay) + .35s); }
.js-motion .hero2.is-in .hero-tag { animation: fade-up .9s var(--spring) calc(var(--hero-delay) + .5s) forwards; }
.js-motion .hero2.is-in .hero-actions { animation: fade-up .9s var(--spring) calc(var(--hero-delay) + .62s) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes line-up { to { transform: none; } }
@keyframes fade-up { to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* soft pink light drifting behind the mark */
.aurora { position: absolute; inset: -10% -10% auto; height: 120%; z-index: 0; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.aurora span:nth-child(1) { width: 46vw; height: 46vw; left: 6%; top: 8%; background: rgba(212, 20, 110, .20); animation: drift1 18s ease-in-out infinite alternate; }
.aurora span:nth-child(2) { width: 38vw; height: 38vw; right: 4%; top: 20%; background: rgba(212, 20, 110, .14); animation: drift2 22s ease-in-out infinite alternate; }
.aurora span:nth-child(3) { width: 30vw; height: 30vw; left: 38%; top: 46%; background: rgba(212, 20, 110, .10); animation: drift3 26s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(12vw, 6vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vw, 10vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-8vw, -8vh) scale(1.2); } }

.scroll-cue { position: absolute; left: 50%; bottom: 26px; z-index: 1; width: 26px; height: 42px; margin-left: -13px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgba(23, 23, 23, .35); }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--ink); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ── Photos that grow to full size as the page scrolls ───────────────── */
.showcase { padding: 0 0 24px; }
.showcase-frame { --p: 1; max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.showcase .slides { max-width: none; aspect-ratio: 16 / 8; border-radius: calc(44px - 22px * var(--p)); transform: scale(calc(.86 + .14 * var(--p))); transform-origin: 50% 0; will-change: transform; }
.js-motion .showcase-frame { --p: 0; }
.slides img.on { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.08); } to { transform: scale(1); } }

/* ── Moving band of subjects ─────────────────────────────────────────── */
.marquee { overflow: hidden; padding: 30px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 40px; }
.marquee-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-size: clamp(34px, 5vw, 64px); font-weight: 700; letter-spacing: -.035em; line-height: 1; white-space: nowrap; color: var(--ink); }
.marquee span.outline { color: transparent; -webkit-text-stroke: 1.5px var(--ink); }
.marquee i { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; background: var(--pink); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── Big statement, lit word by word with the scroll ─────────────────── */
.statement { text-align: center; padding-top: 48px; }
.statement-text { max-width: 980px; margin: 0 auto 26px; font-size: clamp(30px, 4.6vw, 60px); font-weight: 700; line-height: 1.12; letter-spacing: -.035em; color: var(--ink); }
.statement-text .w { transition: opacity .25s linear; }
.js-motion .statement-text .w { opacity: .16; }
.js-motion .statement-text .w.lit { opacity: 1; }

/* ── Things that rise into view ──────────────────────────────────────── */
.js-motion [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--spring), transform .9s var(--spring); transition-delay: var(--d, 0s); }
.js-motion [data-reveal].is-in { opacity: 1; transform: none; }

.tile { transition: transform .5s var(--spring), box-shadow .5s var(--spring), background .3s ease; }
.tile:hover { transform: translateY(-6px); background: rgba(23, 23, 23, .055); }
.js-motion .tile[data-reveal]:not(.is-in) { transform: translateY(40px) scale(.97); }

/* the pink band: a slow light moving across */
.join-card { position: relative; overflow: hidden; isolation: isolate; }
.join-glow { position: absolute; inset: -40%; z-index: -1; background:
  radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent 70%) 20% 30% / 60% 60% no-repeat,
  radial-gradient(closest-side, rgba(0, 0, 0, .12), transparent 70%) 80% 70% / 55% 55% no-repeat;
  animation: glow 14s ease-in-out infinite alternate; }
@keyframes glow { to { transform: translate(8%, -6%) rotate(8deg); } }

/* ── Inner pages: the title and text rise in ─────────────────────────── */
.js-motion .is-page .page-head > * { opacity: 0; transform: translateY(18px); animation: fade-up .8s var(--spring) .05s forwards; }
.js-motion .is-page .page-head > *:nth-child(2) { animation-delay: .12s; }
.js-motion .is-page .page-body { opacity: 0; animation: fade-up .9s var(--spring) .18s forwards; transform: translateY(14px); }

@media (max-width: 640px) {
  .hero2 { min-height: calc(88svh - var(--nav-h)); padding-bottom: 44px; }
  .hero-mark { width: min(72vw, 300px); }
  .showcase-frame { padding: 0 16px; }
  .showcase .slides { aspect-ratio: 4 / 3; }
  .marquee { padding: 22px 0; margin-top: 24px; }
  .marquee-track { gap: 18px; }
  .marquee i { width: 9px; height: 9px; }
  .scroll-cue { display: none; }
}

/* ── Still page for "reduce motion" ──────────────────────────────────── */
.calm .hero-mark, .calm .line > span, .calm .hero-step, .calm [data-reveal], .calm .statement-text .w,
.calm .is-page .page-head > *, .calm .is-page .page-body { opacity: 1 !important; transform: none !important; animation: none !important; }
.calm .showcase-frame { --p: 1 !important; }
.calm .aurora span, .calm .marquee-track, .calm .slides img.on, .calm .join-glow, .calm .scroll-cue span { animation: none !important; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* the home page opens on the mark; its news is further down the page */
.is-home .notice-strip { display: none; }
