/* Doodler landing — the page is a canvas: dot-grid paper, red ink, big type.
   Self-hosted font only (fonts/caveat.woff2). Zero external requests. */

@font-face {
  font-family: "Caveat";
  src: url("/fonts/caveat.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #0b0b0d;
  --panel: #131316;
  --panel-2: #17171b;
  --line: #26262c;
  --text: #f4f1ec;
  --dim: #9b978f;
  --red: #ff3b30;
  --blue: #0a84ff; --yellow: #ffd60a; --green: #30d158;
  --hand: "Caveat", "Bradley Hand", cursive;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-image: radial-gradient(circle, rgba(244, 241, 236, 0.05) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hand { font-family: var(--hand); font-weight: 600; letter-spacing: 0.01em; }
.accent { color: var(--red); }
.mono { font-family: var(--mono); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 99; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 8px; }
button { font-family: inherit; }

/* ---------------- nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 4vw, 56px);
  background: rgba(11, 11, 13, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(38, 38, 44, 0.6);
}
.wordmark {
  display: inline-flex; align-items: baseline; gap: 2px;
  color: var(--text); text-decoration: none;
  font-weight: 800; font-size: 27px; letter-spacing: -0.03em;
}
.wm-loop { width: 50px; height: 29px; color: var(--red); transform: translateY(4px) rotate(-2deg); }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--dim); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  color: #fff !important; background: var(--red);
  padding: 9px 20px; border-radius: 999px; font-weight: 700 !important;
  transform: rotate(-1deg); transition: transform 0.15s ease; display: inline-block;
}
.nav-cta:hover { transform: rotate(1deg) scale(1.04); }

/* ---------------- hero ---------------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  gap: clamp(30px, 4vw, 70px); align-items: center;
  max-width: 1280px; margin: 0 auto;
  padding: clamp(50px, 9vh, 110px) clamp(20px, 4vw, 56px) 74px;
  position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: -8% -18% auto; height: 75%;
  pointer-events: none;
  background: radial-gradient(ellipse 52% 42% at 70% 36%, rgba(255, 59, 48, 0.10), transparent 65%);
}
.hero-copy { position: relative; z-index: 1; }
.hero-h1 {
  font-size: clamp(54px, 7.4vw, 104px);
  line-height: 0.98; letter-spacing: -0.045em; font-weight: 800;
}
.show-wrap { position: relative; display: inline-block; }
.squiggle { position: absolute; left: -2%; bottom: -24px; width: 104%; overflow: visible; }
.squiggle path { stroke-dasharray: var(--len, 600); stroke-dashoffset: var(--len, 600); }
.squiggle.drawn path { transition: stroke-dashoffset 0.7s cubic-bezier(0.5, 0, 0.3, 1); stroke-dashoffset: 0; }
.hero-sub {
  margin: 28px 0 34px; max-width: 30em;
  font-size: clamp(17px, 1.5vw, 20px); color: var(--dim); line-height: 1.6;
}

.cta-card {
  background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 18px; padding: 20px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transform: rotate(-0.5deg);
  max-width: 560px;
}
.cta-label { font-size: 15px; color: var(--dim); margin-bottom: 12px; }
.cta-label .hand { font-size: 22px; }
.prompt-pill {
  display: flex; gap: 14px; align-items: flex-start; width: 100%;
  text-align: left; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  border: 1.5px dashed rgba(255, 59, 48, 0.55); border-radius: 13px;
  padding: 14px 16px; font: 500 14.5px/1.55 var(--sans);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.prompt-pill:hover { border-color: var(--red); background: #1c1c21; }
.prompt-pill code { font-family: var(--mono); color: var(--red); font-size: 13px; }
.copy-badge {
  flex: none; align-self: center;
  font: 700 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--red); border: 1.5px solid currentColor; border-radius: 999px;
  padding: 6px 10px; transition: color 0.15s ease;
}
.copied .copy-badge { color: var(--green); }
.cta-alt { margin-top: 14px; font-size: 14.5px; color: var(--dim); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.npx-inline {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); padding: 7px 13px; font-size: 13.5px;
}
.npx-inline code { font-family: var(--mono); }
.npx-inline:hover { border-color: var(--dim); }
.cta-meta { margin-top: 16px; font-size: 13.5px; color: var(--dim); letter-spacing: 0.02em; }

/* hero stage */
.hero-stage { position: relative; margin: 0; z-index: 1; }
.hand-note { color: var(--yellow); font-size: 26px; line-height: 1.1; transform: rotate(-6deg); position: absolute; z-index: 3; }
.note-screen { top: -40px; left: 2px; display: flex; gap: 8px; align-items: flex-start; }
.hand-arrow { width: 46px; height: 36px; margin-top: 14px; flex: none; }

.hero-demo { position: relative; }
.mock-window {
  position: relative;
  background: linear-gradient(180deg, #1a1a1f, #141418);
  border: 1.5px solid var(--line); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transform: rotate(0.8deg);
  overflow: hidden;
}
.mock-titlebar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--dim);
}
.mock-titlebar i { width: 11px; height: 11px; border-radius: 50%; }
.mock-titlebar i:nth-child(1) { background: #ff5f57; }
.mock-titlebar i:nth-child(2) { background: #febc2e; }
.mock-titlebar i:nth-child(3) { background: #28c840; }
.mock-titlebar span { margin: 0 auto; transform: translateX(-18px); }
.mock-body { padding: 26px 30px 32px; display: grid; gap: 8px; }
.mock-body label { font-size: 12px; color: var(--dim); letter-spacing: 0.03em; }
.mock-input {
  background: #101014; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 13px; font-size: 14px; width: min(62%, 260px); margin-bottom: 10px;
}
.mock-save {
  justify-self: end; margin-top: 4px;
  background: #33415e; border: 1px solid #46587e; border-radius: 9px;
  padding: 9px 26px; font-size: 14px; font-weight: 600;
}
.ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ink.fading { transition: opacity 0.45s ease; opacity: 0; }
.ink-path {
  fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255, 59, 48, 0.45));
  stroke-dasharray: var(--len, 700); stroke-dashoffset: var(--len, 700);
}
.ink-path.drawn { transition: stroke-dashoffset var(--dur, 0.8s) cubic-bezier(0.45, 0, 0.4, 1); stroke-dashoffset: 0; }

.caption-row { display: flex; align-items: center; gap: 10px; min-height: 46px; margin-top: 18px; }
.mic-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }
.caption-quote { font-size: 28px; color: var(--text); min-height: 1em; }

.agent-bubble {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-top: 10px; font-size: 14.5px; color: var(--dim);
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.agent-bubble strong { color: var(--text); }
.agent-bubble code { font-family: var(--mono); color: var(--red); font-size: 13px; }
.agent-bubble.show { opacity: 1; transform: none; }
.agent-dot { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px rgba(255, 59, 48, 0.7); }

/* ---------------- ticker ---------------- */
.ticker {
  border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line);
  overflow: hidden; background: var(--panel); white-space: nowrap;
  padding: 13px 0; transform: rotate(-0.7deg) scale(1.02); margin-top: 26px;
}
.ticker-inner { display: inline-flex; gap: 34px; align-items: center; animation: tick 36s linear infinite; }
.ticker span { font: 700 13.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }
.ticker em { color: var(--red); font-style: normal; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------------- shared section chrome ---------------- */
section { max-width: 1180px; margin: 0 auto; padding: clamp(72px, 11vh, 128px) clamp(20px, 4vw, 56px) 0; }
.kicker { color: var(--red); font-size: 27px; transform: rotate(-1.2deg); display: inline-block; margin-bottom: 6px; }
.h2 { font-size: clamp(34px, 4.4vw, 58px); letter-spacing: -0.035em; line-height: 1.05; font-weight: 800; margin-bottom: 42px; }

[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.6, 0.3, 1); }
[data-reveal].in { opacity: 1; transform: translateY(0) rotate(var(--tilt, 0deg)); }

/* ---------------- problem ---------------- */
.panels { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; }
.panel {
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 18px;
  padding: 22px 24px; min-height: 300px; position: relative;
}
.panel-bad { --tilt: -0.8deg; }
.panel-good { --tilt: 0.9deg; border-color: rgba(255, 59, 48, 0.4); }
.panel-tag { color: var(--yellow); font-size: 24px; }
.failing-text { margin-top: 14px; font-size: 13.5px; line-height: 1.75; color: var(--dim); white-space: pre-wrap; min-height: 9em; }
.failing-text::after { content: "▍"; color: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.mini-mock {
  position: relative; margin-top: 16px; background: #101014;
  border: 1px solid var(--line); border-radius: 12px; height: 176px; padding: 18px;
}
.mini-row { height: 12px; width: 65%; background: #1d1d23; border-radius: 6px; margin-bottom: 10px; }
.mini-row.short { width: 40%; }
.mini-btn {
  position: absolute; right: 26px; bottom: 26px;
  background: #33415e; border-radius: 8px; padding: 8px 22px; font-size: 13px; font-weight: 600;
}
.mini-ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.spoken { margin-top: 16px; font-size: 28px; color: var(--text); text-align: center; }
.punchline {
  margin: 64px auto 0; text-align: center;
  font-size: clamp(30px, 4vw, 52px); font-weight: 800; letter-spacing: -0.03em;
}

/* ---------------- how ---------------- */
.steps { list-style: none; display: grid; gap: 22px; }
.step {
  display: grid; grid-template-columns: 76px 1fr; gap: 18px; align-items: start;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 18px;
  padding: 26px 28px; --tilt: -0.4deg;
}
.step-alt { --tilt: 0.5deg; }
.step-num {
  width: 58px; height: 58px; display: grid; place-items: center;
  font-size: 36px; color: var(--red);
  border: 2.5px solid var(--red); border-radius: 50% 46% 52% 48% / 48% 52% 46% 52%;
  transform: rotate(-4deg);
}
.step h3 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 6px; }
.step p { color: var(--dim); max-width: 52em; }
.step strong, .step em { color: var(--text); }
.term {
  margin-top: 16px; background: #0e0e11; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-family: var(--mono); font-size: 13.5px; line-height: 1.8; color: var(--text);
  overflow-x: auto;
}
.term .dim { color: var(--dim); }
.term .key { color: var(--blue); } .term .str { color: var(--green); }
.toolbar-illo {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 16px;
  background: #0e0e11; border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px;
}
.sw { width: 18px; height: 18px; border-radius: 50%; display: inline-block; }
.sw-r { background: var(--red); outline: 2.5px solid #fff; outline-offset: 1.5px; }
.sw-b { background: var(--blue); } .sw-y { background: var(--yellow); } .sw-g { background: var(--green); }
.tb-sep { width: 1px; height: 20px; background: var(--line); }
.tb-item { font-size: 15px; color: var(--dim); }
.tb-done { background: var(--red); color: #fff; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 6px 16px; }

/* ---------------- artifacts ---------------- */
.artifacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.artifact {
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 18px;
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.artifact.tilt-l { --tilt: -1deg; } .artifact.tilt-r { --tilt: 1deg; }
.art-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.art-head code { font-family: var(--mono); color: var(--red); text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; }
.art-shot { position: relative; background: #101014; border: 1px solid var(--line); border-radius: 12px; height: 150px; padding: 16px; }
.shot-row { height: 11px; width: 60%; background: #1d1d23; border-radius: 6px; }
.shot-btn { position: absolute; right: 22px; bottom: 24px; background: #33415e; border-radius: 8px; padding: 7px 20px; font-size: 12.5px; font-weight: 600; }
.shot-ink { position: absolute; inset: 0; width: 100%; height: 100%; }
.artifact > p { color: var(--dim); font-size: 14.5px; }

/* ---------------- features ---------------- */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feat {
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 16px; padding: 22px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.feat:hover { transform: translateY(-4px) rotate(-0.4deg); border-color: rgba(255, 59, 48, 0.5); }
.feat h3 { font-size: 17.5px; margin-bottom: 8px; letter-spacing: -0.01em; }
.feat p { color: var(--dim); font-size: 14.5px; }
.feat code { font-family: var(--mono); color: var(--red); font-size: 13px; }

/* ---------------- privacy ---------------- */
.privacy { text-align: center; }
.privacy-h {
  font-size: clamp(36px, 5.4vw, 72px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02;
  background: linear-gradient(115deg, var(--text) 58%, var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 18px;
}
.privacy p { color: var(--dim); max-width: 46em; margin: 0 auto; font-size: 17px; }

/* ---------------- install ---------------- */
.install-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; }
.inst-card {
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 20px; padding: 28px;
}
.inst-primary { border-color: rgba(255, 59, 48, 0.55); box-shadow: 0 24px 70px rgba(255, 59, 48, 0.07); --tilt: -0.6deg; }
.inst-tag { font: 700 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--red); margin-bottom: 14px; }
.inst-tag .hand { text-transform: none; letter-spacing: 0; font-size: 20px; }
.inst-card h3 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 16px; }
.inst-note { margin-top: 14px; color: var(--dim); font-size: 14.5px; }
.npx-big {
  display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer;
  background: #0e0e11; border: 1.5px solid var(--line); border-radius: 13px;
  color: var(--text); padding: 16px 18px; font: 600 16.5px var(--mono); text-align: left;
}
.npx-big:hover { border-color: var(--dim); }
.npx-big .copy-badge { margin-left: auto; }
.cmds { margin-top: 20px; width: 100%; border-collapse: collapse; font-size: 14px; }
.cmds td { padding: 9px 10px; border-top: 1px solid var(--line); color: var(--dim); }
.cmds td:first-child { font-family: var(--mono); color: var(--text); white-space: nowrap; font-size: 13.5px; }

/* ---------------- footer ---------------- */
.foot { text-align: center; padding: 96px 20px 60px; }
.wm-foot { font-size: 42px; }
.wm-foot .wm-loop { width: 76px; height: 42px; }
.foot-line { color: var(--dim); font-size: 27px; margin: 10px 0 18px; transform: rotate(-1deg); }
.foot-links { font-size: 14px; color: var(--dim); }
.foot-links a { color: var(--dim); }
.foot-links a:hover { color: var(--text); }

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stage { order: -1; max-width: 560px; margin-top: 30px; }
  .panels, .artifacts, .install-cols { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .feat-grid { grid-template-columns: 1fr; }
  .hero-h1 { font-size: clamp(44px, 13vw, 64px); }
  .step { grid-template-columns: 1fr; }
  .caption-quote { font-size: 22px; }
  .prompt-pill { flex-direction: column; }
  .copy-badge { align-self: flex-start; }
}

/* ---------------- reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: rotate(var(--tilt, 0deg)); transition: none; }
  .ink-path, .squiggle path { stroke-dashoffset: 0 !important; transition: none !important; }
  .agent-bubble { opacity: 1; transform: none; }
  .ticker-inner { animation: none; }
  .mic-dot { animation: none; }
  .failing-text::after { animation: none; }
  .nav-cta, .feat, .feat:hover { transform: none; transition: none; }
}
