/*
 * Ravel public-site visual layer
 *
 * This intentionally mirrors the current game's visual language without
 * importing its runtime, gameplay code, or stylesheet. The small asset kit in
 * /assets/ravel is copied for static-site deployment.
 */

@font-face {
  font-family: "Ravel Brand";
  src: url("/assets/ravel/cormorant-garamond-brand-latin.ttf") format("truetype");
  font-display: swap;
}

/* The public site uses the same locally bundled UI and display faces as the
 * game. This avoids a heavier system fallback or synthetic bold on phones. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  src: url("/assets/ravel/inter-400-latin.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  src: url("/assets/ravel/inter-400-latin.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  src: url("/assets/ravel/inter-400-latin.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 500;
  src: url("/assets/ravel/newsreader-500-latin.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 600;
  src: url("/assets/ravel/newsreader-500-latin.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ravel-obsidian: #0b1013;
  --ravel-fjord: #142029;
  --ravel-ivory: #f1ebdd;
  --ravel-stone: #c8c0b3;
  --ravel-muted: #92989a;
  --ravel-gold: #c99b4b;
  --ravel-gold-bright: #f1c76a;
  --ravel-gold-light: #f4d284;
  --ravel-gold-deep: #8a6327;
  --ravel-thread-aura: #ffaa32;
  --ravel-thread-body: #ffc04a;
  --ravel-thread-core: #ffe084;
  --ravel-glass: rgba(16, 23, 28, 0.58);
  --ravel-glass-dense: rgba(17, 25, 31, 0.78);
  --ravel-glass-soft: rgba(241, 235, 221, 0.07);
  --ravel-border: rgba(241, 235, 221, 0.22);
  --ravel-border-strong: rgba(241, 235, 221, 0.38);
  --ravel-radius: 14px;
  --ravel-radius-lg: 18px;
  --ravel-blur: 16px;
  --ravel-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
  --ravel-display: Newsreader, Georgia, "Times New Roman", serif;
  --ravel-ui: Inter, Avenir Next, "Segoe UI", system-ui, sans-serif;
  --ravel-brand: "Ravel Brand", Cormorant Garamond, Baskerville, Georgia, serif;
  --ravel-type-ui-regular: 400;
  --ravel-type-ui-label: 500;
  --ravel-type-ui-action: 600;
  --ravel-tracking-label: 0.09em;
  --ravel-tracking-action: 0.02em;
  --ravel-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --leaderboard-surface-background: rgba(17, 25, 31, 0.42);
  --leaderboard-surface-border: rgba(241, 235, 221, 0.22);
  --leaderboard-row-background: rgba(241, 235, 221, 0.07);
  --leaderboard-row-border: rgba(255, 255, 255, 0.07);
  --leaderboard-control-background: var(--ravel-glass-soft);
  --leaderboard-control-active: linear-gradient(180deg, var(--ravel-gold-light), #d9a850);
}

html {
  min-height: 100%;
  background: var(--ravel-obsidian);
}

body {
  min-height: 100%;
  color: var(--ravel-ivory);
  font-family: var(--ravel-ui);
  font-weight: var(--ravel-type-ui-regular);
  background: var(--ravel-obsidian);
  isolation: isolate;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  content: "";
  opacity: 1;
  transform: none;
  mask-image: none;
  background:
    linear-gradient(180deg, rgba(7, 14, 18, 0.42) 0%, rgba(8, 15, 18, 0.09) 27%, rgba(8, 14, 17, 0.52) 100%),
    url("/assets/ravel/backdrop_day.webp") center 35% / cover no-repeat;
}

body::after {
  content: "";
  background:
    radial-gradient(ellipse 85% 70% at 55% 34%, transparent 44%, rgba(5, 10, 13, 0.26) 100%),
    linear-gradient(90deg, rgba(5, 10, 13, 0.3), transparent 19%, transparent 81%, rgba(5, 10, 13, 0.3)),
    linear-gradient(180deg, rgba(5, 10, 13, 0.13) 0%, transparent 17%, transparent 70%, rgba(5, 10, 13, 0.6) 100%);
}

body.site-home::before {
  background:
    linear-gradient(90deg, rgba(7, 13, 16, 0.66), rgba(8, 14, 17, 0.12) 60%, rgba(8, 14, 17, 0.32)),
    linear-gradient(180deg, rgba(7, 14, 18, 0.18), transparent 45%, rgba(5, 10, 13, 0.42)),
    url("/assets/ravel/backdrop_day.webp") center 38% / cover no-repeat;
}

body.site-home::after {
  background:
    radial-gradient(circle at 68% 35%, rgba(241, 199, 106, 0.16), transparent 25%),
    radial-gradient(ellipse 90% 80% at 48% 36%, transparent 39%, rgba(5, 10, 13, 0.48) 100%),
    linear-gradient(180deg, rgba(5, 10, 13, 0.14), transparent 20%, transparent 68%, rgba(5, 10, 13, 0.66) 100%);
}

.ambient {
  z-index: 0;
}

.ambient span {
  width: 0.2rem;
  background: var(--ravel-thread-core);
  box-shadow: 0 0 0.75rem rgba(255, 192, 74, 0.7);
  opacity: 0.35;
}

.site-shell,
.hero--placeholder {
  position: relative;
  z-index: 1;
}

.site-shell {
  width: min(1160px, calc(100vw - 40px));
  padding: 20px 0 30px;
}

.site-header {
  min-height: 64px;
  margin-bottom: 22px;
  padding: 0;
}

.brand-link {
  gap: 10px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  filter:
    drop-shadow(0 2px 3px rgba(4, 8, 10, 0.7))
    drop-shadow(0 7px 16px rgba(0, 0, 0, 0.25));
}

.brand-lockup {
  display: grid;
  gap: 1px;
  min-width: 0;
  color: var(--ravel-ivory);
  font-family: var(--ravel-brand);
  font-weight: 500;
  line-height: 1;
  filter: drop-shadow(0 1.5px 2px rgba(4, 8, 10, 0.7)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.28));
}

.brand-lockup__name {
  font-size: 1.7rem;
  letter-spacing: 0.13em;
}

.brand-lockup__subtitle {
  color: var(--ravel-gold-bright);
  font-size: 0.54rem;
  letter-spacing: 0.34em;
}

.site-nav {
  gap: 8px;
}

.nav-link,
.ghost-link,
.button,
.pill {
  min-height: 44px;
  border-radius: var(--ravel-radius);
  border-color: var(--ravel-border);
  color: var(--ravel-ivory);
  background: rgba(12, 20, 24, 0.46);
  box-shadow: inset 0 1px 0 rgba(241, 235, 221, 0.08);
  transition:
    transform 160ms var(--ravel-ease),
    border-color 160ms var(--ravel-ease),
    background 160ms var(--ravel-ease),
    filter 160ms var(--ravel-ease);
}

.nav-link {
  padding: 0 13px;
  font-size: 0.7rem;
  font-family: var(--ravel-ui);
  font-weight: var(--ravel-type-ui-action);
  letter-spacing: 0.04em;
}

.nav-link:hover,
.ghost-link:hover,
.button:hover,
.pill:hover {
  border-color: var(--ravel-border-strong);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.nav-link[aria-current="page"] {
  border-color: rgba(241, 199, 106, 0.54);
  color: var(--ravel-gold-bright);
  background: rgba(16, 25, 29, 0.7);
}

.site-nav .nav-link--cta {
  border-color: rgba(244, 210, 132, 0.62);
  color: #241a0c;
  background: linear-gradient(180deg, var(--ravel-gold-light), #daa952);
  box-shadow: 0 8px 22px rgba(218, 169, 82, 0.26), inset 0 1px 0 rgba(255, 252, 204, 0.7);
}

:where(a, button, input, select):focus-visible {
  outline: 2px solid var(--ravel-gold-bright);
  outline-offset: 3px;
}

.panel,
.content-card,
.seo-section,
.stat-card,
.difficulty-card,
.feed-row,
.leaderboard-row,
.status,
.copy-box,
.link-card {
  border-color: var(--ravel-border);
  border-radius: var(--ravel-radius);
  background:
    linear-gradient(180deg, rgba(241, 235, 221, 0.065), transparent 22%),
    var(--ravel-glass);
  box-shadow: var(--ravel-shadow), inset 0 1px 0 rgba(241, 235, 221, 0.09);
  backdrop-filter: blur(var(--ravel-blur)) saturate(1.08);
  -webkit-backdrop-filter: blur(var(--ravel-blur)) saturate(1.08);
}

.panel::before {
  inset: 0;
  border: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(241, 235, 221, 0.05), transparent 26%);
}

.hero {
  gap: 18px;
}

.hero--content {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.hero-panel {
  min-height: 500px;
  padding: clamp(28px, 4.2vw, 50px);
}

.side-panel {
  padding: 22px;
}

h1,
.placeholder-lockup h1 {
  color: var(--ravel-ivory);
  font-family: var(--ravel-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 0.98;
  text-shadow: 0 2px 16px rgba(4, 8, 10, 0.54);
}

h1 {
  max-width: 700px;
  font-size: clamp(2.45rem, 5.7vw, 4.75rem);
}

.kicker,
.section-title,
.seo-section h2,
.copy-section h2 {
  color: var(--ravel-gold-bright);
  font-family: var(--ravel-ui);
  font-weight: var(--ravel-type-ui-label);
  letter-spacing: var(--ravel-tracking-label);
}

.kicker {
  margin-bottom: 12px;
  font-size: 0.68rem;
}

.lede,
.content-card p,
.seo-section p,
.copy-section p {
  color: rgba(241, 235, 221, 0.84);
}

.button-row {
  gap: 10px;
}

.button,
.ghost-link--primary {
  font-family: var(--ravel-ui);
  font-weight: var(--ravel-type-ui-action);
  letter-spacing: var(--ravel-tracking-action);
  border-color: rgba(244, 210, 132, 0.62);
  color: #241a0c;
  background: linear-gradient(180deg, var(--ravel-gold-light), #daa952);
  box-shadow: 0 8px 22px rgba(218, 169, 82, 0.28), inset 0 1px 0 rgba(255, 252, 204, 0.72);
}

.button--secondary {
  border-color: var(--ravel-border);
  color: var(--ravel-ivory);
  background: rgba(16, 25, 31, 0.56);
  box-shadow: var(--ravel-shadow), inset 0 1px 0 rgba(241, 235, 221, 0.09);
}

.button--small {
  min-height: 44px;
}

.pill,
.link-list a {
  font-family: var(--ravel-ui);
  font-weight: var(--ravel-type-ui-action);
  letter-spacing: var(--ravel-tracking-action);
}

.content-card h2,
.content-card h3,
.home-promise h2 {
  font-family: var(--ravel-display);
  font-weight: 500;
  letter-spacing: 0;
}

.content-card {
  min-height: 150px;
}

.link-list a {
  min-height: 48px;
  border-color: var(--ravel-border);
  border-radius: var(--ravel-radius);
  background: rgba(16, 25, 31, 0.48);
}

.link-list a:hover,
.link-list a:focus-visible {
  border-color: var(--ravel-border-strong);
  background: rgba(16, 25, 31, 0.7);
}

.stat-value {
  color: var(--ravel-gold-bright);
}

.stat-label,
.difficulty-card span,
.feed-row span,
.fine-print,
.field label {
  color: var(--ravel-stone);
}

.pill {
  min-height: 40px;
  color: var(--ravel-gold-bright);
  border-color: rgba(241, 199, 106, 0.38);
  background: rgba(16, 25, 31, 0.62);
}

.field input,
.field select {
  min-height: 46px;
  border-color: var(--ravel-border);
  border-radius: var(--ravel-radius);
  color: var(--ravel-ivory);
  background: rgba(10, 17, 21, 0.75);
}

.leaderboard-page {
  width: min(100%, 790px);
  display: grid;
  gap: 18px;
  margin: clamp(22px, 4.5vw, 54px) auto 0;
}

.leaderboard-page__header {
  padding: 0 2px;
}

.leaderboard-page__header .kicker {
  margin-bottom: 8px;
}

.leaderboard-page h1 {
  margin: 0;
  max-width: none;
  font-size: clamp(2.4rem, 5vw, 3.75rem);
}

.leaderboard-page__lede,
.leaderboard-page__note {
  margin: 10px 0 0;
  color: rgba(241, 235, 221, 0.8);
  font-size: 0.94rem;
  line-height: 1.55;
}

.leaderboard-page__note {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 10px;
  color: var(--ravel-stone);
  font-size: 0.8rem;
  text-align: center;
}

.leaderboard-surface {
  padding: clamp(18px, 3.2vw, 28px);
  border: 1px solid var(--leaderboard-surface-border);
  border-radius: var(--ravel-radius-lg);
  background:
    linear-gradient(180deg, rgba(241, 235, 221, 0.06), transparent 18%),
    var(--leaderboard-surface-background);
  box-shadow: var(--ravel-shadow), inset 0 1px 0 rgba(241, 235, 221, 0.1);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
}

.leaderboard-control-group {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid var(--ravel-border);
  border-radius: 13px;
  background: var(--leaderboard-control-background);
}

.leaderboard-control-group button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  padding: 8px 4px;
  color: var(--ravel-stone);
  background: transparent;
  cursor: pointer;
  font-family: var(--ravel-ui);
  font-size: 0.69rem;
  font-weight: var(--ravel-type-ui-action);
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
  transition:
    color 160ms var(--ravel-ease),
    background 160ms var(--ravel-ease),
    box-shadow 160ms var(--ravel-ease);
}

.leaderboard-control-group--difficulty button {
  min-height: 40px;
  color: var(--ravel-stone);
}

.leaderboard-control-group--difficulty {
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.leaderboard-control-group button:hover,
.leaderboard-control-group button:focus-visible {
  color: var(--ravel-gold-bright);
  background: rgba(241, 199, 106, 0.1);
}

.leaderboard-control-group button[aria-pressed="true"] {
  color: #2b1e0d;
  background: var(--leaderboard-control-active);
  box-shadow: inset 0 1px 0 rgba(255, 252, 204, 0.72), 0 0 22px rgba(218, 169, 82, 0.18);
}

.leaderboard-control-group--difficulty button:hover,
.leaderboard-control-group--difficulty button:focus-visible,
.leaderboard-control-group--difficulty button[aria-pressed="true"] {
  background: transparent;
  box-shadow: none;
}

.leaderboard-control-group--difficulty button[aria-pressed="true"] {
  color: var(--ravel-gold-bright);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.leaderboard-context {
  margin: 14px 0 10px;
  color: var(--ravel-stone);
  font-size: 0.82rem;
  line-height: 1.4;
}

.leaderboard-table {
  min-width: 0;
  margin-top: 14px;
}

.leaderboard-column-labels,
.leaderboard-row {
  display: grid;
  grid-template-columns: 34px 30px minmax(0, 1fr) minmax(74px, auto) minmax(54px, auto);
  gap: 10px;
  align-items: center;
  text-align: left;
}

.leaderboard-column-labels {
  margin: 0;
  padding: 11px 14px 9px;
  border: 1px solid var(--ravel-border);
  border-bottom-color: rgba(255, 255, 255, 0.09);
  border-radius: 16px 16px 0 0;
  background: var(--leaderboard-row-background);
  color: var(--ravel-stone);
  font-family: var(--ravel-ui);
  font-size: 0.62rem;
  font-weight: var(--ravel-type-ui-label);
  letter-spacing: var(--ravel-tracking-label);
}

.leaderboard-player-column {
  grid-column: 2 / 4;
}

.leaderboard-perfects-column {
  grid-column: 4 / 5;
  text-align: right;
}

.leaderboard-column-labels span:last-child {
  grid-column: 5 / 6;
  text-align: right;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 180px;
  max-height: min(42svh, 390px);
  margin: 0 0 10px;
  overflow-y: auto;
  border: 1px solid var(--ravel-border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  padding: 2px 0 4px;
  background: var(--leaderboard-row-background);
}

.leaderboard-row {
  min-height: 46px;
  padding: 9px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.leaderboard-rank {
  display: grid;
  place-items: center;
  color: var(--ravel-gold-bright);
  font-family: var(--ravel-ui);
  font-size: 0.78rem;
  font-weight: var(--ravel-type-ui-action);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.leaderboard-rank svg {
  width: 20px;
  height: 20px;
}

.leaderboard-rank--crown-2 {
  color: #c9ccd4;
}

.leaderboard-rank--crown-3 {
  color: #cd8f5a;
}

.leaderboard-monogram {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(241, 199, 106, 0.45);
  border-radius: 50%;
  color: var(--ravel-gold-bright);
  background: rgba(241, 199, 106, 0.12);
  font-family: var(--ravel-display);
  font-size: 0.82rem;
  font-weight: 600;
}

.leaderboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ravel-ivory);
  font-family: var(--ravel-ui);
  font-size: 0.9rem;
  font-weight: var(--ravel-type-ui-label);
}

/* the account digits sit under the fantasy name, never inside it */
.leaderboard-tag {
  display: block;
  color: var(--ravel-stone);
  font-family: var(--ravel-ui);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.leaderboard-perfects {
  color: var(--ravel-gold-bright);
  font-family: var(--ravel-ui);
  font-size: 0.82rem;
  font-weight: var(--ravel-type-ui-action);
}

.leaderboard-time {
  color: var(--ravel-stone);
  font-family: var(--ravel-ui);
  font-size: 0.82rem;
  font-weight: var(--ravel-type-ui-label);
}

.leaderboard-perfects,
.leaderboard-time {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.leaderboard-row + .leaderboard-row {
  border-top: 1px solid var(--leaderboard-row-border);
}

.leaderboard-table[data-period="today"] .leaderboard-column-labels,
.leaderboard-table[data-period="today"] .leaderboard-row {
  grid-template-columns: 34px 30px minmax(0, 1fr) minmax(54px, auto);
}

.leaderboard-table[data-period="today"] .leaderboard-perfects-column {
  display: none;
}

.leaderboard-table[data-period="today"] .leaderboard-column-labels span:last-child {
  grid-column: 4 / 5;
}

.leaderboard-list .status {
  margin: auto;
  padding: 24px 14px;
  border: 0;
  border-radius: 0;
  color: var(--ravel-stone);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.leaderboard-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid var(--ravel-border);
  border-radius: 999px;
  color: var(--ravel-stone);
  background: var(--leaderboard-row-background);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.leaderboard-live svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--ravel-gold-bright);
}

.leaderboard-live[hidden] {
  display: none;
}

.profile-medallion {
  border-color: var(--ravel-border-strong);
  background: rgba(16, 25, 31, 0.62);
}

/* Home: a public-facing promise, not a copy of the game's UI. */
.landing-shell {
  display: grid;
  align-content: space-between;
  min-height: 100svh;
}

.landing-header {
  margin-bottom: clamp(16px, 3vh, 34px);
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.7fr);
  align-items: end;
  gap: clamp(20px, 5vw, 72px);
  min-height: min(660px, calc(100svh - 170px));
  padding: clamp(28px, 5.5vw, 76px);
  overflow: hidden;
  border: 1px solid var(--ravel-border);
  border-radius: var(--ravel-radius-lg);
  background:
    linear-gradient(145deg, rgba(12, 22, 27, 0.55), rgba(12, 22, 27, 0.12) 60%, rgba(12, 22, 27, 0.4)),
    rgba(10, 18, 22, 0.18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(241, 235, 221, 0.11);
  isolation: isolate;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 13, 16, 0.54), transparent 62%),
    linear-gradient(0deg, rgba(6, 13, 16, 0.54), transparent 46%);
}

.home-hero__copy,
.home-hero__journey {
  position: relative;
  z-index: 2;
}

.home-hero__copy {
  max-width: 610px;
  padding-bottom: clamp(10px, 2vh, 30px);
}

.home-hero h1 {
  max-width: 640px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 6.6vw, 5.85rem);
}

.home-hero .lede {
  max-width: 520px;
  margin-bottom: 0;
  font-size: clamp(1rem, 1.7vw, 1.16rem);
}

.home-hero__availability {
  margin: 18px 0 0;
  color: rgba(241, 235, 221, 0.75);
  font-size: 0.76rem;
  font-weight: var(--ravel-type-ui-label);
  letter-spacing: var(--ravel-tracking-label);
  text-transform: uppercase;
}

.home-hero__journey {
  align-self: center;
  max-width: 330px;
  justify-self: end;
  padding: 24px;
  border: 1px solid var(--ravel-border);
  border-radius: var(--ravel-radius);
  background: var(--ravel-glass);
  box-shadow: var(--ravel-shadow), inset 0 1px 0 rgba(241, 235, 221, 0.09);
  backdrop-filter: blur(var(--ravel-blur)) saturate(1.1);
  -webkit-backdrop-filter: blur(var(--ravel-blur)) saturate(1.1);
}

.home-hero__journey-label {
  display: block;
  margin-bottom: 9px;
  color: var(--ravel-gold-bright);
  font-size: 0.68rem;
  font-family: var(--ravel-ui);
  font-weight: var(--ravel-type-ui-label);
  letter-spacing: var(--ravel-tracking-label);
}

.home-hero__journey h2 {
  margin: 0 0 10px;
  color: var(--ravel-ivory);
  font-family: var(--ravel-display);
  font-size: clamp(1.55rem, 2.7vw, 2.15rem);
  font-weight: 500;
  line-height: 1.02;
}

.home-hero__journey p {
  margin: 0 0 18px;
  color: rgba(241, 235, 221, 0.78);
  font-size: 0.93rem;
  line-height: 1.55;
}

.home-hero__journey a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--ravel-gold-bright);
  font-size: 0.78rem;
  font-family: var(--ravel-ui);
  font-weight: var(--ravel-type-ui-action);
  letter-spacing: var(--ravel-tracking-action);
  text-decoration-color: rgba(241, 199, 106, 0.5);
  text-underline-offset: 5px;
  text-transform: uppercase;
}

.hero-thread {
  position: absolute;
  z-index: 1;
  width: min(72vw, 810px);
  height: min(80%, 500px);
  right: -4%;
  bottom: -3%;
  pointer-events: none;
  overflow: visible;
}

.hero-thread__aura {
  stroke: var(--ravel-thread-aura);
  stroke-width: 8;
  stroke-linecap: round;
  fill: none;
  opacity: 0.58;
  filter: url("#thread-aura");
}

.hero-thread__body {
  stroke: var(--ravel-thread-body);
  stroke-width: 3.2;
  stroke-linecap: round;
  fill: none;
  opacity: 0.8;
  filter: url("#thread-body");
}

.hero-thread__core {
  stroke: var(--ravel-thread-core);
  stroke-width: 1.05;
  stroke-linecap: round;
  fill: none;
  opacity: 0.98;
}

.hero-thread__glint {
  stroke: #fff2b4;
  stroke-width: 1.7;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 1 42;
  opacity: 0.95;
  animation: thread-glint 3.4s linear infinite;
}

.home-promise {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.home-promise article {
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--ravel-border);
  border-radius: var(--ravel-radius);
  background: rgba(11, 20, 24, 0.6);
  box-shadow: var(--ravel-shadow), inset 0 1px 0 rgba(241, 235, 221, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.home-promise h2 {
  margin: 0 0 9px;
  color: var(--ravel-ivory);
  font-family: var(--ravel-display);
  font-size: 1.32rem;
  font-weight: 500;
}

.home-promise p {
  margin: 0;
  color: rgba(241, 235, 221, 0.78);
  font-size: 0.9rem;
  line-height: 1.52;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 18px 2px 0;
  color: rgba(241, 235, 221, 0.72);
  font-size: 0.74rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.site-footer a {
  color: var(--ravel-stone);
  text-decoration-color: rgba(241, 199, 106, 0.42);
  text-underline-offset: 4px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--ravel-gold-bright);
}

@keyframes thread-glint {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -172; }
}

@media (max-width: 800px) {
  .site-shell {
    width: min(100vw - 24px, 1160px);
    padding-top: 14px;
  }

  .site-header {
    align-items: center;
  }

  .brand-icon {
    width: 42px;
    height: 42px;
  }

  .brand-lockup__name {
    font-size: 1.45rem;
  }

  .hero--content {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 640px;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .home-hero__journey {
    align-self: end;
    justify-self: start;
  }

  .hero-thread {
    width: min(124vw, 770px);
    height: 48%;
    right: -34%;
    bottom: 8%;
  }

  .home-promise {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    display: grid;
    gap: 12px;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .site-nav .nav-link {
    min-width: 0;
    padding: 0 7px;
    font-size: 0.62rem;
    text-align: center;
  }

  .site-nav .nav-link--cta {
    grid-column: span 3;
  }

  .site-nav--four-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leaderboard-page {
    gap: 14px;
    margin-top: 22px;
  }

  .leaderboard-surface {
    padding: 18px 14px;
    border-radius: var(--ravel-radius);
  }

  .leaderboard-control-group button {
    min-height: 46px;
    padding-inline: 4px;
    font-size: 0.67rem;
  }

  .leaderboard-control-group--difficulty button {
    min-height: 42px;
  }

  .leaderboard-column-labels,
  .leaderboard-row {
    grid-template-columns: 30px 26px minmax(0, 1fr) minmax(46px, auto) minmax(48px, auto);
    gap: 6px;
    padding-inline: 10px;
  }

  .leaderboard-table[data-period="today"] .leaderboard-column-labels,
  .leaderboard-table[data-period="today"] .leaderboard-row {
    grid-template-columns: 30px 26px minmax(0, 1fr) minmax(48px, auto);
  }

  .leaderboard-column-labels {
    padding-block: 10px 8px;
    font-size: 0.57rem;
  }

  .leaderboard-monogram {
    width: 25px;
    height: 25px;
    font-size: 0.75rem;
  }

  .leaderboard-rank svg {
    width: 18px;
    height: 18px;
  }

  .leaderboard-perfects,
  .leaderboard-time {
    font-size: 0.73rem;
  }

  .leaderboard-page__note {
    padding-inline: 4px;
    text-align: left;
  }

  .hero-panel {
    padding: 26px 20px;
  }

  .home-hero {
    min-height: 680px;
    padding: 26px 20px;
  }

  .home-hero h1 {
    font-size: clamp(2.8rem, 14vw, 4.05rem);
  }

  .home-hero__journey {
    width: 100%;
    padding: 20px;
  }

  .hero-thread {
    width: 155vw;
    right: -62%;
    bottom: 9%;
  }

  .home-promise article {
    min-height: auto;
  }

  .site-footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-thread__glint {
    animation: none;
    stroke-dasharray: none;
    opacity: 0.72;
  }
}
