/* Khata24 website. Same colours as the app: deep teal with gold.
   Light and dark: follows the phone/computer, or the switch in the top bar
   (html[data-theme], set by theme.js). */
:root {
  --teal-900: #163632;
  --teal-800: #1f4a44;
  --teal-700: #2f6b62;
  --gold: #f2c14e;

  --bg: #f4f8f7;
  --surface: #ffffff;
  --surface-2: #f4f8f7;
  --chip: #e3efec;
  --ink: #1e2423;
  --muted: #5b6866;
  --line: #d9e4e1;
  --heading: #1f4a44;
  --link: #2f6b62;
  --link-hover: #1f4a44;
  --bar: #1f4a44;
  --hero-a: #1f4a44;
  --hero-b: #2f6b62;
  --foot: #163632;
  --note: #f4f8f7;
  --warn: #fdf1ef;
  --shadow: rgba(22, 54, 50, .18);
  --radius: 16px;
  color-scheme: light;
}

/* Dark: chosen with the switch… */
html[data-theme="dark"] {
  --bg: #0e1615;
  --surface: #151f1d;
  --surface-2: #1b2826;
  --chip: #213330;
  --ink: #e2ebe8;
  --muted: #9db0ab;
  --line: #2a3a37;
  --heading: #9fd8ca;
  --link: #86d0bf;
  --link-hover: #b5e6da;
  --bar: #101b19;
  --hero-a: #13231f;
  --hero-b: #1f4a44;
  --foot: #0a1110;
  --note: #1b2826;
  --warn: #2c1c1a;
  --shadow: rgba(0, 0, 0, .45);
  color-scheme: dark;
}
/* …or by the device, when nothing is chosen. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0e1615;
    --surface: #151f1d;
    --surface-2: #1b2826;
    --chip: #213330;
    --ink: #e2ebe8;
    --muted: #9db0ab;
    --line: #2a3a37;
    --heading: #9fd8ca;
    --link: #86d0bf;
    --link-hover: #b5e6da;
    --bar: #101b19;
    --hero-a: #13231f;
    --hero-b: #1f4a44;
    --foot: #0a1110;
    --note: #1b2826;
    --warn: #2c1c1a;
    --shadow: rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

/* Screenshots: one of each theme in the page, only the matching one shows. */
.only-dark { display: none; }
html[data-theme="dark"] .only-dark { display: block; }
html[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .only-dark { display: block; }
  html:not([data-theme="light"]) .only-light { display: none; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- top bar ---------- */
.top { background: var(--bar); position: sticky; top: 0; z-index: 10; }
.top .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 60px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 20px;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.brand:hover { color: #fff; }
.top nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.top nav a {
  color: #d7e7e3; text-decoration: none; padding: 6px 10px; border-radius: 8px;
  font-size: 15px;
}
.top nav a:hover, .top nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }

.theme-switch {
  display: inline-grid; place-items: center; width: 38px; height: 38px; margin-left: 4px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.25);
  background: transparent; color: #fff; cursor: pointer; padding: 0;
}
.theme-switch[hidden] { display: none; }
.theme-switch:hover { background: rgba(255,255,255,.1); }
.theme-switch svg { width: 20px; height: 20px; }
/* Shows the theme you'd switch to. */
.theme-switch .to-light { display: none; }
html[data-theme="dark"] .theme-switch .to-light { display: block; }
html[data-theme="dark"] .theme-switch .to-dark { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-switch .to-light { display: block; }
  html:not([data-theme="light"]) .theme-switch .to-dark { display: none; }
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
  color: #fff; overflow: hidden;
}
.hero .wrap {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px;
  align-items: center; padding-top: 56px; padding-bottom: 56px;
}
.hero h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.12; margin: 0 0 14px; }
.hero h1 span { color: var(--gold); }
.hero p.lead { font-size: 19px; color: #dcebe7; margin: 0 0 26px; max-width: 34em; }
.hero .phones { display: flex; justify-content: center; gap: 18px; }
.hero .phones .phone { width: 44%; max-width: 230px; box-shadow: 0 24px 50px rgba(0,0,0,.35); }
.hero .phones .phone:first-child { transform: rotate(-4deg) translateY(16px); }
.hero .phones .phone:last-child { transform: rotate(4deg); }

/* A phone drawn around a plain app screen (modern 9:19.5 shape). */
.phone {
  position: relative; background: #0e1f1c; padding: 6px; border-radius: 34px;
  box-shadow: 0 12px 28px var(--shadow), inset 0 0 0 1.5px #2b3d3a;
}
.phone img { width: 100%; border-radius: 28px; }
/* Front camera. */
.phone::before {
  content: ""; position: absolute; top: 13px; left: 50%; width: 9px; height: 9px;
  margin-left: -4.5px; border-radius: 50%; background: #0e1f1c;
  box-shadow: inset 0 0 0 2px #1d2a28;
}

.buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 16px;
  text-decoration: none; border: 2px solid transparent;
}
.btn-gold { background: var(--gold); color: var(--teal-900); }
.btn-gold:hover { background: #f6cf6e; color: var(--teal-900); }
.btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-teal { background: var(--teal-700); color: #fff; }
.btn-teal:hover { background: var(--teal-800); color: #fff; }
.btn-line { border-color: var(--line); color: var(--heading); background: var(--surface); }
.btn-line:hover { border-color: var(--link); color: var(--heading); }
.btn svg { width: 20px; height: 20px; flex: none; }
.small { font-size: 14px; color: #bfd8d2; margin-top: 12px; }

/* ---------- sections ---------- */
section { padding: 56px 0; }
section h2 { font-size: clamp(26px, 3.5vw, 34px); margin: 0 0 8px; color: var(--heading); }
section .sub { color: var(--muted); margin: 0 0 28px; font-size: 17px; }
.alt { background: var(--surface); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.alt .card { background: var(--surface-2); }
.card h3 { margin: 10px 0 6px; font-size: 18px; color: var(--heading); }
.card p { margin: 0; color: var(--muted); }
.icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--chip); font-size: 22px; flex: none;
}

.shots {
  display: grid; grid-auto-flow: column; grid-auto-columns: 210px;
  gap: 22px; overflow-x: auto; padding: 6px 4px 16px; scroll-snap-type: x mandatory;
}
.shots figure { margin: 0; scroll-snap-align: start; }
.shots figcaption { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }
/* The PDF is a page, not a phone screen. */
.shots figure.page { align-self: center; }
.shots figure.page img {
  display: block; border-radius: 10px; border: 1px solid var(--line);
  box-shadow: 0 12px 28px var(--shadow);
}

.cta {
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff;
  border-radius: 24px; padding: 40px; text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: #dcebe7; }
.cta .buttons { justify-content: center; }

/* ---------- document pages ---------- */
.page-head {
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff;
  padding: 40px 0 34px;
}
.page-head h1 { margin: 0; font-size: clamp(28px, 4vw, 38px); }
.page-head p { margin: 6px 0 0; color: var(--gold); }
.doc {
  max-width: 780px; margin: -18px auto 56px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px;
}
.doc h2 { color: var(--heading); font-size: 21px; margin: 30px 0 8px; }
.doc h2:first-child { margin-top: 0; }
.doc strong { color: var(--heading); }
.doc li { margin: 6px 0; }
.doc .note {
  background: var(--note); border-left: 4px solid var(--teal-700);
  padding: 12px 16px; border-radius: 8px; margin: 16px 0;
}
.doc .warn { border-left-color: #c0392b; background: var(--warn); }
.doc ol li::marker { color: var(--link); font-weight: 700; }
.updated { color: var(--muted); font-style: italic; }

.contact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 10px 0 8px; }
.contact a {
  display: flex; gap: 14px; align-items: center; text-decoration: none;
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--ink);
}
.contact a:hover { border-color: var(--link); }
.contact b { display: block; color: var(--heading); }
.contact span { color: var(--muted); font-size: 15px; }

details {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 10px 0;
}
details[open] { background: var(--surface-2); }
summary { cursor: pointer; font-weight: 600; color: var(--heading); }
details p, details ol { margin: 10px 0 2px; }

/* ---------- footer ---------- */
footer { background: var(--foot); color: #a9c4be; padding: 34px 0; font-size: 15px; }
footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: #d7e7e3; text-decoration: none; }
footer a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 40px; }
  .hero .phones .phone { max-width: 180px; }
  .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid, .contact { grid-template-columns: 1fr; }
  .top nav { margin-left: 0; width: 100%; padding-bottom: 8px; }
  .doc { padding: 22px 18px; margin-top: -12px; }
  .cta { padding: 28px 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .contact a { transition: background .15s, border-color .15s; }
}

/* ---------- video ---------- */
.watch { display: grid; grid-template-columns: 1fr minmax(240px, 340px); gap: 40px; align-items: center; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 32px; margin: 10px 0; font-size: 17px; }
.ticks li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px;
  border-radius: 50%; background: var(--chip); color: var(--link);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.video-frame {
  background: #0e1f1c; padding: 6px; border-radius: 30px;
  box-shadow: 0 16px 36px var(--shadow);
}
.video-frame video { display: block; width: 100%; height: auto; border-radius: 24px; background: #163632; }
@media (max-width: 860px) {
  .watch { grid-template-columns: 1fr; }
  .video-frame { max-width: 320px; margin: 0 auto; }
}
