/* ============================================================
   SanskritTypist — sanskrittypist.com
   Palette mirrors the iOS app: system teal + coral accent,
   indigo/cyan liquid-glass gradient field.
   ============================================================ */

/* ---------- Self-hosted fonts (no third-party requests) ---------- */
@font-face {
  font-family: "Noto Serif Devanagari";
  src: url("/assets/fonts/noto-serif-devanagari-devanagari-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: "Noto Serif Devanagari";
  src: url("/assets/fonts/noto-serif-devanagari-devanagari-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/assets/fonts/noto-serif-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/assets/fonts/noto-serif-latin-ext-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Serif";
  src: url("/assets/fonts/noto-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand */
  --teal:        #2f9fb3;
  --teal-bright: #30b0c7;
  --coral:       #ff6b6b;
  --coral-deep:  #e85555;
  --indigo:      #5856d6;
  --cyan:        #32ade6;

  /* Light surfaces */
  --bg:          #ffffff;
  --bg-alt:      #f5f8f9;
  --card:        rgba(255, 255, 255, 0.72);
  --card-solid:  #ffffff;
  --border:      rgba(15, 40, 50, 0.12);
  --border-soft: rgba(15, 40, 50, 0.07);

  /* Type */
  --text:        #10262e;
  --text-2:      #4a616b;
  --text-3:      #6b8089;
  --on-accent:   #ffffff;

  /* Shape */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(16, 38, 46, .06), 0 2px 8px rgba(16, 38, 46, .05);
  --shadow:    0 2px 4px rgba(16, 38, 46, .05), 0 12px 32px rgba(16, 38, 46, .09);
  --shadow-lg: 0 4px 8px rgba(16, 38, 46, .06), 0 24px 64px rgba(16, 38, 46, .14);

  --maxw: 1120px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter,
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-deva: "Noto Serif Devanagari", "Noto Sans Devanagari", "Kohinoor Devanagari",
               "Devanagari Sangam MN", "Nirmala UI", "Mangal", serif;
  --font-iast: "Noto Serif", Charis SIL, "Gentium Plus", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --teal:        #4fd0e3;
  --teal-bright: #40c8e0;
  --coral:       #ff8080;
  --coral-deep:  #ff6b6b;

  --bg:          #07090c;
  --bg-alt:      #0c1116;
  --card:        rgba(255, 255, 255, 0.055);
  --card-solid:  #121820;
  --border:      rgba(255, 255, 255, 0.13);
  --border-soft: rgba(255, 255, 255, 0.075);

  --text:        #f2f6f8;
  --text-2:      #b3c2c9;
  --text-3:      #8397a0;
  --on-accent:   #1a0d0d;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 12px 32px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.6);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, .97rem + .16vw, 1.075rem);
  line-height: 1.62;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, picture { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--coral); }
h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -.021em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.35rem); letter-spacing: -.032em; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.75vw, 2.5rem); letter-spacing: -.026em; }
h3 { font-size: clamp(1.12rem, 1.02rem + .45vw, 1.32rem); }
p  { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: .4rem; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 6px; }

.deva { font-family: var(--font-deva); }
.iast { font-family: var(--font-iast); font-style: italic; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--coral); color: #fff; padding: .75rem 1.15rem;
  border-radius: 0 0 var(--r-sm) 0; font-weight: 650;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.25rem, 7vw, 6rem); position: relative; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 46rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section__head p { color: var(--text-2); font-size: 1.06em; margin-bottom: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .775rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal); margin-bottom: .85rem;
}
.eyebrow::before { content: ""; width: 1.6rem; height: 2px; border-radius: 2px; background: currentColor; }

/* ---------- Liquid glass background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.aurora__blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.aurora__blob--1 { width: 34rem; height: 34rem; top: -13rem; right: -9rem;  background: var(--cyan); }
.aurora__blob--2 { width: 38rem; height: 38rem; top: 42%;    left: -14rem;  background: var(--coral); opacity: .28; }
.aurora__blob--3 { width: 30rem; height: 30rem; bottom: -10rem; right: -6rem; background: var(--indigo); opacity: .26; }
html[data-theme="dark"] .aurora__blob { opacity: .3; }
html[data-theme="dark"] .aurora__blob--2 { opacity: .22; }
html[data-theme="dark"] .aurora__blob--3 { opacity: .2; }

/* ---------- Glass card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(1.25rem, 3vw, 1.85rem);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}
@supports not (backdrop-filter: blur(1px)) { .card { background: var(--card-solid); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .85rem 1.5rem; border-radius: var(--r-pill);
  font-size: 1rem; font-weight: 650; text-decoration: none; border: 1px solid transparent;
  cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: linear-gradient(135deg, var(--coral), var(--coral-deep));
  color: #fff; box-shadow: 0 6px 20px rgba(255, 107, 107, .38);
}
.btn--primary:hover { color: #fff; box-shadow: 0 10px 30px rgba(255, 107, 107, .48); }
.btn--ghost {
  background: var(--card); color: var(--text);
  border-color: var(--border);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.btn--ghost:hover { color: var(--text); border-color: var(--teal); }
.btn--sm { padding: .55rem 1.05rem; font-size: .9rem; }
.btn--sm.btn--primary { box-shadow: 0 2px 8px rgba(255, 107, 107, .28); }
.btn--sm.btn--primary:hover { box-shadow: 0 4px 14px rgba(255, 107, 107, .34); }
html[data-theme="dark"] .btn--primary { box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .btn--primary:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .btn--sm.btn--primary {
  background: var(--border-soft); color: var(--text); box-shadow: none;
}
html[data-theme="dark"] .btn--sm.btn--primary:hover {
  background: rgba(255, 255, 255, .12); color: var(--text); box-shadow: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 3.85rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em;
  color: var(--text); text-decoration: none; margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand__mark { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.nav { display: flex; align-items: center; gap: .35rem; }
.nav a {
  color: var(--text-2); text-decoration: none; font-size: .93rem; font-weight: 550;
  padding: .45rem .7rem; border-radius: var(--r-sm);
}
.nav a:hover { color: var(--text); background: var(--border-soft); }
@media (max-width: 800px) { .nav__links { display: none; } }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem; flex: none;
  border-radius: var(--r-pill); border: 1px solid var(--border);
  background: transparent; color: var(--text-2); cursor: pointer;
}
.theme-toggle:hover { color: var(--teal); border-color: var(--teal); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
html[data-theme="dark"] .theme-toggle .i-sun { display: none; }
html:not([data-theme="dark"]) .theme-toggle .i-moon { display: none; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(1.25rem, 3vw, 2.5rem) clamp(2.5rem, 5vw, 4.5rem); }
.hero__grid {
  display: grid; gap: clamp(2rem, 5vw, 3.75rem);
  grid-template-columns: 1fr; align-items: center;
}
.hero__copy { transform: translateY(clamp(-1em, -6vw, -1.5rem)); }
@media (max-width: 939px) { .hero__copy { transform: none; } }
@media (min-width: 940px) { .hero__grid { grid-template-columns: minmax(0, 1.22fr) minmax(0, .78fr); } }

.hero__icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 1.35rem; }
.hero h1 { margin-bottom: .65rem; }
.hero h1 .grad {
  background: linear-gradient(115deg, var(--teal-bright), var(--indigo) 55%, var(--coral));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lede { font-size: clamp(1.06rem, 1rem + .4vw, 1.28rem); color: var(--text-2); max-width: 34rem; }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin: 1.75rem 0 1.2rem; max-width: 34rem; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: .45rem .95rem;
  font-size: .875rem; color: var(--text-3); list-style: none; padding: 0; margin: 0;
}
.hero__meta li { display: inline-flex; align-items: center; gap: .38rem; margin: 0; }
.hero__meta li::before { content: "✓"; color: var(--teal); font-weight: 700; }

/* ---------- Hero video ---------- */
.hero-video {
  display: block; width: min(300px, 78vw); margin-inline: auto;
  border-radius: 17% / 8.2%; overflow: hidden;
}

/* ---------- Feature grid ---------- */
.grid { display: grid; gap: 1.15rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 620px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 620px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.feature h3 { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.feature__icon {
  width: 2.35rem; height: 2.35rem; flex: none;
  display: grid; place-items: center; border-radius: 11px;
  background: color-mix(in srgb, var(--teal) 16%, transparent);
  color: var(--teal);
}
.feature__icon svg { width: 1.2rem; height: 1.2rem; }
.feature p { color: var(--text-2); margin-bottom: 0; font-size: .97em; }

/* ---------- Keyboard comparison ---------- */
.kb { display: flex; flex-direction: column; }
.kb__tag {
  align-self: flex-start; font-size: .74rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; padding: .3rem .7rem; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--coral) 16%, transparent); color: var(--coral-deep);
  margin-bottom: .9rem;
}
html[data-theme="dark"] .kb__tag { color: var(--coral); }
.kb__tag--teal { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
html:not([data-theme="dark"]) .kb__tag--teal { color: #1c7d8e; }

/* ---------- Mapping table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--card-solid); min-width: 30rem; }
caption { text-align: left; padding: .85rem 1rem; color: var(--text-3); font-size: .875rem; border-bottom: 1px solid var(--border-soft); }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--border-soft); }
thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
td.mono, th.mono { font-family: var(--font-mono); color: var(--coral-deep); }
html[data-theme="dark"] td.mono { color: var(--coral); }
td.deva { font-family: var(--font-deva); font-size: 1.25rem; }
td.iast { font-family: var(--font-iast); font-size: 1.05rem; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; counter-reset: step; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { margin: 0; display: flex; gap: .9rem; align-items: flex-start; }
.steps__num {
  counter-increment: step; flex: none;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .92rem;
  background: linear-gradient(135deg, var(--coral), var(--coral-deep)); color: #fff;
}
.steps h3 { margin-bottom: .25rem; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--text-2); font-size: .95em; }

/* ---------- Audience ---------- */
.aud { display: flex; gap: .75rem; align-items: flex-start; }
.aud__dot { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--coral); margin-top: .62rem; }
.aud strong { display: block; }
.aud span { color: var(--text-2); font-size: .95em; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: .7rem; max-width: 52rem; }
details.qa {
  border: 1px solid var(--border); border-radius: var(--r);
  background: var(--card-solid); overflow: hidden;
}
details.qa[open] { border-color: color-mix(in srgb, var(--teal) 50%, var(--border)); }
details.qa summary {
  cursor: pointer; list-style: none; padding: 1rem 1.15rem;
  font-weight: 650; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after {
  content: "+"; font-size: 1.4rem; font-weight: 400; line-height: 1; color: var(--teal); flex: none;
  transition: transform .2s ease;
}
details.qa[open] summary::after { content: "−"; }
details.qa .qa__a { padding: 0 1.15rem 1.15rem; color: var(--text-2); }
details.qa .qa__a > :last-child { margin-bottom: 0; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .card { padding: clamp(2rem, 5vw, 3.25rem); text-align: center; }
.cta-band h2 { margin-bottom: .6rem; }
.cta-band p { color: var(--text-2); max-width: 38rem; margin-inline: auto; }
.cta-band .hero__cta { justify-content: center; margin-inline: auto; }
.cta-band .hero__meta { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding-block: 2.5rem 3rem; font-size: .92rem; color: var(--text-3);
  background: var(--bg-alt);
}
.site-footer__grid { display: grid; gap: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-2); margin-bottom: .7rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: var(--text-3); text-decoration: none; }
.site-footer a:hover { color: var(--teal); }
.site-footer__bottom { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border-soft); font-size: .85rem; }

/* ---------- Prose (privacy/support) ---------- */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2.25rem; font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); }
.prose h3 { margin-top: 1.5rem; }
.prose ul { padding-left: 1.15rem; }
.prose li { color: var(--text-2); }
.prose p { color: var(--text-2); }
.prose .lead { font-size: 1.12em; color: var(--text); }

/* ---------- App Store badge ---------- */
.appstore-badge { display: flex; width: 100%; align-items: center; justify-content: center; gap: .9rem; padding: 1.05rem 2.1rem; }
.appstore-badge svg { width: 1.9rem; height: 1.9rem; flex: none; }
.appstore-badge > span { display: flex; flex-direction: column; align-items: center; }
.appstore-badge .b-sub { font-size: .78rem; font-weight: 500; opacity: .85; line-height: 1.1; }
.appstore-badge .b-main { font-size: 1.3rem; font-weight: 700; line-height: 1.25; }
