/* Trikey site. Plain CSS, no build step.
   Tokens are the app's: shadcn/ui zinc neutrals, one orange accent used only
   for the logo's top dot. Geist and Geist Mono are served from ./fonts. */

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f4f4f5;
  --ink: #09090b;
  --body: #3f3f46;
  --muted: #52525b;
  --line: #e4e4e7;
  --brand: #ea580c;
  --shadow: drop-shadow(0 1px 2px rgb(0 0 0 / 0.06)) drop-shadow(0 12px 20px rgb(0 0 0 / 0.1));
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --surface: #18181b;
    --ink: #fafafa;
    --body: #d4d4d8;
    --muted: #a1a1aa;
    --line: #27272a;
    --brand: #fb923c;
    --shadow: none;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .wrap {
    padding-inline: 1.5rem;
  }
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

h1,
h2,
h3 {
  color: var(--ink);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 6.2vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.2;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.logo .ink {
  fill: var(--ink);
}

.logo .line {
  fill: none;
  stroke: var(--ink);
}

.logo .top {
  fill: var(--brand);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9375rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-nav a.nav-wide {
  display: none;
}

@media (min-width: 640px) {
  .site-nav a.nav-wide {
    display: inline;
  }
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* Shared pieces */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.center {
  text-align: center;
  justify-items: center;
  margin-inline: auto;
}

.lead {
  font-size: clamp(1.125rem, 2.6vw, 1.3125rem);
  line-height: 1.5;
  color: var(--body);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head {
  display: grid;
  gap: 0.75rem;
  max-width: 44rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section-head h2 {
  font-size: clamp(1.75rem, 4.6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  opacity: 0.88;
}

.btn-quiet {
  background: var(--surface);
  color: var(--ink);
}

.notice {
  margin: 0;
  padding: 1rem 1.125rem;
  border: 1px solid var(--ink);
  border-radius: 16px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}

.notice strong {
  font-weight: 700;
}

.phone {
  display: block;
  width: 100%;
  max-width: 17rem;
  height: auto;
  aspect-ratio: 390 / 844;
  /* The renders are square; clip them to the phone frame's 44px corners. */
  border-radius: 11.3% / 5.2%;
  filter: var(--shadow);
}

.aside {
  color: var(--muted);
  max-width: 38rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--muted);
}

/* Media frames: rounded photo and video cards. Footage is the same in both
   themes, so text on it is always light over a dark scrim. */

.frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: clamp(16px, 2.4vw, 28px);
  background: #18181b;
  isolation: isolate;
}

.frame > img,
.frame > .media,
.frame > picture > img.media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame > .media {
  position: absolute;
  inset: 0;
}

.frame > video.media {
  z-index: 1;
}

.frame-hero {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  aspect-ratio: 16 / 9;
}

.frame-wide {
  aspect-ratio: 4 / 5;
}

.frame-card {
  aspect-ratio: 4 / 3;
}

.frame-key {
  aspect-ratio: 4 / 3;
}

.frame-banner {
  aspect-ratio: 3 / 2;
}

.frame-tall {
  aspect-ratio: 4 / 5;
}

/* Wider screens get cinema-shaped frames. */
@media (min-width: 640px) {
  .frame-wide,
  .frame-tall {
    aspect-ratio: 16 / 9;
  }

  .frame-banner {
    aspect-ratio: 21 / 9;
  }
}

.frame-dark {
  --ink: #fafafa;
  --muted: #d4d4d8;
  color: #fafafa;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: end;
  gap: 0.5rem;
  margin: 0;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(to top, rgb(9 9 11 / 0.78), rgb(9 9 11 / 0.15) 60%, rgb(9 9 11 / 0));
}

.overlay h3 {
  color: #fafafa;
  font-size: clamp(1.75rem, 4.6vw, 2.75rem);
  letter-spacing: -0.035em;
}

.overlay .eyebrow {
  color: #d4d4d8;
}

/* Acts */

.act {
  padding-block: clamp(4rem, 10vw, 7rem);
}

.act-surface {
  background: var(--surface);
}

.beat {
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(1.5rem, 4.4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.beat-lead {
  font-size: clamp(2.125rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.beat-quiet {
  color: var(--muted);
}

p.beat.center {
  max-width: 20ch;
  margin-top: clamp(3.5rem, 9vw, 6rem);
}

.pair {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 760px) {
  .pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Opening */

.hero {
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3rem, 7vw, 5rem);
}

.hero-copy {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
  max-width: 48rem;
  margin-inline: auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.hero .lead {
  max-width: 38rem;
}

.hero .actions {
  justify-content: center;
}

/* I. The old choice */

#choice .frame-wide .overlay {
  align-content: center;
  background: linear-gradient(to top, rgb(9 9 11 / 0.7), rgb(9 9 11 / 0.35));
}

#choice .frame-wide .beat {
  max-width: 14ch;
}

/* II. The idea */

.keys {
  display: grid;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .keys {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.key {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.key .frame {
  margin-bottom: 0.5rem;
}

.key-where {
  color: var(--ink);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.key h3 {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 1rem;
}

.key h3 .mono {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8125rem;
}

.key p:last-child {
  font-size: 1rem;
  line-height: 1.55;
}

.any-two {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
  margin-top: clamp(4.5rem, 12vw, 7rem);
  text-align: center;
}

.any-two .aside {
  margin-inline: auto;
}

.logo-big {
  width: 5.5rem;
  height: auto;
}

/* III. How it feels */

.scene {
  display: grid;
  gap: 1.25rem;
  margin: 0;
}

.frame-scene {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  padding-block: 2.5rem;
}

.frame-scene > .media {
  filter: brightness(0.7);
}

.frame-scene picture {
  position: relative;
  z-index: 2;
  width: 42%;
}

.frame-scene .phone {
  max-width: none;
  filter: drop-shadow(0 24px 40px rgb(0 0 0 / 0.45));
}

.scene figcaption {
  display: grid;
  gap: 0.375rem;
  padding-inline: 0.25rem;
}

.scene-title {
  color: var(--ink);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.scene figcaption p:last-child {
  color: var(--muted);
}

.coda {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(4rem, 10vw, 6rem);
}

/* If a key goes missing */

.episode {
  display: grid;
  gap: 2rem;
  margin-bottom: clamp(3rem, 7vw, 4.5rem);
}

.episode-body {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

.episode-body picture {
  justify-self: center;
}

@media (min-width: 860px) {
  .episode-body {
    grid-template-columns: minmax(0, 1fr) 15rem;
    gap: 4rem;
    padding-inline: 1.5rem;
  }

  .episode-body .phone {
    max-width: 15rem;
    margin-top: -6rem;
    position: relative;
    z-index: 3;
  }
}

.episode-copy {
  display: grid;
  gap: 1.75rem;
  max-width: 36rem;
}

.case {
  display: grid;
  gap: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}

.case-q {
  color: var(--ink);
  font-weight: 600;
  font-size: 1.125rem;
}

/* IV. What it stands for */

.creed {
  list-style: none;
  gap: 0.25rem;
}

.creed .beat {
  color: #fafafa;
  font-size: clamp(2rem, 6.4vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.bento {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0;
}

@media (min-width: 760px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tile {
  padding: 1.5rem;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.tile dt {
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tile dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

/* Status and follow */

.follow {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
  text-align: center;
}

.follow h2 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.follow .notice {
  max-width: 40rem;
  text-align: left;
}

.follow .actions {
  justify-content: center;
}

/* Motion. Scenes fade in where the browser can do it without scripts, and the
   footage plays only for people who haven't asked for less motion: the
   poster image underneath stays in place either way. */

@media (prefers-reduced-motion: reduce) {
  .frame > video.media {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .beat,
    .frame,
    .key,
    .scene figcaption,
    .episode-body,
    .tile {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 25%;
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2rem 3rem;
  color: var(--muted);
  font-size: 0.9375rem;
  display: grid;
  gap: 0.75rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--ink);
}

/* 404 */

.lost {
  padding-block: 5rem 6rem;
  display: grid;
  gap: 1.25rem;
  max-width: 34rem;
  justify-items: start;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
