:root {
  --bg: #080d18;
  --panel: rgba(13, 20, 34, 0.7);
  --panel-strong: rgba(16, 24, 42, 0.88);
  --text: #eaf0ff;
  --muted: #a0add8;
  --blue: #65d5ff;
  --teal: #67f0be;
  --violet: #a27cf2;
  --danger: #ff7a9d;
  --line: rgba(173, 188, 244, 0.22);
  --radius: 24px;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "SF Pro Display", "PingFang SC", "Segoe UI", "Noto Sans SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, #122042 0, transparent 32%),
    radial-gradient(circle at 90% 35%, #1a2844 0, transparent 35%),
    radial-gradient(circle at 50% 100%, #141f38 0, transparent 48%),
    var(--bg);
  scroll-behavior: smooth;
}

.grain,
.ambient-orb {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.grain {
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(255, 255, 255, 0.12) 0,
    transparent 0
  );
  background-size: 4px 4px;
  opacity: 0.08;
}

.ambient-orb {
  filter: blur(65px);
  opacity: 0.42;
}

.ambient-orb.orb-left {
  left: -25%;
  top: -8%;
  width: 55vw;
  height: 55vw;
  max-width: 650px;
  max-height: 650px;
  background: linear-gradient(140deg, #67f0be, #65d5ff);
}

.ambient-orb.orb-right {
  right: -30%;
  top: 30%;
  width: 60vw;
  height: 60vw;
  max-width: 720px;
  max-height: 720px;
  background: linear-gradient(40deg, #a27cf2, #65d5ff);
}

body {
  position: relative;
  overflow-x: hidden;
}

.wrap {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 1rem;
  z-index: 30;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  background: #0c1933;
  border: 1px solid var(--line);
  color: #e5eeff;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: linear-gradient(
    to right,
    rgba(10, 16, 30, 0.75),
    rgba(10, 16, 30, 0.45)
  );
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.brand {
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.95rem;
}

.nav-links a {
  color: #dce6ff;
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: #fff;
}

button {
  font: inherit;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 0.56rem 1rem;
  cursor: pointer;
}

.section {
  padding: 5.5rem 0 0;
  scroll-margin-top: 90px;
}

.hero {
  padding-top: 6rem;
}

.hero-grid {
  display: grid;
  gap: 1.1rem;
  max-width: 820px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.86rem;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.12;
}

.hero-subtitle {
  color: #cfd8fa;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  max-width: 58ch;
  margin: 0.2rem 0 0.7rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #062031;
}

.btn-ghost {
  color: #e4edff;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

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

.btn-ghost:hover {
  border-color: rgba(163, 200, 255, 0.5);
  box-shadow: 0 12px 30px rgba(30, 75, 170, 0.2);
}

.btn.is-disabled-link,
.footer a.is-disabled-link {
  opacity: 0.54;
  pointer-events: none;
  cursor: default;
  filter: grayscale(0.5);
}

.tiny-note {
  color: #98a6d9;
  font-size: 0.9rem;
}

.section-card,
.card,
.arch-canvas,
.status-grid,
.grid-2,
.macos-cards {
  animation: fadeUp 0.7s ease both;
}

.section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  background: linear-gradient(
    180deg,
    rgba(12, 19, 33, 0.85),
    rgba(12, 19, 33, 0.6)
  );
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.section-kicker {
  color: var(--blue);
  font-weight: 700;
  margin: 0;
}

h2 {
  font-size: clamp(1.45rem, 3.2vw, 2.3rem);
  margin-bottom: 0.5rem;
}

.section-subtitle,
#problem p,
#loop > .wrap > p,
#architecture p,
#macos p,
#status p {
  color: #c5cfed;
}

.status-meta {
  margin-top: 0.95rem;
  color: #9fb0dd;
  font-size: 0.95rem;
}

.loop-grid {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  border-radius: 18px;
  padding: 1.2rem;
  border: 1px solid var(--line);
  background: var(--panel);
  min-height: 160px;
}

.card h3 {
  margin: 0;
}

.card p {
  color: #bcc9f1;
  margin-bottom: 0;
}

.card,
.pulse {
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.pulse {
  transform: translateY(8px);
  opacity: 0.95;
}

.pulse:hover,
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(165, 211, 255, 0.35);
  box-shadow: 0 14px 45px rgba(30, 75, 170, 0.26);
}

.delay-1 {
  animation-delay: 0.08s;
}

.delay-2 {
  animation-delay: 0.16s;
}

.delay-3 {
  animation-delay: 0.24s;
}

.arch-canvas {
  margin: 1.1rem 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.arch-layer {
  background: rgba(10, 20, 35, 0.8);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 16px;
  padding: 1rem;
}

.grid-2,
.macos-cards,
.status-grid {
  margin-top: 1.2rem;
  display: grid;
  gap: 1rem;
}

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

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

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

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

.status.now {
  border-left: 5px solid #49d89e;
}

.status.next {
  border-left: 5px solid #f2bf4f;
}

.status.later {
  border-left: 5px solid #818caa;
}

.status-tag {
  font-weight: 700;
  margin-top: 0;
  color: #81ffe1;
}

ul,
ol {
  margin: 0.7rem 0 0;
  color: #bfd3ff;
  line-height: 1.85;
}

.code-block {
  margin: 0.7rem 0 0.95rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(4, 8, 16, 0.78);
  color: #c8d8ff;
  overflow: auto;
  line-height: 1.45;
  font-family: "SFMono-Regular", Consolas, Menlo, Monaco, "Courier New", monospace;
  font-size: 0.92rem;
}

.command-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.copy-feedback {
  color: var(--teal);
  font-size: 0.9rem;
  min-height: 1.3rem;
}

.btn-sm {
  padding: 0.58rem 1rem;
  font-size: 0.9rem;
}

.footer {
  margin-top: 4.8rem;
  border-top: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.84);
  padding: 1.8rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer a {
  color: #bfd3ff;
  text-decoration: none;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .topbar {
    position: static;
  }

  .topbar-inner {
    gap: 0.8rem;
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    row-gap: 0.45rem;
  }

  .loop-grid,
  .arch-canvas,
  .grid-2,
  .start-grid,
  .macos-cards,
  .status-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .section {
    padding-top: 4rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 9.3vw, 2.65rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-card,
  .card,
  .arch-canvas,
  .status-grid,
  .grid-2,
  .macos-cards,
  .loop-grid,
  .grain,
  .ambient-orb,
  .reveal,
  .pulse,
  .code-block,
  .btn,
  .btn:hover,
  .card:hover,
  .pulse:hover {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
