/* v6 - Kinetic. Type is the interface. Two inks and paper, nothing else. */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root { --pad: clamp(1.25rem, 6vw, 6rem); }

:root[data-theme="dark"] {
  --bg: #141311;
  --ink: #E8E2D6;
  --muted: #8F887C;
  --red: #C25742;
  --hair: #2E2B26;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F7F4EE;
  --ink: #131210;
  --muted: #57534B;
  --red: #A63D2F;
  --hair: #D8D2C6;
  color-scheme: light;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "iA Writer Quattro Var", "iA Writer Quattro", system-ui, sans-serif;
  font-variation-settings: "wght" 400;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--red); color: var(--bg); }

:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

.r { color: var(--red); }

/* ---- fixed chrome: the only non-type element allowed is the hairline ---- */

.progress {
  position: fixed; top: 0; left: 0; z-index: 10;
  width: 100%; height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

.toggle {
  position: fixed; top: 1rem; right: 1.1rem; z-index: 10;
  font-family: "iA Writer Mono", monospace;
  font-size: 0.66rem; letter-spacing: 0.16em;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--hair);
  padding: 0.5em 0.9em;
  cursor: pointer;
}
.toggle:hover { color: var(--ink); border-color: var(--muted); }
:root[data-theme="dark"] .toggle::before { content: "LIGHT"; }
:root[data-theme="light"] .toggle::before { content: "DARK"; }

.tc {
  position: fixed; bottom: 1rem; left: 1.15rem; z-index: 10;
  font-family: "iA Writer Mono", monospace;
  font-size: 0.66rem; letter-spacing: 0.16em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: opacity 240ms ease;
}
.tc.off { opacity: 0; }

/* ---- cards ---- */

.card {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--pad);
  max-width: 82rem;
}

.cue {
  font-family: "iA Writer Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(1.4rem, 3.5vh, 2.4rem);
}
.cue::before {
  content: "\25A0";
  color: var(--red);
  margin-right: 1em;
}

.disp {
  font-size: clamp(2.5rem, 8.5vw, 8.25rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-variation-settings: "wght" 760;
  color: var(--ink);
}
.ln { display: block; }
.w { display: inline-block; font-variation-settings: "wght" 760; }

.sub {
  margin-top: clamp(1.3rem, 3.5vh, 2.4rem);
  max-width: 38ch;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  color: var(--muted);
}

/* ---- open card ---- */

.name {
  font-size: clamp(3.6rem, 18vw, 17rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-variation-settings: "wght" 870;
  text-transform: uppercase;
}
.name .r { margin-left: -0.24em; }
.lt { display: inline-block; font-variation-settings: "wght" 870; }

.hint {
  margin-top: clamp(1.6rem, 5vh, 3rem);
  font-family: "iA Writer Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ---- finale: the feeds ---- */

/* extra floor room so the sober line never sits in the timecode's band,
   even with JS blocked */
.card-feeds { padding-bottom: calc(var(--pad) + 2.5rem); }

.feeds { border-top: 1px solid var(--hair); }

.biglink {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.28em 0;
  border-bottom: 1px solid var(--hair);
  text-decoration: none;
  color: var(--ink);
  font-size: clamp(2rem, 6.2vw, 5.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variation-settings: "wght" 330;
  transition: font-variation-settings 120ms ease, color 120ms ease;
}
.biglink .handle {
  font-family: "iA Writer Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}
.biglink:hover,
.biglink:focus-visible {
  font-variation-settings: "wght" 820;
  color: var(--red);
}

.foot {
  margin-top: clamp(2.5rem, 8vh, 5rem);
  font-family: "iA Writer Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.5rem;
  justify-content: space-between;
}
.foot a { color: var(--muted); text-underline-offset: 3px; }
.foot a:hover { color: var(--red); }
.mark { text-transform: uppercase; }

/* ---- motion: position maps to state, nothing else ---- */

@media (prefers-reduced-motion: no-preference) {

  /* the one letter-stagger, once, on load */
  .lt {
    animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--d, 0) * 55ms);
  }

  @supports (animation-timeline: view()) {
    .card { view-timeline: --card block; }
    .card .w {
      animation: gain linear both;
      animation-timeline: --card;
      animation-range: cover calc(8% + var(--i, 0) * 3%) cover calc(40% + var(--i, 0) * 3%);
    }
    .progress {
      animation: grow linear both;
      animation-timeline: scroll(root block);
    }
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(0.35em); font-variation-settings: "wght" 300; }
  to   { opacity: 1; transform: none; font-variation-settings: "wght" 870; }
}
@keyframes gain {
  from { opacity: 0.5; font-variation-settings: "wght" 300; }
  to   { opacity: 1; font-variation-settings: "wght" 760; }
}
@keyframes grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .progress, .tc { display: none; }
  .lt, .w { animation: none; }
  .biglink { transition: none; }
}

/* ---- mobile ---- */

@media (max-width: 480px) {
  .card { padding-top: 4.5rem; padding-bottom: 4.5rem; }
  .disp { font-size: clamp(2.3rem, 11.5vw, 3.4rem); }
  .name { font-size: clamp(3.4rem, 21.5vw, 5.6rem); }
  .biglink { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .tc { display: none; }
}
