:root {
  --bg: #050507;
  --bg-subtle: #0b0b0f;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-hover: rgba(255, 255, 255, 0.045);
  --surface-elevated: #0e0e13;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #ffffff;
  --emerald: #34d399;
  --amber: #fbbf24;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  letter-spacing: -0.011em;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: #000;
  padding: 8px 14px;
  font-weight: 600;
  z-index: 1000;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  border-radius: 6px;
}

/* Ambient Top Glow */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 42% at 50% -8%, rgba(255, 255, 255, 0.075), transparent 70%),
    radial-gradient(ellipse 45% 30% at 50% 18%, rgba(120, 140, 255, 0.045), transparent 70%);
  animation: ambientBreath 12s ease-in-out infinite alternate;
}

@keyframes ambientBreath {
  0% {
    opacity: 0.75;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 12px, 0) scale(1.04);
  }
}

@keyframes heroRise {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@keyframes pulseRing {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(5, 5, 7, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.nav-links a {
  transition: color 0.16s ease;
}

.nav-links a:hover {
  color: var(--text);
}

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

.lang-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  transition: color 0.16s ease, background 0.16s ease;
}

.lang-link:hover {
  color: var(--text);
  background: var(--surface);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-primary {
  background: #f5f5f7;
  color: #050507;
  font-weight: 600;
}

.btn-primary:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.16);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Hero */
.hero {
  padding: 92px 0 64px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  animation: heroRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-eyebrow .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulseRing 2.6s ease-in-out infinite;
}

.hero h1 {
  margin: 0 auto 24px;
  max-width: 880px;
  font-size: clamp(2.5rem, 5.5vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 30%, #a1a1aa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: heroRise 0.75s 0.08s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-lead {
  max-width: 640px;
  margin: 0 auto 34px;
  font-size: clamp(1rem, 1.3vw, 1.16rem);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.65;
  animation: heroRise 0.75s 0.16s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-lead code {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.9em;
}

.hero-cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 64px;
  animation: heroRise 0.75s 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* macOS Showcase Window */
.showcase-wrap {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  animation: heroRise 0.9s 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.showcase-wrap::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0.06));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.mac-window {
  background: #0b0b0f;
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  box-shadow:
    0 40px 100px -20px rgba(0, 0, 0, 0.85),
    0 0 80px -30px rgba(255, 255, 255, 0.08);
}

.mac-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.traffic-lights {
  display: flex;
  gap: 7px;
  align-items: center;
}

.traffic-lights span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.mac-window:hover .tl-r { background: #ff5f57; }
.mac-window:hover .tl-y { background: #febc2e; }
.mac-window:hover .tl-g { background: #28c840; }

.segmented-control {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.seg-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.mac-path {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.mac-body {
  display: grid;
  grid-template-columns: 196px 248px 1fr;
  min-height: 368px;
}

.mac-sidebar {
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.012);
}

.mac-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 10px 5px;
  font-weight: 600;
}

.mac-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1px;
}

.mac-nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 500;
}

.mac-nav-item span:last-child {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.mac-list {
  border-right: 1px solid var(--border);
  padding: 12px 10px;
}

.mac-skill-item {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  border: 1px solid transparent;
}

.mac-skill-item.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.mac-skill-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 500;
}

.mac-skill-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
}

.dot-warn {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

.mac-detail {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.detail-panel {
  display: none;
}

.detail-panel.active {
  display: block;
  animation: panelIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.detail-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.detail-top h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.detail-top code {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.switch-row.interactive {
  cursor: pointer;
}

.switch-row.interactive:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
}

.switch-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.switch-info strong {
  font-size: 0.8rem;
  font-weight: 500;
}

.switch-info small {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Native macOS Switch */
.mac-switch {
  position: relative;
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.mac-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch-row[data-state="on"] .mac-switch {
  background: var(--emerald);
}

.switch-row[data-state="on"] .mac-switch::after {
  transform: translateX(13px);
}

.conflict-tag {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--amber);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}

.mac-statusbar {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mac-statusbar span:first-child {
  color: var(--text-secondary);
}

/* Editorial Sections */
.section {
  padding: 112px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0 0 14px;
  font-size: clamp(1.85rem, 3.4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.section-head p {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text-secondary);
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.bento-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card::before,
.hairline-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.055), transparent 70%);
  transition: opacity 0.3s ease;
}

.bento-card:hover::before,
.hairline-cell:hover::before {
  opacity: 1;
}

.bento-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }

.bento-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--text);
}

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

.bento-card h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.bento-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bento-card code {
  font-size: 0.84em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
}

.bento-mono-box {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.bento-mono-box .hl {
  color: var(--emerald);
}

/* Hairline Grid for Agents */
.hairline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--border);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.hairline-cell {
  position: relative;
  background: var(--bg);
  padding: 24px 26px;
  transition: background 0.2s ease;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

.hairline-cell:hover {
  background: var(--bg-subtle);
}

.cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cell-head strong {
  font-size: 0.98rem;
  font-weight: 600;
}

.cell-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hairline-cell code {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  word-break: break-all;
}

.hairline-cell p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Comparison Table */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow-x: auto;
  background: var(--surface);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.compare-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table td:first-child {
  font-weight: 500;
  color: var(--text);
}

.compare-table td {
  color: var(--text-muted);
}

.compare-table .col-best {
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  font-weight: 500;
}

/* Quickstart Split */
.split-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.terminal-card {
  background: #09090d;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.terminal-title {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.4);
}

.terminal-body {
  padding: 20px;
  overflow-x: auto;
  flex: 1;
}

.terminal-body pre {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.terminal-body .cmd-comment {
  color: var(--text-muted);
}

/* Minimalist Hairline FAQ */
.faq-list {
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  list-style: none;
  padding: 24px 0;
  font-size: 1.04rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--text);
}

.faq-answer {
  padding: 0 0 24px;
  max-width: 780px;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.7;
}

.faq-answer code {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 56px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer-links a:hover,
.site-footer a:hover {
  color: var(--text);
}

/* Responsive */
@media (max-width: 960px) {
  .span-7, .span-5, .span-4, .span-6 {
    grid-column: span 12;
  }
  .hairline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mac-body {
    grid-template-columns: 1fr;
  }
  .mac-sidebar, .mac-list {
    display: none;
  }
  .split-2 {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 64px 0 40px;
  }
  .section {
    padding: 72px 0;
  }
  .hairline-grid {
    grid-template-columns: 1fr;
  }
  .switch-grid {
    grid-template-columns: 1fr;
  }
}
