/* ==========================================================================
   Kriya Keyboard — public website
   Design tokens taken verbatim from 04_DESIGN.md §2 ("Ink & Marigold").
   Dark-first. Marigold only on action moments.
   ========================================================================== */

:root {
  /* Colour tokens — 04_DESIGN.md §2.1 */
  --ink-900: #0e1116;
  --ink-800: #161b22;
  --ink-700: #1f2630;
  --ink-600: #2a3340;
  --text-primary: #f2f4f7;
  --text-secondary: #9aa4b2;
  --genda-500: #f5a31b;
  --genda-300: #ffc65c;
  --neel-500: #4757d6;
  --leaf-500: #2fbf71;
  --mirchi-500: #e5484d;
  --paper-50: #fafaf8;
  --paper-100: #f0efea;

  /* Semantic */
  --bg: var(--ink-900);
  --surface: var(--ink-800);
  --surface-2: var(--ink-700);
  --border: #2a3340;
  --border-soft: #232b36;
  --fg: var(--text-primary);
  --fg-muted: var(--text-secondary);
  --accent: var(--genda-500);
  --link: #8f9cff;

  /* Shape & space — §2.3 */
  --r-card: 20px;
  --r-pill: 28px;
  --r-sm: 10px;
  --gutter: 20px;
  --maxw: 820px;

  --mono: ui-monospace, "Noto Sans Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Anek Latin", var(--sans);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: var(--paper-50);
    --surface: #ffffff;
    --surface-2: var(--paper-100);
    --border: #e2e0d8;
    --border-soft: #ebe9e2;
    --fg: #14181f;
    --fg-muted: #5c6470;
    --link: #3341b8;
  }
}

/* --------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Subtle marigold horizon behind the header — the only decorative flourish. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  background:
    radial-gradient(60% 100% at 15% 0%, rgba(245, 163, 27, 0.10), transparent 70%),
    radial-gradient(50% 100% at 85% 0%, rgba(71, 87, 214, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap-wide { max-width: 1040px; }

/* ------------------------------------------------------------------- header */

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}

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

.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: block;
  flex: none;
  object-fit: contain;
}

.brand .devanagari { color: var(--fg-muted); font-weight: 600; }

img { max-width: 100%; height: auto; }

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--fg); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--fg); background: var(--surface-2); }

/* --------------------------------------------------------------------- type */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--fg);
}

h1 { font-size: clamp(30px, 6vw, 40px); margin: 0 0 12px; font-weight: 700; }
h2 { font-size: clamp(21px, 3.6vw, 25px); margin: 44px 0 12px; }
h3 { font-size: 17px; margin: 28px 0 8px; }

p { margin: 0 0 16px; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 8px; }
li::marker { color: var(--fg-muted); }

strong { color: var(--fg); font-weight: 600; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 1px 6px;
}

hr { border: 0; border-top: 1px solid var(--border-soft); margin: 40px 0; }

/* --------------------------------------------------------------- page intro */

.page-head { padding: 52px 0 8px; }

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.lede { font-size: 18px; color: var(--fg-muted); max-width: 62ch; }

.dates {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg-muted);
  margin: 18px 0 0;
}

.dates span { display: inline-block; margin-right: 18px; }

/* -------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-card);
  padding: 20px 22px;
  margin: 0 0 18px;
}

.card > :last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; }

.card-accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card-good { border-color: color-mix(in srgb, var(--leaf-500) 40%, var(--border)); }
.card-warn { border-color: color-mix(in srgb, var(--mirchi-500) 40%, var(--border)); }

.promise {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--neel-500) 14%, var(--surface)),
    color-mix(in srgb, var(--genda-500) 12%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--genda-500) 35%, var(--border));
  border-radius: var(--r-card);
  padding: 24px;
  margin: 28px 0;
}

.promise p { font-size: 17px; }
.promise > :last-child { margin-bottom: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.grid .card { margin: 0; }

/* ------------------------------------------------------------------- tables */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  margin: 0 0 20px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 460px;
  background: var(--surface);
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

th {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--surface-2);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }

td.yes { color: var(--leaf-500); font-weight: 600; }
td.no  { color: var(--mirchi-500); font-weight: 600; }

/* -------------------------------------------------------------------- steps */

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 20px; }

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 46px;
  margin: 0;
  border-left: 1px solid var(--border);
  margin-left: 15px;
}

.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -15px;
  top: -2px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.steps h3 { margin: 2px 0 6px; font-size: 16px; }
.steps p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: var(--r-pill);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15.5px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--genda-500); color: #17181a; }
.btn-primary:hover { background: var(--genda-300); color: #17181a; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.btn-ghost:hover { background: var(--surface-2); color: var(--fg); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }

/* ---------------------------------------------------------- google play badge */

.play-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px 10px 18px;
  min-height: 56px;
  border-radius: var(--r-pill);
  background: #000;
  border: 1px solid #3a3a3a;
  color: #fff;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.play-badge:hover { color: #fff; border-color: #6d6d6d; transform: translateY(-1px); }
.play-badge:active { transform: scale(0.985); }

.play-badge svg { width: 26px; height: 29px; flex: none; }

.play-badge .pb-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.play-badge .pb-small {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #cfcfcf;
}
.play-badge .pb-big {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

/* Light mode: the badge stays black — that is Google's badge spec. */
@media (prefers-color-scheme: light) {
  .play-badge { border-color: #000; }
}

.play-note { font-size: 13px; color: var(--fg-muted); margin-top: -6px; }

/* --------------------------------------------------------------- brand marks */

.hero-logo {
  width: min(190px, 46vw);
  height: auto;
  margin: 0 auto 22px;
  display: block;
  filter: drop-shadow(0 12px 32px rgba(245, 163, 27, 0.16));
}

/* The logo artwork is light-on-transparent, so on a light background it needs
   an ink plate behind it to stay legible. */
@media (prefers-color-scheme: light) {
  .hero-logo {
    background: var(--ink-900);
    border-radius: 28px;
    padding: 14px;
    box-sizing: border-box;
  }
}

.app-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  flex: none;
  display: block;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.app-row .app-meta { min-width: 180px; flex: 1 1 220px; }
.app-row .app-meta h3 { margin: 0 0 2px; }
.app-row .app-meta p { margin: 0; font-size: 14px; color: var(--fg-muted); }

/* ----------------------------------------------------------------- contacts */

.contact-list { list-style: none; padding: 0; margin: 0; }

.contact-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  margin: 0;
}

.contact-list li:last-child { border-bottom: 0; }

.contact-list .ico { font-size: 18px; line-height: 1.5; width: 24px; flex: none; }
.contact-list .label { display: block; font-size: 12.5px; color: var(--fg-muted); }
.contact-list a { font-weight: 600; }

/* -------------------------------------------------------------------- misc */

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: var(--surface-2);
}

.badge-good { color: var(--leaf-500); border-color: color-mix(in srgb, var(--leaf-500) 40%, transparent); }
.badge-warn { color: var(--mirchi-500); border-color: color-mix(in srgb, var(--mirchi-500) 40%, transparent); }

.toc {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-card);
  padding: 18px 22px;
  margin: 28px 0 8px;
}

.toc h2 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); }
.toc ol { columns: 2; column-gap: 28px; margin: 0; padding-left: 20px; font-size: 14.5px; }
.toc li { margin-bottom: 5px; break-inside: avoid; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

@media (max-width: 560px) { .toc ol { columns: 1; } }

.note {
  font-size: 14.5px;
  color: var(--fg-muted);
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 16px;
  margin: 20px 0;
}

.section-anchor { scroll-margin-top: 84px; }

/* ------------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 72px;
  padding: 34px 0 46px;
  font-size: 14px;
  color: var(--fg-muted);
}

.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; }
.site-footer a { color: var(--fg-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* --------------------------------------------------------------- responsive */

/* Tablet and below */
@media (max-width: 820px) {
  :root { --gutter: 18px; }
  .site-header .wrap { min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
  .page-head { padding-top: 38px; }
  h2 { margin-top: 36px; }
  .steps > li { padding-left: 40px; }
}

/* Phones */
@media (max-width: 620px) {
  :root { --gutter: 16px; }
  body { font-size: 15.5px; line-height: 1.62; }

  /* Header: brand on its own line, nav scrolls horizontally instead of stacking
     into a tall block that pushes the content off-screen. */
  .site-header { position: static; }
  .site-header .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 10px;
  }
  .brand { font-size: 17px; }
  .brand .mark { width: 30px; height: 30px; }

  .site-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 2px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 2px var(--gutter) 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { font-size: 13.5px; padding: 6px 10px; }

  .lede { font-size: 16.5px; }
  .dates span { display: block; margin: 0 0 3px; }

  .card { padding: 17px 16px; border-radius: 16px; }
  .promise { padding: 19px 17px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .toc { padding: 16px 17px; }

  table { font-size: 13.5px; min-width: 420px; }
  th, td { padding: 9px 11px; }

  /* Full-width tap targets on phones */
  .btn, .play-badge { width: 100%; }
  .btn-row { flex-direction: column; gap: 10px; }
  .btn-row .btn, .btn-row .play-badge { justify-content: center; }
  .play-badge { padding-left: 22px; }

  .steps > li { padding-left: 36px; margin-left: 13px; }
  .steps > li::before { width: 27px; height: 27px; left: -13px; font-size: 12px; }

  .contact-list li { gap: 10px; }

  .site-footer { margin-top: 52px; padding: 26px 0 36px; }
  .site-footer .wrap { flex-direction: column; gap: 14px; }
  .footer-links { gap: 12px 16px; }

  .app-row { gap: 14px; }
  .app-icon { width: 66px; height: 66px; border-radius: 18px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .brand .devanagari { display: none; }
  table { min-width: 340px; }
}

/* -------------------------------------------------------------------- print */

@media print {
  body::before, .site-header, .site-footer, .btn-row, .play-badge, .hero-logo { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card, table, .promise { border: 1px solid #ccc; background: #fff; }
  a { color: #000; }
}
