/* Home page G1 + G5 - block class .hp (WordPress puts "home" on <body> itself) (design/projects/home/FOR_ARCHITECT_home.md, prototype
   home/proto/home.html). One markup for everybody; html.is-back (set in <head>
   before first paint for a browser that has finished a quiz) switches the
   first screen from G1 (the quiz of the day's first question) to G5 ("Today",
   "One more"). The H1 exists once: the grid places it - in the first screen on
   the desktop for a new visitor, under the first screen everywhere else. */

.hp { display: flex; flex-direction: column; padding-bottom: 8px; }

/* ---------- G1: the first question of the quiz of the day ---------- */
/* exactly the window minus the header, so the question is fitted to what is left
   and the answer sticker is always in the first screen (design) */
.hero { display: flex; flex-direction: column; height: calc(100vh - 64px); height: calc(100svh - 64px - env(safe-area-inset-top)); min-height: 480px; }
.story { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.dbars, .dhead { display: none; }
.dayhead { padding-top: 4px; }
.daytitle { margin-top: 12px; font-size: 22px; line-height: 1.16; font-weight: 900; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: normal; }
.dayhead .ex { display: none; }
.hp .bars { margin-top: 12px; }
.hp .bars i.now { background: rgba(255, 255, 255, .5); }
.disp { display: flex; flex: 1; flex-direction: column; justify-content: flex-end; min-height: 0; padding: 18px 6px; overflow: hidden; text-align: center; }
/* V1: the same sizes as on the quiz page - 28 / 32 / 34 px, a step smaller over 100 characters; a question
   that still does not fit scrolls inside itself (as on the quiz page) */
.q { flex: 0 1 auto; width: 100%; min-height: 0; padding: 2px 0 4px; overflow-y: auto; scrollbar-width: none; font-size: 28px; font-weight: 900; line-height: 1.08; letter-spacing: -.012em; text-wrap: balance; overflow-wrap: normal; }
.q::-webkit-scrollbar { display: none; }
.q.long { font-size: 26px; }
@media (min-width: 600px) { .q { font-size: 32px; } .q.long { font-size: 30px; } }
@media (min-width: 1000px) { .q { font-size: 34px; } .q.long { font-size: 32px; } }
.hp .stk { flex: none; margin: 0 2px calc(24px + env(safe-area-inset-bottom)); padding: 10px; border-radius: 22px; background: var(--tx); color: var(--ink); box-shadow: 0 10px 28px rgba(15, 22, 30, .3); transform: rotate(-1deg); }
.opts { display: grid; gap: 7px; }
.op { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 14px; border-radius: 14px; background: var(--pill); color: var(--ink); text-align: center; font-size: 17px; line-height: 1.16; font-weight: 800; text-decoration: none; transition: background-color .1s, color .1s, transform .1s; }
.op:active { transform: scale(.98); }
.op.on { background: var(--st); color: var(--tx); }
.hp .stk :focus-visible { outline-color: var(--deep); }

/* ---------- G5: a returning visitor ---------- */
.back { display: none; padding-top: 8px; }
html.is-back .back { display: block; order: -1; }
html.is-back .hero { display: none; }
.meta { margin-top: 4px; font-size: 15px; color: var(--soft); }
.hp .circles { display: flex; gap: 12px; overflow-x: auto; margin: 14px calc(-1 * var(--pad)) 0; padding: 4px var(--pad) 6px; scrollbar-width: none; }
.hp .circles::-webkit-scrollbar { display: none; }
.hp .circ { flex: none; width: 82px; text-align: center; font-size: 13px; line-height: 1.16; font-weight: 800; overflow-wrap: normal; }
.hp .circ u { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 50%; background: var(--glass); font-size: 15px; text-decoration: none; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--st), 0 0 0 4px var(--glass2); }
.hp .circ .lb { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.todayb + .go { margin-top: 22px; }
.daystk { display: block; margin: 34px 6px 0; padding: 18px 18px 20px; border-radius: 22px; background: var(--tx); color: var(--st); text-decoration: none; transform: rotate(-1.5deg); }
.daystk[hidden] { display: none; }
.daystk .dtag { transform: rotate(2deg); }
.daystk b { display: block; margin-top: 12px; font-size: 28px; line-height: 1.04; font-weight: 900; letter-spacing: -.015em; text-wrap: balance; overflow-wrap: normal; }
.daystk .go2 { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--ink); font-size: 16px; font-weight: 900; }
.daystk .go2 svg { width: 16px; height: 16px; }
.daystk:focus-visible { outline-offset: 4px; }

/* ---------- for everybody: about, new, topics ---------- */
.about { margin-top: 40px; }
.about h1 { font-size: 34px; line-height: 1.04; font-weight: 900; letter-spacing: -.025em; text-wrap: balance; }
.about p { max-width: 34em; margin-top: 12px; color: var(--soft); line-height: 1.5; }
.fresh, .topics { margin-top: 36px; }
.fresh .pill { margin-top: 12px; }
/* the home page and the 404 keep "New" two tiles wide in every column (prototype home.html) */
.hp .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- 404 (E4): the plate - H1 with the dark "404" on its corner and "All quizzes ›" ---------- */
.nf { position: relative; display: flex; flex: none; align-items: center; gap: 10px; min-height: 56px; margin-top: 16px; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--glass); }
.nf h1 { flex: 1; min-width: 0; font-size: 17px; line-height: 1.15; font-weight: 900; overflow-wrap: normal; }
.nf .dtag { position: absolute; left: 12px; top: -12px; }
.nf + .mhead .dayhead { padding-top: 16px; }
.is-nf > .nf { margin-bottom: 8px; }

@media (min-width: 600px) {
  .about h1 { font-size: 44px; }
}

/* ---------- desktop: two columns ---------- */
@media (min-width: 1000px) {
  .hp {
    display: grid; grid-template-columns: minmax(0, 1fr) 470px; column-gap: 60px; align-items: start; padding-top: 24px;
    grid-template-areas: "about story" "dhead story" "fresh topics";
    grid-template-rows: auto 1fr auto; /* the story spans two rows: the extra height goes under the day head, not between H1 and it */
  }
  .hero { display: contents; height: auto; min-height: 0; }
  .mhead { display: none; }
  .story { grid-area: story; height: 560px; padding: 18px 26px 0; border-radius: 26px; background: var(--deep); }
  .dbars { display: block; }
  .dbars .bars { margin-top: 0; }
  .hp .stk { margin: 0 0 28px; }
  .op { min-height: 58px; font-size: 18px; }
  .about { grid-area: about; margin-top: 0; }
  .hp .tiles { gap: 8px; margin-top: 12px; }
  .hp .tile { min-height: 132px; }
  .hp .tile .tn { font-size: 18px; }
  .is-nf { grid-template-areas: "nf story" "dhead story" "fresh topics"; }
  .nf { grid-area: nf; max-width: 520px; margin-top: 12px; }
  .about h1 { font-size: 56px; }
  .dhead { display: block; grid-area: dhead; }
  .sidesep { height: 1px; margin: 34px 0 28px; background: var(--glass2); }
  .dhead .daytitle { font-size: 32px; line-height: 1.06; letter-spacing: -.015em; }
  .dhead .ex { display: block; max-width: 30em; margin-top: 12px; font-size: 18px; color: var(--soft); }
  .fresh { grid-area: fresh; margin-top: 56px; }
  .topics { grid-area: topics; margin-top: 56px; }
  /* G5 on the desktop: "Today" and "One more" left (up to 470 px), the day's sticker right */
  html.is-back .hp { grid-template-areas: "back back" "about about" "fresh topics"; grid-template-rows: auto auto auto; }
  html.is-back .back { display: grid; grid-area: back; grid-template-columns: minmax(0, 1fr) 470px; column-gap: 60px; align-items: start; padding-top: 0; }
  html.is-back .dhead { display: none; }
  html.is-back .about { margin-top: 56px; }
  .back .go { max-width: 470px; }
  .daystk { margin: 0; }
  .hp .circles { flex-wrap: wrap; overflow: visible; margin: 14px 0 0; padding: 4px 0 6px; }
}

@media (hover: hover) and (pointer: fine) {
  .op:hover { background: var(--pillh); }
  .op.on:hover { background: var(--st); }
}
