/* Educational Superintelligence. Dawn on workbook paper. */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbf4e6;
  --paper-2: #f5ead4;
  --paper-3: #eedfc2;
  --page: #fffaf0;
  --ink: #14324a;
  --ink-2: #3d566a;
  --sun: #f0a92b;
  --ray: #d94f29;
  --ember: #b83d18;
  --ember-deep: #9c3112;
  --leaf: #276b5e;
  --night: #0f2a40;
  --night-2: #17395a;
  --dawn-text: #fdf3de;
  --dawn-text-2: #c9d6df;
  --rule: rgb(20 50 74 / 0.16);
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --wide: 72rem;
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 106.25%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--ink-2) var(--paper-2);
  caret-color: var(--ray);
  accent-color: var(--ember);
}
body { margin: 0; overflow-x: clip; }

::selection { background: var(--sun); color: var(--night); }

a { color: inherit; text-decoration-color: var(--ray); text-decoration-thickness: 0.09em; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 0.16em; }
:focus-visible { outline: 3px solid var(--ray); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); font-weight: 480; line-height: 1.06; letter-spacing: -0.022em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 7.2vw, 5.1rem); }
h2 { font-size: clamp(2rem, 4.6vw, 3.25rem); }
h3 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -0.01em; font-weight: 560; }
p { margin: 0; }
cite { font-style: normal; color: var(--ink-2); }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--night); color: var(--dawn-text); padding: 0.6rem 1rem; border-radius: 8px; z-index: 5; }
.skip:focus { top: 1rem; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: var(--wide); margin: 0 auto; padding: 1.25rem var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; min-height: 44px; }
.brand-name { font-family: var(--display); font-weight: 560; font-size: clamp(0.92rem, 0.5rem + 1.6vw, 1.02rem); line-height: 1.05; letter-spacing: -0.01em; }
.brand-name span { display: block; }
.mark-sun { fill: var(--sun); }
.mark-rays { fill: none; stroke: var(--ray); stroke-width: 2.6; stroke-linecap: round; }
.mark-horizon { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.top-join { font-weight: 640; font-size: 0.9rem; white-space: nowrap; text-decoration: none; padding: 0.62rem clamp(0.8rem, 3vw, 1.05rem); border-radius: 999px; background: var(--ink); color: var(--paper); min-height: 44px; display: inline-flex; align-items: center; transition: background-color 0.2s var(--ease); }
.top-join:hover { background: var(--night-2); }

/* Hero */
.hero { max-width: var(--wide); margin: 0 auto; padding: clamp(1.5rem, 5vw, 4.5rem) var(--gutter) clamp(3rem, 7vw, 6rem); display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; }
.lede { font-size: clamp(1.12rem, 1.7vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 34rem; margin-top: 1.4rem; }
@media (min-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
}

/* Waitlist form */
.join { margin-top: 2rem; max-width: 33rem; }
.join label { display: block; font-weight: 640; font-size: 0.9rem; margin-bottom: 0.45rem; }
.join-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.join input[type="email"] { flex: 1 1 14rem; min-width: 0; font: inherit; color: var(--ink); background: var(--page); border: 1.5px solid var(--ink); border-radius: 12px; padding: 0.82rem 1rem; min-height: 52px; transition: box-shadow 0.2s var(--ease); }
.join input[type="email"]::placeholder { color: #5d7284; opacity: 1; }
.join input[type="email"]:focus-visible { outline: 3px solid transparent; box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ray); }
.join input[aria-invalid="true"] { border-color: var(--ember-deep); }
.join button { flex: 0 0 auto; font: inherit; font-weight: 700; color: #fff; background: var(--ember); border: 0; border-radius: 12px; padding: 0.82rem 1.4rem; min-height: 52px; cursor: pointer; box-shadow: 0 10px 22px -12px rgb(156 49 18 / 0.75); transition: background-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.join button:hover { background: var(--ember-deep); transform: translateY(-1px); box-shadow: 0 14px 26px -12px rgb(156 49 18 / 0.8); }
.join button:active { transform: translateY(0); }
.join button[aria-disabled="true"] { background: var(--ink-2); box-shadow: none; cursor: progress; transform: none; }
.join-status { min-height: 1.6em; margin-top: 0.6rem; font-weight: 640; font-size: 0.95rem; }
.join-status[data-state="error"] { color: var(--ember-deep); }
.join-note { font-size: 0.9rem; color: var(--ink-2); }
.join-done { font-family: var(--display); font-size: 1.45rem; line-height: 1.3; letter-spacing: -0.012em; margin-top: 2rem; max-width: 30rem; }
.join-done:focus { outline: none; }
.trap { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 30rem) { .join button { flex: 1 1 100%; } }

/* Dawn figure */
.dawn { margin: 0; }
.dawn svg { display: block; width: 100%; height: auto; overflow: visible; }
.dawn-sun { fill: var(--sun); }
.dawn-ray { fill: none; stroke: var(--ray); stroke-width: 7; stroke-linecap: round; }
.dawn-horizon { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.dawn-label { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 30px; fill: var(--ink); }
.dawn figcaption { text-align: center; color: var(--ink-2); font-size: 0.95rem; margin-top: 0.9rem; }

@media (prefers-reduced-motion: no-preference) {
  .dawn-sun { animation: rise 1.5s var(--ease) both; }
  .dawn-ray { stroke-dasharray: 86; animation: ray 0.9s var(--ease) both; }
  .dawn-label { animation: name 0.9s var(--ease) both; }
  .dawn-ray:nth-child(1), .dawn-label:nth-child(1) { animation-delay: 0.55s; }
  .dawn-ray:nth-child(2), .dawn-label:nth-child(2) { animation-delay: 0.7s; }
  .dawn-ray:nth-child(3), .dawn-label:nth-child(3) { animation-delay: 0.85s; }
  .dawn-ray:nth-child(4), .dawn-label:nth-child(4) { animation-delay: 1s; }
  .dawn-ray:nth-child(5), .dawn-label:nth-child(5) { animation-delay: 1.15s; }
}
@keyframes rise { from { transform: translateY(72px); } to { transform: none; } }
@keyframes ray { from { stroke-dashoffset: 86; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes name { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }

/* The picture */
.picture { background: var(--paper-2); padding: clamp(3rem, 8vw, 6.5rem) var(--gutter); display: grid; grid-template-columns: minmax(0, calc(var(--wide) - 2 * var(--gutter))); justify-content: center; }
.picture p { font-family: var(--display); font-weight: 420; font-size: clamp(1.55rem, 3.6vw, 2.6rem); line-height: 1.22; letter-spacing: -0.018em; max-width: 22em; text-wrap: pretty; }

/* Five moves */
.moves { max-width: var(--wide); margin: 0 auto; padding: clamp(4rem, 9vw, 7.5rem) var(--gutter); display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); }
.moves-intro p { margin-top: 1.3rem; max-width: 34rem; }
.moves-intro .aside { color: var(--ink-2); font-size: 0.97rem; padding-top: 1.3rem; border-top: 1px solid var(--rule); }
@media (min-width: 62rem) {
  .moves { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); align-items: start; }
  .moves-intro { position: sticky; top: 2.5rem; }
}

/* A workbook page: ruled lines and a margin line belong to the paper. */
.notebook { --line: 1.9rem; --margin: 5.3rem; position: relative; margin: 0; background-color: var(--page); background-image: linear-gradient(to bottom, transparent calc(var(--line) - 1px), rgb(20 50 74 / 0.13) calc(var(--line) - 1px)); background-size: 100% var(--line); background-position: 0 calc(var(--line) * 0.72); border-radius: 14px; box-shadow: 0 1px 2px rgb(20 50 74 / 0.08), 0 24px 48px -28px rgb(20 50 74 / 0.4); padding: calc(var(--line) * 1.72) clamp(0.8rem, 3vw, 2rem) calc(var(--line) * 1.28) 0; line-height: var(--line); font-size: 1rem; }
.notebook::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--margin); width: 1px; background: rgb(217 79 41 / 0.6); }
.nb-student { font-family: var(--display); font-style: italic; font-size: 1.22rem; line-height: var(--line); padding-left: calc(var(--margin) + 0.9rem); margin-bottom: var(--line); }
.nb-student span { display: block; font-family: var(--body); font-style: normal; font-size: 0.86rem; font-weight: 640; color: var(--ink-2); }
.notebook dl { margin: 0; }
.notebook dl > div { display: grid; grid-template-columns: var(--margin) minmax(0, 1fr); margin-bottom: var(--line); }
.notebook dt { font-family: var(--display); font-style: italic; font-weight: 560; font-size: 1rem; color: var(--ember-deep); text-align: right; padding-right: 0.6rem; }
.notebook dd { margin: 0; padding-left: 0.9rem; }
.notebook figcaption { padding-left: calc(var(--margin) + 0.9rem); font-size: 0.88rem; color: var(--ink-2); }
@media (min-width: 40rem) { .notebook { --margin: 8.4rem; font-size: 1.03rem; } .notebook dt { font-size: 1.2rem; } }

/* Three layers */
.layers { --edge: max(var(--gutter), calc((100vw - var(--wide)) / 2 + var(--gutter))); background: var(--paper-2); padding: clamp(4rem, 9vw, 7.5rem) 0 0; }
.layers-head { padding: 0 var(--gutter) 0 var(--edge); }
.layers-head p { margin-top: 1.3rem; max-width: 36rem; }
.strata { margin: clamp(2.5rem, 5vw, 4rem) 0 0; }
.strata > div { padding: clamp(1.6rem, 3.4vw, 2.6rem) var(--gutter) clamp(1.6rem, 3.4vw, 2.6rem) var(--edge); border-top: 1px solid var(--rule); }
.strata > div:nth-child(2) { background: var(--paper-3); }
.strata > div:nth-child(3) { background: #e4d2ae; }
.strata dt { font-family: var(--display); font-weight: 480; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.1; letter-spacing: -0.02em; }
.strata dd { margin: 0.5rem 0 0; max-width: 34rem; }
@media (min-width: 48rem) {
  .strata > div { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 34rem); column-gap: 2rem; align-items: baseline; }
  .strata dd { margin: 0; }
}

/* Fit */
.fit { max-width: var(--wide); margin: 0 auto; padding: clamp(4rem, 9vw, 7.5rem) var(--gutter); }
.fit-cols { display: grid; gap: 2.75rem; margin-top: clamp(2rem, 4vw, 3.25rem); }
.fit ul { list-style: none; margin: 1.1rem 0 0; padding: 0; }
.fit li { position: relative; padding: 0.85rem 0 0.85rem 2.4rem; border-top: 1px solid var(--rule); }
.fit li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 1.5rem; height: 1.05rem; background: no-repeat left center / contain; }
.fit .yes li::before { background-image: url("/assets/mark-yes.svg"); }
@media (min-width: 48rem) { .fit-cols { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(3rem, 6vw, 6rem); } }

/* Today */
.today { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) clamp(4rem, 9vw, 7.5rem); }
.today-lede { margin-top: 1.3rem; max-width: 38rem; font-size: 1.12rem; }
.ledger { margin: clamp(2rem, 4vw, 3rem) 0 0; border-bottom: 1px solid var(--rule); }
.ledger > div { border-top: 1px solid var(--rule); padding: 1.3rem 0; display: grid; gap: 0.35rem; }
.ledger dt { font-family: var(--display); font-weight: 560; font-size: 1.3rem; letter-spacing: -0.01em; }
.ledger > div:first-child dt { color: var(--leaf); }
.ledger dd { margin: 0; max-width: 40rem; }
@media (min-width: 48rem) { .ledger > div { grid-template-columns: 13rem minmax(0, 1fr); align-items: baseline; } }
.grounds { margin-top: clamp(2rem, 4vw, 3rem); display: grid; gap: 1.5rem; }
.grounds p { max-width: 40rem; }
@media (min-width: 62rem) { .grounds { grid-template-columns: 1fr 1fr; gap: 4rem; } }

/* Close */
.close { position: relative; background: var(--night); color: var(--dawn-text); padding: clamp(4.5rem, 10vw, 8rem) var(--gutter) clamp(9rem, 20vw, 13rem); overflow: hidden; }
.close-inner { position: relative; max-width: 40rem; margin: 0 auto; }
.close p { color: var(--dawn-text-2); margin-top: 1.2rem; max-width: 34rem; }
.close .join label { color: var(--dawn-text); }
.close .join input[type="email"] { border-color: transparent; }
.close .join input[type="email"]:focus-visible { box-shadow: 0 0 0 3px var(--night), 0 0 0 6px var(--sun); }
.close .join-note, .close .join-status { color: var(--dawn-text-2); margin-top: 0.6rem; }
.close .join-status[data-state="error"] { color: #ffb59a; }
.close .join-done { color: var(--dawn-text); }
.close a { text-decoration-color: var(--sun); }
.close :focus-visible { outline-color: var(--sun); }
.close-dawn { position: absolute; left: 50%; bottom: 0; width: min(40rem, 120vw); transform: translateX(-50%); overflow: visible; }
.close-dawn .mark-rays { stroke-width: 7; stroke: #f0774c; }

/* Footer */
.foot { background: var(--night); color: var(--dawn-text-2); border-top: 1px solid rgb(253 243 222 / 0.16); padding: 2rem var(--gutter) 2.5rem; font-size: 0.92rem; display: grid; gap: 0.35rem; justify-items: center; text-align: center; }
.foot-name { font-family: var(--display); font-size: 1.1rem; color: var(--dawn-text); }
.foot a { text-decoration-color: var(--sun); margin: 0 0.5rem; display: inline-block; padding: 0.55rem 0; }
.foot p:nth-child(2) a { margin: 0; }
.foot :focus-visible { outline-color: var(--sun); }

/* Plain text pages */
.plain { max-width: 42rem; margin: 0 auto; padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) clamp(4rem, 9vw, 7rem); }
.plain h1 { font-size: clamp(2.2rem, 5.4vw, 3.4rem); }
.plain h2 { font-size: 1.5rem; margin-top: 2.4rem; }
.plain p, .plain ul { margin-top: 1rem; }
.plain ul { padding-left: 1.2rem; }
.plain li { margin-top: 0.4rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
