/* "Kindly Rewind" by Ryan Bloom, licensed CC BY.
   "Teletactile", freeware. https://www.fontspace.com/teletactile-font-f44368 */

@font-face {
  font-family: "Kindly Rewind";
  src: url("fonts/kindly-rewind-font/KindlyRewind-BOon.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Teletactile";
  src: url("fonts/teletactile-font/Teletactile-3zavL.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #f3efe6;
  --ink-dim: #bdb5a6; /* keeps secondary text at or above WCAG AAA 7:1 over the artwork */
  --black: #0d0c0b;
  --purple: #5d4271;
  --red: #c0343f;
  --orange: #e35d2a;
  --gold: #e0a83c;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--black);
  background-image:
    linear-gradient(to right, rgba(13, 12, 11, 0.92) 0%, rgba(13, 12, 11, 0.6) 45%, rgba(13, 12, 11, 0) 75%),
    url("img/background.jpg");
  background-repeat: no-repeat;
  background-position: center, center bottom;
  background-size: cover, cover;
  background-attachment: scroll, fixed;
  font-family: var(--mono);
  line-height: 1.55;
}

/* Texture overlays -------------------------------------------------------- */

.grain,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.grain {
  background: radial-gradient(120% 90% at 30% 40%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.45;
  mix-blend-mode: multiply;
}

/* Layout ------------------------------------------------------------------ */

.stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  padding: clamp(2rem, 7vw, 6rem);
  padding-bottom: clamp(1rem, 4vw, 3rem);
}

.panel {
  max-width: 34rem;
}

/* Type -------------------------------------------------------------------- */

.wordmark {
  font-family: "Kindly Rewind", var(--mono);
  font-weight: 400;
  font-size: clamp(4rem, 17vw, 9rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  margin: 0;
  color: #fff;
  text-shadow:
    -2px 0 0 rgba(192, 52, 63, 0.55),
     2px 0 0 rgba(93, 66, 113, 0.55),
     0 0 34px rgba(224, 168, 60, 0.18);
}

.subtitle {
  margin: clamp(0.9rem, 3vw, 1.4rem) 0 0;
  font-size: clamp(0.85rem, 2.4vw, 1.05rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

.subtitle::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 3px;
  margin-top: clamp(1.1rem, 3vw, 1.6rem);
  background: linear-gradient(to right, var(--purple), var(--red), var(--orange), var(--gold));
}

.lede {
  margin: clamp(1.1rem, 3vw, 1.6rem) 0 0;
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
  max-width: 30rem;
  color: var(--ink-dim);
}

abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 0.28em;
  text-decoration-color: rgba(189, 181, 166, 0.5);
  cursor: help;
}

/* Line 21 style caption block --------------------------------------------- */

.caption {
  display: inline-block;
  margin: clamp(1.75rem, 5vw, 2.5rem) 0 0;
  padding: 0.45em 0.7em;
  background: #000;
  color: #fff;
  font-family: "Teletactile", var(--mono);
  font-size: clamp(1.05rem, 3.2vw, 1.35rem);
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(243, 239, 230, 0.14);
}

.caption::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 0.35em;
  vertical-align: -0.12em;
  background: #fff;
  /* WCAG 2.2.2: blinking must not run past 5s, so it settles solid after 3 cycles */
  animation: blink 1.2s steps(1, end) 3;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* Contact ----------------------------------------------------------------- */

.colophon {
  position: relative;
  z-index: 2;
  padding: 0 clamp(2rem, 7vw, 6rem) clamp(1.5rem, 4vw, 2.5rem);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.colophon p { margin: 0; }

.colophon a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(224, 168, 60, 0.35);
  padding-bottom: 1px;
}

.colophon a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* Focus / motion ---------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .caption::after { animation: none; }
}

/* Narrow screens: let the stripe sit under the text ------------------------ */

@media (max-width: 40rem) {
  body {
    background-image:
      linear-gradient(
        to bottom,
        rgba(13, 12, 11, 0.95) 0%,
        rgba(13, 12, 11, 0.78) 45%,
        rgba(13, 12, 11, 0.25) 72%,
        rgba(13, 12, 11, 0.88) 100%
      ),
      url("img/background.jpg");
    background-position: center, right bottom;
    background-attachment: scroll, scroll;
  }

  .stage { align-items: flex-start; padding-top: clamp(3rem, 14vw, 5rem); }
}

/* User contrast preferences ------------------------------------------------ */

@media (prefers-contrast: more) {
  :root { --ink-dim: var(--ink); }

  body {
    background-image:
      linear-gradient(to right, rgba(0, 0, 0, 0.97) 0%, rgba(0, 0, 0, 0.85) 60%, rgba(0, 0, 0, 0.6) 100%),
      url("img/background.jpg");
  }

  .wordmark { text-shadow: none; }
  .colophon a { border-bottom-color: currentColor; }
}

/* Hand the palette over to the OS when the user forces their own colors */

@media (forced-colors: active) {
  body {
    background-image: none;
    background-color: Canvas;
  }

  .grain,
  .scanlines { display: none; }

  .wordmark { text-shadow: none; }
  .subtitle::after { background: CanvasText; }

  .caption {
    background: Canvas;
    color: CanvasText;
    border: 1px solid CanvasText;
    box-shadow: none;
  }

  .caption::after {
    animation: none;
    background: CanvasText;
  }

  .colophon { text-shadow: none; }
  .colophon a { border-bottom-color: LinkText; }
}
