/* ============================================================
   MeowArch — “Neko Terminal” design system
   Dark-first cozy terminal aesthetic: ink surfaces, cat-amber
   primary, Arch-sky secondary, monospace accents, paw motifs.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg: #0c0f14;
  --bg-soft: #10141b;
  --surface: #12161d;
  --surface-2: #171d26;
  --surface-3: #1e2632;
  --line: #232b38;
  --line-2: #313d50;
  --text: #e9edf4;
  --text-2: #a8b3c4;
  --text-3: #7b8798;
  --amber: #f5a97f;
  --amber-2: #ffc9a3;
  --amber-ink: #26130a;
  --sky: #8aadf4;
  --sky-2: #b7ceff;
  --green: #a6da95;
  --red: #ee99a0;
  --yellow: #eed49f;
  --on-amber: #26130a;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono",
    "Source Code Pro", Menlo, Consolas, "Noto Sans Mono CJK SC", monospace;

  --radius-s: 9px;
  --radius: 14px;
  --radius-l: 22px;
  --maxw: 1128px;
  --topbar-h: 68px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 12px 34px -14px rgba(0, 0, 0, 0.55);
  --glow-amber: 0 0 0 1px rgba(245, 169, 127, 0.25), 0 8px 30px -10px rgba(245, 169, 127, 0.35);
}

[data-theme="light"] {
  --bg: #f6f1e8;
  --bg-soft: #f1ebdf;
  --surface: #fffdf8;
  --surface-2: #f8f2e6;
  --surface-3: #f0e7d6;
  --line: #e6dbc6;
  --line-2: #d2c3a6;
  --text: #2e2a24;
  --text-2: #6c6455;
  --text-3: #9a9080;
  --amber: #c06728;
  --amber-2: #a25318;
  --sky: #3466b6;
  --sky-2: #274f8f;
  --green: #3f7d33;
  --red: #b2454f;
  --yellow: #8f6d10;
  --on-amber: #fff8ef;
  --shadow-1: 0 1px 2px rgba(83, 66, 40, 0.12);
  --shadow-2: 0 14px 34px -16px rgba(83, 66, 40, 0.3);
  --glow-amber: 0 0 0 1px rgba(192, 103, 40, 0.28), 0 10px 30px -12px rgba(192, 103, 40, 0.35);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 14px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

[hidden] {
  display: none !important;
}

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

a {
  color: var(--sky);
  text-decoration: none;
}

a:hover {
  color: var(--sky-2);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

code {
  font-family: var(--font-mono);
}

::selection {
  background: var(--amber);
  color: var(--on-amber);
}

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

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

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--amber);
  color: var(--on-amber);
  border-radius: var(--radius-s);
  font-weight: 700;
  transition: top 0.2s ease;
}

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

/* ---------- ambient decor ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-decor::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46rem 30rem at 82% -10%, rgba(138, 173, 244, 0.09), transparent 62%),
    radial-gradient(42rem 30rem at 8% 4%, rgba(245, 169, 127, 0.09), transparent 60%);
}

[data-theme="light"] .bg-decor::before {
  background:
    radial-gradient(46rem 30rem at 82% -10%, rgba(52, 102, 182, 0.08), transparent 62%),
    radial-gradient(42rem 30rem at 8% 4%, rgba(192, 103, 40, 0.09), transparent 60%);
}

.bg-decor::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.16;
  mask-image: radial-gradient(70rem 44rem at 50% 0%, #000 0%, transparent 72%);
}

[data-theme="light"] .bg-decor::after {
  opacity: 0.34;
}

.bg-paw {
  position: absolute;
  font-size: 26px;
  opacity: 0.07;
  transform: rotate(-18deg);
  color: var(--amber);
}

.bg-paw.paw-a { top: 18%; left: 4%; }
.bg-paw.paw-b { top: 55%; left: 92%; transform: rotate(24deg); font-size: 34px; }
.bg-paw.paw-c { top: 82%; left: 12%; transform: rotate(12deg); font-size: 30px; }

/* ---------- layout shell ---------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 36px);
}

.section {
  padding: clamp(46px, 7vw, 84px) 0 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(26px, 4vw, 42px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

.kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -0.02em;
  margin-top: 10px;
}

.section-head .sub {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 16.5px;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background-color 0.3s ease;
}

.topbar.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-1);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--topbar-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  margin-right: auto;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 37px;
  height: 35px;
  flex: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand-mark {
  transform: rotate(-7deg) scale(1.06);
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: block;
}

.brand-name em {
  font-style: normal;
  color: var(--amber);
}

.brand-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  line-height: 1.3;
}

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

.nav a {
  position: relative;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 600;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav a[aria-current="page"] {
  color: var(--amber-2);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-button:hover {
  color: var(--amber);
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  height: 38px;
  padding: 0 30px 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237b8798' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.lang-select:hover {
  border-color: var(--line-2);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease,
    background-color 0.18s ease, color 0.18s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

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

.btn-primary {
  background: linear-gradient(160deg, var(--amber-2), var(--amber));
  color: var(--on-amber);
  box-shadow: 0 6px 20px -8px rgba(245, 169, 127, 0.55);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -10px rgba(245, 169, 127, 0.65);
}

[data-theme="light"] .btn-primary {
  box-shadow: 0 6px 18px -8px rgba(160, 84, 24, 0.5);
}

.btn-ghost {
  border-color: var(--line-2);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.btn-ghost:hover {
  border-color: var(--amber);
  color: var(--amber-2);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 13.5px;
}

.btn-danger {
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
  color: var(--red);
  background: color-mix(in srgb, var(--red) 8%, transparent);
}

.btn-danger:hover {
  border-color: var(--red);
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- mobile menu ---------- */
.menu-toggle {
  display: none;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: calc(var(--topbar-h) - 8px);
  left: 14px;
  right: 14px;
  z-index: 99;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 13px 16px;
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-weight: 600;
  font-size: 15.5px;
}

.mobile-menu a:hover,
.mobile-menu a[aria-current="page"] {
  color: var(--amber-2);
  background: color-mix(in srgb, var(--amber) 10%, transparent);
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(28px, 5vw, 58px);
  align-items: center;
  padding: clamp(52px, 8vw, 96px) 0 clamp(30px, 4vw, 48px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 9%, transparent);
  color: var(--amber-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

.hero h1 {
  margin-top: 20px;
  font-size: clamp(46px, 7vw, 76px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.hero h1 .h1-arch {
  color: var(--amber);
}

.hero h1 .paw-accent {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-left: 0.1em;
  vertical-align: 0.06em;
  fill: var(--amber);
  transform: rotate(-14deg);
}

.hero .lede {
  margin-top: 20px;
  font-size: clamp(16.5px, 1.6vw, 18.5px);
  color: var(--text-2);
  max-width: 34em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 30px;
}

.release-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  font-family: var(--font-mono);
  font-size: 12.8px;
  color: var(--text-2);
  transition: border-color 0.2s ease;
}

a.release-pill:hover {
  border-color: var(--amber);
}

.release-pill strong {
  color: var(--amber-2);
  font-weight: 700;
}

.release-pill .dot {
  color: var(--text-3);
}

.release-pill .spark {
  color: var(--amber);
}

.release-pill.is-loading strong {
  color: var(--text-3);
  animation: pulse-soft 1.4s ease-in-out infinite;
}

@keyframes pulse-soft {
  50% { opacity: 0.45; }
}

/* ---------- terminal ---------- */
.terminal {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--bg-soft) 92%, #000 8%);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

[data-theme="light"] .terminal {
  background: #232936;
  border-color: #2c3547;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
}

[data-theme="light"] .terminal-bar {
  background: #2b3342;
}

.terminal-bar .t-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.t-dot:nth-child(1) { background: #ee99a0; }
.t-dot:nth-child(2) { background: #eed49f; }
.t-dot:nth-child(3) { background: #a6da95; }

.terminal-bar .t-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8b96a9;
}

.terminal-body {
  margin: 0;
  padding: 20px 20px 24px;
  font-family: var(--font-mono);
  font-size: 13.2px;
  line-height: 1.55;
  color: #c8d2e2;
  white-space: pre;
  overflow-x: auto;
}

[data-theme="light"] .terminal-body {
  color: #ccd6e6;
}

.terminal-body .t-cat { color: #f5a97f; font-weight: 700; }
.terminal-body .t-key { color: #8aadf4; }
.terminal-body .t-val { color: #e9edf4; }
.terminal-body .t-green { color: #a6da95; }
.terminal-body .t-dim { color: #6d7889; }
.terminal-body .t-prompt { color: #a6da95; }
.terminal-body .t-cmd { color: #e9edf4; font-weight: 700; }

.terminal-caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--amber);
  animation: caret-blink 1.05s steps(1) infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

/* ---------- stats strip ---------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 6px 0 10px;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}

.stat-chip .k {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--amber-2);
}

.stat-chip .v {
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- cards & ears ---------- */
.grid {
  display: grid;
  gap: 16px;
}

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

.card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-2);
}

/* cat ears unfold on hover */
.card--ear::before,
.card--ear::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 26px;
  height: 26px;
  background: var(--surface);
  border: 1px solid transparent;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  opacity: 0;
  transform: translateY(7px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.card--ear::before { left: 22px; }
.card--ear::after { right: 22px; }

.card--ear:hover::before,
.card--ear:hover::after {
  opacity: 1;
  transform: translateY(0);
  border-color: var(--line-2);
  border-bottom: none;
  clip-path: polygon(50% 0, -6% 116%, 106% 116%);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--amber) 13%, transparent);
  color: var(--amber);
  margin-bottom: 16px;
}

.feature-icon.tint-sky {
  background: color-mix(in srgb, var(--sky) 13%, transparent);
  color: var(--sky);
}

.feature-icon.tint-green {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
}

.feature-icon.tint-red {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  color: var(--red);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  font-size: 18.5px;
  letter-spacing: -0.01em;
}

.card p {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 14.5px;
}

/* ---------- latest build panel ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  overflow: hidden;
}

.panel-pad {
  padding: clamp(20px, 3vw, 30px);
}

.device-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12.8px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.device-chip:hover {
  transform: translateY(-1px);
  border-color: var(--amber);
  color: var(--text);
}

.device-chip.is-active {
  border-color: var(--amber);
  color: var(--amber-2);
  background: color-mix(in srgb, var(--amber) 10%, transparent);
}

.device-chip .s-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
}

.device-chip .s-dot.is-official { background: var(--green); }
.device-chip .s-dot.is-community { background: var(--yellow); }

.release-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(18px, 3vw, 34px);
  margin-top: 22px;
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.meta-chip {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}

.meta-chip b {
  color: var(--text);
  font-weight: 600;
}

.artifact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.artifact {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.artifact:hover {
  border-color: var(--amber);
  transform: translateX(3px);
}

.artifact .a-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--sky) 12%, transparent);
  color: var(--sky);
  flex: none;
}

.artifact .a-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.artifact .a-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

.artifact .a-sub {
  font-family: var(--font-mono);
  font-size: 11.8px;
  color: var(--text-3);
  line-height: 1.4;
  word-break: break-all;
}

.artifact .a-go {
  margin-left: auto;
  color: var(--text-3);
  font-size: 17px;
  flex: none;
}

.checksum {
  margin-top: 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
}

.checksum .c-cmd {
  color: var(--green);
}

.checksum .c-hash {
  color: var(--text-2);
  word-break: break-all;
}

/* ---------- news ---------- */
.news-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  overflow: hidden;
}

.news-item {
  display: flex;
  gap: 16px;
  padding: 19px 22px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.18s ease;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item:hover {
  background: var(--surface-2);
}

.news-item .n-date {
  flex: none;
  width: 88px;
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.news-item .n-title {
  font-weight: 700;
  font-size: 15.5px;
}

.news-item:hover .n-title {
  color: var(--amber-2);
}

.news-item .n-sum {
  margin-top: 3px;
  font-size: 13.8px;
  color: var(--text-2);
}

/* ---------- community / link cards ---------- */
.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
}

.link-card:hover h3 {
  color: var(--amber-2);
}

.link-card .lc-go {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  transition: color 0.2s ease;
}

.link-card:hover .lc-go {
  color: var(--amber);
}

/* ---------- subpage hero ---------- */
.page-hero {
  padding: clamp(40px, 6vw, 68px) 0 clamp(24px, 3.6vw, 40px);
}

.page-hero .crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 16px;
  transition: color 0.2s ease;
}

.page-hero .crumb:hover {
  color: var(--amber);
}

.page-hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.page-hero h1 em {
  font-style: normal;
  color: var(--amber);
}

.page-hero .sub {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 16.5px;
  max-width: 40em;
}

/* ---------- flavor picker (download) ---------- */
.flavor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.flavor-card {
  position: relative;
  display: block;
  padding: 22px 24px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.flavor-card:hover {
  transform: translateY(-2px);
}

.flavor-card.is-active {
  border-color: var(--amber);
  box-shadow: var(--glow-amber);
}

.flavor-card.is-disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.flavor-card.is-disabled:hover {
  transform: none;
}

.flavor-card .f-status {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flavor-card .f-status.is-on {
  background: color-mix(in srgb, var(--green) 16%, transparent);
  color: var(--green);
}

.flavor-card .f-status.is-off {
  background: color-mix(in srgb, var(--yellow) 14%, transparent);
  color: var(--yellow);
}

.flavor-card h3 {
  font-size: 18px;
  margin-top: 4px;
}

.flavor-card p {
  margin-top: 6px;
  font-size: 13.8px;
  color: var(--text-2);
}

/* ---------- device cards (devices/download) ---------- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.device-card {
  position: relative;
  padding: 21px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.device-card.is-selectable {
  cursor: pointer;
}

.device-card.is-selectable:hover {
  transform: translateY(-3px);
  border-color: var(--amber);
  box-shadow: var(--shadow-2);
}

.device-card.is-active {
  border-color: var(--amber);
  box-shadow: var(--glow-amber);
}

.device-card.is-muted {
  opacity: 0.66;
}

.device-card h3 {
  font-size: 17.5px;
  padding-right: 74px;
}

.device-card .d-sub {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 12.2px;
  color: var(--text-3);
}

.device-card .d-soc {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--text-2);
}

.badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.badge.is-official {
  background: color-mix(in srgb, var(--green) 15%, transparent);
  color: var(--green);
}

.badge.is-community {
  background: color-mix(in srgb, var(--yellow) 13%, transparent);
  color: var(--yellow);
}

/* ---------- detail panel ---------- */
.detail {
  margin-top: 22px;
}

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  justify-content: space-between;
}

.detail-head h2 {
  font-size: clamp(21px, 2.6vw, 27px);
  letter-spacing: -0.02em;
}

.detail-head h2 em {
  font-style: normal;
  color: var(--amber);
}

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
}

.version-pill strong {
  color: var(--amber-2);
}

.detail .notes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.text-link-ish {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--amber);
  transition: color 0.2s ease;
}

.text-link-ish:hover {
  color: var(--amber-2);
}

/* ---------- state notes ---------- */
.state-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  color: var(--text-2);
  font-size: 14.5px;
}

.state-note.is-warning {
  border-color: color-mix(in srgb, var(--yellow) 45%, transparent);
  background: color-mix(in srgb, var(--yellow) 7%, transparent);
  color: var(--text);
}

.state-note.is-error {
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
  background: color-mix(in srgb, var(--red) 7%, transparent);
}

.state-note.is-ok {
  border-color: color-mix(in srgb, var(--green) 40%, transparent);
  background: color-mix(in srgb, var(--green) 7%, transparent);
}

/* ---------- requirements ---------- */
.req-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.req-list li {
  display: flex;
  gap: 11px;
  align-items: baseline;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14.5px;
}

.req-list li::before {
  content: "▸";
  color: var(--amber);
  font-family: var(--font-mono);
}

.req-list li b {
  color: var(--text);
}

/* ---------- admin ---------- */
.admin-gate {
  max-width: 470px;
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-s);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .field input,
[data-theme="light"] .field select,
[data-theme="light"] .field textarea {
  background: var(--surface);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 22%, transparent);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.field-grid .span-2 {
  grid-column: span 2;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 600;
}

.check-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--amber);
  cursor: pointer;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.admin-row:last-child {
  border-bottom: none;
}

.admin-row .r-main {
  min-width: 0;
}

.admin-row .r-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15.5px;
}

.admin-row .r-title .badge {
  position: static;
}

.admin-row .r-sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row .r-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex: none;
}

.admin-subhead {
  margin: 26px 0 13px;
  padding-top: 22px;
  border-top: 1px dashed var(--line-2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
}

.admin-subhead:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.admin-actions {
  display: flex;
  gap: 11px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.admin-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-3);
}

.status-line {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(6px);
  z-index: 150;
  max-width: min(92vw, 560px);
  padding: 12px 20px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.status-line.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.status-line.is-warning {
  border-color: color-mix(in srgb, var(--yellow) 50%, transparent);
}

.status-line.is-error {
  border-color: color-mix(in srgb, var(--red) 50%, transparent);
}

/* ---------- footer ---------- */
.footer {
  margin-top: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 70%, transparent);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  padding: 30px 0 34px;
  font-size: 13.8px;
  color: var(--text-3);
}

.footer-inner .f-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-2);
  font-weight: 700;
}

.footer-inner .f-brand img {
  width: 26px;
  height: 25px;
}

.footer-inner .f-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-left: auto;
}

.footer-inner a {
  color: var(--text-3);
  transition: color 0.2s ease;
}

.footer-inner a:hover {
  color: var(--amber);
}

.footer-note {
  padding: 0 0 30px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  opacity: 0.75;
}

/* ---------- reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal.d1 { --reveal-delay: 70ms; }
.reveal.d2 { --reveal-delay: 140ms; }
.reveal.d3 { --reveal-delay: 210ms; }
.reveal.d4 { --reveal-delay: 280ms; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .nav {
    display: none;
  }

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

  .hero {
    grid-template-columns: 1fr;
    padding-top: 40px;
  }

  .terminal {
    max-width: 640px;
  }

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

  .release-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar-inner {
    gap: 10px;
  }

  .top-actions {
    gap: 7px;
  }

  .lang-select {
    padding: 0 24px 0 10px;
    background-position: right 8px center;
  }

  .top-actions .github-link {
    display: none;
  }

  .brand-mark {
    width: 31px;
    height: 29px;
  }

  .terminal-body {
    font-size: 10.6px;
    padding: 16px 14px 18px;
  }

  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .flavor-grid {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-grid .span-2 {
    grid-column: span 1;
  }

  .req-list {
    grid-template-columns: 1fr;
  }

  .top-cta {
    display: none;
  }

  .brand-tag {
    display: none;
  }

  .admin-row {
    flex-wrap: wrap;
  }

  .admin-row .r-actions {
    margin-left: 0;
    width: 100%;
  }

  .admin-row .r-actions .btn {
    flex: 1;
  }

  .news-item .n-date {
    width: auto;
  }

  .news-item {
    flex-direction: column;
    gap: 5px;
  }
}

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

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .terminal-caret {
    animation: none;
  }
}
