/* ==========================================================================
   PG Entry — Shared Site Kit
   /assets/site.css
   Night console: deep-ink ground, stacked rounded boards,
   electric cyan as the single brand anchor, amber reserved for rules.
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

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

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

a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }

button { background: none; border: 0; padding: 0; }

main { display: block; }

/* ---------- 2. Design tokens ---------- */
:root {
  /* palette */
  --ink: #0A0F0D;
  --deep: #0F2B22;
  --deep-800: #174A3A;
  --cyan: #39F2D0;
  --mist: #9DFFF0;
  --amber: #FFB454;
  --paper: #F4F7F5;
  --fog: #A9B8B1;
  --line: #2D4A41;

  /* roles */
  --surface: var(--deep);
  --surface-2: var(--deep-800);
  --text: var(--paper);
  --text-dim: var(--fog);
  --accent: var(--cyan);
  --rule: var(--amber);

  /* geometry */
  --r-panel: 32px;
  --r-card: 22px;
  --r-pill: 999px;
  --gap-panel: 10px;

  /* type */
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
    "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono",
    "Roboto Mono", Menlo, Consolas, monospace;

  /* motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 220ms;
  --dur-fast: 180ms;

  /* shell */
  --shell-max: 1280px;
}

/* ---------- 3. Base typography ---------- */
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    radial-gradient(900px 520px at 12% -10%, rgba(57, 242, 208, .10), transparent 62%),
    radial-gradient(760px 460px at 88% 4%, rgba(255, 180, 84, .07), transparent 64%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.012em;
}

h1 { font-size: clamp(30px, 4.6vw, 58px); }
h2 { font-size: clamp(24px, 3.2vw, 38px); }
h3 { font-size: clamp(19px, 2.1vw, 25px); }
h4 { font-size: clamp(17px, 1.6vw, 20px); }

p { max-width: 46em; }

::selection { background: rgba(57, 242, 208, .28); color: var(--paper); }

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

#main-content { scroll-margin-top: 96px; }

main { padding-top: clamp(16px, 3vw, 32px); }

/* ---------- 4. Utilities ---------- */
.container {
  width: min(1180px, 100% - 40px);
  margin-inline: auto;
}

.container--wide {
  width: min(var(--shell-max), 100% - 32px);
  margin-inline: auto;
}

.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;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: .02em;
  font-feature-settings: "tnum" 1;
}

.lead {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.75;
  color: #D4E4DE;
  max-width: 44em;
}

.muted { color: var(--text-dim); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--cyan);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: .75;
}

/* ---------- 5. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  background: var(--cyan);
  color: #04241E;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform var(--dur-fast) var(--ease);
}

.skip-link:focus-visible,
.skip-link:focus {
  transform: translateY(0);
  outline-offset: 4px;
}

/* ---------- 6. Header — floating capsule island ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 16px 0;
  pointer-events: none;
}

.site-header > * { pointer-events: auto; }

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 120;
  pointer-events: none;
  background: rgba(45, 74, 65, .55);
}

.scroll-progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--mist));
  transition: transform 100ms linear;
}

.header-shell {
  width: min(var(--shell-max), 100%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 7px;
  border-radius: var(--r-pill);
  background: rgba(13, 26, 21, .84);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px -30px rgba(0, 0, 0, .95);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: padding var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.site-header[data-scrolled] .header-shell {
  padding: 4px 8px 4px 6px;
  background: rgba(9, 17, 14, .95);
  border-color: rgba(57, 242, 208, .30);
}

/* brand island */
.brand-island {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 5px 14px 5px 5px;
  border-radius: var(--r-pill);
  text-decoration: none;
  color: var(--paper);
  transition: background-color var(--dur-fast) var(--ease);
}

.brand-island:hover { background: rgba(57, 242, 208, .09); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: radial-gradient(120% 120% at 25% 15%, #1C5A47 0%, #0A0F0D 72%);
  border: 1px solid rgba(57, 242, 208, .45);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
}

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

.brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--fog);
  letter-spacing: .08em;
}

/* nav pill */
.nav-pill {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 4px;
  border-radius: var(--r-pill);
  background: rgba(10, 15, 13, .58);
  border: 1px solid rgba(45, 74, 65, .9);
}

.nav-pill a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease);
}

.nav-pill a:hover {
  color: var(--paper);
  background: rgba(57, 242, 208, .10);
}

.nav-pill a[aria-current="page"] {
  color: #04241E;
  background: var(--cyan);
  font-weight: 800;
}

/* header tools */
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.batch-chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px dashed rgba(255, 180, 84, .52);
  background: rgba(255, 180, 84, .09);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.batch-chip:hover {
  background: rgba(255, 180, 84, .19);
  border-color: var(--amber);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--cyan);
  color: #04241E;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.header-cta:hover {
  background: var(--mist);
  box-shadow: 0 12px 28px -16px rgba(57, 242, 208, .9);
}

/* mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(57, 242, 208, .10);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

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

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transition: transform var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 7. Buttons & tags ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 46px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--cyan);
  color: #04241E;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.btn:hover {
  background: var(--mist);
  box-shadow: 0 14px 32px -18px rgba(57, 242, 208, .9);
}

.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--line);
}

.btn--ghost:hover {
  background: rgba(57, 242, 208, .10);
  border-color: var(--cyan);
  color: var(--paper);
  box-shadow: none;
}

.btn--amber {
  background: var(--amber);
  color: #2A1500;
}

.btn--amber:hover {
  background: #FFC780;
  box-shadow: 0 14px 32px -18px rgba(255, 180, 84, .9);
}

.btn--sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(57, 242, 208, .08);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.tag--amber {
  color: var(--amber);
  border-color: rgba(255, 180, 84, .45);
  background: rgba(255, 180, 84, .08);
}

/* ---------- 8. Panels, grid, sections ---------- */
.grid {
  display: grid;
  gap: var(--gap-panel);
}

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

.col-1 { grid-column: span 1; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.panel {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 38px);
  border-radius: var(--r-panel);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 74, 58, .50), rgba(15, 43, 34, .94));
}

.panel--flat { background: var(--deep); }

.panel--ink {
  background: linear-gradient(180deg, rgba(13, 24, 20, .95), rgba(8, 15, 12, .98));
}

.panel--amber {
  border-color: rgba(255, 180, 84, .45);
  background: linear-gradient(180deg, rgba(74, 48, 12, .45), rgba(15, 43, 34, .92));
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(24px, 3.2vw, 40px);
  line-height: 1.08;
  letter-spacing: -.015em;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--cyan);
}

[data-section] { scroll-margin-top: 96px; }

/* ---------- 9. Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--fog);
}

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

.breadcrumb li:not(:last-child)::after {
  content: "/";
  color: var(--line);
}

.breadcrumb a {
  color: var(--fog);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

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

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

/* ---------- 10. Prose ---------- */
.prose { max-width: 46em; }

.prose p { margin-block: 0 1.05em; }

.prose h2 {
  margin-block: 1.6em .55em;
  font-size: clamp(20px, 2vw, 26px);
}

.prose h3 { margin-block: 1.3em .45em; }

.prose ul {
  list-style: disc;
  padding-left: 1.25em;
  margin-block: 0 1.1em;
}

.prose li { margin-block: .35em; }

.prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 11. Media frames (page-level images) ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(23, 74, 58, .70), rgba(10, 15, 13, .95));
  aspect-ratio: 16 / 9;
}

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

.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--map { aspect-ratio: 16 / 10; }

.media-frame:empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(45, 74, 65, .60) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 74, 65, .60) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: .5;
}

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--fog);
}

/* ---------- 12. Reveal / section-state protocol ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 13. Footer ---------- */
.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  padding: 0 16px 24px;
}

.footer-shell {
  width: min(var(--shell-max), 100%);
  margin-inline: auto;
  padding: clamp(26px, 4vw, 52px) clamp(20px, 3.4vw, 48px) clamp(18px, 2.4vw, 28px);
  border-radius: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 74, 58, .34), rgba(9, 18, 14, .94));
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(120px, .85fr));
  gap: clamp(20px, 3vw, 40px);
  padding-bottom: clamp(20px, 2.6vw, 32px);
}

.footer-brand-line {
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .01em;
}

.footer-note {
  margin-top: 10px;
  max-width: 34em;
  font-size: 13px;
  line-height: 1.7;
  color: var(--fog);
}

.footer-note--band {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .03em;
  color: rgba(169, 184, 177, .9);
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  height: 30px;
  padding: 0 13px;
  border-radius: var(--r-pill);
  border: 1px dashed rgba(255, 180, 84, .5);
  background: rgba(255, 180, 84, .08);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

.footer-badge:hover {
  background: rgba(255, 180, 84, .18);
  border-color: var(--amber);
}

.footer-col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--cyan);
}

.footer-links li + li { margin-top: 6px; }

.footer-links a {
  display: inline-block;
  padding: 4px 0;
  font-size: 14px;
  color: var(--fog);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.footer-links a:hover {
  color: var(--paper);
  transform: translateX(3px);
}

.footer-contact-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 15px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: rgba(10, 20, 16, .55);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--fog);
}

.contact-value {
  font-size: 14px;
  line-height: 1.55;
  color: var(--paper);
  overflow-wrap: anywhere;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  padding-top: 18px;
  font-size: 13px;
  color: var(--fog);
}

.footer-copy { margin-right: auto; }

.footer-icp {
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--fog);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.footer-legal a {
  color: var(--fog);
  font-size: 13px;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.footer-legal a:hover { color: var(--cyan); }

/* ---------- 14. Responsive ---------- */
@media (max-width: 1120px) {
  .batch-chip { display: none; }
}

@media (max-width: 960px) {
  .site-header { padding: 10px 10px 0; }

  .header-shell {
    padding: 6px;
    gap: 6px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(11, 21, 17, .96);
  }

  .header-tools { margin-left: auto; }

  .header-cta { display: none; }

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

  .nav-pill {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border-radius: 26px;
    background: rgba(9, 17, 14, .98);
    border: 1px solid var(--line);
    box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .95);
    max-height: min(72vh, 560px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 120%, 0);
    transition: transform var(--dur-fast) var(--ease),
                opacity var(--dur-fast) var(--ease),
                visibility var(--dur-fast) var(--ease);
  }

  .nav-pill[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
  }

  .nav-pill a {
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 15px;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .grid--12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 6; }
  .col-1 { grid-column: span 2; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }

  .container { width: min(1180px, 100% - 28px); }
  .container--wide { width: min(var(--shell-max), 100% - 20px); }

  .brand-sub { display: none; }

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

  .col-1, .col-4, .col-5, .col-6, .col-7, .col-8, .col-12 {
    grid-column: span 1;
  }

  .panel { border-radius: 26px; }

  .footer-top { grid-template-columns: minmax(0, 1fr); }

  .footer-bottom { gap: 8px 16px; }

  .footer-copy { margin-right: 0; flex: 1 1 100%; }
}

/* ---------- 15. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .scroll-progress-bar { transition: none; }
}
