:root {
  --ink: #0d1230;
  --soft: #3f4768;
  --muted: #5a6283;
  --line: #e2e6f2;
  --paper: #f6f7fc;
  --electric: #2b59ff;
  --violet: #7a4dff;
  --magenta: #d63c8f;
  --grad: linear-gradient(110deg, #2b59ff, #7a4dff 55%, #d63c8f);
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --deva: "Noto Sans Devanagari", "Nirmala UI", "Mangal", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(40% 40% at 8% 0%, rgba(43, 89, 255, 0.12), transparent 70%),
    radial-gradient(35% 35% at 100% 10%, rgba(255, 111, 174, 0.12), transparent 70%),
    linear-gradient(180deg, #fbf9f4, #f3f5fd 50%, #eef2fd);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible { outline: 2.5px solid var(--electric); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 12px; z-index: 10; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; }

.top, main, .foot { width: min(1120px, 100% - 32px); margin-inline: auto; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: -0.02em; }

.brand-orb {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff, transparent 38%), conic-gradient(from 210deg, #2b59ff, #7a4dff, #ff6fae, #13c8e6, #2b59ff);
}

.pill-link {
  font-size: 14px; font-weight: 700; text-decoration: none; padding: 9px 16px; border-radius: 99px;
  background: var(--ink); color: #fff; transition: transform 0.2s, background 0.3s;
}
.pill-link:hover { transform: translateY(-1px); background: var(--violet); }

/* Hero */
.hero { padding: 28px 0 32px; max-width: 760px; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }

h1 {
  margin-top: 14px; font-family: var(--display); font-weight: 700;
  font-size: clamp(2.3rem, 6vw, 4rem); line-height: 1.02; letter-spacing: -0.04em;
}
h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.lead { margin-top: 16px; font-size: clamp(16px, 2vw, 18px); color: var(--soft); max-width: 640px; }

.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.stats li { font-size: 13.5px; color: var(--soft); background: rgba(255, 255, 255, 0.8); border: 1px solid #fff; box-shadow: 0 6px 18px -12px rgba(28, 38, 92, 0.35); padding: 6px 12px; border-radius: 99px; }
.stats strong { color: var(--ink); }

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.66));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 60px -32px rgba(28, 38, 92, 0.35);
  border-radius: 26px;
  padding: 22px;
  backdrop-filter: blur(12px);
}

.card h2 { font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

@media (min-width: 860px) {
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.btn { font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border-radius: 99px; padding: 9px 18px; border: 1px solid var(--line); background: #fff; color: var(--ink); transition: border-color 0.2s, transform 0.2s; }
.btn:hover { border-color: var(--violet); transform: translateY(-1px); }

/* Drawing pad */
.canvas-wrap { position: relative; width: 100%; max-width: 420px; margin-inline: auto; aspect-ratio: 1; }

#pad {
  width: 100%; height: 100%; display: block; border-radius: 20px; background: #0d1230;
  touch-action: none; cursor: crosshair;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 40px -24px rgba(13, 18, 48, 0.6);
}

.canvas-hint {
  position: absolute; inset: auto 0 16px; text-align: center; font-size: 14px; color: rgba(255, 255, 255, 0.55);
  pointer-events: none; transition: opacity 0.3s;
}
.canvas-hint.hidden { opacity: 0; }

.tip { margin-top: 14px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* Results */
.status { font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--paper); padding: 4px 10px; border-radius: 99px; }
.status.ready { color: #3d7a00; background: #effbdc; }
.status.error { color: #a1124d; background: #fde8f1; }

.top-pred { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line); }

.glyph {
  flex: none; width: 92px; height: 92px; display: grid; place-items: center; border-radius: 22px;
  font-family: var(--deva); font-size: 56px; font-weight: 700; line-height: 1; color: #fff; background: var(--grad);
}

.top-name { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.top-conf { color: var(--muted); font-size: 14px; }

.bars { list-style: none; margin-top: 16px; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 54px; align-items: center; gap: 10px; font-size: 13.5px; }
.bars .b-glyph { font-family: var(--deva); font-size: 20px; font-weight: 700; text-align: center; }
.bars .b-track { height: 10px; border-radius: 99px; background: #eceff8; overflow: hidden; }
.bars .b-fill { display: block; height: 100%; border-radius: 99px; background: var(--grad); width: 0; transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.bars .b-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--soft); font-weight: 600; }

.sees { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--soft); }
#seen { width: 72px; height: 72px; flex: none; image-rendering: pixelated; border-radius: 10px; background: #000; }

/* Alphabet */
.alphabet { margin-top: 18px; }
.muted { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip {
  font-family: var(--deva); font-size: 20px; font-weight: 600; min-width: 46px; height: 46px; padding: 0 8px; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--violet); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.hit { box-shadow: 0 0 0 3px rgba(122, 77, 255, 0.35); }

/* How it works */
.how { margin-top: 48px; }
.how > h2 { font-family: var(--display); font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -0.03em; }
.steps { list-style: none; display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { background: rgba(255, 255, 255, 0.75); border: 1px solid #fff; border-radius: 22px; padding: 20px; box-shadow: 0 18px 40px -30px rgba(28, 38, 92, 0.4); }
.steps .num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 700; }
.steps h3 { margin-top: 12px; font-family: var(--display); font-size: 18px; letter-spacing: -0.02em; }
.steps p { margin-top: 6px; font-size: 14.5px; color: var(--soft); }

.foot { padding: 40px 0 32px; font-size: 14px; color: var(--soft); }
.foot a { font-weight: 700; }
.foot .muted { margin-top: 4px; font-size: 12.5px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
