:root {
  --bg: oklch(0.94 0.018 75);
  --bg-2: oklch(0.91 0.024 70);
  --fg: oklch(0.28 0.035 50);
  --fg-soft: oklch(0.42 0.028 55);
  --fg-mute: oklch(0.58 0.022 60);
  --line: oklch(0.85 0.025 70);
  --accent: oklch(0.58 0.13 38);
  --accent-ink: oklch(0.98 0.01 75);
  --paper: oklch(0.97 0.012 78);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist Mono", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  cursor: none;
}

.grid-bg {
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, oklch(0.78 0.03 70) 0.8px, transparent 0.8px);
  background-size: 22px 22px;
  background-position: 0 0;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

#ink {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  cursor: none;
}

.ui {
  position: fixed; inset: 0;
  z-index: 5;
  pointer-events: none;
}
.ui > * { pointer-events: auto; }

header.bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Instrument Serif", serif;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
  user-select: none;
}
.wordmark-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}
.wordmark .mark-sub {
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-left: 4px;
  transform: translateY(-1px);
}

.nav-right {
  display: flex; gap: 10px; align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--fg);
  font: 500 12px/1 "Geist Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.pill:hover { background: var(--bg-2); transform: translateY(-1px); border-color: oklch(0.75 0.035 70); }
.pill svg { width: 14px; height: 14px; }

.hero {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
  pointer-events: none;
}
.hero button, .hero a { pointer-events: auto; }
h1.title, .lede, .eyebrow { pointer-events: none; user-select: none; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 28px;
}
.eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 oklch(0.58 0.13 38 / 0.5); }
  70%  { box-shadow: 0 0 0 10px oklch(0.58 0.13 38 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.58 0.13 38 / 0); }
}

h1.title {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
  max-width: 14ch;
  text-wrap: balance;
}
h1.title em {
  font-style: italic;
  color: var(--accent);
}
.underline-stroke {
  position: relative;
  display: inline-block;
}
.underline-stroke svg {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -10px;
  width: 108%;
  height: 22px;
  overflow: visible;
}
.underline-stroke svg path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawStroke 1.6s 0.5s ease-out forwards;
}
@keyframes drawStroke {
  to { stroke-dashoffset: 0; }
}

.lede {
  margin: 22px auto 0;
  max-width: 50ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-soft);
  text-wrap: pretty;
}

.cta-row {
  margin-top: 38px;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 26px 0 22px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  border: none;
  font: 600 13px/1 "Geist Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .2s ease;
  box-shadow: 0 1px 0 oklch(0.6 0.04 60), 0 10px 30px -10px oklch(0.3 0.05 50 / 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: oklch(0.22 0.035 50);
  box-shadow: 0 1px 0 oklch(0.6 0.04 60), 0 16px 40px -10px oklch(0.3 0.05 50 / 0.5);
}
.btn-primary .arrow {
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary .arrow svg { width: 12px; height: 12px; }
.btn-primary .size {
  font-size: 10px; opacity: 0.55; margin-left: 4px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  font: 500 12px/1 "Geist Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-ghost:hover {
  background: var(--paper);
  border-color: oklch(0.7 0.035 70);
}

.platforms {
  margin-top: 20px;
  display: inline-flex;
  gap: 18px;
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.platforms span { display: inline-flex; align-items: center; gap: 6px; }
.platforms .v {
  width: 1px; height: 10px; background: var(--line); display: inline-block;
}

.dock {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px -12px oklch(0.3 0.04 60 / 0.25);
}
.swatch {
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform .12s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: var(--fg); box-shadow: inset 0 0 0 2px var(--paper); }
.swatch.eraser {
  background:
    repeating-linear-gradient(45deg, oklch(0.92 0.015 70) 0 4px, oklch(0.86 0.02 70) 4px 8px);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-soft);
}
.swatch.eraser svg { width: 14px; height: 14px; }
.dock .divider {
  width: 1px; height: 18px; background: var(--line); margin: 0 4px;
}
.dock-btn {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--fg-soft);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.dock-btn:hover { background: var(--bg-2); color: var(--fg); }
.dock-btn svg { width: 16px; height: 16px; }
.dock-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  font: 500 9px/1 "Geist Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.swatch:hover .dock-label,
.dock-btn:hover .dock-label { opacity: 1; }

.size-ring {
  width: 30px; height: 30px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg);
}
.size-ring .dot {
  background: var(--fg);
  border-radius: 999px;
  transition: width .15s ease, height .15s ease;
}


.meta {
  position: absolute;
  right: 32px;
  bottom: 32px;
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: right;
  line-height: 1.7;
  user-select: none;
}
.meta .v { color: oklch(0.45 0.06 38); }

.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 24px; height: 24px;
  border-radius: 999px;
  border: 1.5px solid var(--fg);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 300;
  mix-blend-mode: multiply;
  transition: width .15s ease, height .15s ease, border-color .15s ease;
}
.cursor::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 4px;
  border-radius: 999px;
  background: var(--cursor-color, var(--fg));
  transform: translate(-50%, -50%);
}
.cursor.over-ui {
  border-color: var(--fg-mute);
  width: 18px; height: 18px;
}


.changelog-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 360px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px -20px oklch(0.3 0.04 60 / 0.18);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.36, 0.64, 1);
  display: flex;
  flex-direction: column;
}
.changelog-drawer.open {
  transform: translateX(0);
}
.changelog-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.changelog-title {
  font-family: "Instrument Serif", serif;
  font-size: 22px;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.changelog-close {
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-mute);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.changelog-close svg { width: 14px; height: 14px; }
.changelog-close:hover { background: var(--bg-2); color: var(--fg); }
.changelog-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.changelog-body::-webkit-scrollbar { width: 3px; }
.changelog-body::-webkit-scrollbar-track { background: transparent; }
.changelog-body::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}
.changelog-entry {
  padding-bottom: 28px;
}
.changelog-entry + .changelog-entry {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.changelog-version {
  font: 600 11px/1 "Geist Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.changelog-date {
  font: 400 10px/1 "Geist Mono", monospace;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  margin-bottom: 16px;
}
.changelog-notes {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.changelog-notes li {
  font: 400 12px/1.55 "Geist Mono", monospace;
  color: var(--fg-soft);
  padding-left: 16px;
  position: relative;
}
.changelog-notes li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--fg-mute);
}


.kofi-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
}

@media (max-width: 640px) {
  header.bar { padding: 18px 18px; }
  .meta { display: none; }
  .dock { bottom: 18px; }
  .wordmark { font-size: 22px; }
  .changelog-drawer { width: 100%; }
  .kofi-container {
    position: static;
    width: 100%;
    display: flex;
    justify-content: center;
  }
}
