/* ============================================================
   GAUTHAM'S SPACE OBSERVATORY PORTFOLIO — style.css
   Theme: Deep Space / Comet Observatory
   Fonts: Space Grotesk (display), Inter (body), JetBrains Mono (code)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  /* Dark (default) */
  --bg:           #080B1A;
  --bg-2:         #0D1B3E;
  --surface:      #1E3A5F;
  --surface-2:    #243F6A;
  --border:       rgba(126, 184, 247, 0.18);
  --accent-blue:  #7EB8F7;
  --accent-gold:  #E8C97A;
  --accent-glow:  rgba(232, 201, 122, 0.35);
  --text-primary: #C0C8E8;
  --text-dim:     #6B7FAB;
  --text-bright:  #EEF4FF;
  --star-color:   rgba(200, 215, 255, 0.8);

  /* Phone shell */
  --phone-bg:       #0A0F22;
  --phone-border:   #2A4A7F;
  --phone-screen:   #06091A;
  --phone-button:   #1A2F55;
  --status-bg:      rgba(6, 9, 26, 0.9);

  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* App icon colors */
  --app-about:    linear-gradient(135deg, #667eea, #764ba2);
  --app-projects: linear-gradient(135deg, #f093fb, #f5576c);
  --app-contact:  linear-gradient(135deg, #4facfe, #00f2fe);
  --app-hobbies:  linear-gradient(135deg, #43e97b, #38f9d7);
  --app-chatbot:  linear-gradient(135deg, #E8C97A, #f7971e);
}

[data-theme="light"] {
  --bg:           #EEF2FF;
  --bg-2:         #E0E8FF;
  --surface:      #DBEAFE;
  --surface-2:    #C7D9F8;
  --border:       rgba(30, 58, 95, 0.18);
  --accent-blue:  #1E3A5F;
  --accent-gold:  #B8860B;
  --accent-glow:  rgba(184, 134, 11, 0.25);
  --text-primary: #1A2A4A;
  --text-dim:     #4A6080;
  --text-bright:  #0A1020;
  --star-color:   rgba(80, 100, 160, 0.4);

  --phone-bg:       #D8E4F8;
  --phone-border:   #93B4DC;
  --phone-screen:   #EEF2FF;
  --phone-button:   #B8CDE8;
  --status-bg:      rgba(238, 242, 255, 0.9);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* ── Starfield Canvas ───────────────────────────────────── */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Comet SVG ──────────────────────────────────────────── */
#comet-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* ── Layout ─────────────────────────────────────────────── */
.site-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Top Bar ────────────────────────────────────────────── */
.top-bar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 11, 26, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

[data-theme="light"] .top-bar {
  background: rgba(238, 242, 255, 0.82);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent-gold);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.logo span { color: var(--accent-blue); }

.top-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* OS Switcher */
.os-switcher {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem;
}

.os-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
}

.os-btn.active,
.os-btn:hover {
  background: var(--surface);
  color: var(--accent-gold);
}

/* Theme Toggle */
.theme-toggle {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--accent-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--surface);
  transform: rotate(20deg);
}

/* ── Phone Shell ────────────────────────────────────────── */
.phone-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  width: 100%;
}

.phone {
  position: relative;
  width: 380px;
  min-height: 720px;
  background: var(--phone-bg);
  border: 3px solid var(--phone-border);
  border-radius: 44px;
  box-shadow:
    0 0 0 1px rgba(126,184,247,0.08),
    0 0 60px rgba(126,184,247,0.12),
    0 30px 80px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all var(--transition);
}

/* ── iOS Overrides ─── */
.phone.ios {
  border-radius: 54px;
  border-color: #3A3A3C;
  box-shadow:
    0 0 0 2px #1C1C1E,
    0 0 0 4px #3A3A3C,
    0 30px 80px rgba(0,0,0,0.7);
}

.phone.ios .status-bar { background: #000; color: #fff; }
.phone.ios .home-indicator { display: block; }
.phone.ios .android-nav { display: none !important; }
.phone.ios .notch { display: block; }
.phone.ios .punch-hole { display: none !important; }

/* ── Android Overrides ─── */
.phone.android {
  border-radius: 28px;
  border-color: #2A4A7F;
}

.phone.android .home-indicator { display: none; }
.phone.android .android-nav { display: flex !important; }
.phone.android .notch { display: none !important; }
.phone.android .punch-hole { display: block !important; }

/* ── Windows Overrides ─── */
.phone.windows {
  border-radius: 12px;
  border-color: #0078D4;
  width: 420px;
  box-shadow:
    0 0 0 1px #0078D4,
    0 30px 80px rgba(0,0,0,0.7);
}

.phone.windows .status-bar {
  background: #0078D4;
  color: #fff;
  border-radius: 0;
}

.phone.windows .home-indicator { display: none; }
.phone.windows .android-nav { display: none !important; }
.phone.windows .notch { display: none !important; }
.phone.windows .punch-hole { display: none !important; }
.phone.windows .win-taskbar { display: flex !important; }

/* ── Status Bar ─────────────────────────────────────────── */
.status-bar {
  background: var(--status-bg);
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-bright);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Notch (iOS) ─── */
.notch {
  display: none;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 30px;
  background: #000;
  border-radius: 0 0 20px 20px;
  z-index: 20;
}

/* ── Punch Hole (Android) ─── */
.punch-hole {
  display: none;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: #000;
  border-radius: 50%;
  z-index: 20;
}

/* ── Screen ─────────────────────────────────────────────── */
.phone-screen {
  flex: 1;
  background: var(--phone-screen);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
}

.phone-screen::-webkit-scrollbar { width: 3px; }
.phone-screen::-webkit-scrollbar-track { background: transparent; }
.phone-screen::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 99px; }

/* ── Home Screen ────────────────────────────────────────── */
.home-screen {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100%;
}

.home-wallpaper {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(30,58,95,0.4) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(126,184,247,0.08) 0%, transparent 50%);
  pointer-events: none;
}

/* ── Home Header ─── */
.home-header {
  text-align: center;
  padding-top: 0.5rem;
  position: relative;
}

.home-header .greeting {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.home-header .name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.home-header .title {
  font-size: 0.78rem;
  color: var(--accent-gold);
  margin-top: 0.15rem;
  font-weight: 500;
}

/* ── App Grid ───────────────────────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0 0.25rem;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.app-icon:active,
.app-icon:hover { transform: scale(0.93); }

.app-icon-img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

/* iOS-style rounded square on ios */
.phone.ios .app-icon-img { border-radius: 22px; }
/* Android circle on android */
.phone.android .app-icon-img { border-radius: 28px; }
/* Windows sharp on windows */
.phone.windows .app-icon-img { border-radius: 6px; }

.app-icon-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}

.app-label {
  font-size: 0.68rem;
  color: var(--text-primary);
  text-align: center;
  font-weight: 500;
}

/* ── App colors ─── */
.app-about    .app-icon-img { background: var(--app-about); }
.app-projects .app-icon-img { background: var(--app-projects); }
.app-contact  .app-icon-img { background: var(--app-contact); }
.app-hobbies  .app-icon-img { background: var(--app-hobbies); }
.app-chatbot  .app-icon-img { background: var(--app-chatbot); }
.app-github   .app-icon-img { background: linear-gradient(135deg, #24292E, #586069); }
.app-linkedin .app-icon-img { background: linear-gradient(135deg, #0077B5, #00A0DC); }
.app-resume   .app-icon-img { background: linear-gradient(135deg, #D44000, #FF6B35); }

/* ── Dock ───────────────────────────────────────────────── */
.dock {
  margin: auto 0 0;
  padding: 0 0.25rem 0.5rem;
}

.dock-inner {
  background: rgba(30, 58, 95, 0.5);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0.75rem;
  display: flex;
  justify-content: space-around;
}

[data-theme="light"] .dock-inner {
  background: rgba(193, 214, 248, 0.6);
}

/* ── Android Nav ────────────────────────────────────────── */
.android-nav {
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 0.6rem 1rem;
  background: var(--status-bg);
  flex-shrink: 0;
}

.android-nav button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: color var(--transition);
}

.android-nav button:hover { color: var(--accent-blue); }

/* ── Home Indicator (iOS) ───────────────────────────────── */
.home-indicator {
  display: none;
  height: 28px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--phone-bg);
}

.home-indicator-bar {
  width: 120px;
  height: 4px;
  background: var(--text-dim);
  border-radius: 99px;
  opacity: 0.6;
}

/* ── Windows Taskbar ────────────────────────────────────── */
.win-taskbar {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  background: rgba(0, 120, 212, 0.2);
  border-top: 1px solid #0078D4;
  gap: 0.75rem;
  flex-shrink: 0;
}

.win-taskbar button {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  opacity: 0.8;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: opacity var(--transition);
}

.win-taskbar button:hover { opacity: 1; background: rgba(255,255,255,0.1); }

/* ── App Page (inner screen) ────────────────────────────── */
.app-page {
  min-height: 100%;
  padding: 0;
  animation: slideUp 0.3s ease;
}

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

.app-header {
  padding: 1rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--status-bg);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: background var(--transition);
}

.back-btn:hover { background: var(--surface-2); }

.app-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
}

.app-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  transition: background var(--transition), border-color var(--transition);
}

.card:hover {
  border-color: rgba(126, 184, 247, 0.35);
}

.card-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.4rem;
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

.card-text {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ── Tag Pills ──────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(126, 184, 247, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(126, 184, 247, 0.2);
  letter-spacing: 0.03em;
}

/* ── Section Heading ────────────────────────────────────── */
.section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  padding: 0.25rem 0;
  margin-bottom: 0.1rem;
  border-bottom: 1px solid var(--border);
}

/* ── Skill Bars ─────────────────────────────────────────── */
.skill-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.skill-name {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 80px;
}

.skill-bar-bg {
  flex: 1;
  height: 5px;
  background: var(--bg-2);
  border-radius: 99px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-gold));
  border-radius: 99px;
  transition: width 1s ease;
}

/* ── Timeline ───────────────────────────────────────────── */
.timeline-item {
  display: flex;
  gap: 0.75rem;
  position: relative;
}

.timeline-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  margin-top: 0.35rem;
  box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-line {
  position: absolute;
  left: 3.5px;
  top: 14px;
  bottom: -14px;
  width: 1px;
  background: var(--border);
}

.timeline-content { flex: 1; }
.timeline-date {
  font-size: 0.65rem;
  color: var(--accent-blue);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

/* ── Contact Links ──────────────────────────────────────── */
.contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.contact-link:hover {
  background: var(--surface-2);
  border-color: var(--accent-blue);
  color: var(--text-bright);
  transform: translateX(4px);
}

.contact-link-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Chatbot ────────────────────────────────────────────── */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  min-height: 300px;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
}

.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 99px; }

.chat-bubble {
  max-width: 82%;
  padding: 0.65rem 0.9rem;
  border-radius: 16px;
  font-size: 0.78rem;
  line-height: 1.5;
}

.chat-bubble.bot {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  background: linear-gradient(135deg, #1E3A5F, #2A5080);
  color: var(--text-bright);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.75rem 1rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  animation: typingBounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--status-bg);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
}

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0.5rem 0.9rem;
  color: var(--text-bright);
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
}

.chat-input:focus { border-color: var(--accent-blue); }
.chat-input::placeholder { color: var(--text-dim); }

.chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #0A0F22;
  flex-shrink: 0;
  transition: transform var(--transition), opacity var(--transition);
}

.chat-send:hover { transform: scale(1.1); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Quick Prompts ──────────────────────────────────────── */
.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
}

.quick-prompt-btn {
  font-size: 0.68rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent-blue);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition);
}

.quick-prompt-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent-blue);
}

/* ── Project card extra ─────────────────────────────────── */
.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.project-link {
  font-size: 0.72rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color var(--transition);
}

.project-link:hover { color: var(--accent-gold); }

/* ── Hobbies ────────────────────────────────────────────── */
.hobby-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.hobby-emoji {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* ── Comet Animation ─────────────────────────────────────── */
.comet-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .phone {
    width: 100%;
    min-height: calc(100vh - 80px);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .phone.ios { border-radius: 0; }
  .phone.windows { width: 100%; }

  .top-bar { padding: 1rem; }
  .os-btn { font-size: 0.65rem; padding: 0.25rem 0.5rem; }
}

/* ── Glow pulse on active app icon ─────────────────────── */
@keyframes iconGlow {
  0%   { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
  50%  { box-shadow: 0 4px 24px rgba(232,201,122,0.4); }
  100% { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
}

/* ── About page avatar ──────────────────────────────────── */
.avatar-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 0.75rem;
  box-shadow: 0 0 24px var(--accent-glow);
}

/* ── Stats row ──────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.stat-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.5rem;
  text-align: center;
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.stat-label {
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

/* ── Utility ────────────────────────────────────────────── */
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.text-gold { color: var(--accent-gold); }
.text-blue { color: var(--accent-blue); }
.text-dim  { color: var(--text-dim); font-size: 0.78rem; }
.font-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; }

/* ── Page-level fade ────────────────────────────────────── */
.page-fade {
  animation: pageFade 0.4s ease;
}

@keyframes pageFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── App Grid Section Label ──────────────────────────────── */
.app-grid-section-label {
  grid-column: 1 / -1;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  padding: 0.4rem 0 0.1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
  text-align: left;
}

/* ── Home screen layout fix — dock always at bottom ─────── */
.home-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: 0;
}

.home-screen .app-grid {
  flex: 1;            /* fills space between header and dock */
  align-content: start;
}

/* ── Snake controls ─────────────────────────────────────── */
.snake-ctrl {
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-bright);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.snake-ctrl:active { background: var(--surface-2); }

/* ── Sudoku board cells ──────────────────────────────────── */
.sudoku-cell {
  aspect-ratio: 1;
  background: var(--phone-screen);
  border: none;
  color: var(--text-bright);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  outline: none;
  transition: background var(--transition);
  -webkit-appearance: none;
  width: 100%;
}
.sudoku-cell.prefilled  { color: var(--accent-gold); cursor: default; }
.sudoku-cell.selected   { background: rgba(126,184,247,0.18) !important; }
.sudoku-cell.error      { color: #ff6b6b !important; background: rgba(255,107,107,0.1) !important; }
.sudoku-cell.hint-flash { background: rgba(232,201,122,0.25) !important; }

/* Thicker borders for 3x3 boxes */
.sudoku-cell:nth-child(3n)   { border-right: 2px solid var(--accent-blue); }
.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--accent-blue); }

/* ── Sudoku numpad ──────────────────────────────────────── */
.sudoku-num-btn {
  padding: 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-bright);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  text-align: center;
}
.sudoku-num-btn:hover  { background: var(--surface-2); }
.sudoku-num-btn.erase  { color: #ff6b6b; font-size: 0.75rem; }

/* ── TicTacToe cells ─────────────────────────────────────── */
.ttt-cell {
  aspect-ratio: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform 0.1s;
  user-select: none;
}
.ttt-cell:hover:not(.filled) { background: var(--surface-2); transform: scale(0.96); }
.ttt-cell.win-cell { border-color: var(--accent-gold); background: rgba(232,201,122,0.12); }
.ttt-cell.filled   { cursor: default; }

/* ── Dictionary ─────────────────────────────────────────── */
.dict-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
}
.dict-result-card .word-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
}
.dict-result-card .word-phonetic {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent-blue);
  margin: 0.2rem 0 0.4rem;
}
.dict-result-card .word-meaning {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.dict-result-card .word-example {
  font-size: 0.73rem;
  color: var(--text-dim);
  font-style: italic;
  border-left: 2px solid var(--accent-gold);
  padding-left: 0.5rem;
}
.dict-history-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--accent-blue);
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  transition: all var(--transition);
}
.dict-history-chip:hover { background: var(--surface-2); }
#dict-history { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ── Game button — separate from back-btn so nav doesn't fire ── */
.game-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-bright);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.03em;
}
.game-btn:hover { background: var(--surface-2); }
.game-btn.primary { background: var(--accent-gold); color: #0A0F22; border-color: var(--accent-gold); }
.game-btn.blue    { background: var(--accent-blue); color: #0A0F22; border-color: var(--accent-blue); }
.game-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Contact form ───────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 0.65rem; }
.form-field   { display: flex; flex-direction: column; gap: 0.25rem; }
.form-label   {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
}
.form-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  color: var(--text-bright);
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.form-input:focus   { border-color: var(--accent-blue); }
.form-input::placeholder { color: var(--text-dim); }
textarea.form-input { resize: vertical; min-height: 90px; line-height: 1.5; }
.form-submit {
  background: var(--accent-gold);
  color: #0A0F22;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
}
.form-submit:hover    { opacity: 0.9; transform: translateY(-1px); }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.form-status {
  font-size: 0.78rem;
  text-align: center;
  padding: 0.5rem;
  border-radius: 10px;
  display: none;
}
.form-status.success { display:block; background: rgba(56,239,125,0.12); color: #38ef7d; border: 1px solid rgba(56,239,125,0.25); }
.form-status.error   { display:block; background: rgba(255,107,107,0.12); color: #ff6b6b; border: 1px solid rgba(255,107,107,0.25); }