/* thoughts & you: "Afterglow". Dark only. Colour means time. */
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --midnight: #0c0b10;
  --dusk: #17151d;
  --hairline: #2a2731;
  --bone: #efe9df;
  --fog: #8e8a97;
  --ember: #fd426c;
  --rose: #ee8fb0;
  --violet: #8274ea;
  --display: "Instrument Serif", "New York", Georgia, serif;
  --text: ui-serif, "New York", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --gutter: clamp(24px, 6vw, 72px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  background: var(--midnight);
  color: var(--bone);
  font: 18px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--gutter);
  position: relative;
  overflow-x: hidden;
}

/* Film grain. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -0.4'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* The afterglow: one slow-breathing light. */
body::after {
  content: "";
  position: fixed;
  width: 70vmax;
  height: 70vmax;
  top: -30vmax;
  right: -28vmax;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--ember), var(--rose), var(--violet), var(--ember));
  filter: blur(120px);
  opacity: 0.3;
  pointer-events: none;
  animation: breathe 9s ease-in-out infinite alternate;
  z-index: -1;
}
@keyframes breathe {
  from { opacity: 0.22; transform: scale(0.95); }
  to { opacity: 0.42; transform: scale(1.06); }
}

.eyebrow {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fog);
  margin: 0;
}

header, footer { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }

main {
  align-self: center;
  max-width: 760px;
  padding: 12vh 0 8vh;
  display: grid;
  grid-template-columns: 2px 1fr;
  column-gap: clamp(20px, 4vw, 40px);
}

/* The wick: lit length = time left. Burns down once on load. */
.wick {
  position: relative;
  border-radius: 2px;
  background: color-mix(in srgb, var(--hairline) 60%, transparent);
}
.wick::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(var(--ember), var(--rose) 70%, var(--violet));
  box-shadow: 0 0 6px var(--ember), 0 0 22px color-mix(in srgb, var(--rose) 60%, transparent);
  animation: burn 2.6s cubic-bezier(.5, 0, .2, 1) 0.4s forwards;
}
@keyframes burn { to { height: 72%; } }

h1 {
  font: 400 clamp(64px, 13vw, 148px)/0.9 var(--display);
  letter-spacing: -0.01em;
  margin: 18px 0 28px;
}
h1 em { font-style: italic; display: block; padding-left: 0.45em; }
h1 .small { font-size: 0.55em; display: block; }

.lede {
  color: var(--fog);
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.5;
  max-width: 30ch;
  margin: 0 0 40px;
}

.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.button {
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 18px 26px;
  border-radius: 999px;
  transition: opacity .15s ease, transform .15s ease;
}
.button:active { transform: scale(0.98); opacity: 0.75; }
.primary { background: var(--bone); color: var(--midnight); }
.secondary { color: var(--bone); border: 1px solid var(--hairline); }
.button:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }

.hint { color: var(--fog); font-size: 15px; margin: 18px 0 0; max-width: 36ch; }
/* Before the buttons, the hint says what they're for. */
.lede + .hint { margin: -20px 0 24px; }

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  .wick::before { animation: none; height: 72%; }
}

header p:last-child, footer p:last-child { text-align: right; }
@media (max-width: 560px) {
  header p:last-child, footer p:last-child { display: none; }
  main { padding-top: 8vh; }
}

/* Support, privacy and terms. */
body.doc { display: block; }
body.doc header, body.doc footer { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
body.doc a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--fog); }
body.doc article { max-width: 680px; margin: clamp(48px, 10vw, 120px) 0; }
body.doc h1 { font: 400 clamp(56px, 10vw, 104px)/1 var(--display); margin: 0 0 32px; }
body.doc h2 { font: italic 400 32px/1.2 var(--display); margin: 48px 0 12px; }
body.doc p, body.doc li { color: var(--bone); }
body.doc .lede { color: var(--fog); font-size: 21px; }
body.doc ul { padding-left: 1.1em; }
body.doc li { margin-bottom: 12px; }
body.doc li strong { font-weight: 600; }
body.doc main { display: block; max-width: none; padding: 0; }
body.doc .lede { max-width: none; }
@media (max-width: 560px) {
  body.doc header p:last-child { display: block; text-align: left; }
}
