@font-face {
  font-family: "Kalam";
  src: url("./assets/fonts/Kalam-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Kalam";
  src: url("./assets/fonts/Kalam-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  background: #17201f;
  --frame: 0px;
  --chalk: #f5f0df;
  --chalk-dim: #c1bdb1;
  --pink: #ff6fa5;
  --board: #1b2322;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #17201f;
}

a {
  color: inherit;
}

.blackboard {
  isolation: isolate;
  position: relative;
  width: 100vw;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: var(--chalk);
  background:
    radial-gradient(circle at 84% 43%, rgba(117, 80, 191, 0.16), transparent 25%),
    radial-gradient(circle at 89% 72%, rgba(255, 111, 165, 0.09), transparent 24%),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.035), transparent 30%),
    repeating-linear-gradient(173deg, transparent 0 10px, rgba(255, 255, 255, 0.009) 10px 11px),
    linear-gradient(145deg, #222b2a 0%, var(--board) 48%, #151c1b 100%);
  box-shadow: inset 0 0 145px rgba(0, 0, 0, 0.42);
}

.blackboard::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  border: 0;
  box-shadow:
    inset 0 0 85px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.blackboard::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.18;
  background:
    linear-gradient(12deg, transparent 0 34%, rgba(255, 255, 255, 0.04) 34.15% 34.35%, transparent 34.55%),
    linear-gradient(-8deg, transparent 0 70%, rgba(255, 255, 255, 0.032) 70.15% 70.35%, transparent 70.55%);
}

.board-copy {
  position: absolute;
  z-index: 3;
  top: clamp(34px, 5vh, 54px);
  left: clamp(50px, 6.2vw, 112px);
  width: min(65vw, 1080px);
  text-align: left;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.88),
    1px 1px 0 rgba(255, 255, 255, 0.06);
}

h1 {
  position: relative;
  width: fit-content;
  margin: 0 0 clamp(15px, 2.2vh, 23px);
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(74px, min(7.8vw, 14.6vh), 132px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.022em;
  white-space: nowrap;
  transform: scaleX(0.86);
  transform-origin: left center;
  text-shadow:
    4px 4px 0 rgba(255, 111, 165, 0.2),
    0 0 1px rgba(255, 255, 255, 0.9);
}

h1::after {
  display: block;
  width: 54%;
  height: clamp(4px, 0.55vh, 6px);
  margin-top: clamp(7px, 0.9vh, 9px);
  content: "";
  border-radius: 999px;
  background: var(--pink);
  opacity: 0.88;
  transform: rotate(-1.2deg) translateX(4%);
}

.story {
  width: 100%;
  max-width: 1040px;
}

.story p {
  margin: 0;
  font-family: "Kalam", "Segoe Print", cursive;
  font-size: clamp(27px, min(2.35vw, 4.8vh), 45px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: 0.006em;
}

.story blockquote {
  display: grid;
  gap: clamp(2px, 0.35vh, 4px);
  width: 100%;
  margin: 0 0 clamp(15px, 2vh, 20px);
  padding: 0 0 2px clamp(16px, 1.4vw, 22px);
  border-left: 3px solid rgba(245, 240, 223, 0.68);
}

.story blockquote p {
  font-size: clamp(23px, min(2vw, 4.1vh), 38px);
  white-space: nowrap;
}

.source-link {
  display: inline-block;
  width: fit-content;
  margin-top: clamp(4px, 0.65vh, 7px);
  color: var(--chalk-dim);
  font-family: "Kalam", "Segoe Print", cursive;
  font-size: clamp(13px, min(1.15vw, 2.35vh), 20px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.07em;
  text-decoration: none;
  transition: color 160ms ease;
}

.source-link:hover,
.source-link:focus-visible {
  color: var(--pink);
}

.source-link:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 5px;
}

.story-lines {
  display: grid;
  gap: clamp(5px, 0.7vh, 7px);
}

.story-lines p {
  white-space: nowrap;
}

.story-lines .turn {
  color: var(--pink);
  opacity: 1;
}

.story-lines .rich {
  justify-self: start;
  padding: 0 clamp(8px, 0.85vw, 13px);
  border: 2px solid rgba(255, 111, 165, 0.95);
  border-radius: 50%;
  color: var(--chalk);
  background: rgba(255, 111, 165, 0.05);
  transform: rotate(-1.1deg);
}

.story-lines .punchline {
  margin-top: clamp(5px, 0.95vh, 10px);
  color: var(--pink);
  font-size: clamp(31px, min(2.7vw, 5.25vh), 50px);
  line-height: 1.02;
  white-space: nowrap;
}

.ticker {
  position: absolute;
  z-index: 5;
  left: clamp(50px, 6.2vw, 112px);
  bottom: clamp(25px, 4.1vh, 44px);
  margin: 0;
  color: var(--chalk);
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(58px, min(5.8vw, 10.5vh), 98px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.05em;
  transform: rotate(-1deg);
}

.ticker::after {
  display: block;
  width: 107%;
  height: clamp(3px, 0.55vh, 5px);
  margin-top: clamp(5px, 0.8vh, 8px);
  content: "";
  border-radius: 999px;
  background: var(--pink);
  opacity: 0.86;
  transform: translateX(-3%);
}

.cat-shadow {
  position: absolute;
  z-index: 2;
  right: clamp(36px, 6vw, 94px);
  bottom: clamp(21px, 3.6vh, 43px);
  width: min(29vw, 410px);
  height: clamp(22px, 4.2vh, 42px);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  filter: blur(11px);
  transform: skewX(-7deg);
}

.wino-cat {
  position: absolute;
  z-index: 4;
  right: clamp(-14px, 1.7vw, 32px);
  bottom: clamp(-68px, -4vw, -42px);
  display: block;
  width: min(40vw, 610px);
  height: auto;
  pointer-events: none;
  filter:
    drop-shadow(-13px 17px 17px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 18px rgba(255, 111, 165, 0.12))
    drop-shadow(0 2px 1px rgba(255, 233, 201, 0.1))
    saturate(0.95)
    brightness(1.055)
    contrast(1.02);
}

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

@media (max-width: 860px) {
  .board-copy {
    width: calc(100vw - 100px);
  }

  .wino-cat {
    right: -48px;
    width: min(48vw, 390px);
  }
}

@media (max-width: 760px) {
  :root {
    --frame: 0px;
  }

  .blackboard {
    border-radius: 0;
  }

  .board-copy {
    top: clamp(22px, 3.8vh, 33px);
    left: 27px;
    width: calc(100vw - 54px);
  }

  h1 {
    margin-bottom: clamp(13px, 2.2vh, 19px);
    font-size: clamp(39px, 11.5vw, 45px);
    transform: scaleX(0.9);
  }

  .story p {
    font-size: clamp(17px, 4.9vw, 21px);
    line-height: 1.06;
  }

  .story blockquote {
    gap: 1px;
    margin-bottom: clamp(12px, 2vh, 17px);
    padding-left: 10px;
    border-left-width: 2px;
  }

  .story blockquote p {
    font-size: clamp(16px, 4.55vw, 19px);
    white-space: normal;
  }

  .source-link {
    margin-top: 4px;
    font-size: 11px;
  }

  .story-lines {
    gap: clamp(3px, 0.65vh, 5px);
  }

  .story-lines p {
    white-space: normal;
  }

  .story-lines .rich {
    padding-right: 6px;
    padding-left: 6px;
    border-width: 1.5px;
    white-space: nowrap;
  }

  .story-lines .punchline {
    margin-top: 4px;
    font-size: clamp(16px, 4.35vw, 18px);
    white-space: nowrap;
  }

  .ticker {
    left: 27px;
    bottom: clamp(17px, 3vh, 26px);
    font-size: clamp(42px, 12.5vw, 53px);
  }

  .cat-shadow {
    right: 8px;
    bottom: 19px;
    width: 180px;
    height: 24px;
    filter: blur(8px);
  }

  .wino-cat {
    right: -52px;
    bottom: -42px;
    width: min(60vw, 250px);
  }
}

@media (max-width: 360px) {
  .board-copy {
    top: 20px;
    left: 23px;
    width: calc(100vw - 46px);
  }

  h1 {
    margin-bottom: 12px;
    font-size: 36px;
  }

  .story p {
    font-size: 16px;
  }

  .story blockquote {
    margin-bottom: 10px;
  }

  .story blockquote p {
    font-size: 14.5px;
  }

  .source-link {
    font-size: 10px;
  }

  .story-lines {
    gap: 2px;
  }

  .story-lines .punchline {
    margin-top: 3px;
    font-size: 14.5px;
  }

  .ticker {
    left: 23px;
    bottom: 14px;
    font-size: 41px;
  }

  .cat-shadow {
    right: 2px;
    bottom: 14px;
    width: 150px;
  }

  .wino-cat {
    right: -43px;
    bottom: -33px;
    width: 184px;
  }
}

@media (min-width: 600px) and (max-height: 500px) {
  :root {
    --frame: 10px;
  }

  .board-copy {
    top: 17px;
    left: 34px;
    width: 69vw;
  }

  h1 {
    margin-bottom: 8px;
    font-size: 42px;
  }

  .story p {
    font-size: 15px;
    line-height: 1;
  }

  .story blockquote {
    gap: 1px;
    margin-bottom: 8px;
    padding-left: 8px;
    border-left-width: 2px;
  }

  .story blockquote p {
    font-size: 13px;
    white-space: nowrap;
  }

  .source-link {
    margin-top: 2px;
    font-size: 9px;
  }

  .story-lines {
    gap: 2px;
  }

  .story-lines p {
    white-space: nowrap;
  }

  .story-lines .rich {
    padding-right: 5px;
    padding-left: 5px;
    border-width: 1px;
  }

  .story-lines .punchline {
    margin-top: 2px;
    font-size: 16px;
    white-space: nowrap;
  }

  .ticker {
    left: 34px;
    bottom: 14px;
    font-size: 36px;
  }

  .ticker::after {
    height: 2px;
    margin-top: 4px;
  }

  .cat-shadow {
    right: 13px;
    bottom: 14px;
    width: 190px;
    height: 22px;
    filter: blur(7px);
  }

  .wino-cat {
    right: -24px;
    bottom: -47px;
    width: min(32vw, 260px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .source-link {
    transition: none;
  }
}
