/*
 * Homepage component
 * One owner for the notebook, intro, character stage and cold-joke card.
 * Breakpoints describe compositions rather than individual device models.
 */

.welcome-section {
  width: min(calc(100% - 32px), 1480px);
  margin: 22px auto 18px;
}

.hero-paper {
  --home-ink: var(--color-ink-strong);
  --home-muted: var(--color-muted);
  --home-paper: var(--color-paper);
  --home-rail: 62px;
  --home-content-left: 38px;
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: clamp(660px, 58vw, 760px);
  padding: 76px 48px 46px calc(var(--home-rail) + var(--home-content-left));
  grid-template-columns: minmax(340px, .82fr) minmax(480px, 1.18fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "copy cast"
    "joke cast";
  gap: 24px 40px;
  overflow: hidden;
  border: 1px solid rgba(87, 102, 144, .12);
  border-radius: 34px;
  color: var(--home-ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 42px, rgba(87, 102, 144, .055) 42px 43px),
    var(--home-paper);
  box-shadow: 0 20px 48px rgba(77, 59, 82, .085);
}

/* Notebook binding: the same visual language is kept at every width. */
.hero-paper::before {
  position: absolute;
  z-index: 1;
  top: 26px;
  bottom: 26px;
  left: 20px;
  width: 26px;
  background-image: radial-gradient(circle, #eadfce 0 7px, transparent 7.5px);
  background-position: center;
  background-size: 26px 59px;
  background-repeat: no-repeat space;
  content: "";
  pointer-events: none;
}

.hero-paper::after {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: var(--home-rail);
  width: 1px;
  background: rgba(231, 153, 176, .32);
  box-shadow: 1px 0 rgba(255, 255, 255, .8);
  content: "";
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 4;
  grid-area: copy;
  align-self: start;
  min-width: 0;
}

.hero-kicker {
  display: inline-flex;
  min-height: 32px;
  padding: 0 13px;
  align-items: center;
  border: 1px solid rgba(87, 102, 144, .16);
  border-radius: 9px;
  color: #576690;
  background: rgba(242, 243, 249, .86);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
}

.hero-logo {
  display: block;
  width: 152px;
  height: 58px;
  margin: 28px 0 16px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.hero-copy h1 {
  margin: 0 0 24px;
  color: var(--home-ink);
  font-size: clamp(52px, 5.6vw, 78px);
  font-weight: 950;
  line-height: .94;
  letter-spacing: -.075em;
}

.hero-copy h1 em {
  position: relative;
  z-index: 0;
  display: inline-block;
  margin-top: .08em;
  color: var(--member-eileen);
  font-style: normal;
}

.hero-copy h1 em::after {
  position: absolute;
  z-index: -1;
  right: -8px;
  bottom: 3px;
  left: -5px;
  height: .28em;
  background: color-mix(in srgb, var(--member-diana) 62%, white);
  clip-path: polygon(0 26%, 100% 0, 97% 88%, 2% 100%);
  content: "";
}

.hero-copy p {
  max-width: 390px;
  color: var(--home-muted);
}

.hero-jump {
  display: inline-flex;
  min-height: 48px;
  padding: 0 21px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  background: var(--member-bella);
  box-shadow: 0 10px 0 rgba(147, 74, 68, .07), 0 16px 26px rgba(219, 125, 116, .2);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hero-jump:hover {
  background: var(--member-bella-ink);
  box-shadow: 0 7px 0 rgba(147, 74, 68, .06), 0 13px 22px rgba(219, 125, 116, .2);
  transform: translateY(2px);
}

.hero-jump:focus-visible,
.home-joke-card button:focus-visible {
  outline: 3px solid rgba(87, 102, 144, .22);
  outline-offset: 3px;
}

.hero-cast {
  position: relative;
  z-index: 3;
  grid-area: cast;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(12, minmax(0, 1fr));
}

.hero-cast::before {
  display: none;
}

.hero-sticker {
  position: relative;
  display: block;
  width: min(100%, 210px);
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
  filter: drop-shadow(0 10px 12px rgba(69, 53, 72, .1));
}

.hero-sticker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 1px #fff);
}

.hero-sticker span {
  position: absolute;
  z-index: 4;
  top: var(--caption-top, auto);
  right: var(--caption-right, auto);
  bottom: var(--caption-bottom, auto);
  left: var(--caption-left, auto);
  display: inline-flex;
  min-width: max-content;
  min-height: 32px;
  padding: 0 11px;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, .96);
  border-radius: 11px;
  color: var(--member-ink);
  background: color-mix(in srgb, var(--member-color) 18%, white);
  box-shadow: 0 6px 15px color-mix(in srgb, var(--member-color) 20%, transparent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(var(--caption-rotate, 0deg));
}

.hero-sticker--bella {
  --member-color: var(--member-bella);
  --member-ink: var(--member-bella-ink);
  --caption-top: 64%;
  --caption-left: 76%;
  --caption-rotate: 4deg;
  z-index: 2;
  top: -30px;
  left: -39px;
  grid-column: 4 / 7;
  grid-row: 1 / 5;
  transform: rotate(2deg);
}

.hero-sticker--diana {
  --member-color: var(--member-diana);
  --member-ink: var(--member-diana-ink);
  --caption-top: 49%;
  --caption-right: 76%;
  --caption-rotate: -5deg;
  z-index: 3;
  top: -28px;
  left: 1px;
  grid-column: 1 / 4;
  grid-row: 5 / 9;
  transform: translateX(clamp(14px, 2vw, 26px)) rotate(-3deg);
}

.hero-sticker--eileen {
  --member-color: var(--member-eileen);
  --member-ink: var(--member-eileen-ink);
  --caption-right: -22%;
  --caption-bottom: -4px;
  --caption-rotate: 3deg;
  z-index: 4;
  top: -9px;
  left: -13px;
  width: min(100%, 224px);
  grid-column: 4 / 7;
  grid-row: 8 / 13;
  transform: rotate(2deg);
}

.hero-fan-symbol {
  position: absolute;
  z-index: 5;
  display: grid;
  width: clamp(28px, 3vw, 36px);
  aspect-ratio: 1;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 2px 3px rgba(67, 45, 66, .12));
}

.hero-fan-symbol svg {
  width: 65%;
  height: 65%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-fan-symbol--star {
  color: #db7d74;
}

.hero-fan-symbol--candy {
  color: #e799b0;
}

.hero-fan-symbol--icecream {
  color: #576690;
}

.hero-line {
  position: absolute;
  z-index: 1;
  bottom: 4%;
  left: 5%;
  width: 43%;
  height: 88px;
  opacity: .78;
}

.hero-line::before {
  position: absolute;
  inset: 7px 0 5px;
  background: linear-gradient(90deg, var(--member-eileen), var(--member-diana) 48%, var(--member-bella));
  clip-path: polygon(0 74%, 21% 42%, 43% 66%, 64% 9%, 82% 49%, 100% 18%, 100% 24%, 82% 56%, 64% 17%, 43% 75%, 21% 51%, 0 83%);
  content: "";
}

.hero-line i {
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #8f7aea;
  box-shadow: 0 2px 8px rgba(74, 56, 94, .18);
}

.hero-line i:nth-child(1) { top: 65px; left: -4px; background: var(--member-eileen); }
.hero-line i:nth-child(2) { top: 35px; left: 20%; background: #e799b0; }
.hero-line i:nth-child(3) { top: 58px; left: 42%; background: #db7d74; }
.hero-line i:nth-child(4) { top: 8px; left: 63%; background: var(--member-diana); }
.hero-line i:nth-child(5) { top: 16px; right: -4px; background: #576690; }

.hero-spark--two {
  position: absolute;
  z-index: 4;
  top: 5%;
  right: 3%;
  color: #ef9db5;
  font-family: Georgia, serif;
  font-size: clamp(42px, 4.7vw, 60px);
  line-height: 1;
  opacity: .76;
  transform: rotate(-12deg);
}

.home-joke-card {
  position: relative;
  z-index: 5;
  display: grid;
  grid-area: joke;
  grid-template-columns: minmax(0, 1fr) 100px;
  grid-template-areas:
    "head head"
    "question art"
    "response art";
  width: min(100%, 520px);
  margin: 0;
  padding: 21px 23px 20px;
  overflow: hidden;
  border: 1px solid rgba(87, 102, 144, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 24px rgba(87, 102, 144, .06);
  column-gap: 14px;
}

.home-joke-card::before {
  display: none;
}

.joke-card-head {
  display: flex;
  grid-area: head;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.joke-card-head > div:first-child {
  display: grid;
  gap: 5px;
}

.joke-card-head .eyebrow {
  color: #ce627f;
}

.joke-card-head strong {
  color: #514957;
  font-size: 13px;
}

.joke-card-actions {
  display: flex;
  flex: 0 0 auto;
}

.joke-card-actions button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(231, 153, 176, .18);
  border-radius: 11px;
  color: #b45f79;
  background: rgba(255, 255, 255, .88);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.home-joke-card > p {
  grid-area: question;
  margin: 15px 0 12px;
  color: #403946;
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 850;
  line-height: 1.45;
}

.joke-answer {
  display: flex;
  min-width: 0;
  min-height: 39px;
  margin: 0;
  padding: 0;
  grid-area: response;
  align-items: center;
  gap: 0;
  color: var(--member-eileen);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.joke-answer[hidden] {
  display: none;
}

.joke-answer span {
  flex: none;
  font-size: inherit;
  font-weight: 900;
}

.joke-answer strong {
  min-width: 0;
  overflow: hidden;
  font-size: inherit;
  font-weight: 850;
  text-overflow: ellipsis;
}

.joke-reveal {
  grid-area: response;
  justify-self: start;
  min-height: 39px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #576690;
  box-shadow: 0 7px 16px rgba(87, 102, 144, .17);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.home-joke-confetti {
  position: relative;
  grid-area: art;
  width: 100%;
  min-height: 92px;
  align-self: stretch;
  pointer-events: none;
}

.home-joke-confetti .hero-fan-symbol--star {
  top: -6px;
  left: -8px;
  width: 65px;
  transform: rotate(-11deg);
}

.home-joke-confetti .hero-fan-symbol--candy {
  top: 47px;
  right: auto;
  left: -1px;
  width: 75px;
  transform: rotate(20deg);
}

.home-joke-confetti .hero-fan-symbol--icecream {
  top: 10px;
  bottom: auto;
  left: 34px;
  width: 75px;
  transform: rotate(20deg);
}

/* Compact desktop: enter the shared desktop composition with the app shell. */
@media (min-width: 899.99px) and (max-width: 1099px) {
  .welcome-section {
    width: calc(100% - 24px);
    margin-block: 14px;
  }

  .hero-paper {
    --home-rail: 42px;
    --home-content-left: 24px;
    min-height: clamp(570px, 72vw, 690px);
    padding: 50px 28px 34px calc(var(--home-rail) + var(--home-content-left));
    grid-template-columns: minmax(260px, .82fr) minmax(360px, 1.18fr);
    gap: 18px 22px;
    border-radius: 28px;
  }

  .hero-paper::before {
    left: 10px;
    width: 22px;
    background-size: 22px 48px;
  }

  .hero-kicker { min-height: 29px; font-size: 10px; }
  .hero-logo { width: 126px; height: 48px; margin: 20px 0 13px; }
  .hero-copy h1 { font-size: clamp(44px, 6.5vw, 62px); }
  .hero-jump { min-height: 44px; }
  .hero-sticker { width: min(100%, 170px); }
  .hero-sticker--eileen { width: min(100%, 184px); }
  .hero-sticker span { min-height: 29px; padding-inline: 9px; font-size: 10px; }
  .hero-line { height: 76px; }
  .hero-line i:nth-child(1) { top: 56px; }
  .hero-line i:nth-child(2) { top: 30px; }
  .hero-line i:nth-child(3) { top: 50px; }
  .hero-line i:nth-child(4) { top: 7px; }
  .hero-line i:nth-child(5) { top: 14px; }
  .home-joke-card { width: min(100%, 430px); padding: 17px 18px 16px; }
}

/* Web view shares the same tuned character anchors. */
@media (min-width: 899.99px) {
  .hero-sticker--bella { top: 45px; }
  .hero-sticker--diana { left: -52px; }
}

/* Phone composition: intro, one shared character stage, then the joke card. */
@media (max-width: 899.98px) {
  .welcome-section {
    width: auto;
    margin: 8px 8px 5px;
  }

  .hero-paper {
    --home-rail: 27px;
    min-height: 0;
    padding: 20px 14px 15px 38px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 292px auto;
    grid-template-areas: "copy" "cast" "joke";
    gap: 12px;
    border-radius: 27px;
    background:
      repeating-linear-gradient(0deg, transparent 0 31px, rgba(87, 102, 144, .045) 31px 32px),
      var(--home-paper);
    box-shadow: 0 14px 38px rgba(71, 56, 75, .075);
  }

  .hero-paper::before {
    top: 18px;
    bottom: 18px;
    left: 4px;
    width: 17px;
    background-size: 17px 37px;
  }

  .hero-paper::after { left: var(--home-rail); }
  .hero-kicker { min-height: 28px; padding-inline: 9px; font-size: 9px; }
  .hero-logo { display: none; }
  .hero-copy h1 {
    margin: 12px 0 12px;
    font-size: clamp(36px, 10.5vw, 45px);
    line-height: .92;
  }
  .hero-copy h1 em { color: var(--member-eileen); }
  .hero-copy h1 em::after { height: .25em; }
  .hero-copy p { display: none; }
  .hero-jump {
    min-height: 42px;
    padding-inline: 19px;
    border-radius: 14px;
    background: var(--member-bella);
    box-shadow: 0 9px 20px rgba(219, 125, 116, .22);
    font-size: 12px;
  }

  .hero-sticker { width: min(100%, 112px); }
  .hero-sticker--eileen { width: min(100%, 124px); }
  .hero-sticker span {
    min-height: 26px;
    padding-inline: 8px;
    border-width: 1.5px;
    border-radius: 10px;
    font-size: 9px;
  }
  /* Phone keeps the shared character anchors while tightening the stage. */
  .hero-sticker--diana {
    transform: translateX(18px) rotate(-3deg);
  }
  .hero-sticker--eileen {
    grid-row: 8 / 12;
  }
  .hero-line { bottom: 1%; left: 3%; width: 42%; height: 61px; opacity: .58; }
  .hero-line i { width: 9px; height: 9px; border-width: 2px; }
  .hero-line i:nth-child(1) { top: 44px; left: -3px; }
  .hero-line i:nth-child(2) { top: 23px; }
  .hero-line i:nth-child(3) { top: 39px; }
  .hero-line i:nth-child(4) { top: 5px; }
  .hero-line i:nth-child(5) { top: 10px; right: -3px; }
  .hero-spark--two { top: 24px; right: 17px; font-size: 38px; }
  .home-joke-card {
    grid-template-columns: minmax(0, 1fr) 86px;
    width: 100%;
    padding: 14px;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(87, 102, 144, .045);
  }
  .joke-card-head { align-items: center; gap: 8px; }
  .joke-card-head > div:first-child { gap: 2px; }
  .joke-card-head strong { font-size: 11px; }
  .joke-card-actions button { min-height: 32px; padding-inline: 10px; font-size: 10px; }
  .home-joke-card > p { margin: 11px 0 9px; font-size: 15px; }
  .joke-answer { min-height: 36px; padding-inline: 0; font-size: 11px; }
  .joke-reveal { min-height: 36px; padding-inline: 13px; }
}

@media (max-width: 380px) {
  .hero-paper {
    padding-right: 11px;
    padding-left: 34px;
    grid-template-rows: auto 266px auto;
    gap: 10px;
  }
  .hero-copy h1 { font-size: 34px; }
  .hero-sticker { width: min(100%, 102px); }
  .hero-sticker--eileen { width: min(100%, 112px); }
  .hero-sticker span { min-height: 24px; padding-inline: 7px; font-size: 8.5px; }
  .hero-sticker--diana { transform: translateX(16px) rotate(-3deg); }
  .home-joke-card { grid-template-columns: minmax(0, 1fr) 78px; padding: 13px; column-gap: 9px; }
}

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