/* Chronicle Design Sprint Report - styles.css */

/* ========== CSS CUSTOM PROPERTIES ========== */
:root {
  /* Dark mode (default) */
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-surface: #1e1e1e;
  --bg-hover: #2a2a2a;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #27272a;
  --border-subtle: #1e1e1e;
  --accent: #a78bfa;
  --accent-hover: #c4b5fd;
  --accent-bg: #a78bfa15;
  --score-high: #4ade80;
  --score-mid: #fbbf24;
  --score-low: #f87171;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --tab-active-bg: #a78bfa20;
}

[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #f4f4f5;
  --bg-surface: #ffffff;
  --bg-hover: #e4e4e7;
  --text-primary: #1a1a1a;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --border-color: #e4e4e7;
  --border-subtle: #f4f4f5;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-bg: #7c3aed10;
  --score-high: #16a34a;
  --score-mid: #ca8a04;
  --score-low: #dc2626;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --tab-active-bg: #7c3aed15;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ========== HEADER ========== */
.report-header {
  border-bottom: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.report-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.report-header h1 span {
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-date {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Theme Toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ========== TAB NAVIGATION ========== */
.tab-nav {
  border-bottom: 1px solid var(--border-color);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-nav::-webkit-scrollbar { height: 0; }

.tab-list {
  display: flex;
  gap: 0;
  list-style: none;
  min-width: max-content;
}

.tab-list [role="tab"] {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tab-list [role="tab"]:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab-list [role="tab"][aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--tab-active-bg);
}

.tab-list [role="tab"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ========== TAB PANELS ========== */
.tab-panel {
  display: none;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
  animation: fadeIn 0.25s ease;
}

.tab-panel.active {
  display: block;
}

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

/* ========== OVERVIEW TAB ========== */
.overview-intro {
  max-width: 720px;
  margin-bottom: 48px;
}

.overview-intro h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.overview-intro p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 12px;
}

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

.key-findings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.finding-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.finding-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}

.finding-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Pattern cards */
.patterns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.pattern-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  border-left: 3px solid var(--accent);
}

.pattern-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.pattern-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== CONCEPT TABS ========== */
.concept-header {
  margin-bottom: 32px;
}

.concept-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.concept-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.concept-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.concept-meta-item {
  font-size: 13px;
  color: var(--text-muted);
}

.concept-meta-item strong {
  color: var(--text-secondary);
}

/* Color Palette Swatches */
.palette-section {
  margin-bottom: 32px;
}

.palette-section h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.palette-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease;
  border: 1px solid var(--border-color);
}

.swatch:hover {
  transform: scale(1.15);
  z-index: 2;
}

.swatch::after {
  content: attr(data-hex);
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.swatch:hover::after {
  opacity: 1;
}

.swatch-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
  max-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Typography Showcase */
.typo-section {
  margin-bottom: 32px;
}

.typo-section h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.typo-list {
  display: grid;
  gap: 8px;
}

.typo-item {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.typo-item .role {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  min-width: 80px;
  flex-shrink: 0;
}

.typo-item .spec {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Screen Previews */
.screens-section {
  margin-bottom: 32px;
}

.screens-section h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.screen-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.screen-tab {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.screen-tab:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.screen-tab.active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent);
}

.screen-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Device Frame */
.device-frame {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.device-frame-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-color);
}

.device-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
}

.device-frame-title {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.device-frame {
  position: relative;
}

.device-frame iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

/* Transparent overlay to prevent iframe interaction */
.device-frame .iframe-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  cursor: default;
}

.device-frame.mobile iframe {
  width: 375px;
  height: 667px;
  margin: 0 auto;
  display: block;
}

.device-frame.mobile {
  max-width: 395px;
  margin: 0 auto;
}

/* Design Tokens Summary */
.tokens-section {
  margin-bottom: 32px;
}

.tokens-section h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.token-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
}

.token-item .token-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
}

.token-item .token-value {
  color: var(--text-secondary);
  font-size: 12px;
}

/* ========== COMPARISON TAB ========== */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.comparison-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.comparison-card:hover {
  border-color: var(--accent);
}

.comparison-card h3 {
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.comparison-card iframe {
  width: 100%;
  height: 300px;
  border: none;
  display: block;
  pointer-events: none;
}

.comparison-card .meta {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
}

/* Comparison Table */
.comparison-table-wrap {
  overflow-x: auto;
  margin-bottom: 32px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.comparison-table th,
.comparison-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
}

.comparison-table td {
  color: var(--text-secondary);
}

.comparison-table tr:hover td {
  background: var(--bg-hover);
}

.comparison-table td:first-child {
  font-weight: 500;
  color: var(--text-primary);
}

/* ========== SCORECARD TAB ========== */
.scorecard-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.score-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.15s ease;
}

.score-card.winner {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.score-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.score-card .total-score {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.score-card .total-max {
  font-size: 13px;
  color: var(--text-muted);
}

.score-card.winner .total-score { color: var(--accent); }

/* Score Table */
.score-table-wrap {
  overflow-x: auto;
  margin-bottom: 32px;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.score-table th,
.score-table td {
  padding: 10px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.score-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-secondary);
}

.score-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
}

.score-table tr:hover td {
  background: var(--bg-hover);
}

.score-table .score-high { color: var(--score-high); font-weight: 700; }
.score-table .score-mid { color: var(--score-mid); font-weight: 600; }
.score-table .score-low { color: var(--score-low); font-weight: 600; }
.score-table .score-best { color: var(--accent); font-weight: 700; }

.score-table tr.total-row td {
  font-weight: 700;
  border-top: 2px solid var(--border-color);
  font-size: 14px;
}

/* Persona Fit */
.persona-section {
  margin-bottom: 32px;
}

.persona-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.persona-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.persona-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.persona-card .persona-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.fit-list {
  list-style: none;
}

.fit-list li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}

.fit-excellent { color: var(--score-high); font-weight: 600; }
.fit-good { color: var(--score-mid); font-weight: 500; }
.fit-fair { color: var(--text-muted); }
.fit-poor { color: var(--score-low); }

/* Accessibility Audit */
.a11y-section {
  margin-bottom: 32px;
}

.a11y-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.a11y-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.a11y-table th,
.a11y-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.a11y-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-secondary);
}

.a11y-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--text-primary);
}

.a11y-pass { color: var(--score-high); }
.a11y-partial { color: var(--score-mid); }
.a11y-fail { color: var(--score-low); font-weight: 600; }

/* Recommendation Box */
.recommendation {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.recommendation h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.recommendation p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

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

.hybrid-list {
  list-style: none;
  margin-top: 16px;
}

.hybrid-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hybrid-list li strong {
  color: var(--accent);
}

/* ========== SECTION HEADINGS ========== */
.section-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1023px) {
  .comparison-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .scorecard-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .report-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .report-header h1 { font-size: 1.25rem; }
  .header-right { width: 100%; justify-content: space-between; }
  .tab-nav { padding: 0 16px; }
  .tab-list [role="tab"] { padding: 10px 12px; font-size: 12px; }
  .tab-panel { padding: 24px 16px; }
  .overview-intro h2 { font-size: 1.35rem; }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  .comparison-card iframe { height: 200px; }
  .scorecard-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .score-card .total-score { font-size: 1.5rem; }
  .key-findings { grid-template-columns: 1fr; }
  .device-frame iframe { height: 400px; }
  .device-frame.mobile { max-width: 100%; }
  .device-frame.mobile iframe { width: 100%; }
  .persona-grid { grid-template-columns: 1fr; }
}

@media (max-width: 639px) {
  .scorecard-summary { grid-template-columns: 1fr 1fr; }
  .palette-grid { gap: 6px; }
  .swatch { width: 40px; height: 40px; }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0s !important; transition-duration: 0s !important; }
}
