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

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

body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink-deep);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { display: block; }

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

button { font: inherit; color: inherit; }

a { color: inherit; }

ul,
ol { margin: 0; padding: 0; }

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

.site-header :focus-visible,
.site-footer :focus-visible,
.panel--ink :focus-visible,
.panel--deep :focus-visible {
  outline-color: var(--cyan);
}

#main-content:focus { outline: none; }

[id] { scroll-margin-top: calc(var(--header-h) + 18px); }

/* ========== 02. Tokens ========== */
:root {
  --ink-deep: #061523;
  --blue-cabin: #0B2A45;
  --blue-harbor: #164A6E;
  --steel: #9FB2C4;
  --paper: #E8EDF2;
  --orange: #FF6B2C;
  --orange-deep: #D9531D;
  --cyan: #2FE6D6;
  --white: #FFFFFF;

  --ink-80: rgba(6, 21, 35, .82);
  --ink-70: rgba(6, 21, 35, .72);
  --ink-55: rgba(6, 21, 35, .55);
  --line: rgba(11, 42, 69, .14);
  --line-light: rgba(159, 178, 196, .2);

  --font-display: "Barlow Condensed", "Oswald", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1220px;
  --gutter: clamp(18px, 4vw, 44px);
  --header-h: 76px;
  --cut: 22px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 200ms;
}

/* ========== 03. Typography ========== */
h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: .01em;
  color: var(--ink-deep);
  text-wrap: balance;
}

h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.04; }
h2 { font-size: clamp(26px, 3.4vw, 42px); line-height: 1.2; }
h3 { font-size: clamp(19px, 1.9vw, 25px); line-height: 1.35; }
h4 { font-size: clamp(16px, 1.4vw, 18px); line-height: 1.45; letter-spacing: .02em; }

p { margin: 0; }

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

.num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.lede {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.8;
  color: var(--ink-70);
  max-width: 62ch;
}

.prose {
  max-width: 72ch;
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink-80);
}

.prose p { margin: 0 0 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose h3 { margin: 1.6em 0 .6em; }
.prose ul,
.prose ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }

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

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

.section { padding-block: clamp(48px, 7vw, 92px); }
.section--tight { padding-block: clamp(30px, 4.5vw, 56px); }

.grid { display: grid; gap: clamp(16px, 2.4vw, 30px); }
.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)); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: start;
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line);
}

.rule--ink { background: var(--line-light); }

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

.section-head > * { margin: 0; }

.section-head-aside {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--blue-harbor);
}

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

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--orange);
  transform: skewX(-24deg);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .14em;
  text-decoration: none;
  color: var(--blue-harbor);
  transition: color var(--dur) var(--ease);
}

.link-arrow::after {
  content: "→";
  font-size: 14px;
  transition: transform var(--dur) var(--ease);
}

.link-arrow:hover,
.link-arrow:focus-visible { color: var(--orange-deep); }

.link-arrow:hover::after,
.link-arrow:focus-visible::after { transform: translateX(3px); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: .14em;
  color: var(--blue-harbor);
  background: rgba(22, 74, 110, .08);
  border: 1px solid rgba(22, 74, 110, .18);
}

.tag--hot {
  color: #7A2A00;
  background: rgba(255, 107, 44, .16);
  border-color: rgba(255, 107, 44, .42);
}

.tag--cyan {
  color: #0A5C56;
  background: rgba(47, 230, 214, .2);
  border-color: rgba(47, 230, 214, .55);
}

/* ========== 05. Panels ========== */
.panel {
  position: relative;
  background: var(--white);
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 0 24px 48px -40px rgba(6, 21, 35, .75);
}

.panel--cut {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}

.panel--ink {
  background: var(--blue-cabin);
  color: rgba(255, 255, 255, .78);
  box-shadow: none;
}

.panel--ink h2,
.panel--ink h3,
.panel--ink h4 { color: var(--white); }

.panel--ink .link-arrow { color: var(--cyan); }
.panel--ink .tag { color: var(--cyan); background: rgba(47, 230, 214, .12); border-color: rgba(47, 230, 214, .38); }

.panel--deep {
  background: var(--ink-deep);
  color: rgba(255, 255, 255, .72);
  box-shadow: none;
}

.panel--deep h2,
.panel--deep h3,
.panel--deep h4 { color: var(--white); }

/* ========== 06. Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 24px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.2;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  background: none;
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

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

.btn-primary {
  background: var(--orange);
  color: #1A0800;
}

.btn-primary:hover,
.btn-primary:focus-visible { background: #FF8547; }

.btn-ghost {
  border-color: rgba(159, 178, 196, .5);
  color: var(--white);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(47, 230, 214, .08);
}

.btn-outline {
  border-color: rgba(11, 42, 69, .28);
  color: var(--ink-deep);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--orange);
  color: var(--orange-deep);
}

/* ========== 07. Skip link ========== */
.skip-link {
  position: fixed;
  top: -90px;
  left: 16px;
  z-index: 200;
  padding: 11px 20px;
  background: var(--cyan);
  color: var(--ink-deep);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .1em;
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 14px;
  outline-color: var(--ink-deep);
}

/* ========== 08. Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  color: var(--white);
  background: rgba(6, 21, 35, .62);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  backdrop-filter: blur(12px) saturate(130%);
  border-bottom: 1px solid rgba(159, 178, 196, .16);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.site-header[data-scrolled="true"] {
  background: var(--ink-deep);
  border-bottom-color: rgba(47, 230, 214, .3);
  box-shadow: 0 14px 34px -26px rgba(0, 0, 0, .95);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 36px);
  min-height: var(--header-h);
  padding-block: 11px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1.6px solid var(--orange);
  background: linear-gradient(145deg, rgba(255, 107, 44, .3), rgba(255, 107, 44, 0) 68%);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
  transition: background var(--dur) var(--ease);
}

.brand-mark-dot {
  width: 9px;
  height: 9px;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(47, 230, 214, .16);
  transition: box-shadow var(--dur) var(--ease);
}

.brand:hover .brand-mark,
.brand:focus-visible .brand-mark {
  background: linear-gradient(145deg, rgba(255, 107, 44, .58), rgba(255, 107, 44, .06) 72%);
}

.brand:hover .brand-mark-dot,
.brand:focus-visible .brand-mark-dot { box-shadow: 0 0 0 6px rgba(47, 230, 214, .16); }

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.08;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .09em;
}

.brand-line {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .26em;
  color: var(--steel);
  text-transform: uppercase;
}

.primary-nav { margin-inline-start: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 9px 2px;
  color: rgba(255, 255, 255, .76);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: .05em;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible { color: var(--white); }

.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }

.nav-link[aria-current="page"] { color: var(--white); }

.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: clamp(4px, 1vw, 10px);
}

.header-cta { flex: 0 0 auto; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: rgba(6, 21, 35, .4);
  border: 1px solid rgba(159, 178, 196, .4);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}

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

.nav-toggle-label { display: inline-block; }

.nav-toggle-bars {
  display: grid;
  gap: 4px;
  width: 16px;
}

.nav-toggle-bars span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.site-header[data-nav-open="true"] .nav-toggle-bars span:first-child { transform: translateY(2.75px) rotate(45deg); }
.site-header[data-nav-open="true"] .nav-toggle-bars span:last-child { transform: translateY(-2.75px) rotate(-45deg); }

.scroll-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(159, 178, 196, .14);
  overflow: hidden;
  pointer-events: none;
}

.scroll-rail-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--orange) 0%, #FF8A4C 45%, var(--cyan) 100%);
}

/* ========== 09. Footer ========== */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
  background: var(--ink-deep);
  color: rgba(255, 255, 255, .7);
  overflow: hidden;
}

.footer-cut {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange) 0 22%, var(--cyan) 22% 28%, rgba(22, 74, 110, .9) 28% 100%);
}

.footer-inner {
  position: relative;
  padding-top: clamp(38px, 5.5vw, 68px);
  padding-bottom: 0;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(26px, 4.5vw, 64px);
  align-items: start;
}

.footer-brand .brand { color: var(--white); }

.footer-note {
  margin-top: 16px;
  max-width: 32ch;
  font-size: 14px;
  line-height: 1.85;
  color: var(--steel);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 36px);
}

.footer-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.footer-title {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--cyan);
  text-transform: uppercase;
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1px;
}

.footer-list a {
  display: inline-block;
  padding: 6px 0;
  font-size: 14.5px;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--white);
  border-bottom-color: var(--orange);
}

.footer-contact {
  margin-top: clamp(30px, 4.5vw, 52px);
  padding-top: clamp(22px, 3vw, 30px);
  border-top: 1px solid rgba(159, 178, 196, .16);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px 32px;
}

.contact-item {
  margin: 0;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.contact-key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  color: rgba(159, 178, 196, .85);
  text-transform: uppercase;
}

.contact-val {
  font-size: 14px;
  line-height: 1.6;
  color: var(--white);
  word-break: break-word;
}

.contact-note {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  max-width: 70ch;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--steel);
}

.footer-meta {
  margin-top: clamp(22px, 3.5vw, 36px);
  padding-block: 20px 26px;
  border-top: 1px solid rgba(159, 178, 196, .16);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: rgba(159, 178, 196, .9);
}

.footer-copy,
.footer-icp { margin: 0; }

/* ========== 10. Breadcrumb ========== */
.breadcrumb {
  padding-block: 16px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: #5A7288;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.breadcrumb li + li::before {
  content: "/";
  color: rgba(22, 74, 110, .35);
}

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

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--orange-deep);
  border-bottom-color: currentColor;
}

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

/* ========== 11. Media frame ========== */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--blue-cabin);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
}

.media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 260ms var(--ease);
}

.media:hover img { transform: scale(1.035); }

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x2 { aspect-ratio: 3 / 2; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 3 / 4; }

.media[data-label]::after {
  content: attr(data-label);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 14px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--cyan);
  background: linear-gradient(180deg, rgba(6, 21, 35, 0) 0%, rgba(6, 21, 35, .88) 100%);
  pointer-events: none;
}

/* ========== 12. Reveal protocol ========== */
[data-js="true"] [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}

[data-js="true"] [data-reveal][data-revealed="true"] {
  opacity: 1;
  transform: none;
}

/* ========== 13. Responsive ========== */
@media (max-width: 1023px) {
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px var(--gutter) 22px;
    background: var(--ink-deep);
    border-top: 1px solid rgba(159, 178, 196, .18);
    border-bottom: 2px solid var(--orange);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

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

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

  .nav-link {
    display: block;
    padding: 14px 0;
    font-size: 16.5px;
    color: rgba(255, 255, 255, .82);
    border-bottom: 1px solid rgba(159, 178, 196, .14);
  }

  .nav-link::after { display: none; }

  .nav-link[aria-current="page"] {
    color: var(--cyan);
    border-bottom-color: rgba(47, 230, 214, .4);
  }

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

@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(24px, 4vw, 36px);
  }

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

@media (max-width: 720px) {
  .grid-3,
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

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

@media (max-width: 560px) {
  :root { --header-h: 68px; --cut: 16px; }

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

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

  .brand-line { display: none; }
  .brand-name { font-size: 20px; }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }

  .header-cta {
    padding: 9px 13px;
    font-size: 13px;
    letter-spacing: .05em;
  }

  .nav-toggle { padding: 8px 10px; }

  .section-head { align-items: flex-start; }
}

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

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

  [data-js="true"] [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .media:hover img { transform: none; }
}
