/* =========================================================
   卡卡湾电投简 — 共享 Site Kit
   深海蓝底槽 / 电子青线路 / 信号橙跳转点
   ========================================================= */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--deep);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--ink); text-underline-offset: 3px; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 2. Tokens ---------- */
:root {
  --ink: #0B1F33;
  --cyan: #21D4D8;
  --orange: #FF7A3D;
  --rock: #5B646B;
  --moss: #7A9A6E;
  --clay: #B86B4B;
  --paper: #F4F1EA;
  --mist: #DCE7F0;
  --deep: #0E1720;
  --ice: #F7FBFD;
  --ink-soft: #26384A;
  --line: rgba(14, 23, 32, 0.14);

  --wrap-w: 1240px;
  --gutter: clamp(18px, 4vw, 48px);
  --bd: 3px;
  --shadow-hard: 6px 6px 0 var(--ink);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-display: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-interface: "Archivo Black", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  --font-body: "Noto Sans SC", system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", SFMono-Regular, ui-monospace, Consolas, "Courier New", monospace;
}

/* ---------- 3. Base typography ---------- */
p, li { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rock);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 3px;
  background: var(--cyan);
}

.display-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.2vw, 60px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.22;
  color: var(--ink);
}

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 62ch;
}

.body-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
  max-width: 68ch;
}

/* ---------- 4. Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(48px, 7vw, 96px); }
.section--tight { padding-block: clamp(28px, 4vw, 56px); }

.grid {
  display: grid;
  gap: clamp(18px, 2.4vw, 32px);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--offset { padding-bottom: clamp(16px, 3vw, 32px); }
.grid--offset > :nth-child(even) { transform: translateY(clamp(0px, 2vw, 28px)); }

/* ---------- 5. Buttons ---------- */
.btn {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink);
  --btn-bd: var(--ink);
  --btn-shadow: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-align: center;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: var(--bd) solid var(--btn-bd);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--btn-shadow);
  cursor: pointer;
  transition:
    transform 0.16s var(--ease),
    box-shadow 0.16s var(--ease),
    background-color 0.16s var(--ease),
    color 0.16s var(--ease),
    border-color 0.16s var(--ease);
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--btn-shadow);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--btn-shadow);
}

.btn-primary {
  --btn-bg: var(--orange);
  --btn-fg: var(--deep);
  --btn-bd: var(--deep);
  --btn-shadow: var(--ink);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: currentColor;
  --btn-bd: currentColor;
  --btn-shadow: transparent;
  box-shadow: none;
}
.btn-ghost:hover {
  --btn-bd: var(--orange);
  --btn-fg: var(--orange);
  transform: none;
  box-shadow: none;
}
.btn-ghost:active { transform: none; box-shadow: none; }

.btn-outline {
  --btn-bg: transparent;
  --btn-fg: var(--paper);
  --btn-bd: var(--paper);
  --btn-shadow: transparent;
  box-shadow: none;
}
.btn-outline:hover {
  --btn-bd: var(--cyan);
  --btn-fg: var(--cyan);
  transform: none;
  box-shadow: none;
}
.btn-outline:active { transform: none; box-shadow: none; }

/* ---------- 6. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
  color: var(--deep);
  background: var(--orange);
  border: var(--bd) solid var(--deep);
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform 0.18s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- 7. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  color: var(--ink);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.28s var(--ease),
    color 0.28s var(--ease),
    border-color 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}
.site-header.is-scrolled {
  color: var(--paper);
  background: var(--ink);
  border-bottom-color: rgba(33, 212, 216, 0.32);
  box-shadow: 0 20px 34px -30px rgba(11, 31, 51, 0.95);
}

/* 顶部等宽状态带 */
.header-rail {
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background-color 0.28s var(--ease), border-color 0.28s var(--ease);
}
.header-rail-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--wrap-w);
  margin-inline: auto;
  height: 30px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--rock);
  white-space: nowrap;
}
.rail-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(33, 212, 216, 0.85);
}
.rail-status { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.rail-sep {
  flex: 0 1 40px;
  height: 1px;
  min-width: 16px;
  background: linear-gradient(90deg, var(--rock), transparent);
}
.rail-mono { flex: 0 0 auto; letter-spacing: 0.22em; }

.site-header.is-scrolled .header-rail {
  background: rgba(33, 212, 216, 0.08);
  border-bottom-color: rgba(33, 212, 216, 0.22);
}
.site-header.is-scrolled .header-rail-inner { color: rgba(244, 241, 234, 0.72); }
.site-header.is-scrolled .rail-sep { background: linear-gradient(90deg, var(--cyan), transparent); }

/* 主行 */
.header-main {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  width: 100%;
  max-width: var(--wrap-w);
  margin-inline: auto;
  padding: 15px var(--gutter);
  transition: padding 0.28s var(--ease);
}
.site-header.is-scrolled .header-main { padding-block: 9px; }

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  align-items: end;
  gap: 3px;
  height: 26px;
}
.brand-mark i {
  display: block;
  width: 5px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(33, 212, 216, 0.55);
}
.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 26px; }

.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name {
  font-family: var(--font-interface);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: inherit;
}
.brand-tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  line-height: 1.3;
  color: var(--rock);
}
.site-header.is-scrolled .brand-tagline { color: rgba(244, 241, 234, 0.7); }

/* 移动目录按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 9px 14px;
  color: inherit;
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 0;
  cursor: pointer;
}
.nav-toggle-bars { display: grid; gap: 3px; width: 18px; }
.nav-toggle-bars i {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.site-header[data-open] .nav-toggle-bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle-bars i:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle-bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.nav-toggle-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
}

/* 导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 26px);
  margin-left: auto;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.1vw, 18px);
}
.nav-item { display: block; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 2px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }

.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--rock);
  transition: color 0.2s var(--ease);
}
.nav-link:hover .nav-index { color: var(--orange); }

.nav-link[aria-current="page"] { font-weight: 700; }
.nav-link[aria-current="page"]::after {
  height: 4px;
  background: var(--cyan);
  transform: scaleX(1);
}
.nav-link[aria-current="page"] .nav-index { color: var(--orange); }

.site-header.is-scrolled .nav-index { color: rgba(33, 212, 216, 0.85); }
.site-header.is-scrolled .nav-link[aria-current="page"]::after { background: var(--cyan); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: clamp(10px, 1.6vw, 24px);
  border-left: 2px solid rgba(91, 100, 107, 0.3);
}
.site-header.is-scrolled .nav-actions { border-left-color: rgba(244, 241, 234, 0.2); }
.nav-actions .btn { padding: 11px 16px; font-size: 13px; }

/* 滚动进度 */
.header-progress {
  height: 3px;
  background: rgba(11, 31, 51, 0.1);
  transition: background-color 0.28s var(--ease);
}
.site-header.is-scrolled .header-progress { background: rgba(33, 212, 216, 0.16); }
.header-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--orange));
}

/* ---------- 8. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: 6px;
  color: var(--paper);
  background: var(--ink);
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--orange) 55%, var(--clay) 100%);
  z-index: 2;
}
.footer-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(33, 212, 216, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 212, 216, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 72%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 72%);
}

.footer-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 1.1fr) minmax(0, 1.45fr) minmax(230px, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  width: 100%;
  max-width: var(--wrap-w);
  margin-inline: auto;
  padding: clamp(42px, 6vw, 76px) var(--gutter) clamp(32px, 4.5vw, 52px);
}

.footer-lead { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.footer-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
}
.footer-brandline {
  font-family: var(--font-interface);
  font-weight: 800;
  font-size: clamp(19px, 2.1vw, 23px);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--paper);
  max-width: 22ch;
}
.footer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 32px);
}
.footer-col { display: flex; flex-direction: column; gap: 2px; }
.footer-col-title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.footer-col-list { display: flex; flex-direction: column; }

.footer-link {
  display: inline-block;
  padding: 5px 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: rgba(244, 241, 234, 0.82);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--paper);
  border-bottom-color: var(--orange);
}

.footer-contact { display: flex; flex-direction: column; }
.footer-contact-list { display: flex; flex-direction: column; gap: 16px; }
.footer-label {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(33, 212, 216, 0.85);
}
.footer-value {
  display: block;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(244, 241, 234, 0.9);
  overflow-wrap: break-word;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  background: transparent;
  border: 2px solid rgba(33, 212, 216, 0.55);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.copy-btn:hover {
  color: var(--ink);
  background: var(--cyan);
  border-color: var(--cyan);
}
.copy-btn.is-copied {
  color: var(--moss);
  border-color: var(--moss);
  background: transparent;
}

.footer-base {
  position: relative;
  border-top: 1px solid rgba(244, 241, 234, 0.16);
}
.footer-base-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  width: 100%;
  max-width: var(--wrap-w);
  margin-inline: auto;
  padding: 18px var(--gutter) 26px;
}
.footer-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: rgba(244, 241, 234, 0.6);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 4px;
}
.footer-legal-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(244, 241, 234, 0.72);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-legal-links a:hover,
.footer-legal-links a:focus-visible {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* ---------- 9. Shared page components ---------- */
.crumbs {
  padding-block: 14px;
  border-bottom: 1px solid rgba(91, 100, 107, 0.25);
}
.crumbs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.crumbs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--rock);
}
.crumbs-item + .crumbs-item::before { content: "/"; color: var(--rock); }
.crumb {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s var(--ease);
}
.crumb:hover,
.crumb:focus-visible { border-bottom-color: var(--orange); }
.crumb-current { color: var(--ink); font-weight: 500; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 2.2vw, 28px);
  background: var(--ice);
  border: var(--bd) solid var(--ink);
  box-shadow: var(--shadow-hard);
  transition:
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.card:hover,
.card:focus-within {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--ink);
  border-color: var(--cyan);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title {
  font-family: var(--font-interface);
  font-size: clamp(17px, 1.8vw, 20px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.card-text { font-size: 15px; line-height: 1.75; color: var(--ink-soft); }
.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}
.card-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--rock);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid currentColor;
  background: transparent;
  color: var(--ink);
}
.tag--live {
  color: #3B5630;
  background: rgba(122, 154, 110, 0.18);
  border-color: var(--moss);
}
.tag--warn {
  color: #96430F;
  background: rgba(255, 122, 61, 0.16);
  border-color: var(--orange);
}
.tag--archive {
  color: #7C4126;
  background: rgba(184, 107, 75, 0.16);
  border-color: var(--clay);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.filter-btn {
  appearance: none;
  padding: 9px 16px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  color: var(--ink);
  background: var(--ice);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 rgba(11, 31, 51, 0.85);
  cursor: pointer;
  transition:
    transform 0.16s var(--ease),
    box-shadow 0.16s var(--ease),
    background-color 0.16s var(--ease),
    color 0.16s var(--ease),
    border-color 0.16s var(--ease);
}
.filter-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(11, 31, 51, 0.85);
  border-color: var(--orange);
}
.filter-btn[aria-pressed="true"] {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--cyan);
}
.filter-btn[aria-pressed="true"]::before {
  content: "●";
  margin-right: 7px;
  font-size: 9px;
  vertical-align: middle;
  color: var(--orange);
}

.timeline {
  --tl-pad: clamp(18px, 2.6vw, 30px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.6vw, 30px);
  padding-left: var(--tl-pad);
  border-left: var(--bd) solid var(--ink);
}
.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--tl-pad) - 12px);
  top: 7px;
  width: 16px;
  height: 16px;
  background: var(--cyan);
  border: var(--bd) solid var(--ink);
}
.timeline-date {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--rock);
}

.media {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  background: var(--mist);
  border: var(--bd) solid var(--ink);
  box-shadow: 8px 8px 0 rgba(11, 31, 51, 0.16);
}
.media > img,
.media > svg,
.media > video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.media--wide > img,
.media--wide > svg,
.media--wide > video { aspect-ratio: 21 / 9; }
.media--square > img,
.media--square > svg,
.media--square > video { aspect-ratio: 1 / 1; }
.media-caption {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ice);
  border-top: 2px solid var(--ink);
}

/* ---------- 10. Motion hooks ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 11. Focus ---------- */
:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
.site-footer :where(a, button):focus-visible {
  outline-color: var(--cyan);
}

/* ---------- 12. Responsive ---------- */
@media (max-width: 1140px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    background: var(--ink);
    border-top: var(--bd) solid var(--cyan);
    box-shadow: 0 26px 44px -30px rgba(11, 31, 51, 0.95);
    transition: max-height 0.32s var(--ease), visibility 0.32s var(--ease);
  }
  .site-header[data-open] .site-nav {
    max-height: min(78vh, 660px);
    overflow-y: auto;
    visibility: visible;
  }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item { border-bottom: 1px solid rgba(244, 241, 234, 0.12); }

  .nav-link {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    color: var(--paper);
  }
  .nav-link::after { display: none; }
  .nav-index { color: rgba(33, 212, 216, 0.85); font-size: 11px; }
  .nav-link:hover .nav-index { color: var(--orange); }
  .nav-link[aria-current="page"] { background: rgba(33, 212, 216, 0.1); }
  .nav-link[aria-current="page"] .nav-index { color: var(--orange); }
  .site-header.is-scrolled .nav-index { color: rgba(33, 212, 216, 0.85); }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px 20px 22px;
    border-left: 0;
    border-top: 1px solid rgba(244, 241, 234, 0.12);
  }
  .nav-actions .btn { width: 100%; padding: 12px 16px; }
  .nav-actions .btn-ghost { --btn-fg: var(--paper); }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .footer-contact { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .grid--offset > :nth-child(even) { transform: none; }
}

@media (max-width: 760px) {
  .header-rail-inner { height: 26px; font-size: 10px; letter-spacing: 0.08em; }
  .rail-mono { display: none; }
  .rail-sep { display: none; }
  .brand-name { font-size: 17px; }
  .brand-tagline { font-size: 9px; letter-spacing: 0.1em; }
  .header-main { padding-block: 12px; }

  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brandline { max-width: none; }
  .footer-base-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 560px) {
  .brand-mark { height: 22px; }
  .brand-tagline { display: none; }
  .nav-toggle-label { display: none; }
  .footer-nav { grid-template-columns: minmax(0, 1fr); }
  .footer-actions .btn { flex: 1 1 auto; }
  .media { box-shadow: 5px 5px 0 rgba(11, 31, 51, 0.16); }
}

/* ---------- 13. Reduced motion ---------- */
@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;
  }
  .btn:hover,
  .filter-btn:hover,
  .card:hover { transform: none; }
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
