/* ==============================================================================
   RetroKeys — Web Dashboard Styles
   Modern Apple-inspired Light & Dark Design System
   ============================================================================== */

:root {
  /* Light Theme (Default) */
  --bg-primary: #FAFAFC;
  --bg-secondary: #FFFFFF;
  --bg-surface: #F0F2F6;
  --bg-surface-elevated: #FFFFFF;
  --surface-primary: #FFFFFF;
  --surface-secondary: #F0F2F6;

  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #86868B;

  --accent-color: #0071E3;
  --accent-primary: #0071E3;
  --accent-hover: #0077ED;
  --accent-light: rgba(0, 113, 227, 0.08);
  --accent-amber: #D97706;
  --accent-cyan: #00C7BE;

  --color-success: #34C759;
  --color-warning: #FF9500;
  --color-danger: #FF3B30;

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

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.08);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Monaco, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --key-cap-bg: #FFFFFF;
  --key-cap-side: #E2E8F0;
  --key-cap-shadow: 0 4px 0 #CBD5E1, 0 6px 12px rgba(0, 0, 0, 0.08);
  --key-cap-pressed: 0 1px 0 #CBD5E1, 0 2px 4px rgba(0, 0, 0, 0.08);

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-theme {
  --bg-primary: #0D0E11;
  --bg-secondary: #16181D;
  --bg-surface: #1E2128;
  --bg-surface-elevated: #242831;
  --surface-primary: #1E2128;
  --surface-secondary: #16181D;

  --text-primary: #F5F5F7;
  --text-secondary: #A1A1A6;
  --text-tertiary: #6E6E73;

  --accent-color: #2997FF;
  --accent-primary: #2997FF;
  --accent-hover: #47A3FF;
  --accent-light: rgba(41, 151, 255, 0.12);
  --accent-amber: #F59E0B;
  --accent-cyan: #2BD9D0;

  --border-subtle: rgba(255, 255, 255, 0.10);
  --border-hover: rgba(255, 255, 255, 0.20);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);

  --key-cap-bg: #2C2C2E;
  --key-cap-side: #1C1C1E;
  --key-cap-shadow: 0 4px 0 #18181B, 0 6px 12px rgba(0, 0, 0, 0.5);
  --key-cap-pressed: 0 1px 0 #18181B, 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 252, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s ease;
}

body.dark-theme .site-header {
  background: rgba(13, 14, 17, 0.88);
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.logo-text {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.version-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: var(--radius-full);
  font-weight: 600;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s ease;
  white-space: nowrap;
}

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

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

.theme-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition);
}

.theme-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-hover);
}

.nav-appstore-link {
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-appstore-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.nav-appstore-badge {
  height: 36px;
  width: auto;
  border-radius: 6px;
}

.sun-icon { display: block; }
.moon-icon { display: none; }
body.dark-theme .sun-icon { display: none; }
body.dark-theme .moon-icon { display: block; }

.lang-select {
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 70px 0 50px 0;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(0, 113, 227, 0.15) 0%, rgba(0, 199, 190, 0.08) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-light);
  color: var(--accent-color);
  border: 1px solid rgba(0, 113, 227, 0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 22px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
  color: var(--text-primary);
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-color);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.25);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-hover);
}

.hero-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Interactive Device Stage */
.display-stage {
  margin: 40px auto 0 auto;
  max-width: 760px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  text-align: left;
}

.stage-menubar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.stage-menubar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.status-indicator {
  font-size: 12px;
  color: var(--color-success);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Virtual Keyboard Stage */
.keyboard-stage {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.keyboard-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.keyboard-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.key-cap {
  background: var(--key-cap-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--key-cap-shadow);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  min-width: 44px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.15s;
}

.key-cap:active, .key-cap.pressed {
  transform: translateY(3px);
  box-shadow: var(--key-cap-pressed);
  background: var(--accent-light);
  color: var(--accent-color);
}

.key-cap.key-space {
  min-width: 240px;
}

.key-cap.key-enter {
  min-width: 80px;
  background: var(--accent-light);
  color: var(--accent-color);
}

.key-tap-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* Section Header */
.section {
  padding: 60px 0;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px auto;
}

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

.section-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
}

/* Switch Soundboard Cards */
.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.switch-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.switch-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
}

.switch-card.active {
  border-color: var(--accent-color);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 2px var(--accent-color);
}

.switch-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.switch-title-wrap h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.switch-title-wrap p {
  font-size: 12px;
  color: var(--text-secondary);
}

.switch-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.switch-play-btn:hover {
  background: var(--accent-color);
  color: #FFFFFF;
}

.switch-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 16px;
  font-size: 11px;
}

.spec-item span {
  display: block;
  color: var(--text-secondary);
}

.spec-item strong {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* Typing Test & HUD */
.test-suite-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.telemetry-col {
  text-align: center;
  flex: 1;
}

.telemetry-val {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-color);
  line-height: 1.1;
}

.telemetry-lbl {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 4px;
}

.typing-textarea {
  width: 100%;
  height: 90px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.2s;
}

.typing-textarea:focus {
  border-color: var(--accent-color);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.slider-container input[type="range"] {
  flex: 1;
  accent-color: var(--accent-color);
}

/* Interactive Stepper Guide */
.stepper-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

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

.step-tab {
  padding: 8px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.step-tab:hover {
  color: var(--text-primary);
}

.step-tab.active {
  background: var(--accent-color);
  color: #FFFFFF;
  border-color: var(--accent-color);
}

.step-content {
  display: none;
}

.step-content.active {
  display: block;
}

.step-body-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
}

.step-info h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-info p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.step-visual-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}

.step-actions {
  display: flex;
  gap: 12px;
}

/* Ambient Audio Soundscapes */
.ambient-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.ambient-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.eq-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
  margin: 16px 0;
}

.eq-bar {
  flex: 1;
  background: var(--accent-light);
  border-radius: 2px;
  height: 6px;
  transition: height 0.15s ease;
}

.ambient-card.active .eq-bar {
  background: var(--accent-color);
  animation: eqBounce 0.8s infinite alternate ease-in-out;
}

.ambient-card.active .eq-bar:nth-child(2) { animation-delay: 0.15s; }
.ambient-card.active .eq-bar:nth-child(3) { animation-delay: 0.3s; }
.ambient-card.active .eq-bar:nth-child(4) { animation-delay: 0.1s; }
.ambient-card.active .eq-bar:nth-child(5) { animation-delay: 0.25s; }

@keyframes eqBounce {
  from { height: 6px; }
  to { height: 28px; }
}

/* Specifications Grid */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.spec-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.spec-icon {
  font-size: 26px;
  margin-bottom: 12px;
}

.spec-box h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.spec-box p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Download Section */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.download-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.download-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* FAQ Section */
.faq-section {
  padding: 80px 0;
}

.faq-section .section-header {
  margin-bottom: 24px;
  text-align: left;
}

.faq-accordion {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: transparent;
  border: none;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.faq-trigger span {
  flex: 1;
  text-align: left;
}

.faq-trigger .chevron {
  transition: transform 0.25s ease;
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item.open .faq-trigger .chevron {
  transform: rotate(180deg);
}

.faq-content {
  display: none;
  padding: 0 22px 18px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: left;
}

.faq-item.open .faq-content {
  display: block;
}

/* Footer */
.site-footer {
  padding: 32px 0 28px;
  font-size: 0.80rem;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  margin-top: 60px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.footer-logo img {
  border-radius: 6px;
}

.footer-tagline {
  font-size: 0.80rem;
  color: var(--text-secondary);
}

.footer-languages-info {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: right;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: var(--border-subtle);
}

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-copy-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-copy {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.footer-apple-legal {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-tertiary);
}

/* Apple-Style Locale / Language Picker */
.footer-locale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease, color 0.2s ease;
}

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

.globe-icon {
  color: inherit;
  flex-shrink: 0;
}

.footer-locale-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: inherit;
  border: none;
  font-size: 0.76rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
  padding: 2px 18px 2px 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}

.footer-locale-select:hover {
  color: var(--accent-primary);
}

.footer-locale-select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 960px) {
  .site-nav { display: none; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 34px; }
  .step-body-grid { grid-template-columns: 1fr; }
  .keyboard-row:nth-child(1) { display: none; }
  .footer-top-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-languages-info { text-align: left; }
  .footer-bottom-row { flex-direction: column-reverse; align-items: flex-start; gap: 12px; }
}

@media (max-width: 520px) {
  .version-tag { display: none; }
  .nav-container { padding: 0 16px; }
}
