/* =====================================================
   AFTER TOMORROW — Shared Stylesheet
   aftertomorrowfm.com
   ===================================================== */

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

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

body {
  background-color: #000000;
  color: #FFFFFF;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6,
.nav-links a,
.episode-label,
.section-heading,
.footer-copy,
.back-link,
.story-meta,
.card-meta {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
}

/* === COLOUR TOKENS === */
:root {
  --bg: #000000;
  --surface: #0C0C14;
  --accent: #6263F0;
  --accent-dark: #4A47C0;
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0A8;
  --text-dim: #606068;
  --border: #1A1A24;
  --glow: 0 0 20px rgba(98, 99, 240, 0.4);
  --glow-strong: 0 0 30px rgba(98, 99, 240, 0.6);
}

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

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #000000;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled {
  background: rgba(0, 0, 0, 0.85);
  border-bottom-color: var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  height: 44px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

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

.nav-links .twitter-link {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links .twitter-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* === HERO === */
.hero {
  padding: 80px 20px 64px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-title {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.hero-rule {
  height: 2px;
  width: 120px;
  background: var(--accent);
  box-shadow: var(--glow);
  border: none;
  border-radius: 1px;
}

/* === SECTION HEADING === */
.section-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
  font-variant: small-caps;
}

/* === EPISODE GRID === */
.episodes-section {
  padding: 48px 20px 64px;
  max-width: 1100px;
  margin: 0 auto;
}

.episode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .episode-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* === EPISODE CARD === */
.episode-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  position: relative;
}

.episode-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: var(--glow);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.episode-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 32px rgba(98, 99, 240, 0.15);
  transform: translateY(-2px);
}

.episode-card:hover::after {
  opacity: 1;
}

.card-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--surface);
}

.card-thumbnail-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0C0C14 0%, #12121E 50%, #0A0A12 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-thumbnail-placeholder svg {
  width: 64px;
  height: 64px;
  opacity: 0.35;
}

.card-body {
  padding: 20px 22px 22px;
}

.episode-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.card-title {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.card-description {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.card-meta {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.card-meta .separator {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
}

/* === ABOUT SECTION === */
.about-section {
  padding: 64px 20px;
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

@media (min-width: 768px) {
  .about-inner {
    grid-template-columns: 1fr auto;
    gap: 60px;
  }
}

.about-text h2 {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.about-text p {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.about-link {
  color: var(--accent);
  text-decoration: none;
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.about-link:hover {
  color: #ffffff;
}

.about-logo {
  flex-shrink: 0;
  text-align: center;
}

.about-logo img {
  width: 120px;
  height: auto;
  opacity: 0.85;
  border-radius: 8px;
}

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  background: #000000;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

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

.footer-logo img {
  height: 32px;
  width: auto;
  opacity: 0.7;
}

.footer-star {
  color: var(--accent);
  margin: 0 8px;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.footer-twitter {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-twitter:hover {
  color: var(--accent);
}

/* === STORY / EPISODE PAGE === */

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 12px 0;
  transition: color 0.2s ease;
  min-height: 44px;
}

.back-link:hover {
  color: var(--accent);
}

.back-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Story header */
.story-header {
  padding: 32px 20px 0;
  max-width: 720px;
  margin: 0 auto;
}

.story-episode-label {
  display: block;
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.story-title {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.story-description {
  font-size: 18px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.55;
  margin-bottom: 20px;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 28px;
}

.story-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-dim);
}

.story-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  box-shadow: 0 0 12px rgba(98, 99, 240, 0.5);
  border: none;
  margin-bottom: 0;
}

/* Story body */
.story-body-wrapper {
  padding: 48px 20px 64px;
  max-width: 720px;
  margin: 0 auto;
}

.story-body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(17px, 2.5vw, 19px);
  line-height: 1.85;
  color: var(--text-primary);
  max-width: 680px;
}

.story-body p {
  margin-bottom: 1.5em;
}

.story-body p:last-child {
  margin-bottom: 0;
}

/* Scene break */
.scene-break {
  text-align: center;
  color: var(--accent);
  font-size: 20px;
  letter-spacing: 0.4em;
  margin: 2.5em 0;
  user-select: none;
}

/* Dialogue blockquotes */
.story-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.8em 0 1.8em 0;
  padding: 0.5em 0 0.5em 1.5em;
  font-style: italic;
  color: #D0D0E0;
  box-shadow: -3px 0 16px rgba(98, 99, 240, 0.2);
}

/* Closing question box */
.closing-question {
  margin-top: 3em;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 6px;
  box-shadow: var(--glow);
}

.closing-question p {
  font-style: italic;
  color: var(--text-secondary);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.7;
  margin-bottom: 0 !important;
  text-align: center;
}

/* Story nav (top + bottom back links) */
.story-nav {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.story-nav-bottom {
  padding: 8px 20px 48px;
  border-top: 1px solid var(--border);
  max-width: 720px;
  margin: 0 auto;
}

/* === SHARE BUTTON === */
.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-dark);
  padding: 10px 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s;
  min-height: 44px;
}

.share-btn:hover {
  background: rgba(98, 99, 240, 0.1);
  box-shadow: var(--glow);
}

.share-btn svg { flex-shrink: 0; }

.share-btn.copied {
  color: #5BE0A0;
  border-color: #2A6050;
}

.share-feedback {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
}

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

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
}

/* =====================================================
   VISUAL EFFECTS
   ===================================================== */

/* C — VHS glitch on episode card hover */
@keyframes at-glitch {
  0%, 100% { transform: translate(0, 0);   filter: none; }
  5%        { transform: translate(-5px, 0); filter: hue-rotate(90deg) brightness(1.4) saturate(2); }
  10%       { transform: translate( 5px, 0); filter: hue-rotate(-60deg) brightness(0.9); }
  15%       { transform: translate(-2px, 1px); filter: none; }
  20%       { transform: translate(0, 0); }
  60%       { transform: translate(0, 0);   filter: none; }
  65%       { transform: translate( 3px, -1px); filter: hue-rotate(45deg) brightness(1.2); }
  70%       { transform: translate(-1px, 0);    filter: none; }
  75%       { transform: translate(0, 0); }
}

/* scan-line overlay covering the thumbnail area */
.episode-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(98, 99, 240, 0.05) 3px,
    rgba(98, 99, 240, 0.05) 4px
  );
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.episode-card:hover::before {
  opacity: 1;
}

.episode-card:hover .card-thumbnail,
.episode-card:hover .card-thumbnail-placeholder {
  animation: at-glitch 0.6s linear forwards;
}

/* === SUBSCRIBE SECTION === */
.subscribe-section {
  padding: 72px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.subscribe-inner {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.subscribe-heading {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: clamp(20px, 3.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.subscribe-sub {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.subscribe-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.subscribe-input {
  flex: 1;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.subscribe-input::placeholder {
  color: var(--text-dim);
}

.subscribe-input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(98, 99, 240, 0.15);
}

.subscribe-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
  min-height: 44px;
}

.subscribe-btn:hover {
  background: var(--accent-dark);
  box-shadow: var(--glow);
}

.subscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.subscribe-msg {
  margin-top: 16px;
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 13px;
  min-height: 20px;
  letter-spacing: 0.02em;
}

.subscribe-msg--ok  { color: #5BE0A0; }
.subscribe-msg--err { color: #F06262; }
