/* PokeZoneBuddy - Modern Minimal Design */

/* === Variables === */
:root {
  /* Colors */
  --primary: #7C3AED;
  --primary-dark: #6D28D9;
  --accent: #C084FC;
  --text: #111827;
  --text-muted: #6B7280;
  --bg: #FFFFFF;
  --bg-alt: #F9FAFB;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  
  /* Layout */
  --container-max: 1200px;
  --radius: 12px;
  --radius-sm: 8px;

  /* Legal theme */
  --legal-bg: #fff6ed;            /* light card bg */
  --legal-text: #1f2937;          /* light text */
  --legal-border: rgba(249, 115, 22, 0.45);
  --legal-heading: #c2410c;
  --legal-strong: #b45309;
  --legal-link: #c2410c;
  --legal-link-hover: #ea580c;
  --legal-accent: #f97316;        /* top bar */
  --legal-divider: rgba(249, 115, 22, 0.30);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #8B5CF6;
    --primary-dark: #A78BFA;
    --accent: #C4B5FD;
    --text: #F9FAFB;
    --text-muted: #9CA3AF;
    --bg: #0F0F0F;
    --bg-alt: #1A1A1A;
    --border: #2A2A2A;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);

    /* Legal theme (dark) */
    --legal-bg: rgba(82, 35, 11, 0.85);
    --legal-text: #fde7d5;
    --legal-border: rgba(249, 115, 22, 0.45);
    --legal-heading: #fed7aa;
    --legal-strong: #fff1d6;
    --legal-link: #fb923c;
    --legal-link-hover: #fdba74;
    --legal-accent: #f97316;
    --legal-divider: rgba(249, 115, 22, 0.32);
  }
}

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

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

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === Layout === */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

section {
  padding: var(--space-lg) 0;
}

/* === Typography === */
h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(3.25rem, 7vw, 4.5rem);
  margin-bottom: 0;
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: var(--space-md);
  text-align: center;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: var(--space-md);
}

/* === Hero === */
header {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(192, 132, 252, 0.08) 100%);
  padding: var(--space-lg) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(192, 132, 252, 0.22), transparent 55%);
  pointer-events: none;
}

header .container {
  position: relative;
  z-index: 1;
}

.hero {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.hero-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: nowrap;
}

.hero-media {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  min-width: auto;
}

.hero-icon {
  width: 148px;
  height: 148px;
  background: transparent;
  box-shadow: none;
  border-radius: 28px;
}

.hero-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-start;
  max-width: 540px;
}

.hero-content h1 {
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 10%, var(--accent) 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.hero-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: var(--space-xs);
}

.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-ghost {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.18);
  color: var(--primary);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.32);
  color: var(--primary);
}

/* === Highlights === */
.highlights {
  background: var(--bg-alt);
  position: relative;
  overflow: hidden;
}

.highlights::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(124, 58, 237, 0.12), transparent 55%),
    radial-gradient(circle at bottom right, rgba(192, 132, 252, 0.2), transparent 55%);
  pointer-events: none;
}

.highlights .container {
  position: relative;
  z-index: 1;
}

/* === Showcase === */
.showcase {
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.16), transparent 55%),
    radial-gradient(circle at bottom left, rgba(192, 132, 252, 0.18), transparent 55%);
  pointer-events: none;
}

.showcase .container {
  position: relative;
  z-index: 1;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  align-items: center;
}

/* === Section Blocks === */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.section-heading h2 {
  margin-bottom: 0;
  text-align: left;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: color 0.2s ease;
  white-space: nowrap;
}

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

.section-card {
  background: var(--bg);
  border-radius: calc(var(--radius) * 1.25);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: relative;
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-md);
  width: 80px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}

.feature-card {
  gap: var(--space-sm);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.feature-item {
  padding: var(--space-sm);
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.feature-icon {
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feature-item h3 {
  font-size: 1.125rem;
  color: var(--primary);
}

.feature-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.showcase-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 520px;
}

.showcase-copy h2 {
  margin-bottom: 0;
  text-align: left;
}

.showcase-lead {
  color: var(--text-muted);
  font-size: 1rem;
}

.showcase-steps {
  list-style: none;
  display: grid;
  gap: var(--space-sm);
}

.showcase-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-sm);
  align-items: start;
}

.step-index {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.showcase-steps strong {
  display: block;
  margin-bottom: 0.25rem;
}

.showcase-steps p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.example-inline {
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: var(--space-sm);
}

.example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
}

.example-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.16);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.example-city {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.example-times {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-sm);
  align-items: center;
  text-align: center;
}

.example-block {
  display: grid;
  gap: 0.25rem;
}

.label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.value {
  font-size: 1.125rem;
  font-weight: 600;
}

.example-arrow {
  font-size: 1.75rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.22);
  color: #ffffff;
  font-weight: 700;
}

.example-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.showcase-visual {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  justify-content: center;
}

.preview-frame {
  width: clamp(260px, 40vw, 520px);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.preview-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.preview-caption {
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-align: center;
  position: relative;
  z-index: 1;
  margin: 0;
}

/* === Release Notes === */
.release-notes {
  background: var(--bg-alt);
  position: relative;
  overflow: hidden;
}

.release-notes::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 55%),
    radial-gradient(circle at bottom left, rgba(192, 132, 252, 0.2), transparent 50%);
  pointer-events: none;
}

.release-notes .container {
  position: relative;
  z-index: 1;
}

.release-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.release-version {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.release-date {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.release-actions .btn {
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
}

.release-content {
  display: block;
}

.release-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.release-group {
  padding: var(--space-sm);
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.release-group h3 {
  font-size: 1rem;
  margin-bottom: var(--space-xs);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.release-group ul {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

.release-group li {
  line-height: 1.6;
}

.release-sublist {
  margin-top: 0.35rem;
  margin-left: 1rem;
  list-style: disc;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: grid;
  gap: 0.35rem;
}

.release-content a {
  color: var(--primary);
  font-weight: 600;
}

.release-content a:hover {
  color: var(--primary-dark);
}

.release-error {
  padding: var(--space-sm);
  border-radius: var(--radius);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #b91c1c;
  font-weight: 600;
}

.release-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .section-header {
    align-items: flex-start;
  }

  .section-link {
    white-space: normal;
  }

  .section-card {
    padding: var(--space-sm);
  }

  .section-card::before {
    left: var(--space-sm);
  }

  .showcase-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .showcase-copy {
    max-width: none;
  }

  .showcase-steps {
    gap: var(--space-sm);
  }

  .example-times {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  .example-arrow {
    display: none;
  }

  .preview-frame {
    width: 100%;
  }

  .hero-grid {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
  }

  .hero-media {
    align-self: center;
  }

  .hero-content {
    align-items: center;
    max-width: none;
  }

  .hero-content h1 {
    text-align: center;
  }

  .hero-subtitle {
    max-width: 36ch;
  }

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

@media (prefers-color-scheme: dark) {
  .section-card {
    background: rgba(17, 24, 39, 0.8);
    border-color: rgba(107, 114, 128, 0.3);
  }

  .release-group {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(75, 85, 99, 0.45);
  }

  .release-group h3 {
    color: var(--accent);
  }

  .feature-item {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(75, 85, 99, 0.45);
  }

  .hero-media {
    background: transparent;
    box-shadow: none;
  }

  .hero-content h1 {
    color: #ede9fe;
  }

  .hero-subtitle,
  .hero-meta {
    color: rgba(229, 231, 235, 0.82);
  }

  .step-index {
    background: rgba(167, 139, 250, 0.22);
    color: #ede9fe;
  }

  .example-inline {
    background: rgba(124, 58, 237, 0.24);
    border-color: rgba(167, 139, 250, 0.35);
  }

  .example-badge {
    background: rgba(167, 139, 250, 0.3);
    color: #ede9fe;
  }

  .example-city {
    color: #ede9fe;
  }

  .label {
    color: rgba(229, 231, 235, 0.7);
  }

  .value {
    color: #f5f3ff;
  }

  .example-note {
    color: rgba(229, 231, 235, 0.75);
  }

  .highlight {
    background: rgba(167, 139, 250, 0.32);
    color: #f8f5ff;
  }

  .preview-caption {
    color: rgba(229, 231, 235, 0.8);
  }

  .preview-frame {
    border-color: rgba(107, 114, 128, 0.35);
  }

  @media (prefers-color-scheme: dark) {
    /* Legal card already uses CSS variables for dark mode; no extra overrides needed */
  }

  .release-error {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
  }
}

/* === Legal Notice === */
.legal-notice {
  background: var(--bg-alt);
  position: relative;
  overflow: hidden;
}

.legal-notice::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--legal-accent) 22%, transparent), transparent 55%),
    radial-gradient(circle at bottom left, color-mix(in srgb, var(--legal-accent) 18%, transparent), transparent 55%);
  pointer-events: none;
}

.legal-notice .container { position: relative; z-index: 1; }

.section-card.legal-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--legal-bg);
  border: 1px solid var(--legal-border);
  color: var(--legal-text);
  box-shadow: var(--shadow-md);
}

.section-card.legal-card::before { background: var(--legal-accent); }

.section-card.legal-card h3 {
  color: var(--legal-heading);
  font-size: 1.35rem;
  margin-bottom: var(--space-sm);
}

.section-card.legal-card p { line-height: 1.7; margin-bottom: var(--space-sm); }
.section-card.legal-card strong { color: var(--legal-strong); font-weight: 700; }

.section-card.legal-card a {
  color: var(--legal-link);
  text-decoration: underline;
  font-weight: 600;
}
.section-card.legal-card a:hover { color: var(--legal-link-hover); }

.section-card.legal-card .credits {
  font-size: 0.875rem;
  border-top: 1px solid var(--legal-divider);
  padding-top: var(--space-sm);
  margin-top: var(--space-sm);
}

/* === Footer === */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: var(--space-md) 0;
}

.footer-content {
  text-align: center;
}

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

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  transition: color 0.2s ease;
}

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

.copyright {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* === Responsive === */
@media (max-width: 768px) {
  :root {
    --space-lg: 3rem;
    --space-xl: 4rem;
  }
  
  .cta-group {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  
  .btn {
    width: 100%;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

/* === Performance === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Print === */
@media print {
  .btn,
  footer {
    display: none;
  }
}
