@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url('fonts/syne-latin-wght-normal.woff2') format('woff2');
}

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

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

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('fonts/space-grotesk-latin-wght-normal.woff2') format('woff2');
}

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

@font-face {
  font-family: 'Syne Fallback';
  src: local('Arial'), local('ArialMT');
  ascent-override: 93.933%;
  descent-override: 27.926%;
  line-gap-override: 0%;
  size-adjust: 98.4745%;
}

@font-face {
  font-family: 'Epilogue Fallback';
  src: local('Arial'), local('ArialMT');
  ascent-override: 71.148%;
  descent-override: 21.1643%;
  line-gap-override: 0%;
  size-adjust: 111.0361%;
}

@font-face {
  font-family: 'Geist Fallback';
  src: local('Arial'), local('ArialMT');
  ascent-override: 95.9379%;
  descent-override: 28.1609%;
  line-gap-override: 0%;
  size-adjust: 104.7553%;
}

@font-face {
  font-family: 'Space Grotesk Fallback';
  src: local('Arial'), local('ArialMT');
  ascent-override: 89.7072%;
  descent-override: 26.6204%;
  line-gap-override: 0%;
  size-adjust: 109.6903%;
}

@font-face {
  font-family: 'Geist Mono Fallback';
  src: local('Courier New'), local('CourierNewPSMT');
  ascent-override: 100.5164%;
  descent-override: 29.5048%;
  line-gap-override: 0%;
  size-adjust: 99.9837%;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-raise: #121214;
  --bg-raise-2: #1a1a1d;
  --line: #26262b;
  --text-hi: #f4f4f2;
  --text: #c9c9c6;
  --text-lo: #8d8d8a;
  --accent: #7a4afb;
  --accent-hover: #8a5fff;
  --accent-ink: #a58bff;
  --on-accent: #ffffff;
  --glow: rgb(255 255 255 / 0.045);
  --shadow-lift: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 24px 60px -24px rgb(0 0 0 / 0.8);
  --shadow-hover: 0 1px 0 rgb(255 255 255 / 0.06) inset, 0 36px 70px -24px rgb(0 0 0 / 0.9);

  --font-shout: 'Syne', 'Syne Fallback', 'Arial Black', sans-serif;
  --font-display: 'Epilogue', 'Epilogue Fallback', system-ui, sans-serif;
  --font-body: 'Geist', 'Geist Fallback', system-ui, sans-serif;
  --font-ui: 'Space Grotesk', 'Space Grotesk Fallback', system-ui, sans-serif;
  --font-mono: 'Geist Mono', 'Geist Mono Fallback', ui-monospace, monospace;

  --gutter: clamp(1rem, 0.4rem + 2.6vw, 3rem);
  --radius-card: 14px;
  --ease-arrive: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-sort: linear(0, 0.35 12%, 0.75 28%, 1.03 50%, 1.01 70%, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #f7f7f5;
    --bg-raise: #ffffff;
    --bg-raise-2: #eeeeeb;
    --line: #deded9;
    --text-hi: #0b0b0c;
    --text: #34342f;
    --text-lo: #66665f;
    --accent-hover: #6a3aeb;
    --accent-ink: #5b2fd6;
    --glow: rgb(255 255 255 / 0.9);
    --shadow-lift: 0 1px 0 rgb(255 255 255 / 0.7) inset, 0 24px 60px -28px rgb(20 20 18 / 0.28);
    --shadow-hover: 0 1px 0 rgb(255 255 255 / 0.7) inset, 0 36px 70px -26px rgb(20 20 18 / 0.36);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f7f5;
  --bg-raise: #ffffff;
  --bg-raise-2: #eeeeeb;
  --line: #deded9;
  --text-hi: #0b0b0c;
  --text: #34342f;
  --text-lo: #66665f;
  --accent-hover: #6a3aeb;
  --accent-ink: #5b2fd6;
  --glow: rgb(255 255 255 / 0.9);
  --shadow-lift: 0 1px 0 rgb(255 255 255 / 0.7) inset, 0 24px 60px -28px rgb(20 20 18 / 0.28);
  --shadow-hover: 0 1px 0 rgb(255 255 255 / 0.7) inset, 0 36px 70px -26px rgb(20 20 18 / 0.36);
}

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

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 clamp(1.0625rem, 1.04rem + 0.1vw, 1.125rem) / 1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 84rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1.25rem, 1rem + 1vw, 2rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 700 1.2rem/1 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text-hi);
  text-decoration: none;
}

.brand svg {
  width: 1.75rem;
  height: 1.75rem;
}

.hero {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 0.5rem + 3vw, 4rem);
  min-height: 0;
  padding-block: 0 clamp(1.5rem, 1rem + 3vw, 4rem);
}

.table {
  order: -1;
}

@media (min-width: 64rem) {
  .hero {
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
  }

  .table {
    order: 0;
  }
}

.copy {
  max-width: 38rem;
}

h1 {
  font: 800 clamp(2rem, min(1.2rem + 4.4vw, 0.6rem + 6.4vh), 5.25rem) / 1.02 var(--font-shout);
  letter-spacing: -0.025em;
  color: var(--text-hi);
  text-wrap: balance;
}

.dot-accent {
  color: var(--accent);
}

.lead {
  max-width: 34rem;
  margin-top: clamp(1rem, 0.4rem + 2vh, 2.25rem);
  font-size: clamp(1rem, min(0.9rem + 0.5vw, 0.75rem + 1.1vh), 1.375rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: clamp(1.25rem, 0.5rem + 2.4vh, 2.75rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.85rem 1.35rem;
  border: 0;
  border-radius: 999px;
  font: 500 1rem/1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-arrive);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary svg {
  width: 1rem;
  height: 1rem;
  transition: transform 200ms var(--ease-arrive);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  background: var(--bg-raise);
  color: var(--text-hi);
}

.btn-ghost:hover {
  background: var(--bg-raise-2);
}

.table {
  position: relative;
  container-type: size;
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
}

.table::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}

.pile {
  position: relative;
  container-type: size;
  width: min(100cqw, 100cqh, 40rem);
  height: min(100cqw, 100cqh, 40rem);
}

.card {
  --x: 0;
  --y: 0;
  --r: 0deg;
  --s: 1;
  position: absolute;
  left: 0;
  top: 0;
  z-index: var(--z, 1);
  width: min(33cqw, 30cqh);
  transform: translate(calc(var(--x) * 1cqw), calc(var(--y) * 1cqh)) rotate(var(--r)) scale(var(--s));
  transform-origin: 0 0;
  transition: transform 900ms var(--ease-sort);
  transition-delay: var(--d, 0ms);
}

.pile.is-tidy .card {
  transform: translate(var(--tx), var(--ty)) scale(var(--ts));
}

.float {
  animation: float var(--f, 7s) ease-in-out var(--fd, 0s) infinite alternate;
}

@keyframes float {
  from { transform: translateY(-4px) rotate(-0.4deg); }
  to { transform: translateY(5px) rotate(0.5deg); }
}

.pile.is-tidy .float {
  animation-play-state: paused;
}

.ref {
  display: grid;
  gap: 0.5rem;
  padding: 0.42rem 0.42rem 0.55rem;
  border-radius: var(--radius-card);
  background: var(--bg-raise-2);
  box-shadow: var(--shadow-lift);
  animation: land 900ms var(--ease-arrive) backwards;
  animation-delay: calc(var(--i) * 70ms + 150ms);
  transition: transform 260ms var(--ease-arrive), box-shadow 260ms ease;
}

.card:hover {
  z-index: 20;
}

.card:hover .ref {
  transform: translateY(-6px) scale(1.035);
  box-shadow: var(--shadow-hover);
}

@keyframes land {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(1.12) rotate(calc(var(--i) * 3deg - 12deg));
  }
}

.thumb {
  --soft: color-mix(in oklab, var(--ink) 16%, transparent);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6em;
  overflow: hidden;
  padding: 0.9em;
  border-radius: calc(var(--radius-card) - 5px);
  background: var(--tone);
  color: var(--ink);
  font-size: clamp(0.5rem, 2.2cqw, 0.85rem);
}

.meta {
  overflow: hidden;
  padding-inline: 0.2rem;
  font: 400 clamp(0.55rem, 1.9cqw, 0.74rem) / 1.3 var(--font-mono);
  color: var(--text-lo);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.t {
  font: 700 1.05em/1.15 var(--font-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.t.big {
  font-size: 1.45em;
  line-height: 1.05;
  max-width: 10ch;
}

.t.small {
  font: 500 0.85em/1 var(--font-ui);
  opacity: 0.7;
}

.t.mono {
  font: 500 0.9em/1.55 var(--font-mono);
  letter-spacing: 0;
}

.t.serif {
  font: 400 3.4em/0.9 Georgia, 'Times New Roman', serif;
  letter-spacing: -0.02em;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.between {
  justify-content: space-between;
}

.center {
  display: grid;
  justify-items: center;
  gap: 0.6em;
  margin-block: auto;
  text-align: center;
}

.lines {
  display: grid;
  gap: 0.45em;
}

.thumb i {
  display: block;
  font-style: normal;
}

.bar {
  width: 100%;
  height: 0.42em;
  border-radius: 99px;
  background: var(--soft);
}

.bar.thin { height: 0.32em; }
.w-3 { width: 1.4em !important; }
.w-4 { width: 2.4em !important; }
.w-6 { width: 50% !important; }
.w-7 { width: 58% !important; }
.w-8 { width: 4.5em !important; }
.w-9 { width: 75% !important; }
.w-10 { width: 6.5em !important; }
.w-11 { width: 90% !important; }

.dot {
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.85;
}

.dot.sm {
  width: 1.1em;
  height: 1.1em;
}

.pill {
  align-self: flex-start;
  padding: 0.45em 0.8em;
  border-radius: 99px;
  background: var(--ink);
  color: var(--tone);
  font: 600 0.78em/1 var(--font-ui);
  white-space: nowrap;
}

.center .pill {
  align-self: center;
}

[data-kind='code'] {
  justify-content: flex-start;
}

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  background: color-mix(in oklab, var(--ink) 22%, transparent);
  translate: -50% -60%;
}

.play::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 54%;
  border-block: 0.5em solid transparent;
  border-left: 0.8em solid var(--ink);
  translate: -50% -50%;
}

[data-kind='video'] {
  justify-content: flex-end;
}

.scrub {
  height: 0.25em;
  border-radius: 99px;
  background: var(--soft);
}

.scrub i {
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
}

.wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 3.2em;
}

.wave i {
  flex: 1;
  height: var(--h);
  border-radius: 99px;
  background: var(--ink);
  opacity: 0.8;
}

.folio {
  align-self: flex-end;
  font: 500 0.75em/1 var(--font-mono);
  opacity: 0.6;
}

[data-kind='place'] {
  justify-content: flex-end;
  background:
    linear-gradient(90deg, transparent 47%, color-mix(in oklab, var(--ink) 10%, transparent) 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 60%, color-mix(in oklab, var(--ink) 8%, transparent) 60% 64%, transparent 64%),
    linear-gradient(35deg, transparent 30%, color-mix(in oklab, var(--ink) 7%, transparent) 30% 34%, transparent 34%),
    var(--tone);
}

.pin {
  position: absolute;
  top: 34%;
  left: 50%;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50% 50% 50% 0;
  background: #e5484d;
  rotate: -45deg;
  translate: -50% -50%;
  box-shadow: 0 0.4em 0.8em -0.2em rgb(0 0 0 / 0.35);
}

.pin::after {
  content: '';
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: #fff;
}

[data-kind='font'] {
  justify-content: center;
  align-items: flex-start;
}

.progress {
  height: 0.35em;
  border-radius: 99px;
  background: var(--soft);
}

.progress i {
  width: 66%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
}

.q {
  font: 500 0.85em/1.3 var(--font-body);
  opacity: 0.75;
}

.opts {
  display: grid;
  gap: 0.35em;
}

.opt {
  height: 1.5em;
  border-radius: 0.45em;
  background: var(--soft);
}

.opt.on {
  box-shadow: inset 0 0 0 0.14em var(--ink);
}

.tidy {
  min-height: 2.5rem;
  padding: 0.6rem 1.05rem;
  font-size: 0.9375rem;
}

.tidy svg {
  width: 1rem;
  height: 1rem;
}

.tidy [data-label='mess'],
.tidy[aria-pressed='true'] [data-label='tidy'] {
  display: none;
}

.tidy[aria-pressed='true'] [data-label='mess'] {
  display: inline;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
