:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #030707;
  color: #eef7f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 25%, rgba(0, 219, 151, 0.17), transparent 28rem),
    radial-gradient(circle at 80% 70%, rgba(40, 114, 255, 0.12), transparent 24rem),
    #030707;
}

.stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  cursor: grab;
  user-select: none;
}

.stage.is-dragging {
  cursor: grabbing;
}

.stage.is-card-debug {
  cursor: default;
}

.stage.is-article-open {
  cursor: default;
}

.stage::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black 0, transparent 72%);
}

.drag-surface {
  position: absolute;
  top: 50%;
  left: 0;
  width: 260vw;
  height: 68vh;
  transform: translate3d(0, -50%, 0);
  will-change: transform;
  touch-action: pan-y;
}

.drag-surface::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  content: "";
  background: linear-gradient(
    90deg,
    transparent,
    rgba(23, 230, 164, 0.72),
    rgba(255, 255, 255, 0.22),
    rgba(23, 230, 164, 0.72),
    transparent
  );
}

.drift-card {
  position: absolute;
  z-index: 0;
  display: grid;
  place-items: end start;
  width: clamp(112px, 10vw, 176px);
  aspect-ratio: 1 / 1.18;
  padding: 0.7rem;
  overflow: hidden;
  border: 1px solid rgba(164, 255, 224, 0.16);
  border-radius: 7px;
  background:
    linear-gradient(150deg, rgba(23, 230, 164, 0.18), transparent 54%),
    linear-gradient(180deg, rgba(13, 28, 31, 0.68), rgba(2, 7, 9, 0.78));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  opacity: 0.7;
  cursor: pointer;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.drift-card:hover,
.drift-card:focus-visible,
.tile:hover,
.tile:focus-visible {
  border-color: rgba(32, 223, 163, 0.72);
  outline: none;
}

.drift-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.35;
}

.drift-card span {
  position: relative;
  z-index: 1;
  color: rgba(216, 255, 241, 0.86);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
}

.tile {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: end start;
  width: clamp(180px, 18vw, 320px);
  aspect-ratio: 4 / 5;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgba(151, 255, 218, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 48%),
    linear-gradient(180deg, rgba(8, 39, 33, 0.84), rgba(5, 12, 13, 0.92));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  cursor: pointer;
  transform: translateZ(0);
}

.tile::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px,
      transparent 16px
    );
  opacity: 0.42;
}

.tile span {
  position: relative;
  z-index: 1;
  max-width: 11rem;
  color: #d8fff1;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.tile-a {
  top: 5%;
  left: 11vw;
}

.drift-a {
  top: 49%;
  left: 27vw;
}

.tile-b {
  top: 42%;
  left: 44vw;
}

.drift-b {
  top: 7%;
  left: 63vw;
}

.drift-c {
  top: 63%;
  left: 74vw;
}

.tile-c {
  top: 10%;
  left: 82vw;
}

.tile-d {
  top: 48%;
  left: 122vw;
}

.drift-d {
  top: 13%;
  left: 146vw;
}

.tile-e {
  top: 2%;
  left: 160vw;
}

.tile-f {
  top: 44%;
  left: 195vw;
}

.drift-e {
  top: 7%;
  left: 214vw;
}

.tile-g {
  top: 14%;
  left: 228vw;
}

.drift-f {
  top: 58%;
  left: 242vw;
}

.stage.is-card-debug [data-card-id] {
  outline: 1px solid rgba(32, 223, 163, 0.5);
  outline-offset: 4px;
  cursor: pointer;
}

.stage.is-card-debug .drift-card {
  pointer-events: auto;
}

.stage.is-card-debug [data-card-id]::after {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  padding: 0.28rem 0.42rem;
  border: 1px solid rgba(151, 255, 218, 0.22);
  border-radius: 999px;
  background: rgba(3, 7, 7, 0.72);
  color: rgba(216, 255, 241, 0.92);
  content: attr(data-card-label);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  text-transform: uppercase;
}

.stage.is-card-debug [data-card-selected="true"] {
  outline-color: #20dfa3;
  box-shadow:
    0 0 0 1px rgba(32, 223, 163, 0.7),
    0 24px 80px rgba(0, 0, 0, 0.36);
}

.hero {
  --hero-progress: 0;
  --hero-copy-opacity: 1;
  --hero-copy-scale: 1;
  --hero-copy-y: 0px;
  --hero-full-y: clamp(-110px, calc((2100px - 100vw) * 0.22), 150px);
  --hero-user-y: 0px;
  --hero-x: 0px;
  --hero-y: 0px;
  --hero-brand-gap: 2.25rem;
  position: relative;
  z-index: 2;
  display: flex;
  width: min(760px, calc(100vw - 3rem));
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 0 3rem clamp(1.5rem, 7vw, 7rem);
  pointer-events: none;
  transform: translate3d(
    var(--hero-x),
    calc(var(--hero-full-y) + var(--hero-y) + var(--hero-user-y)),
    0
  );
  will-change: transform;
}

.brand {
  margin: 0 0 var(--hero-brand-gap);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: 0;
  transition: margin 80ms linear;
}

.hero-copy {
  opacity: var(--hero-copy-opacity);
  transform: translate3d(0, var(--hero-copy-y), 0)
    scale(var(--hero-copy-scale));
  transform-origin: left top;
  transition:
    opacity 80ms linear,
    transform 80ms linear;
  will-change: opacity, transform;
}

.subtitle {
  max-width: 34rem;
  margin: 0 0 1.25rem;
  color: #20dfa3;
  font-size: clamp(0.78rem, 1.2vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.55;
  text-transform: uppercase;
}

h1 {
  max-width: 46rem;
  margin: 0;
  font-size: clamp(3rem, 7.2vw, 7rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.94;
}

.no-wrap {
  white-space: nowrap;
}

.readout {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 3;
  display: flex;
  gap: 0.5rem;
  color: rgba(238, 247, 242, 0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: auto;
  transform: translate3d(0, 0.35rem, 0);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.readout:hover,
.readout:focus-within {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.readout span {
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(151, 255, 218, 0.16);
  border-radius: 999px;
  background: rgba(3, 7, 7, 0.64);
  backdrop-filter: blur(10px);
}

.settings-trigger {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  min-width: 3.75rem;
  height: 2.25rem;
  border: 1px solid rgba(151, 255, 218, 0.2);
  border-radius: 999px;
  background: rgba(3, 7, 7, 0.68);
  color: rgba(238, 247, 242, 0.86);
  cursor: pointer;
  font: 700 0.8rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
  backdrop-filter: blur(12px);
}

.settings-trigger:hover,
.settings-trigger:focus-visible {
  border-color: rgba(32, 223, 163, 0.72);
  color: #eef7f2;
}

.article-drawer {
  --article-pull-y: 0px;
  --article-pull-progress: 0;
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-rows: 4.25rem minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(32, 223, 163, 0.2), transparent 18rem),
    linear-gradient(180deg, #fbfff9 0%, #edf8f1 100%);
  color: #12201a;
  box-shadow: 0 calc(var(--article-pull-progress) * -18px) 70px
    rgba(32, 223, 163, calc(var(--article-pull-progress) * 0.2));
  pointer-events: auto;
  transform: translate3d(0, calc(100% + var(--article-pull-y)), 0);
  transition: transform 560ms cubic-bezier(0.2, 0.86, 0.18, 1);
  will-change: transform;
}

.article-drawer[hidden] {
  display: grid;
  visibility: hidden;
  pointer-events: none;
}

.article-drawer.is-open {
  visibility: visible;
  transform: translate3d(0, var(--article-pull-y), 0);
}

.article-drawer.is-pulling {
  transition-duration: 120ms;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

.article-drawer.is-pull-ready .article-topbar {
  border-bottom-color: rgba(32, 223, 163, 0.32);
  background: rgba(232, 255, 245, 0.86);
}

.article-drawer.is-pull-ready .article-close {
  border-color: rgba(32, 223, 163, 0.82);
  background: rgba(32, 223, 163, 0.24);
  color: #09291d;
}

.article-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(18, 32, 26, 0.08);
  background: rgba(251, 255, 249, 0.76);
  backdrop-filter: blur(18px);
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.article-close {
  min-width: 4.5rem;
  height: 2.35rem;
  border: 1px solid rgba(32, 223, 163, 0.54);
  border-radius: 999px;
  background: rgba(32, 223, 163, 0.12);
  color: #123327;
  cursor: pointer;
  font: 800 0.82rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.article-close:hover,
.article-close:focus-visible {
  background: rgba(32, 223, 163, 0.2);
  outline: none;
}

.article-shell {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 5rem) clamp(1.25rem, 4vw, 3rem) 6rem;
  overscroll-behavior-y: contain;
  overflow-y: auto;
  scrollbar-color: #a9f2dc #fbfff9;
  scrollbar-width: thin;
  touch-action: pan-y;
}

.article-shell::-webkit-scrollbar {
  width: 0.72rem;
}

.article-shell::-webkit-scrollbar-track {
  background: #fbfff9;
}

.article-shell::-webkit-scrollbar-thumb {
  border: 0.18rem solid #fbfff9;
  border-radius: 999px;
  background: rgba(32, 223, 163, 0.34);
}

.article-shell::-webkit-scrollbar-thumb:hover {
  background: rgba(32, 223, 163, 0.46);
}

.article-header {
  display: grid;
  justify-items: center;
  gap: 0.95rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
  text-align: center;
}

.article-header h2 {
  max-width: 14ch;
  margin: 0;
  color: #0d1b16;
  font-size: clamp(2.25rem, 7vw, 5.8rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 0.96;
}

.article-meta {
  margin: 0;
  color: rgba(21, 58, 44, 0.72);
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
}

.article-body {
  max-width: 42rem;
  margin: 0 auto;
  color: rgba(15, 31, 25, 0.86);
  font-size: clamp(1.02rem, 1.45vw, 1.16rem);
  font-weight: 520;
  letter-spacing: 0.01em;
  line-height: 1.92;
}

.article-body p {
  margin: 0 0 1.15em;
  text-align: justify;
  text-indent: 2em;
  text-justify: inter-ideograph;
}

.article-body p::selection,
.article-header h2::selection,
.article-meta::selection {
  background: rgba(32, 223, 163, 0.28);
}

.settings-panel {
  position: fixed;
  right: 1rem;
  bottom: 3.75rem;
  z-index: 6;
  width: min(19rem, calc(100vw - 2rem));
  max-height: calc(100vh - 5rem);
  padding: 1rem;
  overflow-y: auto;
  border: 1px solid rgba(151, 255, 218, 0.2);
  border-radius: 8px;
  background: rgba(3, 7, 7, 0.86);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  color: rgba(238, 247, 242, 0.88);
  pointer-events: auto;
  backdrop-filter: blur(18px);
}

.settings-header,
.settings-actions,
.settings-field,
.settings-check {
  display: flex;
  align-items: center;
}

.settings-header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-header p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.settings-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.settings-metrics div {
  padding: 0.65rem;
  border: 1px solid rgba(151, 255, 218, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}

.settings-metrics dt,
.settings-metrics dd {
  margin: 0;
}

.settings-metrics dt {
  color: rgba(238, 247, 242, 0.56);
  font-size: 0.68rem;
  font-weight: 700;
}

.settings-metrics dd {
  margin-top: 0.32rem;
  color: #d8fff1;
  font: 800 0.86rem/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
}

.settings-section-title {
  margin: 1rem 0 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(151, 255, 218, 0.12);
  color: rgba(238, 247, 242, 0.76);
  font-size: 0.78rem;
  font-weight: 800;
}

.settings-close,
.settings-actions button {
  border: 1px solid rgba(151, 255, 218, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 247, 242, 0.82);
  cursor: pointer;
  font: 700 0.75rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.settings-close {
  height: 1.85rem;
  padding: 0 0.65rem;
}

.settings-field {
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-field > span {
  line-height: 1.25;
}

.settings-field small {
  display: block;
  max-width: 12rem;
  margin-top: 0.24rem;
  color: rgba(238, 247, 242, 0.52);
  font-size: 0.68rem;
  font-weight: 600;
}

.settings-field-stacked {
  align-items: flex-start;
}

.settings-field input,
.settings-field select {
  width: 5.5rem;
  height: 2rem;
  border: 1px solid rgba(151, 255, 218, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #eef7f2;
  font: 700 0.82rem/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
  text-align: right;
}

.settings-field select {
  width: 8.5rem;
  text-align: left;
}

.settings-check {
  justify-content: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
  color: rgba(238, 247, 242, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
}

.settings-check input {
  width: 1rem;
  height: 1rem;
  accent-color: #20dfa3;
}

.settings-help {
  margin: 0.7rem 0 1rem;
  color: rgba(238, 247, 242, 0.58);
  font-size: 0.75rem;
  line-height: 1.4;
}

.settings-actions {
  justify-content: flex-end;
  gap: 0.5rem;
}

.settings-actions button {
  height: 2rem;
  padding: 0 0.8rem;
}

.settings-actions button:last-child {
  border-color: rgba(32, 223, 163, 0.7);
  background: rgba(32, 223, 163, 0.16);
  color: #d8fff1;
}

@media (max-width: 760px) {
  .drag-surface {
    width: 360vw;
  }

  .tile {
    width: clamp(150px, 42vw, 230px);
  }

  .hero {
    --hero-full-y: 0px;
    justify-content: flex-end;
    padding-bottom: 7rem;
  }
}

@media (min-width: 2550px) {
  .hero {
    --hero-full-y: clamp(-150px, calc(-99px - (100vw - 2550px) * 0.34), -99px);
  }
}
