/* Wise Guy Bedtime: colors pulled from Sal's bedroom (refs/style_bedroom.jpg). */
:root {
  color-scheme: light dark;

  --wall: #f4e7c5;        /* cream wall */
  --paper: #fff8e6;       /* card paper */
  --text: #2a1810;        /* outline ink, also body text */
  --text-soft: #6b4a33;
  --line: #2a1810;        /* cartoon outlines + hard shadows */
  --wood: #7a4524;        /* armchair leather / picture frame */
  --floor: #6a2e1b;       /* bedroom floorboards */
  --floor-grain: #5b2716;
  --mustard: #e0ad3a;     /* lamp shade */
  --mustard-hi: #f0c45c;
  --green: #1d4a31;       /* the tracksuit */
  --green-hi: #2a6142;
  --cream: #f7ecd2;       /* text on green / floor */
  --red: #b2472d;         /* the kid's sweater */
  --glow: rgba(255, 210, 110, 0.55);

  --radius: 18px;
  --shadow: 4px 5px 0 var(--line);
  --shadow-sm: 3px 4px 0 var(--line);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Same room, lamp on, lights out. */
    --wall: #17110c;
    --paper: #251a12;
    --text: #f3e4c4;
    --text-soft: #c7ad86;
    --line: #000;
    --wood: #8a5530;
    --floor: #2e140b;
    --floor-grain: #261009;
    --mustard: #e6b544;
    --mustard-hi: #f2c962;
    --green: #1f5236;
    --green-hi: #2b6a47;
    --cream: #f3e4c4;
    --red: #d0654a;
    --glow: rgba(230, 168, 70, 0.22);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wall);
  color: var(--text);
  font: 500 1rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The lamp's cone of light. */
.glow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 75vh;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 100% at 50% -15%, var(--glow), transparent 70%);
  z-index: 0;
}

.hero, main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: inherit; }

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

:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Header ---------- */

.hero {
  text-align: center;
  padding-top: 2.75rem;
}

.portrait {
  position: relative;
  width: min(15.5rem, 64vw);
  margin: 0 auto 1.6rem;
  transform: rotate(-2deg);
  border: 10px solid var(--wood);
  border-radius: 14px;
  box-shadow: 0 0 0 3px var(--line), 6px 7px 0 3px var(--line);
  background: var(--paper);
}

/* Little nail it hangs from. */
.portrait::before {
  content: "";
  position: absolute;
  top: -26px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--mustard);
  box-shadow: 0 0 0 3px var(--line);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px var(--line);
  outline: 3px solid var(--line);
  outline-offset: -3px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100;
  line-height: 1.05;
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.015em;
  text-shadow: 3px 3px 0 var(--mustard);
}

.tagline {
  max-width: 27rem;
  margin: 0.9rem auto 1.5rem;
  color: var(--text-soft);
  font-size: 1.05rem;
}

/* ---------- Social buttons ---------- */

.socials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.social {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.4rem 0.65rem;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.social svg { width: 28px; height: 28px; }
.social--tiktok svg { color: var(--text); }
.social--youtube svg { color: var(--red); }
.social--instagram svg { color: var(--green-hi); }

@media (prefers-color-scheme: dark) {
  .social--instagram svg { color: var(--mustard); }
}

/* Shared press effect for anything that looks like a button. */
.social:hover, .btn:hover { transform: translate(-1px, -2px); box-shadow: 4px 6px 0 var(--line); }
.social:active, .btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--line); }

/* ---------- Sections ---------- */

main { padding-top: 2.75rem; flex: 1; }

.section-head { margin: 0 0 1.1rem; }
.section-head h2 {
  font-size: 1.75rem;
  font-weight: 800;
  text-decoration: underline wavy var(--mustard) 3px;
  text-underline-offset: 7px;
  text-decoration-skip-ink: none;
}
.section-head p { margin: 0.95rem 0 0; color: var(--text-soft); }

/* ---------- Tonight's story ---------- */

.tonight {
  position: relative;
  margin-bottom: 3rem;
  padding: 1.25rem 1.25rem 1.35rem 2.6rem;
  background: var(--green);
  color: var(--cream);
  border: 3px solid var(--line);
  border-radius: 22px;
  box-shadow: 6px 7px 0 var(--line);
  overflow: hidden;
}

/* Tracksuit stripes down the side. */
.tonight::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  width: 15px;
  background: linear-gradient(to right, var(--cream) 0 4px, transparent 4px 10px, var(--cream) 10px 14px);
  opacity: 0.9;
}

.pill {
  margin: 0;
  font-family: var(--body);
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem 0.25rem 0.6rem;
  background: var(--mustard);
  color: #2a1810;
  border: 2.5px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pill svg { width: 16px; height: 16px; }

.tonight-grid { display: grid; gap: 1.1rem; margin-top: 1rem; }

.tonight .video {
  width: min(100%, 16rem);
  margin: 0 auto;
  border: 3px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-sm);
}
.tonight video, .tonight .video img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.tonight .hook {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.tonight h3 { font-size: 1.6rem; font-weight: 900; color: var(--mustard-hi); }
.tonight .meta { margin: 0.3rem 0 1.1rem; opacity: 0.85; font-weight: 700; font-size: 0.92rem; }

@media (min-width: 600px) {
  .tonight-grid { grid-template-columns: 13rem 1fr; align-items: center; gap: 1.4rem; }
  .tonight-grid--text { grid-template-columns: 1fr; }
  .tonight .video { width: 100%; }
}

/* ---------- Buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 1.1rem;
  border: 3px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font: 800 1rem/1.2 var(--body);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }

.btn--lamp { background: var(--mustard); color: #2a1810; }
.btn--lamp:hover { background: var(--mustard-hi); }
.btn--green { background: var(--green); color: var(--cream); }
.btn--green:hover { background: var(--green-hi); }

/* ---------- Episode cards ---------- */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

.card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  padding: 1.1rem 1.15rem 1.2rem;
  background: var(--paper);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.badge {
  grid-row: span 2;
  display: grid;
  place-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--mustard);
  color: #2a1810;
  border: 3px solid var(--line);
  border-radius: 50%;
  text-align: center;
  line-height: 1;
}
.badge small { font-weight: 800; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; }
.badge b { font-family: var(--display); font-size: 1.45rem; font-weight: 900; }

.card h3 {
  align-self: end;
  font-size: 1.45rem;
  font-weight: 800;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.55rem;
}
.card .new {
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff8e6;
}
.card .meta { align-self: start; margin: 0; color: var(--text-soft); font-weight: 700; font-size: 0.9rem; }
.card .hook { grid-column: 1 / -1; margin: 0.6rem 0 0.9rem; font-style: italic; }
.card .btn { grid-column: 1 / -1; }

.watch {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
  font-size: 0.9rem;
}
.watch a { text-underline-offset: 3px; }

/* ---------- Footer: the bedroom floor ---------- */

.floor {
  position: relative;
  z-index: 1;
  margin-top: 3.5rem;
  padding: 2.25rem 16px calc(2rem + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--cream);
  background:
    repeating-linear-gradient(to bottom, transparent 0 46px, var(--floor-grain) 46px 49px),
    var(--floor);
  border-top: 3px solid var(--line);
}
.floor p { margin: 0 auto; max-width: 30rem; }
.goodnight {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100;
  font-style: italic;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--mustard-hi);
}
.floor .handle { margin-top: 0.4rem; font-weight: 700; }
.floor .handle a { text-underline-offset: 3px; }
.disclosure { margin-top: 1.25rem !important; font-size: 0.82rem; opacity: 0.8; }
.copy { margin-top: 0.3rem !important; font-size: 0.78rem; opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
  .social, .btn { transition: none; }
}
