/**
 * 6767.chat — Apple Design System Stylesheet
 * Principles: Light-first, Clarity, Deference, Depth, Clean SVGs (Zero Emojis), SF Typography
 */

:root {
  /* System Typography */
  --font-apple: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Color Palette — Light First (Apple Default) */
  --bg-page: #f5f5f7;
  --bg-section: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-tertiary: #fbfbfd;
  
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #a1a1a6;
  
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blue-active: #0062c4;
  --apple-blue-light: rgba(0, 113, 227, 0.08);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);
  --divider: rgba(0, 0, 0, 0.06);

  /* Frosted Glass / Translucency */
  --nav-bg: rgba(255, 255, 255, 0.82);
  --nav-border: rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.08);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 12px 36px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-floating: 0 20px 48px rgba(0, 0, 0, 0.12);

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 980px;

  /* Layout */
  --max-w-content: 1024px;
  --max-w-wide: 1200px;
}

[data-theme="dark"] {
  --bg-page: #000000;
  --bg-section: #161617;
  --bg-card: #1c1c1e;
  --bg-card-hover: #242426;
  --bg-tertiary: #121214;

  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-tertiary: #6e6e73;

  --apple-blue: #2997ff;
  --apple-blue-hover: #47a7ff;
  --apple-blue-active: #147ce5;
  --apple-blue-light: rgba(41, 151, 255, 0.15);

  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.24);
  --divider: rgba(255, 255, 255, 0.08);

  --nav-bg: rgba(22, 22, 23, 0.82);
  --nav-border: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(28, 28, 30, 0.72);
  --glass-border: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 12px 36px rgba(0, 0, 0, 0.6);
  --shadow-floating: 0 20px 48px rgba(0, 0, 0, 0.7);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-apple);
  color: var(--text-primary);
  background-color: var(--bg-page);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* ── Scroll Progress Bar ── */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: var(--apple-blue);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 10001;
  transition: transform 0.08s linear;
}

/* ── Apple Global Sticky Navigation Bar ── */
.apple-nav {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  height: 48px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--nav-border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.apple-nav-inner {
  max-width: var(--max-w-content);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.apple-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.apple-nav-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: block;
}

.apple-nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 28px;
}

.apple-nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: none;
  opacity: 0.8;
  letter-spacing: -0.01em;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.apple-nav-links a:hover {
  opacity: 1;
  color: var(--apple-blue);
}

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

.live-online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--apple-blue-light);
  color: var(--apple-blue);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(0, 113, 227, 0.15);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #34c759;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

.theme-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0.8;
  transition: opacity 0.2s, background-color 0.2s;
}

.theme-toggle-btn:hover {
  opacity: 1;
  background-color: var(--border-subtle);
}

/* ── Apple Announcement Ribbon ── */
.apple-ribbon {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 20px;
  font-size: 13px;
  text-align: center;
  color: var(--text-secondary);
}

.apple-ribbon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  max-width: 900px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.ribbon-tag {
  background: var(--apple-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ribbon-text {
  color: var(--text-primary);
  font-weight: 400;
}

.ribbon-cta {
  color: var(--apple-blue);
  font-weight: 500;
}
.ribbon-cta::after {
  content: " ›";
}

/* ── Hero Section (Product as Sole Hero) ── */
.hero-section {
  position: relative;
  overflow: hidden;
  padding: 64px 24px 72px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle at 50% 10%, rgba(0, 113, 227, 0.04) 0%, transparent 60%);
}

/* ── Fable Hero: WebGL atmosphere layer (procedural tree, tit, sky/cloud, DoF) ── */
.fable-hero-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Fallback gradient: seen before the bundle boots, under reduced motion,
     and wherever WebGL is unavailable. */
  background: linear-gradient(180deg, #9dc0e6 0%, #86a7d3 55%, #5b7fae 100%);
}
[data-theme="dark"] .fable-hero-stage {
  background: linear-gradient(180deg, #0b1526 0%, #101a2e 55%, #05070d 100%);
}
.fable-hero-stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* Soft scrim so the copy keeps its contrast over the moving sky.
   pointer-events:none keeps canvas clicks (the bird) working through it. */
.fable-hero-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(245, 245, 247, 0.42) 0%, rgba(245, 245, 247, 0.12) 42%, rgba(245, 245, 247, 0.5) 100%);
}
[data-theme="dark"] .fable-hero-stage::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.12) 42%, rgba(0, 0, 0, 0.55) 100%);
}
/* Everything else in the hero sits above the scene. */
.hero-section > *:not(.fable-hero-stage) {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--apple-blue);
  margin-bottom: 12px;
}

.hero-headline {
  font-size: clamp(40px, 5.5vw, 76px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 16px;
  max-width: 820px;
}

.hero-subhead {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 400;
  line-height: 1.44;
  color: var(--text-secondary);
  max-width: 660px;
  margin-bottom: 32px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

/* Apple Stadium Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--apple-blue);
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  padding: 11px 24px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background-color 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--apple-blue-hover);
  transform: scale(1.02);
}

.btn-primary:active {
  background: var(--apple-blue-active);
  transform: scale(0.98);
}

/* Apple Secondary Link */
.btn-link {
  display: inline-flex;
  align-items: center;
  color: var(--apple-blue);
  font-size: 16px;
  font-weight: 400;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-link::after {
  content: " ›";
  font-size: 1.2em;
  line-height: 1;
}

.btn-link:hover {
  opacity: 0.7;
}

/* ── Hero Showcase: Realistic macOS Studio Display Frame ── */
.hero-stage {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  perspective: 1200px;
}

.macos-window {
  background: var(--bg-card);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-floating);
  overflow: hidden;
  text-align: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.macos-window:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.16);
}

.macos-titlebar {
  height: 42px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
}

.traffic-lights {
  display: flex;
  gap: 8px;
}

.traffic-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.traffic-close { background-color: #ff5f56; border: 1px solid #e0443e; }
.traffic-min { background-color: #ffbd2e; border: 1px solid #dea123; }
.traffic-max { background-color: #27c93f; border: 1px solid #1aab29; }

.macos-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.macos-content {
  padding: 32px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 840px) {
  .macos-content {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
}

/* User Card in Window */
.user-profile-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
  border-radius: var(--radius-md);
  background: #e5e5ea;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .user-profile-block {
  background: #252528;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.avatar-wrapper {
  position: relative;
  margin-bottom: 16px;
  cursor: pointer;
  border-radius: 50%;
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.avatar-wrapper:hover {
  transform: scale(1.06);
}

.avatar-wrapper:active {
  transform: scale(0.95);
}

.avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-card);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: block;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.profile-handle {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

/* Thinking status — Apple HIG Day / Night Adaptive */
.thinking-status-wrapper {
  margin-bottom: 14px;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

.thinking-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 18px;
  min-width: 220px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .thinking-status-pill {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.thinking-status-pill .cc-row-container {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  justify-items: center;
  align-items: center;
  font-family: "Cascadia Code", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
}

.thinking-status-pill .cc-row {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  animation: word-step 36s infinite linear;
}

.thinking-status-pill .cc-spin-container {
  display: inline-grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  width: 1.2em;
  height: 1.2em;
  position: relative;
  flex: 0 0 auto;
}

.thinking-status-pill .cc-spin {
  grid-area: 1 / 1;
  color: #0071e3;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  animation: spin-step 2.4s infinite linear;
}

[data-theme="dark"] .thinking-status-pill .cc-spin {
  color: #38bdf8;
}

.thinking-status-pill .cc-label {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.thinking-status-pill .cc-verb {
  background: linear-gradient(90deg, #0055b3 0%, #0071e3 38%, #003a7a 50%, #0071e3 62%, #0055b3 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #0071e3;
  font-weight: 600;
  animation: cc-sweep 2.4s linear infinite;
}

[data-theme="dark"] .thinking-status-pill .cc-verb {
  background: linear-gradient(90deg, #38bdf8 0%, #38bdf8 38%, #e0f2fe 50%, #38bdf8 62%, #38bdf8 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #38bdf8;
}

.thinking-status-pill .cc-dots {
  color: #3a3a3c;
  margin-left: 2px;
  font-weight: 500;
}

[data-theme="dark"] .thinking-status-pill .cc-dots {
  color: #d1d1d6;
}

@keyframes cc-sweep {
  0% { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

@keyframes spin-step {
  0%, 8.333% { opacity: 1; visibility: visible; }
  8.334%, 100% { opacity: 0; visibility: hidden; }
}

@keyframes word-step {
  0%, 5.555% { opacity: 1; visibility: visible; }
  5.556%, 100% { opacity: 0; visibility: hidden; }
}

.stats-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.stat-chip {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  font-size: 11.5px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
}

.stat-chip:hover {
  border-color: rgba(0, 113, 227, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

[data-theme="dark"] .stat-chip {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

[data-theme="dark"] .stat-chip:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: #242426;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stat-chip strong {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

/* VibeCoding Terminal in Window — Day / Night Mode Adaptive */
.launch-cli-box {
  background: #f2f2f7;
  color: #1d1d1f;
  border-radius: var(--radius-md);
  padding: 22px;
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .launch-cli-box {
  background: #141416;
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.cli-row-header {
  font-size: 12px;
  color: #86868b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 8px;
  transition: border-color 0.3s ease;
}

[data-theme="dark"] .cli-row-header {
  color: #64748b;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.cli-badge-tag {
  color: #0071e3;
  font-weight: 500;
}

[data-theme="dark"] .cli-badge-tag {
  color: #38bdf8;
  font-weight: normal;
}

/* AI Launcher Direct Web Links inside Window */
.ai-launcher-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-launcher-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 540px) {
  .ai-launcher-items {
    grid-template-columns: 1fr;
  }
}

.ai-launcher-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-launcher-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 113, 227, 0.35);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.08);
}

[data-theme="dark"] .ai-launcher-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: #f1f5f9;
}

[data-theme="dark"] .ai-launcher-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.12);
}

.ai-launcher-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-launcher-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--apple-blue-light);
  color: var(--apple-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .ai-launcher-icon {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.ai-launcher-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

[data-theme="dark"] .ai-launcher-title {
  color: #f8fafc;
}

.ai-launcher-url {
  font-size: 11px;
  font-family: "Cascadia Code", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  color: #86868b;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.ai-launcher-card:hover .ai-launcher-url {
  color: var(--apple-blue);
}

[data-theme="dark"] .ai-launcher-card:hover .ai-launcher-url {
  color: #38bdf8;
}

.cli-agent-launcher-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.cli-command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .cli-command-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.launch-cli-box,
.cli-command-item,
.cli-prompt-label,
.cli-command-code,
code.cli-command-code {
  font-family: "Cascadia Code", "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace !important;
  font-size: 13px;
  line-height: 1.5;
}

.cli-prompt-label {
  color: #6e6e73;
  margin-right: 6px;
  user-select: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .cli-prompt-label {
  color: #94a3b8;
  font-weight: 500;
}

.cli-command-code {
  color: #0071e3;
  word-break: break-all;
  font-weight: 500;
  letter-spacing: -0.01em;
  background: transparent;
  padding: 0;
  border: none;
}

[data-theme="dark"] .cli-command-code {
  color: #38bdf8;
  font-weight: 500;
}

.copy-btn {
  background: transparent;
  border: none;
  color: #86868b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
}

.copy-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1d1d1f;
}

[data-theme="dark"] .copy-btn {
  color: #94a3b8;
}

[data-theme="dark"] .copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* ── Section Container ── */
.apple-section {
  padding: 96px 24px;
  max-width: var(--max-w-content);
  margin: 0 auto;
  width: 100%;
}

.section-eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--apple-blue);
  margin-bottom: 8px;
  text-align: center;
}

.section-heading {
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 16px;
}

.section-description {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.47;
  color: var(--text-secondary);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 56px;
}

/* ── Apple Bento Highlights Grid ── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.bento-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 36px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-hover);
}

.bento-col-8 { grid-column: span 8; }
.bento-col-4 { grid-column: span 4; }
.bento-col-6 { grid-column: span 6; }
.bento-col-12 { grid-column: span 12; }

@media (max-width: 880px) {
  .bento-col-8, .bento-col-4, .bento-col-6 {
    grid-column: span 12;
  }
}

.bento-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-blue);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.bento-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.bento-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Tool & Tech Chips (Clean SVGs, No Emojis) */
.tool-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-page);
  border: 1px solid var(--divider);
  color: var(--text-primary);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s;
}

.tool-chip svg, .tool-chip img {
  width: 15px;
  height: 15px;
  display: block;
}

.tool-chip:hover {
  background: var(--apple-blue-light);
  border-color: var(--apple-blue);
  color: var(--apple-blue);
}

.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-page);
  border: 1px solid var(--divider);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.tech-pill img, .tech-pill svg {
  width: 15px;
  height: 15px;
  display: block;
}

.bento-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--divider);
  padding-top: 18px;
  margin-top: auto;
}

/* ── Chapter 1: Open Source Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.repo-card-apple {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.repo-card-apple:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-hover);
}

.repo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.repo-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.repo-name svg {
  color: var(--apple-blue);
  flex-shrink: 0;
}

.repo-lang-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-page);
  border: 1px solid var(--divider);
  color: var(--text-secondary);
}

.repo-description {
  font-size: 14px;
  line-height: 1.48;
  color: var(--text-secondary);
  margin-bottom: 18px;
  flex-grow: 1;
}

.repo-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.repo-star {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #d97706;
}

.repo-star svg {
  width: 13px;
  height: 13px;
  fill: #d97706;
}

/* ── Chapter 2: Cinematic Pro Dark Section (Developer APIs) ── */
.dark-pro-section {
  background: #000000;
  color: #f5f5f7;
  padding: 104px 24px;
  width: 100%;
}

.dark-pro-section .section-eyebrow {
  color: #2997ff;
}

.dark-pro-section .section-heading {
  color: #ffffff;
}

.dark-pro-section .section-description {
  color: #86868b;
}

.api-interactive-container {
  max-width: var(--max-w-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 860px) {
  .api-interactive-container {
    grid-template-columns: 1fr;
  }
}

.api-list-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.api-endpoint-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: #161617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  transition: all 0.2s ease;
}

.api-endpoint-item:hover {
  background: #1f1f21;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.api-method {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(41, 151, 255, 0.15);
  color: #2997ff;
}

.api-path {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #e2e8f0;
  margin-left: 12px;
}

.api-console-box {
  background: #161617;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.api-console-header {
  padding: 12px 16px;
  background: #1c1c1e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-tabs-row {
  display: flex;
  gap: 6px;
}

.code-tab-btn {
  background: transparent;
  border: none;
  color: #86868b;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.code-tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 500;
}

.code-terminal-pre {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #93c5fd;
  overflow-x: auto;
}

/* ── Chapter 3: Connections / Portals ── */
.connections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.connection-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.connection-card:hover {
  transform: translateY(-2px);
  border-color: var(--apple-blue);
  box-shadow: var(--shadow-card-hover);
}

.connection-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.connection-icon img, .connection-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.connection-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.connection-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Apple Fat Footer ── */
.apple-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 24px 32px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.apple-footer-inner {
  max-width: var(--max-w-content);
  margin: 0 auto;
}

.footer-nav-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 24px;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer-col-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col-links a:hover {
  color: var(--text-primary);
}

.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 11px;
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .apple-nav-links {
    display: none;
  }
  .hero-section {
    padding: 48px 16px 56px;
  }
  .bento-card {
    padding: 24px;
  }
}

/* Accessibility: Reduce Motion Guard */
@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;
  }
}
