/* ---------- tokens ---------- */
:root {
  --blue:    #4aa3cc;
  --trench:  #01060f;

  --display: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --body: "Inter", "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ink: #08283a;
  --ink-soft: rgba(8, 40, 58, .72);
  --hair: rgba(8, 40, 58, .22);

  --pad: clamp(1.25rem, 5vw, 4.5rem);
  --bubble-op: .35;
  --glow-op: 0;
  --ray-op: 1;
}

* { box-sizing: border-box; }

html[lang="ja"] {
  --display: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, serif;
  --body: "Inter", "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
}
html[lang="zh-Hans"] {
  --display: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --body: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
html[lang="zh-Hant"] {
  --display: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --body: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

:is([lang="ja"], [lang="zh-Hans"], [lang="zh-Hant"]) :is(.station, .role, .zone, .foot, .dive-cue, .masthead) {
  letter-spacing: .15em;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(1rem, .96rem + .3vw, 1.15rem);
  line-height: 1.7;
  color: var(--ink);
  background: var(--trench);
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: fixed;
  left: 1rem; top: -3rem;
  z-index: 20;
  padding: .6rem 1rem;
  background: #fff;
  color: #08283a;
  border-radius: 0 0 .5rem .5rem;
  transition: top .2s;
}
.skip:focus { top: 0; }

/* ---------- the water column ---------- */
.dive {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .3) transparent;
}

.water {
  background-image: linear-gradient(
    180deg,
    #e6f6fc 0%,
    #c8ebf8 10%,
    #a3d7ee 20%,
    #6cb7d9 30%,
    #2c7fae 38%,
    #0e4d7b 44%,
    #0a3c63 55%,
    #05223f 68%,
    #03152e 80%,
    #01060f 92%,
    #01060f 100%
  );
}

.scene {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--pad) * 1.6) var(--pad);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  isolation: isolate;
}

.scene__inner { width: min(62rem, 100%); margin-inline: auto; }

.station {
  margin: 0 0 clamp(1rem, 3vw, 2rem);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 1.2rem;
  text-wrap: balance;
}

h1 { font-size: clamp(3rem, 4rem + 9vw, 8.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 1.4rem + 3.4vw, 3.8rem); }

.title__slash { color: var(--blue); }

.lede {
  max-width: 34rem;
  margin: 0 0 1.6rem;
  font-size: clamp(1.1rem, 1rem + .6vw, 1.45rem);
  font-weight: 300;
}

.body { max-width: 38rem; color: var(--ink); }

a { color: inherit; }
.mail { text-decoration-thickness: 1px; text-underline-offset: .25em; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }

/* ---------- per-scene ink ---------- */
.scene { color: var(--ink); }
.scene--surface,
.scene--twilight { --ink: #08283a; --ink-soft: rgba(8, 40, 58, .7); --hair: rgba(8, 40, 58, .22); }
.scene--midnight { --ink: #d9f0fa; --ink-soft: rgba(217, 240, 250, .68); --hair: rgba(217, 240, 250, .25); }
.scene--abyss    { --ink: #cfeaf7; --ink-soft: rgba(207, 234, 247, .62); --hair: rgba(126, 214, 240, .3); }
.scene--trench   { --ink: #bcdff0; --ink-soft: rgba(188, 223, 240, .55); --hair: rgba(126, 214, 240, .26); }

/* ---------- surface light ---------- */
.rays, .caustics { position: absolute; inset: -10% -20%; z-index: -1; pointer-events: none; }

.rays {
  opacity: var(--ray-op);
  background-image: repeating-linear-gradient(
    102deg,
    rgba(255, 255, 255, .55) 0 1.6%,
    rgba(255, 255, 255, 0) 1.6% 6.5%
  );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .9), transparent 72%);
  filter: blur(14px);
  animation: drift 22s ease-in-out infinite alternate;
}

.caustics {
  opacity: calc(var(--ray-op) * .8);
  background-image:
    radial-gradient(60% 42% at 18% 6%, rgba(255, 255, 255, .8), transparent 70%),
    radial-gradient(52% 36% at 62% 2%, rgba(255, 255, 255, .6), transparent 72%),
    radial-gradient(40% 30% at 88% 10%, rgba(255, 255, 255, .5), transparent 74%);
  filter: blur(6px);
  animation: shimmer 12s ease-in-out infinite alternate;
}

@keyframes drift { to { transform: translate3d(-3%, 2%, 0) scale(1.06); } }
@keyframes shimmer { to { transform: translate3d(2%, -1%, 0) scale(1.1); opacity: calc(var(--ray-op) * .45); } }

/* ---------- dive cue ---------- */
.dive-cue {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 1.4rem;
  font: inherit;
  font-size: .92rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(255, 255, 255, .35);
  border: 1px solid var(--hair);
  border-radius: 999px;
  cursor: pointer;
  transition: background .25s, transform .25s;
}
.dive-cue:hover { background: rgba(255, 255, 255, .6); transform: translateY(2px); }

/* ---------- member shapes ---------- */
.split {
  display: grid;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
}
.split--flip { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); }
.split--flip .avatar { order: -1; }

.role {
  margin: -.6rem 0 1.4rem;
  font-size: .85rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.avatar {
  width: 100%;
  height: auto;
  max-width: 22rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--hair);
  box-shadow: 0 1.5rem 3.5rem rgba(3, 21, 46, .4);
}

#meyo .avatar {
  box-shadow: 0 0 3.5rem rgba(90, 210, 240, .28), 0 1.5rem 3.5rem rgba(3, 21, 46, .5);
}

/* ---------- social ---------- */
.links { list-style: none; margin: 0 0 1.6rem; padding: 0; max-width: 46rem; }
.links__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hair);
}
a.links__row { text-decoration: none; transition: color .25s; }
a.links__row:hover, a.links__row:focus-visible { color: #9ff0ff; }
.links__name { font-family: var(--display); font-size: clamp(1.15rem, 1rem + 1vw, 1.7rem); }
.links__state {
  font-size: .8rem;
  letter-spacing: .1em;
  color: var(--ink-soft);
}

/* ---------- fixed rig ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% -10%, transparent 30%, rgba(1, 6, 15, .85) 100%);
  opacity: var(--glow-op);
}

.rig { position: fixed; inset: 0; z-index: 2; pointer-events: none; }

.rig__glow {
  position: absolute;
  inset: 0;
  opacity: var(--glow-op);
  background:
    radial-gradient(38% 24% at 78% 74%, rgba(80, 220, 255, .16), transparent 70%),
    radial-gradient(28% 18% at 22% 88%, rgba(120, 90, 255, .14), transparent 72%);
}

.rig__bubble {
  position: absolute;
  bottom: -12vh;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85), rgba(255, 255, 255, .18) 60%, transparent 75%);
  border: 1px solid rgba(255, 255, 255, .28);
  opacity: var(--bubble-op);
  animation: rise linear infinite;
}
.rig__bubble--1 { left: 12%; width: 9px;  height: 9px;  animation-duration: 19s; animation-delay: -2s; }
.rig__bubble--2 { left: 34%; width: 5px;  height: 5px;  animation-duration: 26s; animation-delay: -9s; }
.rig__bubble--3 { left: 58%; width: 13px; height: 13px; animation-duration: 22s; animation-delay: -14s; }
.rig__bubble--4 { left: 76%; width: 6px;  height: 6px;  animation-duration: 30s; animation-delay: -5s; }
.rig__bubble--5 { left: 91%; width: 10px; height: 10px; animation-duration: 24s; animation-delay: -18s; }

@keyframes rise {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(2.5vw, -55vh, 0); }
  100% { transform: translate3d(-1.5vw, -112vh, 0); }
}

/* ---------- chrome ---------- */
.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem var(--pad);
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  mix-blend-mode: difference;
  color: #fff;
  pointer-events: none;
}

.langs {
  display: flex;
  gap: .15rem;
  pointer-events: auto;
}
.langs button {
  display: block;
  padding: .35rem .55rem;
  font: inherit;
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: none;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: .5;
  transition: opacity .2s;
}
.langs button:hover { opacity: 1; }
.langs button[aria-pressed="true"] {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: .45em;
  text-decoration-thickness: 1px;
}

.readout {
  position: fixed;
  right: var(--pad);
  bottom: 1.3rem;
  z-index: 5;
  margin: 0;
  text-align: right;
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}
.gauge {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.6rem);
  letter-spacing: .04em;
}
.gauge span { font-variant-numeric: tabular-nums; }
.zone {
  margin: .2rem 0 0;
  font-size: .74rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .75;
}

.stations {
  position: fixed;
  left: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
}
.stations ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.stations button {
  display: block;
  width: 30px; height: 30px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.stations i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
  transition: transform .3s, background .3s;
}
.stations button[aria-current="true"] i {
  background: #9ff0ff;
  transform: scale(1.9);
  box-shadow: 0 0 12px 2px rgba(159, 240, 255, .7);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 2rem;
  margin-top: clamp(3rem, 10vh, 6rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--hair);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */
@media (max-width: 62rem) {
  .split, .split--flip { grid-template-columns: minmax(0, 1fr); }
  .split--flip .avatar { order: 0; }
  .avatar { max-width: 13rem; }
  .stations { display: none; }
}

@media (max-width: 40rem) {
  h1 { font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1.02; }
  .masthead { letter-spacing: .14em; }
  .readout { bottom: .9rem; }
  .gauge { font-size: 1.5rem; }
  .links__row { gap: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dive { scroll-behavior: auto; }
  .rays, .caustics, .rig__bubble { animation: none; }
  .dive-cue { transition: none; }
}
