:root {
  color-scheme: dark;

  /* Colors */
  --color-bg: #0a0514;
  --color-surface: #0c1520;
  --color-surface-alt: #111d2a;
  --color-text: #e8f0ff;
  --color-text-bright: #ffffff;
  --color-muted: #8ea0ba;
  --color-dim: #5a6b82;
  --color-accent-blue: #5aa7ff;
  --color-accent-green: #4ade80;
  --color-accent-purple: #b58dff;
  --color-accent-orange: #ffaa66;
  --color-accent-yellow: #ffd666;
  --color-warning: #ff7b6b;

  /* Syntax highlighting colors (code-like) */
  --syntax-keyword: #ff79c6;
  --syntax-string: #50fa7b;
  --syntax-number: #bd93f9;
  --syntax-comment: #6272a4;
  --syntax-operator: #ff79c6;
  --syntax-key: #8be9fd;

  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', Consolas, monospace;

  /* Layout */
  --terminal-max-width: 1600px;
  --terminal-max-height: 850px;

  /* Borders & Shadows */
  --border-light: 1px solid rgba(255, 255, 255, 0.08);
  --border-lighter: 1px solid rgba(255, 255, 255, 0.07);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 16px 34px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.35);

  /* Border radius */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-xxs: 6px;

  /* Dock-aware spacing */
  --dock-offset-bottom: calc(20px + 60px + 1.2rem + 1rem);
}

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

html,
body {
  height: 100%;
  max-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.4;
  overflow: hidden;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  position: relative;
  z-index: 0;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 5, 20, 0.88);
  backdrop-filter: blur(12px);
  z-index: 3000;
  animation: intro-fade-in 0.4s ease forwards;
}

.intro-overlay[hidden] {
  display: none !important;
}

.intro-overlay--closing {
  animation: intro-fade-out 0.3s ease forwards;
}

.intro-overlay__panel {
  max-width: 520px;
  width: calc(100% - 3rem);
  padding: clamp(2rem, 4vw, 3rem);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(17, 25, 40, 0.95), rgba(20, 30, 48, 0.85));
  border: 1px solid rgba(128, 155, 190, 0.25);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  text-align: center;
  position: relative;
}

.intro-overlay__language {
  align-self: flex-end;
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.35rem 0.4rem;
  border-radius: var(--radius-sm);
  background: rgba(12, 20, 32, 0.92);
  background-color: rgba(12, 20, 32, 0.92);
  border: 1px solid rgba(90, 167, 255, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.intro-overlay__language-button {
  border: none;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-xs);
  background: transparent;
  color: rgba(232, 240, 255, 0.78);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.intro-overlay__language-button:hover,
.intro-overlay__language-button:focus-visible {
  color: var(--color-text-bright);
  background: rgba(74, 222, 128, 0.16);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.35);
  outline: none;
}

.intro-overlay__language-button--active {
  background: rgba(90, 167, 255, 0.28);
  color: var(--color-text-bright);
  box-shadow: inset 0 0 0 1px rgba(90, 167, 255, 0.5);
  transform: translateY(-1px);
}

.intro-overlay__eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(232, 240, 255, 0.55);
}

.intro-overlay__heading {
  margin: 0;
  font-size: clamp(1.15rem, 3.6vw, 1.55rem);
  font-weight: 600;
  color: var(--color-text-bright);
  line-height: 1.35;
}

.intro-overlay__lead {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: rgba(232, 240, 255, 0.7);
}

.intro-overlay__actions {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.intro-overlay__button {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.78rem 1.3rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(128, 155, 190, 0.35);
  background: rgba(16, 24, 38, 0.85);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.intro-overlay__button:hover {
  transform: translateY(-2px);
  border-color: rgba(90, 167, 255, 0.55);
}

.intro-overlay__button-icon {
  font-size: 1.25rem;
  line-height: 1;
  color: rgba(90, 167, 255, 0.9);
}

.intro-overlay__button-content {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.intro-overlay__button-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.intro-overlay__button-title {
  font-size: 0.84rem;
  color: var(--color-text-bright);
  letter-spacing: 0.04em;
}

.intro-overlay__button-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 123, 107, 0.2);
  border: 1px solid rgba(255, 123, 107, 0.4);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 123, 107, 0.95);
  font-weight: 500;
}

.intro-overlay__button-copy {
  font-size: 0.7rem;
  color: rgba(232, 240, 255, 0.65);
  line-height: 1.4;
}

.intro-overlay__button--primary {
  background: linear-gradient(135deg, rgba(90, 167, 255, 0.3) 0%, rgba(74, 222, 128, 0.25) 100%);
  border-color: rgba(90, 167, 255, 0.6);
  color: var(--color-text-bright);
  box-shadow: 0 12px 30px rgba(90, 167, 255, 0.25);
}

.intro-overlay__button--primary:hover {
  background: linear-gradient(135deg, rgba(90, 167, 255, 0.4) 0%, rgba(74, 222, 128, 0.35) 100%);
}

.intro-overlay__button:disabled,
.intro-overlay__button--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.7);
}

.intro-overlay__button:disabled:hover,
.intro-overlay__button--disabled:hover {
  transform: none;
  border-color: rgba(128, 155, 190, 0.35);
}

.intro-overlay__button--primary:disabled,
.intro-overlay__button--primary.intro-overlay__button--disabled {
  background: rgba(16, 24, 38, 0.6);
  border-color: rgba(128, 155, 190, 0.25);
  box-shadow: none;
}

@keyframes intro-fade-in {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes intro-fade-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.98);
  }
}

.particle-background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  filter: blur(18px);
  transition: filter 0.4s ease;
}

.particle-background--focused {
  filter: blur(0px);
  pointer-events: auto;
  cursor: crosshair;
}

body:focus-visible {
  outline: none;
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(260px, 300px);
  grid-template-rows: 1fr;
  gap: clamp(1.8rem, 3vw, 3rem);
  align-items: stretch;
  justify-content: center;
  padding: clamp(2rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3rem) 120px clamp(2rem, 4vw, 3rem);
  position: relative;
  z-index: 1;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

/* Terminal focused state */
.workspace--focused {
  opacity: 1;
  filter: none;
  pointer-events: auto;
}

/* Terminal blurred state (when panel is open) */
.workspace--blurred {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .explorer {
    min-height: auto;
    max-height: none;
  }

  .help {
    position: static;
  }
}

/* Panel header shared styles */
.panel-header {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(221, 232, 247, 0.6);
  background: var(--color-surface-alt);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.65rem 0.95rem;
  flex-shrink: 0;
}
