/* Tastematter Design System
   Extracted from taste.systems - Terminal Design Language
   Border radius: 0 everywhere (sharp corners)
   Typography: VCR OSD Mono for headers, system sans for body
*/

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Brand Colors */
  --primary: #D35400;
  --primary-hover: #B34700;
  --secondary: #FF5C00;

  /* Light Theme */
  --background: #F4F5F6;
  --surface: #FFFFFF;
  --border: #E4E4E2;
  --foreground: #131A1F;
  --muted: #6B7280;

  /* Terminal Colors */
  --terminal-green: #22C55E;
  --terminal-amber: #F59E0B;
  --terminal-red: #EF4444;
  --terminal-cyan: #06B6D4;

  /* Traffic Lights */
  --traffic-red: #ff5f57;
  --traffic-yellow: #ffbd2e;
  --traffic-green: #28ca42;
}

/* Dark Theme */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #131A1F;
    --surface: #1A222A;
    --border: #252E38;
    --foreground: #F2F2F0;
    --muted: #9CA3AF;
  }
}

/* ============================================
   FONT FACE
   ============================================ */
@font-face {
  font-family: 'VCR OSD Mono';
  src: url('./assets/VCR_OSD_MONO_1.001.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.font-mono {
  font-family: 'VCR OSD Mono', 'Courier New', monospace;
}

.uppercase {
  text-transform: uppercase;
}

.tracking-wide {
  letter-spacing: 0.05em;
}

.tracking-wider {
  letter-spacing: 0.1em;
}

h1, h2, h3, .heading {
  font-family: 'VCR OSD Mono', monospace;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

@media (min-width: 768px) {
  h1 { font-size: 3rem; }
  h2 { font-size: 2.5rem; }
}

.text-muted {
  color: var(--muted);
}

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

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
}

.section {
  padding: 4rem 0;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   COMPONENTS: BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(211, 84, 0, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid var(--foreground);
}

.btn-outline:hover {
  background-color: var(--foreground);
  color: var(--background);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* ============================================
   COMPONENTS: CARDS
   ============================================ */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.card-title {
  font-family: 'VCR OSD Mono', monospace;
  text-transform: uppercase;
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

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

/* ============================================
   COMPONENTS: TERMINAL WINDOW
   ============================================ */
.terminal {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
}

.terminal-lights {
  display: flex;
  gap: 0.5rem;
}

.terminal-light {
  width: 12px;
  height: 12px;
  border-radius: 0;
}

.terminal-light.red { background-color: var(--traffic-red); }
.terminal-light.yellow { background-color: var(--traffic-yellow); }
.terminal-light.green { background-color: var(--traffic-green); }

.terminal-title {
  font-family: 'VCR OSD Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.terminal-body {
  padding: 2rem;
  font-family: 'VCR OSD Mono', monospace;
}

.terminal-line {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.terminal-prompt {
  color: var(--terminal-green);
  user-select: none;
}

.terminal-command {
  color: var(--foreground);
}

.terminal-comment {
  color: var(--muted);
}

/* ============================================
   COMPONENTS: CODE BLOCK
   ============================================ */
.code-block {
  position: relative;
  background-color: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1.5rem;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  font-family: 'VCR OSD Mono', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #E2E8F0;
}

.code-block .comment {
  color: #6B7280;
}

.code-block .command {
  color: var(--terminal-green);
}

.copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.5rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  color: #E2E8F0;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
  background-color: var(--terminal-green);
  color: white;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(244, 245, 246, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
  .header {
    background-color: rgba(19, 26, 31, 0.9);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 1.25rem;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--foreground);
}

.logo-icon {
  width: 28px;
  height: 28px;
}

.nav {
  display: none;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }
}

.nav-link {
  font-family: 'VCR OSD Mono', monospace;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

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

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding: 4rem 0;
  text-align: center;
}

@media (min-width: 768px) {
  .hero {
    padding: 6rem 0;
  }
}

.hero-title {
  margin-bottom: 1.5rem;
}

.hero-title-line {
  display: block;
}

/* Mobile hero title */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
}

@media (min-width: 769px) {
  .hero-title {
    font-size: 3rem;
  }

  .hero-title-line {
    display: inline;
  }

  .hero-title-line:nth-child(2)::before {
    content: "_";
  }

  .hero-title-line:nth-child(2)::after {
    content: "\A";
    white-space: pre;
  }

  .hero-title-line:nth-child(3)::before {
    content: "_";
  }
}

.hero-subtitle {
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: 1.125rem;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features-title {
  text-align: center;
  margin-bottom: 3rem;
}

/* ============================================
   INSTALL SECTION
   ============================================ */
.install {
  text-align: center;
}

.install-title {
  margin-bottom: 1rem;
}

.install-subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
}

.install-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.install-tab {
  padding: 0.5rem 1rem;
  font-family: 'VCR OSD Mono', monospace;
  font-size: 0.875rem;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.install-tab.active,
.install-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.install-code {
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

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

.footer-copy {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.hidden { display: none; }

/* Status indicator */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--terminal-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   MOBILE RESPONSIVE OVERRIDES
   ============================================ */

/* Prevent horizontal overflow globally */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* All containers must respect viewport */
.container, .terminal, .code-block, .card {
  max-width: 100%;
  box-sizing: border-box;
}

/* Terminal and code blocks scroll internally */
.terminal, .code-block {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.terminal-body, .code-block pre {
  overflow-x: auto;
  max-width: 100%;
}

/* Mobile-first fixes */
@media (max-width: 640px) {
  h2 {
    font-size: 1.125rem;
  }

  .hero {
    padding: 1.5rem 0;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  /* Terminal - key fix for overflow */
  .terminal {
    margin: 0 -0.75rem;
    width: calc(100% + 1.5rem);
    border-left: none;
    border-right: none;
  }

  .terminal-body {
    padding: 0.75rem;
    font-size: 0.65rem;
  }

  .terminal-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .terminal-prompt {
    display: none;
  }

  .terminal-command, .terminal-comment {
    font-size: 0.6rem;
    word-break: break-all;
    line-height: 1.4;
  }

  /* Code blocks */
  .code-block {
    padding: 0.75rem;
    margin: 0 -0.75rem;
    width: calc(100% + 1.5rem);
    border-left: none;
    border-right: none;
  }

  .code-block pre {
    font-size: 0.6rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .copy-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.6rem;
  }

  /* Cards */
  .card {
    padding: 1rem;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .card-text {
    font-size: 0.8rem;
  }

  /* Section padding reduced */
  .section {
    padding: 1.5rem 0;
  }

  /* Buttons */
  .btn {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
  }

  /* Install section */
  .install-tabs {
    flex-direction: column;
    gap: 0.5rem;
  }

  .install-tab {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.75rem;
  }

  /* Footer */
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .footer-link, .footer-copy {
    font-size: 0.75rem;
  }

  /* Container */
  .container {
    padding: 0 0.75rem;
  }

  /* Header */
  .logo {
    font-size: 1rem;
  }

  .logo-icon {
    width: 20px;
    height: 20px;
  }

  /* Gap utilities */
  .gap-6 {
    gap: 1rem;
  }
}

/* Medium screens */
@media (min-width: 641px) and (max-width: 767px) {
  h1 {
    font-size: 1.75rem;
  }

  .terminal-command {
    font-size: 0.75rem;
  }

  .code-block pre {
    font-size: 0.7rem;
  }
}
