/* 深蓝 Deep Blue — shared system.
   Motif: the circle of Snell's window. Photos sit in circles, buttons are round, bullets are dots. */

:root {
  --bg: #061c30;
  --surface: #0b2a45;
  --surface-2: #103757;
  --ink: #e8f3f0;
  --muted: #a9c3c8;
  --accent: #ff8466;
  --accent-strong: #ff9d84;
  --accent-ink: #061c30;
  --foam: #e8f3f0;
  --foam-2: #d5e8e4;
  --navy: #061c30;
  --navy-muted: #35546a;

  --z0: #0f5677;
  --z1: #0a3a5a;
  --z2: #072640;
  --z3: #04162a;
  --z4: #020a14;

  --st-cr: #ff8466;
  --st-en: #ffb27d;
  --st-vu: #f1d27c;
  --st-nt: #a6d9c9;
  --st-lc: #6db4a6;
  --st-dd: #a9c3c8;

  --font: "Chillax", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-display: clamp(3rem, 6.4vw, 6.25rem);

  --margin: clamp(1rem, 3.2vw, 3rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(6rem, 13vw, 13rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
  --t-reveal: 800ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, svg, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:target { scroll-margin-top: 6rem; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- type ---------- */
h1, h2, h3, h4 { font-weight: 600; text-wrap: balance; }
.display { font-size: var(--step-display); line-height: 1.02; letter-spacing: -0.03em; }
.head { font-size: var(--step-head); line-height: 1.08; letter-spacing: -0.025em; }
.lead { font-size: var(--step-lead); line-height: 1.45; }
.small { font-size: var(--step-small); line-height: 1.5; }
.muted { color: var(--muted); }
p { max-width: 62ch; text-wrap: pretty; }
.nums { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { padding-inline: var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.section { padding-block: calc(var(--section) / 2); }
.foam { background: var(--foam); color: var(--navy); --ink: var(--navy); --bg: var(--foam); --surface-2: #c3dcd7; --muted: var(--navy-muted); --surface: var(--foam-2); --accent-ink: var(--foam); --accent: #b83f20; --accent-strong: #9e3418; }
.foam ::selection { background: var(--navy); color: var(--foam); }

/* the motif */
.port { display: block; border-radius: 50%; overflow: hidden; aspect-ratio: 1; background: var(--surface); }
.port img, .port video { width: 100%; height: 100%; object-fit: cover; }
.dot { display: inline-block; width: 0.62em; height: 0.62em; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6em; min-height: 3.25rem; padding: 0 1.7rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.btn:active { transform: scale(0.96); }
.btn--quiet { background: var(--surface); color: var(--ink); }
.btn--small { min-height: 2.6rem; padding: 0 1.2rem; font-size: 0.9375rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 1.1em; height: 1.1em; transition: transform var(--t-hover) var(--ease-out); }
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent-strong); }
  .btn--quiet:hover { background: var(--surface-2); }
  .btn:hover svg { transform: translate(2px, -2px); }
  .link:hover { text-decoration-color: currentColor; }
}

.field { width: 100%; min-height: 3.25rem; padding: 0.75rem 1.25rem; background: var(--surface); border: 0; border-radius: 999px; font-size: max(1rem, var(--step-body)); color: inherit; transition: background-color var(--t-hover) ease; }
textarea.field { border-radius: 1.6rem; min-height: 9rem; resize: vertical; line-height: 1.6; }
select.field { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a9c3c8' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1.25rem center; padding-right: 2.75rem; }
.field::placeholder { color: var(--muted); opacity: 0.85; }
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-row { display: grid; gap: 1.25rem; }
.form-row--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 40em) { .form-row--2 { grid-template-columns: 1fr; } }

/* choice chips: round, filled when chosen */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.5em; min-height: 2.6rem; padding: 0 1.1rem; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: var(--step-small); font-weight: 500; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"], .chip[aria-selected="true"], .chip:has(input:checked) { background: var(--ink); color: var(--bg); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .chip:not([aria-pressed="true"]):not([aria-selected="true"]):hover { background: var(--surface-2); } }

/* ---------- site header ---------- */
.site-head { position: sticky; top: 0; z-index: 40; background: var(--head-bg, var(--bg)); transition: background-color 400ms ease; }
.site-head__bar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.brand__mark { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); position: relative; overflow: hidden; }
.brand__mark::after { content: ""; position: absolute; inset: 55% 0 0; background: var(--bg); }
.nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); }
.nav__links { display: flex; gap: clamp(1rem, 2.2vw, 2rem); }
.nav__links a { text-decoration: none; font-weight: 500; position: relative; padding-block: 0.4rem; }
.nav__links a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: -0.35rem; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--accent); }
.nav__me { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 500; }
.avatar { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 600; flex: none; }
.nav__menu { display: none; font-weight: 500; min-height: 2.75rem; padding: 0 0.25rem; }
@media (max-width: 52em) {
  .nav__links, .nav__cta { display: none; }
  .nav__menu { display: inline-flex; align-items: center; }
  .nav__me span { display: none; }
}
.drawer { position: fixed; inset: 0; z-index: 60; background: var(--bg); padding: 1.25rem var(--margin) 2rem; display: flex; flex-direction: column; }
.drawer__top { display: flex; justify-content: space-between; align-items: center; min-height: 3.25rem; }
.drawer__links { margin-top: 2rem; display: grid; gap: 0.25rem; }
.drawer__links a { font-size: clamp(2.25rem, 10vw, 3.5rem); font-weight: 600; letter-spacing: -0.03em; text-decoration: none; line-height: 1.25; }
.drawer .btn { margin-top: auto; }

/* ---------- page opener (inner pages) ---------- */
.opener { padding-top: clamp(3rem, 8vw, 7rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.opener h1 { font-size: var(--step-display); line-height: 1.02; letter-spacing: -0.03em; }
.opener p { margin-top: 1.5rem; font-size: var(--step-lead); line-height: 1.45; max-width: 34ch; }

/* ---------- footer ---------- */
.site-foot { background: var(--z4); color: var(--ink); padding-top: clamp(7rem, 13vw, 11rem); padding-bottom: 2rem; }
.foot-mark { display: flex; align-items: flex-end; gap: clamp(0.5rem, 1.5vw, 1.25rem); }
.foot-mark__word { font-size: clamp(5rem, 22vw, 20rem); line-height: 0.82; font-weight: 600; letter-spacing: -0.06em; }
.foot-mark__sun { width: clamp(4rem, 16vw, 14rem); aspect-ratio: 1; border-radius: 50%; background: var(--accent); position: relative; overflow: hidden; margin-bottom: 0.4em; flex: none; }
.foot-mark__sun::after { content: ""; position: absolute; inset: 55% 0 0; background: var(--z4); }
.foot-cols { margin-top: clamp(3rem, 6vw, 4.5rem); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem var(--gutter); }
.foot-cols h2 { font-size: var(--step-body); font-weight: 600; margin-bottom: 0.9rem; }
.foot-cols ul { display: grid; gap: 0.45rem; }
.foot-cols a { text-decoration: none; color: var(--muted); }
.foot-cols a:hover { color: var(--ink); }
.foot-base { margin-top: 3.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; color: var(--muted); font-size: var(--step-small); }
.credits { margin-top: 2.5rem; color: var(--muted); }
.credits summary { cursor: pointer; color: var(--ink); font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 0.5rem; }
.credits summary::-webkit-details-marker { display: none; }
.credits summary::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); }
.credits ol { margin-top: 1rem; columns: 2 22rem; column-gap: var(--gutter); padding-left: 1.4rem; list-style: decimal; }
.credits li { break-inside: avoid; margin-bottom: 0.35rem; }
@media (max-width: 52em) { .foot-cols { grid-template-columns: 1fr 1fr; } }

/* ---------- dialog ---------- */
dialog { border: 0; padding: 0; background: var(--bg); color: var(--ink); max-width: min(64rem, calc(100vw - 2rem)); width: 100%; max-height: calc(100dvh - 2rem); border-radius: 2rem; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); } /* taste-skill-ignore: dialog floats */
dialog::backdrop { background: rgba(2, 10, 20, 0.72); }
.dialog__close { position: absolute; top: 1rem; right: 1rem; width: 3rem; height: 3rem; border-radius: 50%; background: var(--surface); display: grid; place-items: center; z-index: 2; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.dialog__close:hover { background: var(--surface-2); }
.dialog__close:active { transform: scale(0.94); }
.dialog__close svg { width: 1.1rem; height: 1.1rem; }
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: dlg-in 360ms var(--ease-out); }
  dialog[open]::backdrop { animation: fade-in 300ms ease; }
}
@keyframes dlg-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }

/* join dialog: the dive card */
.join { display: grid; grid-template-columns: 1fr 1fr; }
.join__card { background: var(--accent); color: var(--accent-ink); padding: clamp(1.75rem, 4vw, 3rem); display: flex; flex-direction: column; gap: 1.5rem; position: relative; overflow: hidden; min-height: 26rem; }
.join__card .port { width: 62%; position: absolute; right: -14%; bottom: -12%; background: var(--z1); }
.join__card h2 { font-size: clamp(2rem, 3.4vw, 2.75rem); line-height: 1.05; letter-spacing: -0.03em; max-width: 9em; }
.join__card p { max-width: 22ch; font-weight: 500; }
.join__form { padding: clamp(1.75rem, 4vw, 3rem); display: grid; gap: 1.25rem; align-content: start; overflow-y: auto; }
.join__form h3 { font-size: var(--step-lead); }
.join__switch { color: var(--muted); font-size: var(--step-small); }
.join__switch button { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 46em) {
  .join { grid-template-columns: 1fr; }
  .join__card { min-height: 13rem; }
  .join__card .port { width: 44%; right: -8%; bottom: -30%; }
}

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 80; display: flex; align-items: center; gap: 0.8rem; padding: 0.9rem 1.4rem 0.9rem 0.9rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 500; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); transform: translate(-50%, 0); max-width: calc(100vw - 2rem); } /* taste-skill-ignore: toast floats */
.toast .dot { width: 1.75rem; height: 1.75rem; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: toast-in 420ms var(--ease-out); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 24px); } }

/* ---------- IUCN status ---------- */
.status { display: inline-flex; align-items: center; gap: 0.45em; font-size: var(--step-small); font-weight: 500; white-space: nowrap; }
.status .dot { width: 0.7em; height: 0.7em; }
.st-CR .dot { background: var(--st-cr); } .st-EN .dot { background: var(--st-en); } .st-VU .dot { background: var(--st-vu); }
.st-NT .dot { background: var(--st-nt); } .st-LC .dot { background: var(--st-lc); } .st-DD .dot, .st-NE .dot { background: var(--st-dd); }

/* ---------- motion (content stays visible without JavaScript) ---------- */
.shutter { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .no-anim [data-reveal] { transition: none; }
  .js .port[data-reveal] { transform: scale(0.9); }
  .js .port[data-reveal].is-in { transform: none; }
  .js .shutter[data-reveal] { opacity: 1; transform: none; clip-path: circle(0% at 50% 50%); transition: clip-path 1300ms var(--ease-in-out); }
  .js .shutter[data-reveal] img { transform: scale(1.12); transition: transform 1700ms var(--ease-soft); }
  .js .shutter[data-reveal].is-in { clip-path: circle(50% at 50% 50%); }
  .js .shutter[data-reveal].is-in img { transform: none; }
  .js [data-rise] { opacity: 0; transform: translateY(22px); animation: rise 900ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 110ms + 150ms); }
  .drift { animation: drift 24s ease-in-out infinite alternate; }
  .js .open-port { animation: port-open 1400ms var(--ease-in-out) 100ms both; }
}
@keyframes port-open { from { clip-path: circle(0% at 50% 50%); } to { clip-path: circle(50% at 50% 50%); } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.14) translate(-2%, 1.5%); } }

/* ---------- dive card (home + profile) ---------- */
.divecard { grid-column: 1 / 6; background: var(--z0); color: var(--foam); border-radius: 2rem; padding: 1.75rem; aspect-ratio: 0.72; display: flex; flex-direction: column; position: relative; overflow: hidden; max-width: 28rem; }
.divecard__top { display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.divecard__top .brand { font-size: 1.1rem; }
.divecard__top .brand__mark::after { background: var(--z0); }
.divecard__port { width: 72%; margin: 2rem auto 0; background: var(--z1); }
.divecard__name { margin-top: auto; font-size: clamp(2rem, 3vw, 2.75rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.divecard__meta { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 1rem; }
.divecard__meta dt { font-size: var(--step-small); color: #d3e6e4; }
.divecard__meta dd { font-weight: 500; }
