/* Clipstream macOS HIG Design System */
:root {
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;
  
  --bg-canvas: #090B10;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-focus: rgba(56, 189, 248, 0.6);
  
  --hud-bg: rgba(22, 27, 34, 0.78);
  --hud-border: rgba(255, 255, 255, 0.14);
  --hud-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  
  --accent-blue: #0A84FF;
  --accent-cyan: #38BDF8;
  --accent-purple: #A855F7;
  --accent-indigo: #6366F1;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-system);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  selection-background-color: rgba(10, 132, 255, 0.3);
}

/* Background Ambient Lighting */
.ambient-glow-1 {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(6, 182, 212, 0.08) 45%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-2 {
  position: fixed;
  top: 40%;
  left: 80%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, transparent 65%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Header & Nav */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mobile-nav-toggle {
  display: none;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-btn-gh {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-btn-gh:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-cyan);
  margin-bottom: 24px;
}

.hero-title {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #FFFFFF 0%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #0A84FF 0%, #0066DD 100%);
  color: #FFFFFF;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.45);
}

.brew-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.brew-pill:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-primary);
}

.brew-pill code {
  color: var(--accent-cyan);
  margin-right: 10px;
}

.copy-icon {
  opacity: 0.6;
  transition: opacity 0.15s;
}

.brew-pill:hover .copy-icon {
  opacity: 1;
}

/* Key shortcut visual badge */
.hotkey-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

kbd {
  display: inline-block;
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

/* Interactive HUD Simulator Area */
.hud-showcase {
  margin: 20px auto 72px;
  max-width: 820px;
  position: relative;
}

.hud-caption-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 8px;
}

.hud-badge-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hud-tip {
  font-size: 12px;
  color: var(--text-muted);
}

/* The actual 720x460pt HUD Window Simulator */
.hud-window {
  width: 100%;
  max-width: 720px;
  height: 460px;
  margin: 0 auto;
  background: var(--hud-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-radius: 18px;
  border: 1px solid var(--hud-border);
  box-shadow: var(--hud-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  user-select: none;
}

/* HUD Top Bar */
.hud-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  gap: 12px;
}

.hud-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  flex: 1;
}

.hud-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}

.hud-search-box input::placeholder {
  color: var(--text-muted);
}

.hud-pills {
  display: flex;
  gap: 4px;
}

.hud-pill {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hud-pill.active {
  background: var(--accent-blue);
  color: #FFFFFF;
  font-weight: 600;
}

/* HUD Body Split: 40% Left / 60% Right */
.hud-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.hud-list-col {
  width: 40%;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.hud-item:hover, .hud-item.selected {
  background: var(--accent-blue);
}

.hud-item.selected .item-num,
.hud-item.selected .item-text,
.hud-item.selected .item-icon {
  color: #FFFFFF !important;
}

.item-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  width: 12px;
}

.item-icon {
  font-size: 12px;
  width: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-text {
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.item-pin {
  font-size: 10px;
  color: #F59E0B;
}

/* HUD Right Inspector: 60% */
.hud-inspector-col {
  width: 60%;
  padding: 14px;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  overflow-y: auto;
}

.inspector-fade {
  transition: opacity 0.15s ease-in-out;
}

/* Code Inspector */
.code-preview-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lang-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
}

.code-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.btn-clean-copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-clean-copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

.code-viewport {
  display: flex;
  flex: 1;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 0;
}

.code-gutter {
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.25);
  text-align: right;
  user-select: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.code-lines {
  padding: 0 12px;
  white-space: pre;
  color: #E2E8F0;
}

/* Link Preview */
.link-preview-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-host-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  font-size: 18px;
}

.link-domain {
  font-size: 14px;
  font-weight: 700;
}

.link-url-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Color Preview */
.color-preview-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
}

.color-swatch-large {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.format-pills {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.fmt-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
}

.fmt-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

/* Toast HUD Notification */
.toast-hud {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #FFFFFF;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 10;
}

.toast-hud.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Feature Sections */
.section-title-wrap {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 16px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 80px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
  transition: all 0.2s ease;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Keyboard Map Showcase */
.shortcuts-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 80px;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcuts-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shortcuts-table tr:last-child {
  border-bottom: none;
}

.shortcuts-table td {
  padding: 14px 12px;
  font-size: 14px;
}

.shortcut-action {
  color: var(--text-primary);
  font-weight: 500;
}

.shortcut-desc {
  color: var(--text-secondary);
}

/* Code Deliverables Tabs Section */
.code-section {
  margin-bottom: 80px;
}

.code-tabs-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.code-tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.code-tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
  font-weight: 600;
}

.code-block-container {
  background: rgba(13, 17, 23, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.code-block-content {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #F1F5F9;
  max-height: 520px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 14px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text-primary);
}

/* Responsiveness */
@media (max-width: 768px) {
  .site-nav {
    padding: 16px 0;
    position: relative;
  }

  .mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
  }

  .mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .hamburger-bar {
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .mobile-nav-toggle.active .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-nav-toggle.active .hamburger-bar:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle.active .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
    animation: navDropIn 0.2s ease-out forwards;
  }

  @keyframes navDropIn {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-link {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-primary);
  }

  .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-btn-gh {
    justify-content: center;
    margin-top: 6px;
    padding: 10px 14px;
    font-size: 14px;
  }

  .hero-title {
    font-size: 38px;
  }
  .hud-window {
    height: 520px;
    flex-direction: column;
  }
  .hud-body {
    flex-direction: column;
  }
  .hud-list-col {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .hud-inspector-col {
    width: 100%;
    height: calc(100% - 200px);
  }
}
