/* ============ reset ============ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, figure, blockquote, dl, dd { margin: 0; }

ul, ol { padding: 0; list-style: none; }

img, svg, video { display: block; max-width: 100%; }

button { font: inherit; color: inherit; background: none; border: 0; }

a { color: inherit; }

/* ============ tokens ============ */
:root {
  --abyss: #061525;
  --harbor: #0A2038;
  --paper: #0F2B45;
  --cyan: #35F2E6;
  --magenta: #FF3DBE;
  --sunset: #FF8A3D;
  --violet: #8B5CF6;
  --foam: #F4FBFF;
  --mist: #A9C4D6;
  --line: #1D5A73;

  --font-display: "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  --font-body: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, Consolas, monospace;
  --font-editorial: "Noto Serif SC", "Songti SC", serif;

  --wrap: 1320px;
  --gutter: clamp(16px, 3.4vw, 44px);
  --radius: 2px;
  --nav-break: 1080px;
}

/* ============ base ============ */
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 680px at 84% -10%, rgba(53, 242, 230, 0.10), transparent 60%),
    radial-gradient(900px 560px at 4% 0%, rgba(139, 92, 246, 0.12), transparent 58%),
    var(--abyss);
  color: var(--foam);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(36px, 5.4vw, 68px); }
h2 { font-size: clamp(26px, 3.4vw, 42px); }
h3 { font-size: clamp(20px, 2.2vw, 27px); }
h4 { font-size: clamp(17px, 1.5vw, 20px); }

p { max-width: 72ch; }

::selection {
  background: rgba(53, 242, 230, 0.28);
  color: var(--foam);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ============ utilities ============ */
.container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(40px, 6vw, 88px); }

.stack {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 22px);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(53, 242, 230, 0.8);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -90px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--cyan);
  color: #04121F;
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus { top: 14px; }

/* ============ buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn--sunset {
  background: var(--sunset);
  color: #20100A;
  box-shadow: 0 0 0 1px rgba(255, 138, 61, 0.35), 0 12px 28px -18px rgba(255, 138, 61, 0.9);
}

.btn--sunset:hover { background: #FFA568; transform: translateY(-1px); }

.btn--ghost {
  background: rgba(53, 242, 230, 0.05);
  border-color: var(--line);
  color: var(--foam);
}

.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); }

/* ============ header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(6, 21, 37, 0.99), rgba(6, 21, 37, 0.93));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px -32px rgba(0, 0, 0, 0.95);
}

.header-signal {
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 42%, var(--magenta) 74%, var(--sunset));
  opacity: 0.85;
}

.header-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr auto;
  align-items: center;
  gap: clamp(16px, 2.4vw, 40px);
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 12px var(--gutter);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--foam);
}

.brand-glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid rgba(53, 242, 230, 0.7);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  transform: skewX(-7deg);
  box-shadow: inset 0 0 18px rgba(53, 242, 230, 0.22);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.02em;
  font-style: italic;
  text-shadow: 0 0 1px rgba(53, 242, 230, 0.65);
}

.brand-season {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--mist);
  text-transform: uppercase;
  white-space: nowrap;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 2vw, 26px);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-list a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 10px 13px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mist);
  text-decoration: none;
  transition: color 0.18s ease;
}

.nav-list a:hover { color: var(--foam); }

.nav-list a[aria-current="page"] { color: var(--foam); }

.nav-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 2px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(53, 242, 230, 0.9);
}

.nav-quick { display: flex; gap: 8px; }

.quick-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.quick-link--cyan { color: var(--cyan); }
.quick-link--cyan:hover { background: rgba(53, 242, 230, 0.14); }

.quick-link--magenta { color: var(--magenta); }
.quick-link--magenta:hover { background: rgba(255, 61, 190, 0.14); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--mist);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 1px dashed var(--line);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.tool-index:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--foam);
  transition: border-color 0.18s ease, color 0.18s ease;
}

.nav-toggle:hover { border-color: var(--cyan); color: var(--cyan); }

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 55%, var(--magenta));
  box-shadow: 0 0 12px rgba(53, 242, 230, 0.6);
  transition: transform 0.12s linear;
  pointer-events: none;
}

/* ============ footer ============ */
.site-footer {
  margin-top: clamp(48px, 7vw, 110px);
  background: linear-gradient(180deg, var(--harbor), var(--abyss) 68%);
  border-top: 1px solid var(--line);
}

.footer-signal {
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 45%, var(--magenta) 76%, var(--sunset));
  opacity: 0.8;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: clamp(24px, 3.4vw, 56px);
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(36px, 5vw, 72px) var(--gutter) clamp(24px, 3vw, 40px);
}

.footer-col { min-width: 0; }

.footer-blurb {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--mist);
  max-width: 34ch;
}

.footer-note {
  margin-top: 14px;
  padding-left: 11px;
  border-left: 2px solid rgba(53, 242, 230, 0.55);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: rgba(169, 196, 214, 0.74);
  max-width: 40ch;
}

.footer-heading {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  color: var(--mist);
}

.footer-list a {
  display: inline-block;
  color: var(--mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.footer-list a:hover {
  color: var(--foam);
  border-bottom-color: var(--cyan);
}

.footer-list--plain li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--foam);
  word-break: break-word;
}

.footer-key {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 16px var(--gutter) 30px;
  border-top: 1px solid rgba(29, 90, 115, 0.65);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--mist);
}

.footer-copy,
.footer-icp { max-width: none; }

.footer-icp { color: rgba(169, 196, 214, 0.8); }

/* ============ shared blocks ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--mist);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--line);
}

.breadcrumb a {
  color: var(--mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.breadcrumb a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

.breadcrumb [aria-current="page"] { color: var(--foam); }

.grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 28px);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: rgba(15, 43, 69, 0.65);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
}

.tag--cyan {
  color: var(--cyan);
  border-color: rgba(53, 242, 230, 0.45);
  background: rgba(53, 242, 230, 0.09);
}

.tag--magenta {
  color: var(--magenta);
  border-color: rgba(255, 61, 190, 0.45);
  background: rgba(255, 61, 190, 0.09);
}

.tag--sunset {
  color: var(--sunset);
  border-color: rgba(255, 138, 61, 0.45);
  background: rgba(255, 138, 61, 0.1);
}

.card {
  background: linear-gradient(180deg, var(--harbor), rgba(10, 32, 56, 0.78));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: 0 18px 40px -32px rgba(0, 0, 0, 0.95);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: rgba(53, 242, 230, 0.5);
  box-shadow: 0 0 0 1px rgba(53, 242, 230, 0.16), 0 22px 46px -28px rgba(53, 242, 230, 0.55);
}

.card--paper {
  background: var(--paper);
  border-color: rgba(53, 242, 230, 0.24);
}

.paper-stack {
  position: relative;
  isolation: isolate;
}

.paper-stack::before {
  content: "";
  position: absolute;
  inset: 10px -7px -10px 7px;
  border: 1px solid rgba(29, 90, 115, 0.9);
  background: rgba(15, 43, 69, 0.55);
  z-index: -1;
  pointer-events: none;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--cyan);
  text-decoration: none;
}

.link-arrow::after {
  content: "→";
  transition: transform 0.18s ease;
}

.link-arrow:hover::after { transform: translateX(4px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(22px, 3vw, 40px);
}

/* ============ image containers ============ */
.media-frame {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(139, 92, 246, 0.28), transparent 60%),
    linear-gradient(160deg, var(--paper), var(--harbor));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 21, 37, 0) 46%, rgba(6, 21, 37, 0.68));
  pointer-events: none;
}

.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }

/* ============ reveal ============ */
[data-reveal] {
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-reveal].is-pending {
  opacity: 0;
  transform: translateY(22px);
}

/* ============ responsive ============ */
@media (max-width: 1080px) {
  .header-inner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .nav-toggle { display: inline-flex; }

  .tool-index { display: none; }

  .primary-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    max-height: min(72vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px var(--gutter) 22px;
    background: var(--harbor);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 26px 50px -18px rgba(0, 0, 0, 0.7);
  }

  .primary-nav[data-open="true"] { display: flex; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list a {
    padding: 14px 6px;
    font-size: 16px;
    border-bottom: 1px solid rgba(29, 90, 115, 0.55);
  }

  .nav-list a[aria-current="page"]::after {
    left: 6px;
    right: auto;
    bottom: 8px;
    width: 26px;
  }

  .nav-quick {
    margin-top: 16px;
    flex-wrap: wrap;
  }

  .quick-link { padding: 9px 14px; font-size: 12.5px; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { gap: 28px 32px; }
}

@media (max-width: 640px) {
  .brand-season { display: none; }
  .brand-name { font-size: 16px; }
  .brand-glyph { width: 34px; height: 34px; font-size: 16px; }
  .header-tools .btn--sunset { padding: 9px 12px; font-size: 13px; min-height: 40px; }
  .nav-toggle { padding: 8px 10px; }

  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }

  .footer-inner { grid-template-columns: minmax(0, 1fr); padding-bottom: 20px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-blurb,
  .footer-note { max-width: none; }
  p { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal],
  [data-reveal].is-pending {
    opacity: 1;
    transform: none;
  }

  .scroll-progress { transition: none; }
}
