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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
ul, ol { list-style: none; }

/* Container */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (max-width: 768px) {
  .container { padding-inline: var(--space-2); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, var(--text-5xl)); }
h2 { font-size: clamp(1.5rem, 3.5vw, var(--text-3xl)); }
h3 { font-size: clamp(1.25rem, 2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); font-family: var(--font-body); }

p { margin-bottom: 1.25em; }
p:last-child { margin-bottom: 0; }

/* Score Badge */
.tdw-score {
  font-family: var(--font-mono);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tdw-score--circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--tdw-red);
  color: #fff;
  font-size: 1rem;
  flex-direction: column;
  gap: 0;
  line-height: 1;
  box-shadow: var(--shadow-red);
}
.tdw-score--circle .score-label {
  font-size: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 2px;
}
.tdw-score--lg {
  width: 80px;
  height: 80px;
  font-size: 1.5rem;
}
.tdw-score--xl {
  width: 100px;
  height: 100px;
  font-size: 1.875rem;
}

/* Ratings color */
.score-high   { background: var(--tdw-green) !important; }
.score-mid    { background: var(--tdw-gold) !important; color: var(--text) !important; }
.score-low    { background: var(--tdw-text-muted) !important; }
.score-worst  { background: #555 !important; }

/* Category pill */
.cat-pill {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--tdw-red);
  color: #fff;
  transition: background var(--dur-fast) var(--ease);
}
.cat-pill:hover { background: var(--tdw-red-dark); }
.cat-pill--blue   { background: var(--tdw-blue); }
.cat-pill--gold   { background: var(--tdw-gold); color: var(--text); }
.cat-pill--outline {
  background: transparent;
  color: var(--tdw-red);
  border: 1.5px solid var(--tdw-red);
}

/* Dividers */
.rule { height: 1px; background: var(--border); width: 100%; }
.rule--gradient {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Section header */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--tdw-red);
}
.section-header h2 { margin: 0; font-size: var(--text-xl); }
.section-header .see-all {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--tdw-red);
  white-space: nowrap;
}
.section-header .see-all:hover { color: var(--tdw-red-dark); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  border: none;
  text-decoration: none;
}
.btn--primary {
  background: var(--tdw-red);
  color: #fff;
  box-shadow: var(--shadow-red);
}
.btn--primary:hover {
  background: var(--tdw-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(200,16,46,0.35);
}
.btn--secondary {
  background: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--secondary:hover {
  border-color: var(--text);
  background: var(--surface);
}
.btn--ghost { background: transparent; color: var(--tdw-red); padding: 0; }

/* Reading progress bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tdw-red), var(--tdw-gold));
  z-index: 9999;
  width: 0%;
  transition: width 50ms linear;
}

/* Lazy fade-in */
.lazy-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.lazy-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Aspect ratios */
.aspect-poster { aspect-ratio: 2/3; }
.aspect-video  { aspect-ratio: 16/9; }
.aspect-square { aspect-ratio: 1/1; }
.aspect-banner { aspect-ratio: 21/9; }
.cover-img     { width: 100%; height: 100%; object-fit: cover; }

/* Grid systems */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-4); }
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2,1fr); gap: var(--space-2); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Truncate */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* Selection */
::selection { background: rgba(200,16,46,0.15); color: var(--text); }

/* Focus */
:focus-visible { outline: 2px solid var(--tdw-red); outline-offset: 3px; border-radius: 2px; }
