:root {
  --bg: #f6f0e5;
  --bg-deep: #e9ddca;
  --panel: rgba(255, 251, 244, 0.82);
  --panel-strong: rgba(255, 250, 242, 0.94);
  --line: rgba(28, 23, 18, 0.12);
  --line-strong: rgba(28, 23, 18, 0.22);
  --ink: #171311;
  --muted: #675d52;
  --warm: #a3512d;
  --cool: #244a5f;
  --shadow-soft: 0 24px 80px rgba(55, 36, 20, 0.12);
  --shadow-frame: 0 42px 120px rgba(41, 28, 15, 0.18);
  --radius-xl: 36px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --font-system: 'Avenir Next', 'Aptos', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'Iowan Old Style', 'Baskerville', 'Times New Roman', Georgia, serif;
  --font-reading: 'Charter', 'Georgia', 'Times New Roman', serif;
  --font-mono:
    'IBM Plex Mono', 'SFMono-Regular', 'SF Mono', Menlo, Monaco, 'Liberation Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top left, rgba(163, 81, 45, 0.14), transparent 26%),
    radial-gradient(circle at right top, rgba(36, 74, 95, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: var(--font-system);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition:
    background 900ms cubic-bezier(0.22, 1, 0.36, 1),
    color 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.font-mode-display {
  --bg: #f6efe3;
  --bg-deep: #eadac8;
  --panel: rgba(255, 248, 239, 0.8);
  --panel-strong: rgba(255, 250, 244, 0.95);
  --ink: #18110d;
  --muted: #68594b;
  --render-body: var(--font-system);
  --render-display: var(--font-display);
  --render-detail: var(--font-system);
  --role-tone: var(--warm);
  --frame-glow: rgba(163, 81, 45, 0.16);
  --frame-contrast: rgba(255, 255, 255, 0.94);
  --page-bloom-a: rgba(163, 81, 45, 0.18);
  --page-bloom-b: rgba(114, 59, 38, 0.08);
  --ripple-accent: rgba(162, 75, 34, 0.18);
  --ripple-accent-strong: rgba(162, 75, 34, 0.34);
}

body.font-mode-interface {
  --bg: #edf3f4;
  --bg-deep: #d7e5e8;
  --panel: rgba(248, 252, 252, 0.82);
  --panel-strong: rgba(250, 253, 255, 0.95);
  --ink: #102026;
  --muted: #52656d;
  --render-body: var(--font-system);
  --render-display: var(--font-system);
  --render-detail: var(--font-system);
  --role-tone: var(--cool);
  --frame-glow: rgba(36, 74, 95, 0.16);
  --frame-contrast: rgba(247, 249, 251, 0.94);
  --page-bloom-a: rgba(36, 74, 95, 0.16);
  --page-bloom-b: rgba(70, 130, 162, 0.1);
  --ripple-accent: rgba(34, 88, 108, 0.16);
  --ripple-accent-strong: rgba(34, 88, 108, 0.32);
}

body.font-mode-reading {
  --bg: #f4ede6;
  --bg-deep: #e8ddd2;
  --panel: rgba(255, 251, 248, 0.84);
  --panel-strong: rgba(255, 252, 249, 0.96);
  --ink: #1c140f;
  --muted: #6d5c51;
  --render-body: var(--font-reading);
  --render-display: var(--font-reading);
  --render-detail: var(--font-reading);
  --role-tone: #70523f;
  --frame-glow: rgba(112, 82, 63, 0.14);
  --frame-contrast: rgba(255, 251, 248, 0.96);
  --page-bloom-a: rgba(112, 82, 63, 0.16);
  --page-bloom-b: rgba(186, 156, 121, 0.08);
  --ripple-accent: rgba(119, 84, 56, 0.16);
  --ripple-accent-strong: rgba(119, 84, 56, 0.32);
}

body.font-mode-mono {
  --bg: #ebf1eb;
  --bg-deep: #dbe6db;
  --panel: rgba(247, 251, 247, 0.82);
  --panel-strong: rgba(249, 253, 249, 0.95);
  --ink: #101612;
  --muted: #56645a;
  --render-body: var(--font-mono);
  --render-display: var(--font-mono);
  --render-detail: var(--font-mono);
  --role-tone: #2a4d3b;
  --frame-glow: rgba(42, 77, 59, 0.18);
  --frame-contrast: rgba(247, 251, 248, 0.96);
  --page-bloom-a: rgba(42, 77, 59, 0.18);
  --page-bloom-b: rgba(91, 130, 104, 0.08);
  --ripple-accent: rgba(31, 75, 53, 0.18);
  --ripple-accent-strong: rgba(31, 75, 53, 0.34);
}

.type-ripple {
  position: fixed;
  inset: 0;
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.type-ripple::before {
  position: absolute;
  inset: 0;
  content: '';
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 58%);
  opacity: 0;
}

.type-ripple-row {
  position: absolute;
  left: -6vw;
  width: 112vw;
  color: var(--ripple-accent, rgba(162, 75, 34, 0.18));
  font-family: var(--render-display, var(--font-display));
  font-size: clamp(5rem, 15vw, 14rem);
  font-weight: 600;
  line-height: 0.82;
  letter-spacing: -0.08em;
  text-transform: none;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.92);
  filter: blur(12px);
}

.type-ripple-row:first-child {
  top: 18vh;
}

.type-ripple-row-alt {
  top: 56vh;
  color: var(--ripple-accent-strong, rgba(162, 75, 34, 0.34));
  font-family: var(--render-body, var(--font-system));
  font-size: clamp(2.6rem, 7vw, 7rem);
  letter-spacing: -0.05em;
}

body.mode-transitioning .type-ripple::before {
  animation: ripple-flash 1100ms cubic-bezier(0.19, 1, 0.22, 1);
}

body.mode-transitioning .type-ripple-row:first-child {
  animation: ripple-row-primary 1100ms cubic-bezier(0.19, 1, 0.22, 1);
}

body.mode-transitioning .type-ripple-row-alt {
  animation: ripple-row-secondary 1100ms cubic-bezier(0.19, 1, 0.22, 1);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

p,
li {
  margin-top: 0;
  color: var(--muted);
  font-family: var(--render-body, var(--font-system));
  font-size: 1rem;
  line-height: 1.62;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--render-display, var(--font-display));
  font-weight: 600;
}

h1 {
  font-size: clamp(3.9rem, 8vw, 7rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

h2 {
  font-size: clamp(2.15rem, 4vw, 3.5rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

h3 {
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

code,
pre,
.eyebrow,
.card-kicker,
.control-hint,
.button,
.docs-nav a,
.site-nav a {
  font-family: var(--font-mono);
}

.eyebrow,
.card-kicker,
.control-hint {
  margin: 0 0 0.9rem;
  color: var(--role-tone, var(--warm));
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-home {
  position: relative;
  z-index: 0;
  color: var(--ink);
  font-family: var(--render-body, var(--font-system));
  filter: brightness(0.08) saturate(0.12);
  transition:
    filter 80ms linear,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

body:not(.intro-active) .site-home {
  filter: none;
}

body.is-assembling .site-home {
  transform: none;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: auto;
  padding: 1rem;
  background: #000;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition:
    opacity 40ms linear,
    visibility 0s linear 40ms;
}

body:not(.intro-active) .intro-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0s;
}

.intro-surface {
  width: min(1260px, 100%);
  margin: 0 auto;
}

.intro-file {
  margin-bottom: 0.55rem;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.intro-source {
  margin: 0;
  color: rgba(255, 255, 255, 0.96);
  font-family: var(--font-mono);
  font-size: clamp(0.88rem, 1.2vw, 1.05rem);
  line-height: 1.72;
  white-space: pre-wrap;
}

.intro-action {
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-mono);
  font-size: 0.94rem;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.page-shell {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 4rem;
  transform: perspective(1600px) rotateX(calc(var(--tilt-y, 0) * 1deg))
    rotateY(calc(var(--tilt-x, 0) * 1deg));
  transform-style: preserve-3d;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.78rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.site-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.site-nav a {
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(23, 19, 17, 0.08);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.3);
  color: rgba(23, 19, 17, 0.72);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rendered-hero,
.system-shell,
.install-band,
.docs-hero,
.docs-nav,
.docs-section,
.docs-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  transition:
    background 720ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 720ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 720ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rendered-hero,
.install-band {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1.16fr);
  gap: 1.2rem;
  padding: 1.35rem;
  border-radius: var(--radius-xl);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  min-height: 100%;
  padding: 0.5rem 0.2rem;
}

.hero-copy .hero-text {
  max-width: 42ch;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
}

.hero-frame {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  border-radius: calc(var(--radius-xl) - 8px);
  background:
    radial-gradient(circle at top, var(--frame-glow), transparent 48%),
    linear-gradient(180deg, var(--frame-contrast) 0%, rgba(255, 251, 244, 0.75) 100%);
  box-shadow: var(--shadow-frame);
  overflow: hidden;
  transform: translateZ(18px);
  transition:
    background 720ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 720ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-frame-media {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1.3rem;
}

.hero-frame-media::before,
.hero-frame-media::after {
  position: absolute;
  inset: auto;
  content: '';
  border-radius: 50%;
  pointer-events: none;
}

.hero-frame-media::before {
  width: clamp(220px, 42vw, 420px);
  height: clamp(220px, 42vw, 420px);
  background: radial-gradient(circle, var(--frame-glow), transparent 68%);
  filter: blur(6px);
}

.hero-frame-media::after {
  inset: 1.2rem;
  border: 1px solid rgba(23, 19, 17, 0.07);
  border-radius: calc(var(--radius-xl) - 16px);
}

.hero-frame-word {
  position: relative;
  z-index: 1;
  color: var(--ink);
  transition:
    transform 720ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 360ms ease,
    letter-spacing 720ms cubic-bezier(0.22, 1, 0.36, 1),
    color 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-frame-note {
  position: absolute;
  right: 1.4rem;
  bottom: 1.2rem;
  z-index: 1;
  width: min(16rem, 54%);
  margin: 0;
  color: rgba(23, 19, 17, 0.72);
  text-align: right;
}

.hero-frame-controls {
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.2rem 1.2rem;
  border-top: 1px solid rgba(23, 19, 17, 0.08);
  background: rgba(255, 255, 255, 0.38);
}

.control-hint {
  margin-bottom: 0;
  color: rgba(23, 19, 17, 0.62);
}

.role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.role-tab,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.82rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(23, 19, 17, 0.76);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.role-tab {
  cursor: pointer;
}

.role-tab:hover,
.role-tab:focus-visible,
.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(23, 19, 17, 0.28);
  box-shadow: 0 14px 28px rgba(23, 19, 17, 0.08);
  outline: none;
}

.role-tab.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #f8f0e4;
}

.mode-copy {
  display: grid;
  gap: 0.85rem;
}

.mode-copy h2 {
  max-width: 12ch;
}

.system-shell,
.install-band {
  margin-top: 1.2rem;
}

.system-shell {
  padding: 1.15rem;
  border-radius: var(--radius-xl);
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.95rem;
}

.system-card,
.install-panel,
.docs-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
}

.system-card {
  min-height: 15rem;
  padding: 1.15rem;
}

.install-band {
  align-items: start;
}

.install-panel {
  padding: 1.15rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.code-block,
.terminal {
  overflow-x: auto;
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: #12100f;
  color: #f3eee5;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.7;
}

.install-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.button-primary {
  background: var(--ink);
  color: #f8f0e4;
  border-color: var(--ink);
}

.button-secondary {
  background: transparent;
}

.role-display {
  font-family: var(--font-display);
  font-size: clamp(8rem, 18vw, 16rem);
  font-style: italic;
  line-height: 0.8;
  letter-spacing: -0.11em;
}

.role-interface {
  font-family: var(--font-system);
  font-size: clamp(6rem, 14vw, 11.5rem);
  line-height: 0.82;
  letter-spacing: -0.085em;
}

.role-reading {
  font-family: var(--font-reading);
  font-size: clamp(7rem, 15vw, 12.5rem);
  line-height: 0.82;
  letter-spacing: -0.095em;
}

.role-mono {
  font-family: var(--font-mono);
  font-size: clamp(4.8rem, 11vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.assemble-target {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

body.is-assembling .assemble-target {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
}

body.is-assembling .assemble-target:nth-of-type(1) {
  transition-delay: 0ms;
}

body.is-assembling .assemble-target:nth-of-type(2) {
  transition-delay: 80ms;
}

body.is-assembling .assemble-target:nth-of-type(3) {
  transition-delay: 160ms;
}

body.mode-transitioning .hero-frame-word,
body.mode-transitioning h1,
body.mode-transitioning h2,
body.mode-transitioning h3,
body.mode-transitioning p,
body.mode-transitioning .button,
body.mode-transitioning .site-nav a,
body.mode-transitioning .system-card,
body.mode-transitioning .install-panel,
body.mode-transitioning .rendered-hero,
body.mode-transitioning .hero-frame {
  animation: type-blip 980ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.mode-transitioning .hero-frame-word {
  animation: type-blip-word 980ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes type-blip {
  0% {
    opacity: 0.28;
    filter: blur(8px);
    transform: translateY(8px) scale(0.985);
  }

  45% {
    opacity: 1;
    filter: blur(0);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes type-blip-word {
  0% {
    opacity: 0.1;
    filter: blur(10px);
    transform: scale(0.82);
    letter-spacing: -0.16em;
  }

  42% {
    opacity: 1;
    filter: blur(0);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes ripple-flash {
  0% {
    opacity: 0;
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes ripple-row-primary {
  0% {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    filter: blur(20px);
  }

  24% {
    opacity: 1;
    transform: scale(1.01) translateY(0);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: scale(1.08) translateY(-10px);
    filter: blur(6px);
  }
}

@keyframes ripple-row-secondary {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(30px);
    filter: blur(22px);
  }

  32% {
    opacity: 0.92;
    transform: scale(1.01) translateY(0);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: scale(1.1) translateY(-14px);
    filter: blur(8px);
  }
}

.page-shell-docs {
  width: min(1180px, calc(100% - 2rem));
}

.docs-main {
  display: grid;
  gap: 1.2rem;
}

.docs-hero {
  padding: 1.35rem;
  border-radius: var(--radius-xl);
}

.hero-text-strong {
  max-width: 52ch;
  font-size: 1.08rem;
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.docs-nav {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
}

.docs-nav a {
  padding: 0.78rem 0.9rem;
  border: 1px solid rgba(23, 19, 17, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
  color: rgba(23, 19, 17, 0.78);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-content {
  display: grid;
  gap: 1rem;
}

.docs-section {
  padding: 1.15rem;
  border-radius: var(--radius-lg);
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.docs-card {
  padding: 1rem;
}

.launch-list,
.docs-section ul {
  padding-left: 1.2rem;
}

@media (max-width: 1100px) {
  .rendered-hero,
  .install-band,
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-nav {
    position: static;
  }
}

@media (max-width: 780px) {
  h1 {
    font-size: clamp(3rem, 14vw, 4.6rem);
  }

  h2 {
    font-size: clamp(1.9rem, 8vw, 2.8rem);
  }

  .page-shell,
  .page-shell-docs {
    width: min(100% - 1.25rem, 100%);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-frame {
    grid-template-rows: minmax(290px, 1fr) auto;
  }

  .hero-frame-note {
    position: static;
    width: 100%;
    text-align: left;
  }

  .system-grid,
  .docs-grid {
    grid-template-columns: 1fr;
  }

  .system-card {
    min-height: auto;
  }

  .page-shell {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .site-home,
  .page-shell,
  .rendered-hero,
  .system-shell,
  .install-band,
  .docs-hero,
  .docs-nav,
  .docs-section,
  .docs-card,
  .hero-frame,
  .hero-frame-word {
    transition: none;
    animation: none;
  }

  .type-ripple,
  .type-ripple::before,
  .type-ripple-row {
    display: none;
  }
}
