/* Knowlu hero: white paper with the dot grid (js/dots.js), the big wordmark and tagline, a small piece of Knowlu's
   list for today (what you'd get), and the pilot button. On a wide screen the lockup and the button sit on the left and
   the list on the right; narrower, they stack: lockup, list, button.
   dots.js reads its colors from this section: the paper is its background, the dots mix toward --hero-dot,
   the dots around the sign-up box tint toward --hero-hot, and a stirred dot takes one of the four class colors. */

.hero {
  --hero-paper: var(--field);
  --hero-dot: var(--ink-3);
  --hero-hot: var(--accent);
  --hero-halo: 0 0 2px var(--hero-paper), 0 0 6px var(--hero-paper), 0 0 14px var(--hero-paper);
  position: relative; isolation: isolate; overflow: hidden;
  min-height: max(640px, 100svh); display: grid;
  background: var(--hero-paper); color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero { --hero-paper: var(--bg); --hero-dot: var(--ink-2); }
}
:root[data-theme="dark"] .hero { --hero-paper: var(--bg); --hero-dot: var(--ink-2); }

.hero-fx { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; max-width: none; pointer-events: none; }

.hero-in {
  justify-self: center; align-self: center; width: 100%; max-width: var(--page);
  display: grid; justify-items: center; grid-template-areas: "lock" "today" "go";
  padding: calc(var(--nav-h) + var(--safe-t) + clamp(40px, 7svh, 80px)) var(--gut) clamp(56px, 8svh, 88px);
  /* pressing and holding gathers the dots; that should not select the words */
  user-select: none; -webkit-user-select: none;
}
.hero-in :is(input, .wl-msg, .wl-done, .hero-today) { user-select: text; -webkit-user-select: text; }

/* ---------- the lockup ---------- */
/* never wider than the screen: the wordmark is 3.96em wide */
.lockup { grid-area: lock; font-size: min(var(--t-wordmark), calc((100vw - 2 * var(--gut)) / 3.96)); font-weight: 400; line-height: 1; display: grid; justify-items: start; }
.wm.wm-xl { font-size: 1em; color: var(--ink); white-space: nowrap; }
.lockup .tag { font: 400 .2745em/1.2 var(--serif); margin: .04em 0 0 .093em; color: var(--ink); text-shadow: var(--hero-halo); }

/* ---------- what you'd get: a piece of Knowlu's list for today ----------
   The product's own look, without a window around it: a sheet of the page's paper with an ink hairline (a softer
   line in the dark theme), the answer on top in the display face with its reason, the rest of the day under it.
   Solid, so the dots part around it. Sizes are in em off the sheet's font size. */
.hero-today { grid-area: today; margin: clamp(36px, 5svh, 52px) 0 0; width: min(100%, 27em); font: 400 clamp(15px, 1.12vw, 17px)/1.4 var(--sans); }
.ht-sheet {
  container: hts / inline-size;
  --sbg: var(--bg); --sedge: var(--ink);
  background: var(--sbg); color: var(--ink); border: 1px solid var(--sedge); border-radius: var(--r);
  box-shadow: 0 30px 60px -32px color-mix(in srgb, var(--shadow) 38%, transparent);
  padding: 1.1em 1.4em .35em; text-align: left;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ht-sheet { --sbg: var(--bg-2); --sedge: var(--field-line); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--shadow) 60%, transparent); }
}
:root[data-theme="dark"] .ht-sheet { --sbg: var(--bg-2); --sedge: var(--field-line); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--shadow) 60%, transparent); }

.ht-day { display: flex; justify-content: space-between; gap: 1em; font-size: .82em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ht-day span:first-child { font-weight: 600; color: var(--ink-2); }

/* class colors: which class an item belongs to, as a small square only */
.hero-today [data-class="cs"] { --cc: var(--c-cs); }
.hero-today [data-class="chem"] { --cc: var(--c-chem); }
.hero-today [data-class="span"] { --cc: var(--c-span); }
.hero-today [data-class="psyc"] { --cc: var(--c-psyc); }
.ht-mk { display: block; width: .72em; height: .72em; background: var(--cc, var(--ink)); }

.ht-next { display: grid; grid-template-columns: .72em minmax(0, 1fr); column-gap: .85em; padding: 1em 0 1.3em; }
.ht-next .ht-mk { margin-top: .78em; }
.ht-t { font: 400 2.1em/1.1 var(--display); letter-spacing: -.016em; color: var(--ink); }
.ht-m { margin-top: .4em; font-size: .86em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ht-why { margin-top: .7em; font: 400 1.12em/1.4 var(--serif); color: var(--ink); }

.ht-then { list-style: none; margin: 0; padding: 0; }
.ht-then li {
  display: grid; grid-template-columns: .72em minmax(0, 1fr) auto; grid-template-areas: "mk t m";
  column-gap: .85em; align-items: center; padding: .72em 0; border-top: 1px solid var(--line);
}
.ht-then .ht-mk { grid-area: mk; }
.ht-t2 { grid-area: t; min-width: 0; font: 400 1.1em/1.2 var(--display); letter-spacing: -.006em; color: var(--ink); }
.ht-then .ht-m { grid-area: m; margin: 0; color: var(--ink-3); white-space: nowrap; }
/* a narrow sheet (about 290px at the usual 15px): the class and time go under the item's name. In em, so a sheet set
   smaller for a short screen keeps them on one line for as long as they fit. */
@container hts (max-width: 19.3em) {
  .ht-then li { grid-template-areas: "mk t" ". m"; grid-template-columns: .72em minmax(0, 1fr); row-gap: .15em; }
  .ht-then .ht-mk { align-self: center; }
}

.ht-cap { margin-top: 12px; font: 400 14px/1.45 var(--sans); color: var(--ink-3); text-align: center; text-wrap: balance; text-shadow: var(--hero-halo); }

/* ---------- the pilot button ---------- */
.hero-go { grid-area: go; margin-top: clamp(28px, 4svh, 44px); display: grid; justify-items: center; gap: 14px; }
.hero-go-btn { height: 60px; padding: 0 32px; font-size: 18px; }
.hero-go-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.hero-go-note { font: 400 var(--t-body)/1.5 var(--serif); color: var(--ink-2); text-align: center; text-wrap: balance; text-shadow: var(--hero-halo); }
/* the short fine print is for an upright phone only (below) */
.hero-go-short { display: none; }

/* ---------- a tablet, or a phone on its side: lockup and button on the left, the list on the right ----------
   Every size here is a share of the screen's width, so the three always fit inside the gutters: the list takes up
   to 46% of the width, the gap 5%, and the wordmark (3.96em wide) the 41% that is left at most. The words under the
   button wrap to the room the list leaves them. */
@media (min-width: 740px), (min-width: 600px) and (orientation: landscape) and (max-height: 520px) {
  .hero-in {
    grid-template-columns: minmax(0, max-content) auto; grid-template-rows: auto auto;
    grid-template-areas: "lock today" "go today";
    justify-content: center; justify-items: start; column-gap: clamp(32px, 5vw, 72px);
    padding-block: calc(var(--nav-h) + var(--safe-t) + 32px) 56px;
  }
  .lockup { font-size: clamp(56px, 9.6vw, 112px); align-self: end; }
  .hero-today { align-self: center; margin: 0; width: min(46vw, 27em); }
  .ht-cap { text-align: left; }
  .hero-go { align-self: start; justify-items: start; margin-top: clamp(24px, 4svh, 40px); }
  .hero-go-note { text-align: left; font-size: 17px; }
}
/* ---------- a wide screen: the same, at the desktop's sizes ---------- */
@media (min-width: 1180px) {
  .hero-in { grid-template-columns: max-content minmax(0, 27em); column-gap: clamp(72px, 7vw, 128px); }
  .lockup { font-size: clamp(112px, 10.6vw, 172px); }
  .hero-today { width: clamp(25em, 30vw, 27em); }
  .hero-go { margin-top: clamp(32px, 4.4svh, 48px); }
  .hero-go-note { font-size: var(--t-body); }
}
/* a short screen (a phone on its side): the hero fits in one screen, with a lower bar, less room above and below,
   and a smaller lockup and list */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1179.98px) {
  :root { --nav-h: 60px; }
  .hero { min-height: 100svh; }
  .hero-in { padding-block: calc(var(--nav-h) + var(--safe-t) + 14px) 18px; }
  .lockup { font-size: clamp(52px, 8vw, 84px); }
  .hero-today { font-size: 13px; }
  .ht-sheet { padding: .9em 1.2em .2em; }
  .ht-next { padding: .8em 0 1em; }
  .ht-then li { padding: .6em 0; }
  .ht-cap { margin-top: 8px; font-size: 13px; }
  .hero-go { margin-top: 16px; gap: 8px; }
  .hero-go-btn { height: 52px; padding: 0 26px; font-size: 17px; }
  .hero-go-note { font-size: 15px; line-height: 1.4; }
}

/* a phone: the words sit in the middle of the paper, and the hero is as tall as they need */
@media (max-width: 520px) {
  .hero { min-height: calc(100svh - 96px); }
  .hero-in { padding-top: calc(var(--nav-h) + var(--safe-t) + 32px); padding-bottom: 48px; }
  .hero-today { margin-top: 28px; font-size: 15px; }
  .ht-sheet { padding-inline: 1.15em; }
  .hero-go { margin-top: 28px; }
  .hero-go-note { font-size: 17px; }
}

/* ---------- small portrait: what we leave out ----------
   A phone held upright (the stacked layout, below the 740px two-column width) shows less, step by step. Hidden with
   CSS only, so the markup, the tablet and the desktop are unchanged; a phone on its side still shows everything.
   Here: the example list for today and its caption, and the long fine print, which gives way to the short one. The
   hero is then the lockup, the button and one line under it, with more room between lockup and button so the paper
   reads as space, not as a gap. */
@media (max-width: 739.98px) and (orientation: portrait) {
  .hero-today, .hero-go-long { display: none; }
  .hero-go-short { display: block; }
  .hero-in { padding-bottom: 32px; }
  .hero-go { margin-top: clamp(40px, 7svh, 64px); }
}
