/* drewhalvorsen.com - colour chapters. Colours and type come from the cover of Capacity Event:
   the concrete room, the cyan of the data rain, white lettering, and the one warm lamp on the wall. */

@font-face {
  font-family: "League Gothic";
  src: url("/assets/fonts/league-gothic.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --room: #090c0f;
  --concrete: #1b232b;
  --band-a: #131a20;
  --band-b: #1d2730;
  --abyss: #052430;
  --slate: #26333d;
  --cyan: #1cc4f2;
  --mist: #b9c7ce;
  --paper: #f4f7f8;
  --deep: #032029;
  --lamp: #f2a53b;

  --display: "League Gothic", "Arial Narrow", Impact, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step-small: 0.875rem;
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(3rem, 1.6rem + 5.4vw, 6.5rem);
  --step-poster: clamp(5rem, 13.5vw, 14rem);
  --hero-size: min(19.5vw, 30svh);

  --edge: clamp(1.125rem, 2.4vw, 2rem);
  --bar: 4rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--bar); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--room);
  color: var(--paper);
  font-family: var(--text);
  font-size: var(--step-body);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
::selection { background: var(--lamp); color: var(--room); }

h1, h2, .foot-name {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 0.9;
}
.lead { font-size: var(--step-lead); line-height: 1.32; letter-spacing: -0.015em; }

.skip { position: absolute; left: var(--edge); top: -5rem; z-index: 30; padding: 0.75rem 1rem; background: var(--lamp); color: var(--room); font-weight: 600; }
.skip:focus { top: 0.5rem; }

/* fields: one ground and one ink each */
[data-field="room"] { --bg: var(--room); --ink: var(--paper); --soft: var(--cyan); }
[data-field="concrete"] { --bg: var(--concrete); --ink: var(--paper); --soft: var(--cyan); }
[data-field="abyss"] { --bg: var(--abyss); --ink: var(--paper); --soft: var(--cyan); }
section[data-field], footer[data-field] { background: var(--bg); color: var(--ink); }

/* the bar takes the field beneath it */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--bar);
  display: flex; align-items: center; gap: 2rem;
  padding: 0 var(--edge);
  background: var(--bg); color: var(--ink);
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
.mark { font-family: var(--display); font-size: var(--step-lead); text-transform: uppercase; letter-spacing: 0.02em; text-decoration: none; line-height: 1; margin-right: auto; }
.links { display: flex; gap: 1.75rem; }
.links a { font-weight: 600; font-size: 1rem; text-decoration: none; padding: 0.5rem 0; }
.links a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.button {
  display: inline-block; padding: 0.7rem 1.1rem;
  background: var(--lamp); color: var(--room);
  font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.button:hover { background: #ffbf63; transform: translateY(-2px); }
.button:active { transform: translateY(1px); }

/* hero: the whole scene of the cover, sized by the height of the screen so that the examiner on the left and the
   head are both in view; where the screen is wider than the picture the room's darkness carries on at the sides */
.hero { position: relative; margin-top: var(--bar); min-height: max(calc(100svh - var(--bar)), 36rem); display: flex; align-items: flex-end; overflow: hidden; background: var(--room); }
.hero-upper { position: absolute; inset: 0; overflow: hidden; }
.hero-pic { position: absolute; top: -15.8%; left: 50%; height: 137%; aspect-ratio: 1600 / 1300; transform: translateX(-50%); overflow: hidden; }
.hero-pic img { width: 100%; height: 100%; max-width: none; object-fit: cover; animation: drift 28s ease-in-out infinite alternate; }
.hero-pic::before, .hero-pic::after { content: ""; position: absolute; top: 0; bottom: 0; width: 14%; z-index: 1; }
.hero-pic::before { left: 0; background: linear-gradient(to right, rgb(9, 12, 15), rgba(9, 12, 15, 0)); /* taste-skill-ignore: the picture's edge melts into the dark room */ }
.hero-pic::after { right: 0; background: linear-gradient(to left, rgb(9, 12, 15), rgba(9, 12, 15, 0)); /* taste-skill-ignore: the picture's edge melts into the dark room */ }
.hero-upper::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(to bottom, rgba(9, 12, 15, 0) 40%, rgba(9, 12, 15, 0.8) 72%, rgba(9, 12, 15, 0.94) 100%); /* taste-skill-ignore: the neutral scrim under text on a photograph */ }
.hero-lower { position: relative; z-index: 3; width: 100%; padding: 0 var(--edge) 4.25rem; text-align: center; color: var(--paper); }
.split { font-size: var(--hero-size); line-height: 0.86; margin-bottom: 1.75rem; }
.split-a { color: var(--paper); }
.split-b { color: var(--cyan); }
.hero-say { max-width: 34ch; margin: 0 auto; font-size: var(--step-lead); line-height: 1.32; font-weight: 600; letter-spacing: -0.015em; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.07); } }

/* the book */
.book { display: grid; grid-template-columns: 1fr 1fr; gap: var(--edge); min-height: 92svh; padding: calc(var(--bar) + 3rem) var(--edge) 5rem; align-items: center; }
.book-plate { display: flex; justify-content: center; }
.book-plate img { width: auto; max-height: 78svh; }
.book-text { display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; align-self: stretch; max-width: 40rem; }
.book-text h2 { font-size: var(--step-head); margin-bottom: 1.75rem; }
.book-text p + p { margin-top: 1.1rem; }
.book-text p { max-width: 46ch; }
.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.cell { display: flex; align-items: center; min-height: 4.5rem; padding: 0 1.25rem; font-weight: 600; text-decoration: none; margin: 0; }
.cell-ink { background: var(--lamp); color: var(--room); transition: transform 160ms var(--ease), background-color 160ms var(--ease); }
.cell-ink:hover { background: #ffbf63; transform: translateY(-2px); }
.cell-tone { background: var(--slate); color: var(--paper); }
a.cell-tone:hover { background: #34444f; }

/* three statements, one field each */
.say { position: relative; min-height: 76svh; padding: calc(var(--bar) + 1.5rem) var(--edge) 2.25rem; display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: auto 1fr; column-gap: var(--edge); }
.say-note { grid-column: 8 / span 5; font-size: var(--step-lead); line-height: 1.32; font-weight: 600; max-width: 30ch; }
.say-phrase { grid-column: 1 / -1; align-self: end; font-size: var(--step-poster); line-height: 0.88; }
.say-b .say-note { grid-column: 1 / span 5; }
.say-b .say-phrase { text-align: right; color: var(--cyan); }

/* the witness: questions on the left, the record on the right */
.witness { padding: calc(var(--bar) + 4rem) var(--edge) 6rem; }
.witness-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--edge); row-gap: 1.5rem; align-items: end; margin-bottom: 3.5rem; }
.witness-head h2 { grid-column: 1 / span 7; font-size: var(--step-head); }
.witness-head .soft { display: block; color: var(--soft); }
.witness-head .lead { grid-column: 8 / span 5; max-width: 32ch; }
.qa { display: grid; grid-template-columns: minmax(16rem, 26rem) 1fr; gap: var(--edge); align-items: start; }
.qa-side img { width: 100%; }
.qa-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.375rem; margin-bottom: 1.5rem; }
.qa-tabs button {
  appearance: none; border: 0; cursor: pointer; text-align: left;
  min-height: 4rem; padding: 0.75rem 1.1rem;
  background: var(--band-b); color: var(--paper);
  font: 600 var(--step-body)/1.25 var(--text); letter-spacing: -0.01em;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
.qa-tabs button:hover { background: #2a3742; transform: translateX(4px); }
.qa-tabs button[aria-selected="true"] { background: var(--cyan); color: var(--deep); transform: none; }
.panel { display: grid; gap: 0.375rem; }
.panel + .panel { margin-top: 2.5rem; }
.panel h3 { font: 600 var(--step-lead)/1.25 var(--text); letter-spacing: -0.015em; margin-bottom: 0.75rem; color: var(--soft); }
.band { display: grid; grid-template-columns: minmax(8rem, 22%) 1fr; column-gap: 1.5rem; align-items: baseline; padding: 1.4rem 1.5rem; background: var(--band-a); }
.band:nth-of-type(even) { background: var(--band-b); }
.when { grid-row: 1 / span 2; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--soft); }
.what { font-size: var(--step-lead); line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; }
.note { margin-top: 0.35rem; color: var(--mist); }
.js .qa-panels .panel { display: none; margin-top: 0; }
.js .qa-panels .panel.is-on { display: grid; }
.js .panel h3 { position: absolute; width: 1px; height: 1px; /* taste-skill-ignore: kept for screen readers */ overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:not(.js) .qa-tabs { display: none; }
.js .panel.is-on .band { animation: answer 420ms var(--ease) both; }
.js .panel.is-on .band:nth-of-type(2) { animation-delay: 80ms; }
.js .panel.is-on .band:nth-of-type(3) { animation-delay: 160ms; }
.js .panel.is-on .band:nth-of-type(4) { animation-delay: 240ms; }
@keyframes answer { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* about */
.about { padding: calc(var(--bar) + 4rem) var(--edge) 7rem; }
.about h2 { font-size: var(--step-head); margin-bottom: 2.5rem; }
.about-text { columns: 2; column-gap: calc(var(--edge) * 2); font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.015em; color: var(--mist); font-weight: 600; }
.about-text p { break-inside: avoid; }
.about-text p + p { margin-top: 1.1em; }
.about-text strong { color: var(--ink); font-weight: 700; }
.hl { color: var(--ink); padding: 0 0.12em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl-cyan { background: var(--cyan); color: var(--deep); }
.hl-ice { background: var(--slate); }

/* the close: one row of three tiles, the middle one is the action */
.close { display: grid; grid-template-columns: 2fr 8fr 2fr; gap: 0.75rem; padding: calc(var(--bar) + 4rem) 0 6rem; overflow: hidden; }
.tile { min-height: 26rem; }
.tile-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.tile-form { background: var(--lamp); color: var(--room); padding: clamp(1.5rem, 3.4vw, 3rem); display: flex; flex-direction: column; justify-content: center; }
.tile-form h2 { font-size: var(--step-head); margin-bottom: 1rem; }
.tile-form .lead { max-width: 36ch; margin-bottom: 1.75rem; font-weight: 600; }
.tile-form label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.field { display: flex; max-width: 34rem; background: var(--paper); padding: 0.375rem; }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--room); font: 400 var(--step-body)/1.2 var(--text); padding: 0.8rem 0.9rem; }
.field input:focus-visible { outline: 3px solid var(--room); outline-offset: 0; }
.field button { appearance: none; border: 0; cursor: pointer; background: var(--room); color: var(--paper); font: 600 1rem/1 var(--text); padding: 0 1.4rem; transition: background-color 160ms var(--ease), transform 160ms var(--ease); }
.field button:hover { background: #24313b; }
.field button:active { transform: scale(0.97); }
.trap { position: absolute; left: -200vw; width: 1px; height: 1px; /* taste-skill-ignore: the bot trap, off screen */ overflow: hidden; }
.consent { max-width: 62ch; margin-top: 1.1rem; font-size: var(--step-small); line-height: 1.45; }

/* foot */
.foot { padding: 5rem var(--edge) 2rem; background: var(--bg); color: var(--ink); overflow: hidden; }
.foot-name { color: var(--cyan); font-size: var(--step-poster); line-height: 0.82; white-space: nowrap; margin: 0 0 3.5rem; }
.foot-row { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--edge); row-gap: 2rem; align-items: start; }
.foot-reach { grid-column: 1 / span 7; font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.015em; }
.foot-reach a { text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.foot-links { grid-column: 8 / span 5; display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; font-weight: 600; }
.foot-links a { text-decoration: none; padding: 0.4rem 0; }
.foot-links a:hover, .foot-reach a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.foot-legal { margin-top: 5rem; font-size: var(--step-small); }

/* plain pages: legal notice, privacy notice, the steps of the sign-up */
.plain { min-height: 100svh; padding: calc(var(--bar) + 4rem) var(--edge) 6rem; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--edge); align-content: start; }
.plain h1 { grid-column: 1 / -1; font-size: var(--step-head); margin-bottom: 2.5rem; }
.plain-body { grid-column: 1 / span 8; max-width: 68ch; }
.plain-body h2 { font: 700 var(--step-lead)/1.25 var(--text); text-transform: none; letter-spacing: -0.015em; margin: 2.5rem 0 0.75rem; }
.plain-body h3 { font: 700 var(--step-body)/1.3 var(--text); margin: 1.5rem 0 0.4rem; }
.plain-body p, .plain-body ul { margin: 0 0 0.9rem; }
.plain-body ul { padding-left: 1.2rem; }
.plain-body li + li { margin-top: 0.35rem; }
.plain-body .lead { margin-bottom: 1.5rem; }
.plain-aside { grid-column: 10 / span 3; align-self: start; }
.plain-aside img { width: 100%; }
.gap { background: var(--lamp); color: var(--room); padding: 0 0.2em; }

/* entrances: only when the script is running, never hiding content without it */
.js .reveal > *, .js .say .reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.js .in .reveal > *, .js .say.in .reveal { opacity: 1; transform: none; }
.js .in .reveal > *:nth-child(2), .js .say.in .say-phrase { transition-delay: 90ms; }
.js .in .reveal > *:nth-child(3) { transition-delay: 180ms; }
.js .in .reveal > *:nth-child(4) { transition-delay: 270ms; }
.js .in .reveal + .reveal > * { transition-delay: 150ms; }
.js .in .reveal + .reveal > *:nth-child(2) { transition-delay: 240ms; }

@media (max-width: 799px) {
  :root { --hero-size: min(29vw, 17svh); --step-poster: clamp(3.75rem, 19vw, 8rem); }
  .links { display: none; }
  .button { padding: 0.6rem 0.8rem; }
  .split span { display: block; }
  .hero { display: block; min-height: 0; }
  .hero-upper { position: relative; inset: auto; }
  .hero-pic { position: relative; top: auto; left: auto; width: 100%; height: min(81.25vw, 52svh); aspect-ratio: auto; transform: none; }
  .hero-pic img { object-position: 50% 0; }
  .hero-pic::before, .hero-pic::after { display: none; }
  .hero-upper::after { background: linear-gradient(to bottom, rgba(9, 12, 15, 0) 58%, rgb(9, 12, 15) 100%); /* taste-skill-ignore: the picture's foot melts into the dark room */ }
  .hero-lower { margin-top: -1.5rem; padding-bottom: 3.5rem; }
  .hero-say { max-width: 28ch; }
  .book { grid-template-columns: 1fr; padding-top: calc(var(--bar) + 2rem); gap: 2.5rem; }
  .book-plate img { max-height: none; width: 78%; }
  .cells { grid-template-columns: 1fr; }
  .cell { min-height: 3.75rem; }
  .say { min-height: 64svh; grid-template-columns: 1fr; }
  .say-note, .say-b .say-note { grid-column: 1; max-width: 24ch; }
  .say-b .say-note { justify-self: end; text-align: right; }
  .say-b .say-phrase { text-align: left; }
  .witness-head { grid-template-columns: 1fr; }
  .witness-head h2, .witness-head .lead { grid-column: 1; }
  .qa { grid-template-columns: 1fr; }
  .qa-side img { width: 100%; height: 13rem; object-fit: cover; object-position: 50% 35%; }
  .qa-tabs { grid-template-columns: 1fr; }
  .foot-name { font-size: 15.4vw; }
  .qa-tabs button { min-height: 3rem; padding: 0.55rem 0.9rem; }
  .band { grid-template-columns: 1fr; padding: 1.1rem; }
  .when { grid-row: auto; margin-bottom: 0.3rem; }
  .about-text { columns: 1; }
  .close { grid-template-columns: 1fr 1fr; padding-left: var(--edge); padding-right: var(--edge); }
  .tile-form { grid-column: 1 / -1; grid-row: 1; min-height: 0; }
  .tile-pic { min-height: 7.5rem; height: 7.5rem; }
  .field { flex-direction: column; gap: 0.375rem; }
  .field button { padding: 1rem; }
  .foot-reach, .foot-links { grid-column: 1 / -1; }
  .plain-body { grid-column: 1 / -1; }
  .plain-aside { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-upper img { animation: none; }
  .js .reveal > *, .js .say .reveal { opacity: 1; transform: none; transition: none; }
}
@media print {
  .js .reveal > *, .js .say .reveal { opacity: 1; transform: none; }
  .js .panel.is-on .band { animation: none; }
  .button, .cell-ink, .qa-tabs button, .field button { transition: none; }
}
