@font-face {
  font-family: "Kantumruy Pro";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url(/fonts/kantumruy-pro-khmer-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Kantumruy Pro";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url(/fonts/kantumruy-pro-latin-wght-normal.woff2) format("woff2-variations");
  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;
}

/* Colours match docs/brand and apps/desktop/src/App.css in Hunlean/Kotra. */
:root {
  --bg: #f7f7f5;
  --bg-alt: #f0efec;
  --surface: #ffffff;
  --ink: #1b1b1a;
  --ink-2: #44433f;
  --muted: #6b6a66;
  --line: #e3e2de;
  --accent: #c8102e;
  --accent-hover: #9e0c24;
  --ok: #1f8a4c;
  --on-ink: #f7f7f5;
  --ink-panel: #1b1b1a;
  --ink-panel-text: #d9d8d3;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --bg-alt: #1c1c1b;
    --surface: #1f1f1e;
    --ink: #ecebe8;
    --ink-2: #cfcdc8;
    --muted: #a09e99;
    --line: #34332f;
    --accent: #ff5a6e;
    --accent-hover: #ff8291;
    --on-ink: #161615;
    --ink-panel: #232322;
    --ink-panel-text: #cfcdc8;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Kantumruy Pro", "Segoe UI", "Khmer UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* Khmer script needs taller lines. / is Khmer, /en/ is English; Khmer text keeps its lang="km" wrapper. */
[lang="km"] { line-height: 1.85; }
h1 [lang="km"], h2 [lang="km"], h3 [lang="km"] { line-height: 1.5; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; padding: 8px 14px; background: var(--ink); color: var(--on-ink); border-radius: 8px; }
.skip:focus { left: 16px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.wordmark { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; }
.nav a:hover { background: var(--bg-alt); color: var(--ink); }
.lang { display: flex; padding: 3px; border-radius: 10px; background: var(--bg-alt); border: 1px solid var(--line); }
.lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--muted); font-size: 14px; text-decoration: none; }
.lang a:hover { color: var(--ink); }
.lang a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
@media (max-width: 760px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-2); color: var(--on-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--bg-alt); color: var(--ink); }
.btn-soon { margin: 0; background: transparent; color: var(--muted); border: 1px dashed var(--line); cursor: default; font-weight: 500; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-light { background: var(--on-ink); color: var(--ink); }
.btn-light:hover { background: var(--line); color: var(--ink); }
@media (prefers-color-scheme: dark) {
  .btn-light { background: var(--ink); color: var(--bg); }
  .btn-light:hover { background: var(--ink-2); color: var(--bg); }
}

/* Mac button: flip <html data-mac> to "live" once the first notarized .dmg is on downloads.kotra.app. */
html[data-mac="soon"] .mac-live,
html[data-mac="live"] .mac-soon { display: none; }

/* Hero */
.hero { padding: 64px 0 72px; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c8102e; }
h1 { margin: 0 0 20px; font-size: clamp(34px, 5vw, 52px); font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
h1 [lang="km"] { font-size: 0.86em; letter-spacing: 0; line-height: 1.45; }
.lead { margin: 0 0 32px; font-size: 18px; color: var(--ink-2); max-width: 34em; }
.downloads { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.fine { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

/* App mock, after the Kotra App UI design */
.mock { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 48px -24px rgb(0 0 0 / 0.18); overflow: hidden; }
.mock-bar { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-rec { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.rec-btn { width: 52px; height: 52px; flex: none; border-radius: 50%; background: #c8102e; display: grid; place-items: center; }
.rec-btn span { width: 16px; height: 16px; border-radius: 3px; background: #fff; }
.rec-info { display: flex; flex-direction: column; min-width: 0; }
.rec-time { font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rec-title { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.level { flex: 1; display: flex; align-items: center; gap: 3px; height: 32px; min-width: 60px; }
.level i { flex: 1; border-radius: 2px; background: var(--ok); animation: level 1.2s ease-in-out infinite alternate; }
.level i:nth-child(1) { height: 25%; }
.level i:nth-child(2) { height: 55%; animation-delay: -0.3s; }
.level i:nth-child(3) { height: 80%; animation-delay: -0.6s; }
.level i:nth-child(4) { height: 50%; animation-delay: -0.2s; }
.level i:nth-child(5) { height: 95%; animation-delay: -0.9s; }
.level i:nth-child(6) { height: 65%; animation-delay: -0.4s; }
.level i:nth-child(7) { height: 85%; animation-delay: -0.7s; }
.level i:nth-child(8) { height: 40%; animation-delay: -0.1s; }
.level i:nth-child(n+9) { height: 15%; background: var(--line); animation: none; }
@keyframes level { to { transform: scaleY(0.45); } }
@media (prefers-reduced-motion: reduce) { .level i { animation: none; } }
.mock-transcript { padding: 8px 20px 12px; }
.mock-transcript p { margin: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 8px 0; font-size: 16px; }
.mock-transcript time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 5px; }
.mock-transcript .pending span { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.mock-transcript .pending i { height: 10px; border-radius: 5px; background: var(--bg-alt); width: 80%; }
.mock-transcript .pending i + i { width: 45%; }
.mock-foot { display: flex; align-items: center; gap: 6px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .hero { padding: 40px 0 56px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 480px) {
  .downloads .btn { width: 100%; }
  .level { display: none; }
}

/* Sections */
.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .section { padding: 56px 0; } }
h2 { margin: 0 0 32px; font-size: clamp(26px, 3.4vw, 36px); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; line-height: 1.3; }
.sub { margin: -20px 0 0; color: var(--muted); font-size: 17px; }
.sub.wide { margin: -20px 0 32px; max-width: 46em; }
.note { margin: 24px 0 0; font-size: 14px; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.steps p, .card p { margin: 0; color: var(--ink-2); }
.step-n { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 16px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-weight: 600; }
.steps li:first-child .step-n { background: #c8102e; color: #fff; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }

.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.modes { margin-top: 40px; }
.modes dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.modes dl > div { padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.modes dt { font-weight: 600; margin-bottom: 2px; }
.modes dd { margin: 0; color: var(--ink-2); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 48px; align-items: start; }
.split h2 { margin-bottom: 32px; }
.checks, .needs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.checks li, .needs li { position: relative; padding-left: 34px; color: var(--ink-2); }
.checks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat; }
.needs li::before { content: ""; position: absolute; left: 6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); }

/* Windows guide */
.guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: g; display: flex; flex-direction: column; gap: 20px; }
.guide-steps li { counter-increment: g; position: relative; padding-left: 52px; color: var(--ink-2); min-height: 36px; }
.guide-steps li::before { content: counter(g); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-weight: 600; color: var(--ink); }
.guide-steps b { color: var(--ink); }

/* A drawing of the SmartScreen dialog, so the guide works before real screenshots exist. */
.smartscreen { font-family: "Segoe UI", system-ui, sans-serif; line-height: 1.45; }
.ss-panel { background: #0b5fa5; color: #fff; padding: 28px 28px 20px; border-radius: 8px; box-shadow: 0 24px 48px -24px rgb(0 0 0 / 0.35); }
.ss-title { margin: 0 0 14px; font-size: 26px; font-weight: 300; }
.ss-text { margin: 0 0 12px; font-size: 14px; opacity: 0.95; }
.ss-small { font-size: 13px; }
.ss-link { margin: 0 0 14px; font-size: 14px; text-decoration: underline; }
.ss-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.ss-btn { padding: 6px 18px; border: 2px solid #fff; font-size: 14px; }
.ss-btn + .ss-btn { background: #fff; color: #0b5fa5; }
.ss-mark { position: relative; display: inline-block; outline: 3px solid #ffc83d; outline-offset: 3px; border-radius: 2px; }
.ss-tag { position: absolute; top: -14px; right: -14px; width: 24px; height: 24px; border-radius: 50%; background: #ffc83d; color: #1b1b1a; font-size: 13px; font-weight: 700; display: grid; place-items: center; text-decoration: none; }
.ss-link .ss-mark { padding-right: 4px; }

@media (max-width: 860px) {
  .steps, .cards, .faq { grid-template-columns: 1fr; gap: 20px; }
  .split, .guide { grid-template-columns: 1fr; gap: 24px; }
  .split h2 { margin-bottom: 8px; }
  .sub { margin: 0; }
  .sub.wide { margin: -16px 0 24px; }
}
@media (max-width: 560px) {
  .modes dl { grid-template-columns: 1fr; }
}

/* Help / CTA */
.cta { background: var(--ink-panel); color: var(--on-ink); padding: 64px 0; }
@media (prefers-color-scheme: dark) { .cta { color: var(--ink); } }
.cta h2 { margin-bottom: 8px; }
.cta p { margin: 0; color: var(--ink-panel-text); }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }

.foot { padding: 28px 0; font-size: 14px; color: var(--muted); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* Dialogs */
dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 32px 64px -24px rgb(0 0 0 / 0.4); }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dialog-body { padding: 28px 24px 20px; }
.dialog-body h2 { font-size: 22px; margin: 0 0 10px; }
.dialog-body p { margin: 0 0 16px; color: var(--ink-2); }
.copy-row code { display: block; padding: 10px 14px; border-radius: 10px; background: var(--bg-alt); font-family: inherit; font-size: 16px; color: var(--ink); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-actions .btn { min-height: 46px; padding: 0 18px; font-size: 15px; }
.copy-done { display: none; }
.copied .copy-idle { display: none; }
.copied .copy-done { display: inline; }

.notfound h1 { margin-top: 40px; }
