/* silika.app — the product's public site. Same brand as the lab: night ink and
   lamplight sand grains on parchment, Manrope. Light/dark follows the device. */
:root {
  --bg: #f7f3ea;
  --surface: #ffffff;
  --surface-2: #eee9de;
  --text: #1b2a4a;
  --muted: #5f6b80;
  --border: #ded8ca;
  --ink: #1b2a4a;
  --on-ink: #f7f3ea;
  --sand: #f2a63b;
  --school: #007067;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141b29;
    --surface: #1b2436;
    --surface-2: #243047;
    --text: #ece7dc;
    --muted: #a3abbb;
    --border: #313e57;
    --ink: #f2a63b;
    --on-ink: #1b2a4a;
    --school: #3fb3a7;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---------- Wordmark: both i-dots are sand grains; three grains spill out ---------- */
.wordmark {
  display: inline-flex; align-items: baseline; text-decoration: none;
  font-weight: 800; letter-spacing: -0.02em; line-height: 1; color: var(--text);
}
.wordmark .i { position: relative; display: inline-block; }
.wordmark .grain {
  position: absolute; left: 50%; top: 0.02em; transform: translateX(-50%);
  width: 0.16em; height: 0.16em; border-radius: 50%; background: var(--sand);
}
.wordmark .spill { display: inline-flex; align-items: flex-end; gap: 0.07em; margin-left: 0.06em; }
.wordmark .spill i { width: 0.13em; height: 0.13em; border-radius: 50%; background: var(--sand); }
.wordmark .spill i:nth-child(2) { width: 0.09em; height: 0.09em; margin-bottom: 0.14em; opacity: 0.8; }
.wordmark .spill i:nth-child(3) { width: 0.07em; height: 0.07em; margin-bottom: 0.04em; opacity: 0.6; }

/* ---------- Top bar ---------- */
.top { display: flex; align-items: center; gap: 16px; padding: 18px 0; }
.top .wordmark { font-size: 24px; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lang { display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.lang button {
  border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px;
  padding: 5px 10px; cursor: pointer;
}
.lang button[aria-pressed='true'] { background: var(--surface-2); color: var(--text); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 12px 20px; border-radius: 11px; font-weight: 700; font-size: 15px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 18px; }
.hero p { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.hero .row { display: flex; flex-wrap: wrap; gap: 10px; }

/* The lab bench: beaker, flask and test tube, with sand-grain bubbles rising. Decorative. */
.bench { color: var(--text); }
.bench svg { width: 100%; height: auto; display: block; }
.bench .liquid { fill: var(--sand); }
.bench .liquid.soft { opacity: 0.45; }
.bench .bubble { fill: var(--sand); stroke: var(--bg); stroke-width: 2; animation: rise 3.2s ease-in infinite; }
.bench .bubble:nth-of-type(2) { animation-delay: 0.8s; }
.bench .bubble:nth-of-type(3) { animation-delay: 1.7s; }
.bench .bubble:nth-of-type(4) { animation-delay: 2.3s; animation-duration: 2.6s; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(-150px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bench .bubble { animation: none; } }

/* ---------- Sections ---------- */
section { padding: 36px 0; }
h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 24px; max-width: 40em; }

.school {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px;
}
.school h2 { font-size: 22px; }
.school .lede { margin: 0; }
.school .btn { margin-left: auto; }
.signin-link { font-weight: 700; font-size: 14px; text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.signin-link:hover { background: var(--surface-2); }

/* ---------- Sign-in page ---------- */
.signin { max-width: 440px; margin: 40px auto 64px; text-align: center; }
.signin h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 8px; }
.signin p { color: var(--muted); margin: 0 0 24px; }
.signin .gsi { display: flex; justify-content: center; min-height: 44px; }
.signin .form-status { margin-top: 18px; }
.signin .small { font-size: 14px; margin-top: 28px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: s; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
.step::before {
  counter-increment: s; content: counter(s);
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--sand); color: #1b2a4a; font-weight: 800; font-size: 14px; margin-bottom: 10px;
}
.step h3 { margin: 0 0 4px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fact { border-top: 2px solid var(--border); padding-top: 12px; }
.fact strong { display: block; margin-bottom: 2px; }
.fact span { color: var(--muted); font-size: 14px; }

.contact {
  background: var(--surface-2); border-radius: var(--radius); padding: 28px;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; align-items: start;
}
.contact h2 { font-size: 22px; margin: 0; }
.contact-intro p { margin: 6px 0 0; color: var(--muted); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.form .wide { grid-column: 1 / -1; }
.form input, .form textarea {
  font: inherit; font-weight: 400; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; width: 100%;
}
.form textarea { resize: vertical; min-height: 96px; }
.form input:focus-visible, .form textarea:focus-visible { outline: 2px solid var(--sand); outline-offset: 1px; border-color: transparent; }
.form [aria-invalid='true'] { border-color: #d64545; }
.form .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-end { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-status { margin: 0; font-size: 14px; color: var(--muted); font-weight: 500; }
.form-status.ok { color: var(--school); }
.form-status.error { color: #d64545; }
@media (prefers-color-scheme: dark) { .form [aria-invalid='true'] { border-color: #ff6b66; } .form-status.error { color: #ff6b66; } }

footer { padding: 32px 0 48px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
footer a { color: var(--muted); }
footer .wordmark { font-size: 18px; margin-right: auto; }

/* ---------- Legal pages ---------- */
.doc { max-width: 720px; padding: 24px 0 48px; }
.doc h1 { font-size: 34px; letter-spacing: -0.02em; margin: 8px 0 4px; }
.doc h2 { font-size: 20px; margin: 28px 0 6px; }
.doc .meta { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.doc li { margin: 4px 0; }
.draft {
  border: 1px dashed var(--sand); background: color-mix(in srgb, var(--sand) 12%, var(--surface));
  border-radius: 10px; padding: 12px 14px; font-size: 14px;
}

/* Only the chosen language shows. */
[data-l='mn'] { display: none; }
html[lang='mn'] [data-l='en'] { display: none; }
html[lang='mn'] [data-l='mn'] { display: revert; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; }
  .bench { max-width: 340px; margin: 0 auto; width: 100%; }
  .steps { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr; }
  .school .btn { margin-left: 0; }
  .contact { grid-template-columns: 1fr; padding: 20px; }
  .form { grid-template-columns: 1fr; }
}
