/* luccie.dev: the home page. Fonts and navbar are in base.css. */

/* Blue, yellow and black are VGA text-mode colours. The layers get darker
 * towards the hardware. */
:root {
  --blue: #0000aa;
  --layer-1: #000092;
  --layer-2: #000078;
  --layer-3: #00005c;
  --layer-4: #00003c;
  --white: #ffffff;
  --soft: #c8ccff;
  --yellow: #ffff55;
  --gutter: clamp(1.25rem, 6vw, 5.5rem);
  --console: "MyOS2 Console", ui-monospace, monospace;
}

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

html {
  background: var(--layer-4);
  color: var(--white);
  font: 400 112.5%/1.55 "Bricolage Grotesque", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
body { margin: 0; }
p { margin: 0 0 0.75em; max-width: 62ch; }

h1, h2, h3, .screen { font-family: var(--console); font-weight: 400; font-synthesis: none; }

/* --- Name and the recorded session ------------------------------------- */

.hero {
  background: var(--blue);
  padding: 0.75rem var(--gutter) clamp(3rem, 8vh, 5rem);
}

/* Console text is sized in multiples of 16px, so its pixels stay sharp. */
h1 { margin: -0.08em 0 -0.06em -0.06em; font-size: 96px; line-height: 1; }
@media (min-width: 640px) { h1 { font-size: 176px; } }
@media (min-width: 1000px) { h1 { font-size: 272px; } }

.lede { max-width: 40ch; margin-bottom: 2.5rem; font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.4; }

.session { display: grid; gap: 1.25rem; margin: 0; }
@media (min-width: 1000px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) max-content; column-gap: 3rem; }
  .hero h1 { grid-column: 1 / -1; }
  .session { display: contents; }
  .screen { grid-area: 2 / 2 / span 2; }
  .session figcaption { grid-area: 3 / 1; align-self: end; max-width: 26rem; }
}

.screen {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: #000;
  font-size: 16px;
  line-height: 18px;
}
@media (min-width: 640px) { .screen { padding: 32px; letter-spacing: 2px; } }
@media (min-width: 1280px) { .screen { font-size: 32px; line-height: 36px; letter-spacing: 0; } }
.screen code { font: inherit; }
.screen .said { color: var(--yellow); }
.cursor { display: inline-block; width: 0.5em; height: 1em; background: var(--white); vertical-align: -0.25em; }

figcaption { color: var(--soft); }
figcaption p:last-child { margin: 0; }

/* Plays once: compile, then run. Without motion, it's simply all there. */
@media (prefers-reduced-motion: no-preference) {
  .typed { display: inline-block; vertical-align: top; clip-path: inset(0 100% 0 0); animation: type 1.3s steps(22) 0.9s forwards; }
  .typed-run { animation: type 0.5s steps(7) 3.4s forwards; }
  .after-compile, .after-run { visibility: hidden; animation: show 0s 3s forwards; }
  .after-run { animation-delay: 4.2s; }
}
@keyframes type { to { clip-path: inset(0); } }
@keyframes show { to { visibility: visible; } }

/* --- Layers ------------------------------------------------------------ */

.layer { padding: clamp(2.5rem, 7vh, 4.5rem) var(--gutter); }
.music { background: var(--layer-1); }
.language { background: var(--layer-2); }
.system { background: var(--layer-3); }
.processor { background: var(--layer-4); }

h2 { margin: 0 0 1.5rem; font-size: 48px; line-height: 1; }
h3 { margin: 0 0 0.4rem; font-size: 32px; line-height: 1.1; color: var(--yellow); }

.items { display: grid; gap: 2.5rem 3rem; }
.items p { margin: 0; }

@media (min-width: 900px) {
  .layer { display: grid; grid-template-columns: 19rem minmax(0, 1fr); column-gap: 2rem; }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wide { grid-column: 1 / -1; }
}

/* --- EXA: the music, and what's stored of it --------------------------- */

.scope { margin: 1.5rem 0 0; }
.scope svg { display: block; width: 100%; height: clamp(8rem, 18vw, 13rem); }
.scope path { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.scope .signal { stroke: #8f9bff; stroke-width: 1.5; }
.scope .residual { stroke: var(--yellow); stroke-width: 2.5; }
.scope figcaption { display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; margin-top: 0.75rem; font-size: 0.9rem; }
.key::before { content: ""; display: inline-block; width: 1.6em; margin-right: 0.6em; border-top: 3px solid; vertical-align: 0.25em; }
.key-signal::before { border-color: #8f9bff; }
.key-residual::before { border-color: var(--yellow); }

footer { padding: 0 var(--gutter) 3rem; color: var(--soft); }
footer p { margin: 0; }
