/* ===================================
   ENK vs AS - 2026 Design System
   ================================== */

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

:root {
  /* Color System - Dark Mode Default */
  --clr-bg: #0a0a0a;
  --clr-bg-elevated: #1a1a1a;
  --clr-bg-card: #222;
  --clr-text: #f5f5f5;
  --clr-text-muted: #a0a0a0;
  --clr-border: #333;
  
  --clr-primary: #00ff88;
  --clr-primary-hover: #00cc6a;
  --clr-accent: #ff3366;
  
  /* Gradients */
  --grad-primary: linear-gradient(135deg, #00ff88 0%, #00cc88 100%);
  --grad-card: linear-gradient(145deg, #1a1a1a 0%, #222 100%);
  
  /* Typography Scale */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Courier New", monospace;
  
  --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --fs-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --fs-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --fs-lg: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --fs-xl: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  --fs-2xl: clamp(2.5rem, 2rem + 2vw, 4rem);
  --fs-3xl: clamp(3rem, 2.5rem + 2.5vw, 5rem);
  
  /* Spacing Scale */
  --space-xs: clamp(0.5rem, 0.45rem + 0.25vw, 0.75rem);
  --space-sm: clamp(0.75rem, 0.7rem + 0.25vw, 1rem);
  --space-md: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
  --space-lg: clamp(1.5rem, 1.3rem + 1vw, 2.5rem);
  --space-xl: clamp(2rem, 1.5rem + 2vw, 4rem);
  --space-2xl: clamp(3rem, 2rem + 4vw, 6rem);
  
  /* Layout */
  --max-width: 1400px;
  --content-width: 800px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
  --clr-bg: #ffffff;
  --clr-bg-elevated: #f9f9f9;
  --clr-bg-card: #f5f5f5;
  --clr-text: #0a0a0a;
  --clr-text-muted: #666;
  --clr-border: #e0e0e0;
  
  --clr-primary: #00cc6a;
  --clr-primary-hover: #00aa58;
  
  --grad-card: linear-gradient(145deg, #ffffff 0%, #f5f5f5 100%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

/* Base Styles */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--clr-text);
  background: var(--clr-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--clr-primary-hover);
}

strong {
  font-weight: 600;
  color: var(--clr-text);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 1000;
  
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  cursor: pointer;
  transition: all var(--transition-base);
}

.theme-toggle:hover {
  transform: scale(1.1);
  border-color: var(--clr-primary);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  color: var(--clr-text);
}

.moon-icon {
  display: block;
}

.sun-icon {
  display: none;
}

[data-theme="light"] .moon-icon {
  display: none;
}

[data-theme="light"] .sun-icon {
  display: block;
}

/* Layout */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

/* Hero Section - Typography First */
.hero {
  text-align: center;
  margin-bottom: var(--space-2xl);
  padding: var(--space-2xl) 0;
}

.hero h1 {
  font-size: var(--fs-3xl);
  font-weight: 800;
  margin-bottom: var(--space-md);
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: var(--fs-lg);
  color: var(--clr-text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

.hero__meta {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 500;
}

/* Quick Answer - Bento Grid */
.quick-answer {
  margin-bottom: var(--space-2xl);
}

.quick-answer h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: var(--space-lg);
}

.comparison-card {
  background: var(--grad-card);
  border: 2px solid var(--clr-border);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.comparison-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.comparison-card.enk {
  border-color: var(--clr-primary);
}

.comparison-card.as {
  border-color: #6366f1;
}

.comparison-card h3 {
  margin-bottom: var(--space-md);
  font-size: var(--fs-xl);
}

.comparison-card ul {
  list-style: none;
}

.comparison-card li {
  padding: var(--space-xs) 0;
  padding-left: var(--space-md);
  position: relative;
}

.comparison-card li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--clr-primary);
  font-weight: bold;
}

/* Calculator Section */
.calculator-section {
  margin-bottom: var(--space-2xl);
}

.calculator-container {
  max-width: var(--content-width);
  margin: 0 auto;
  background: var(--clr-bg-elevated);
  border: 2px solid var(--clr-border);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.calculator-container h2 {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.calculator-intro {
  text-align: center;
  color: var(--clr-text-muted);
  margin-bottom: var(--space-xl);
}

/* Form Grid - Container Queries Ready */
.form-grid {
  display: grid;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@container (min-width: 600px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-group label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  font-size: var(--fs-sm);
}

.label-text {
  color: var(--clr-text);
}

.label-helper {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--clr-text-muted);
}

/* Input Styling - Micro-interactions */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  padding-right: 3rem;
  
  background: var(--clr-bg);
  border: 2px solid var(--clr-border);
  border-radius: var(--border-radius-sm);
  
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  color: var(--clr-text);
  
  transition: all var(--transition-base);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.input-wrapper input::placeholder {
  color: var(--clr-text-muted);
}

.input-suffix {
  position: absolute;
  right: var(--space-md);
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  pointer-events: none;
}

/* CTA Button - Gradient */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  
  background: var(--grad-primary);
  border: none;
  border-radius: var(--border-radius-sm);
  
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #000;
  
  cursor: pointer;
  transition: all var(--transition-base);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 255, 136, 0.3);
}

.cta-button:active {
  transform: translateY(0);
}

.cta-button.secondary {
  background: transparent;
  border: 2px solid var(--clr-primary);
  color: var(--clr-primary);
}

.cta-button.secondary:hover {
  background: var(--clr-primary);
  color: #000;
}

/* Results Container */
.results-container {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background: var(--clr-bg-card);
  border: 2px solid var(--clr-primary);
  border-radius: var(--border-radius);
  
  animation: slideIn var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.results-container.hidden {
  display: none;
}

.result-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.result-recommendation {
  font-size: var(--fs-2xl);
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.result-recommendation.enk {
  color: var(--clr-primary);
}

.result-recommendation.as {
  color: #6366f1;
}

.result-reason {
  font-size: var(--fs-lg);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-sm);
}

.result-savings {
  font-size: var(--fs-base);
  padding: var(--space-md);
  background: var(--clr-bg-elevated);
  border-radius: var(--border-radius-sm);
  margin-top: var(--space-md);
}

.result-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.result-comparison {
  background: var(--clr-bg-elevated);
  border: 1px solid var(--clr-border);
  border-radius: var(--border-radius-sm);
  padding: var(--space-lg);
}

.result-comparison h3 {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--clr-border);
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--clr-border);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row-total {
  margin-top: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 2px solid var(--clr-primary);
  border-bottom: none;
}

.result-label {
  font-weight: 600;
}

.result-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--clr-primary);
}

.result-footer {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: var(--clr-bg-elevated);
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--clr-accent);
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
}

/* Comparison Table */
.comparison-table-section {
  margin-bottom: var(--space-2xl);
}

.comparison-table-section h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.table-wrapper {
  overflow-x: auto;
  border: 2px solid var(--clr-border);
  border-radius: var(--border-radius);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--clr-bg-elevated);
}

.comparison-table thead {
  background: var(--clr-bg-card);
}

.comparison-table th {
  padding: var(--space-md);
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--clr-border);
}

.comparison-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--clr-border);
}

.comparison-table tbody tr:hover {
  background: var(--clr-bg-card);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.table-note {
  margin-top: var(--space-md);
  padding: var(--space-md);
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  font-style: italic;
}

/* FAQ Section */
.faq-section {
  margin-bottom: var(--space-2xl);
}

.faq-section h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.faq-grid {
  display: grid;
  gap: var(--space-md);
  max-width: var(--content-width);
  margin: 0 auto;
}

.faq-item {
  background: var(--clr-bg-elevated);
  border: 2px solid var(--clr-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all var(--transition-base);
}

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

.faq-item summary {
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-icon {
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.faq-content {
  padding: 0 var(--space-lg) var(--space-lg) var(--space-lg);
  color: var(--clr-text-muted);
  animation: fadeIn var(--transition-base);
}

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

.faq-content ul {
  margin-left: var(--space-lg);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

.faq-content li {
  margin-bottom: var(--space-xs);
}

/* CTA Section */
.cta-section {
  margin-bottom: var(--space-2xl);
  padding: var(--space-2xl);
  background: var(--grad-card);
  border: 2px solid var(--clr-primary);
  border-radius: var(--border-radius);
  text-align: center;
}

.cta-content h2 {
  margin-bottom: var(--space-md);
}

.cta-content p {
  color: var(--clr-text-muted);
  margin-bottom: var(--space-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-features {
  list-style: none;
  margin-bottom: var(--space-xl);
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-features li {
  padding: var(--space-sm) 0;
  font-size: var(--fs-lg);
}

.cta-button {
  max-width: 400px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--clr-border);
  padding: var(--space-xl) var(--space-md);
  margin-top: var(--space-2xl);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  margin-bottom: var(--space-md);
}

.footer-brand strong {
  font-size: var(--fs-lg);
}

.footer-brand p {
  color: var(--clr-text-muted);
  margin-top: var(--space-xs);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.footer-disclaimer {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: var(--fs-2xl);
  }
  
  .comparison-table {
    font-size: var(--fs-sm);
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: var(--space-sm);
  }
}

/* View Transitions API (Progressive Enhancement) */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.3s;
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Foote Line */
.footer-line {
  margin-top: 2.5rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #8a8a8a;
  letter-spacing: 0.01em;
  text-align: center;
}

.footer-line a {
  color: inherit;
  text-decoration: none;
}

.footer-line a:hover {
  color: #585858;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-line .sep {
  margin: 0 0.35rem;
  opacity: 0.5;
}
