/* Keysingate landing. Three themes as tokens; fonts per script are chosen by
   the page's lang (see :lang rules at the end). */

:root,
:root[data-theme="paper"] {
  /* Paper — the owner's palette (blog.mnemostroma.my), violet removed. */
  --bg: #f2f5f9;
  --surface: #ffffff;
  --line: #c3ccd6;
  --line-soft: #dde3ea;
  --text: #20242b;
  --muted: #4b5563;
  --accent: #0f766e;          /* teal — actions */
  --accent-ink: #ffffff;
  --link: #3d5f8f;            /* slate blue — links, facts */
  --mark: #765f2c;            /* olive — highlights */
  --code-bg: #e8edf3;
  color-scheme: light;
}

:root[data-theme="graphite"] {
  /* Graphite — the same hues for the dark. */
  --bg: #0f1216;
  --surface: #161b21;
  --line: #2a323c;
  --line-soft: #1f262e;
  --text: #e6e9ee;
  --muted: #9aa4b1;
  --accent: #2bb3a3;
  --accent-ink: #062320;
  --link: #8fb0dc;
  --mark: #d1b170;
  --code-bg: #1b2229;
  color-scheme: dark;
}

:root[data-theme="clay"] {
  /* Clay — bone, moss and rust: a warm, uncommon third. */
  --bg: #efeae0;
  --surface: #f8f5ee;
  --line: #cfc6b4;
  --line-soft: #e2dbcd;
  --text: #22251f;
  --muted: #5d5b52;
  --accent: #2f4a3a;          /* moss */
  --accent-ink: #f8f5ee;
  --link: #8a3f22;            /* rust */
  --mark: #8a3f22;
  --code-bg: #e6dfd1;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f1216; --surface: #161b21; --line: #2a323c; --line-soft: #1f262e;
    --text: #e6e9ee; --muted: #9aa4b1; --accent: #2bb3a3; --accent-ink: #062320;
    --link: #8fb0dc; --mark: #d1b170; --code-bg: #1b2229; color-scheme: dark;
  }
}

:root {
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 14px;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}
:lang(ko) { --font: "Noto Sans KR", "Onest", system-ui, sans-serif; }
:lang(ja) { --font: "Noto Sans JP", "Onest", system-ui, sans-serif; }
:lang(zh-Hans), :lang(zh) { --font: "Noto Sans SC", "Onest", system-ui, sans-serif; }
:lang(hi) { --font: "Noto Sans Devanagari", "Onest", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
:lang(ko) body, :lang(ja) body, :lang(zh) body, :lang(zh-Hans) body { line-height: 1.75; word-break: keep-all; }
:lang(hi) body { line-height: 1.8; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
pre {
  background: var(--code-bg); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 16px; overflow-x: auto; line-height: 1.5;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
header.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.bar { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; font-size: 18px; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }
.brand b { color: var(--accent); font-weight: 650; }
nav.main { display: flex; gap: 18px; margin-left: auto; }
nav.main a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav.main a:hover { color: var(--text); }
.tools { display: flex; gap: 8px; }
.tools select {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; cursor: pointer;
}
@media (max-width: 900px) { nav.main { display: none; } .tools { margin-left: auto; } }
@media (max-width: 520px) {
  .bar { gap: 10px; }
  .brand span { display: none; }
  .tools select { max-width: 9.5rem; padding: 6px 8px; font-size: 13px; }
}
.tools, .tools select { min-width: 0; }

.notice { background: var(--code-bg); border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--muted); padding: 8px 0; }

/* Hero */
.hero { padding-top: clamp(56px, 10vw, 120px); padding-bottom: clamp(48px, 7vw, 88px); }
.kicker { display: inline-block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mark); font-weight: 600; margin-bottom: 18px; }
:lang(ko) .kicker, :lang(ja) .kicker, :lang(zh) .kicker, :lang(hi) .kicker { letter-spacing: 0; text-transform: none; }
h1 {
  font-size: clamp(38px, 6.4vw, 76px); line-height: 1.04; letter-spacing: -0.035em;
  font-weight: 700; margin: 0 0 24px; max-width: 15ch; text-wrap: balance;
}
:lang(ko) h1, :lang(ja) h1, :lang(zh) h1, :lang(hi) h1 { letter-spacing: -0.01em; line-height: 1.2; max-width: 20ch; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 62ch; margin: 0 0 34px; text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 16px;
  border: 1px solid var(--line); color: var(--text); background: var(--surface);
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Sections */
section { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line-soft); }
h2 { font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 16px; font-weight: 680; }
h3 { font-size: 19px; margin: 0 0 8px; font-weight: 630; letter-spacing: -0.01em; }
.section-lead { color: var(--muted); max-width: 64ch; margin: 0 0 36px; font-size: 18px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px; }
.card p { margin: 0; color: var(--muted); }
.step { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-bottom: 12px; display: block; }

.split { display: grid; gap: 40px; grid-template-columns: 1.1fr 1fr; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
ul.ticks { list-style: none; padding: 0; margin: 0 0 28px; }
ul.ticks li { padding: 10px 0 10px 30px; border-bottom: 1px solid var(--line-soft); position: relative; }
ul.ticks li::before { content: ""; position: absolute; left: 4px; top: 19px; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.links { display: flex; flex-wrap: wrap; gap: 12px; }

details { border-bottom: 1px solid var(--line-soft); padding: 18px 0; }
details summary { cursor: pointer; font-weight: 600; font-size: 18px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; float: right; color: var(--muted); font-family: var(--mono); }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin: 10px 0 0; max-width: 70ch; }

/* Forms */
form.reg { display: grid; gap: 14px; max-width: 560px; }
form.reg label { display: grid; gap: 6px; font-size: 15px; font-weight: 550; }
form.reg input, form.reg textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
}
form.reg textarea { min-height: 110px; resize: vertical; }
form.reg .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--muted); }
form.reg .check input { margin-top: 5px; }
form.reg .hp { position: absolute; left: -9999px; }
.status { min-height: 1.6em; font-size: 15px; }

footer { border-top: 1px solid var(--line-soft); padding: 40px 0 56px; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
footer .brand { font-size: 16px; }
footer .sp { margin-left: auto; }
.split > * { min-width: 0; }
