/* GnarlyKey site. Restyle by changing the variables first. */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #efede6;
  --text: #16181d;
  --muted: #5d6270;
  --border: #e2dfd6;
  --accent: #ff5b2e;
  --accent-ink: #ffffff;
  --friendly: #18a06b;
  --firm: #e0433b;
  --pro: #2f6fe4;
  --ready: #3478f6;
  --working: #f59e0b;
  --error: #dc2626;
  --key-face: #ffffff;
  --key-edge: #d6d2c6;
  --shadow: 0 1px 2px rgba(22, 24, 29, .06), 0 8px 24px rgba(22, 24, 29, .08);
  --radius: 14px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121317;
    --surface: #1b1d23;
    --surface-2: #22252c;
    --text: #eef0f4;
    --muted: #9aa1ad;
    --border: #2e323b;
    --key-face: #2a2e36;
    --key-edge: #14161a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;  /* Korean: don't break words mid-syllable-group */
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 6px; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 760px; }
.center { text-align: center; justify-content: center; }
.mono { font-family: var(--mono); }

/* ---------- buttons, keys ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 22px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 91, 46, .3); }
.button.small { padding: 8px 16px; font-size: 14px; }
.button.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border); }
.button.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--text); }
.button.dark { background: var(--text); color: var(--bg); }
.button.dark:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px;
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  color: var(--text); background: var(--key-face);
  border: 1px solid var(--key-edge); border-bottom-width: 3px; border-radius: 8px;
}
kbd.inline { min-width: 0; height: auto; padding: 0 6px; font-size: 13px; border-bottom-width: 2px; border-radius: 5px; }
.keys { display: inline-flex; gap: 5px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-decoration: none; }
.brand-key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-size: 16px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.brand.small { font-size: 15px; }
.brand.small .brand-key { width: 24px; height: 24px; font-size: 13px; }
.nav-links { display: flex; gap: 22px; margin-left: 12px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 15px; }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  font: inherit; font-size: 14px; background: none; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.lang-toggle:hover { color: var(--text); border-color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: 64px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.eyebrow { color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(38px, 6vw, 60px); font-weight: 800; letter-spacing: -0.02em; }
.accent { color: var(--accent); }
.lead { font-size: 19px; color: var(--muted); margin: 20px 0 28px; max-width: 520px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fineprint { margin-top: 14px; color: var(--muted); font-size: 14px; }
.fineprint a { margin-left: 8px; }

/* ---------- demo ---------- */
.demo { position: relative; }
.window {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.window-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--key-edge); }
.window-title { margin-left: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.demo-lang { margin-left: auto; display: flex; gap: 4px; }
.chip {
  font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
}
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.window-body { padding: 4px 18px 18px; position: relative; }
.field-row {
  display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--muted);
}
.field-value { color: var(--text); }
.message {
  min-height: 210px; padding-top: 14px; white-space: pre-wrap; font-size: 15.5px; line-height: 1.7;
}
.message .sel {
  background-image: linear-gradient(color-mix(in srgb, var(--pro) 26%, transparent), color-mix(in srgb, var(--pro) 26%, transparent));
  background-repeat: no-repeat; background-size: 0% 100%; transition: background-size .9s linear;
}
.message .sel.on { background-size: 100% 100%; }
.message .caret {
  display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: text-bottom;
  background: var(--accent); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.demo-working {
  position: absolute; right: 18px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 6px 12px; border-radius: 999px;
}
/* demo: steps, keyboard, tone track */
.demo { --tone: var(--pro); }
.demo[data-tone="friendly"] { --tone: var(--friendly); }
.demo[data-tone="displeased"] { --tone: var(--firm); }
.demo[data-tone="standard"] { --tone: var(--pro); }

.demo-steps {
  list-style: none; margin: 14px 0 10px; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.demo-steps li {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  transition: color .2s, border-color .2s, background .2s;
}
.demo-steps li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-steps .n {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; background: var(--surface-2);
}
.demo-steps li.on { color: var(--text); border-color: var(--tone); }
.demo-steps li.on .n { background: var(--tone); color: #fff; }

.keyboard {
  display: grid; gap: 5px; padding: 10px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.kb-row { display: flex; gap: 5px; }
.kb-key {
  position: relative; flex: 1 1 0; min-width: 0; height: 38px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text);
  background: var(--key-face); border: 1px solid var(--key-edge); border-bottom-width: 3px;
  border-radius: 7px; transition: transform .08s ease, background .12s, color .12s, box-shadow .12s;
}
.kb-key .jamo {
  position: absolute; top: 2px; right: 5px; font-family: var(--font);
  font-size: 9.5px; font-weight: 500; color: var(--muted);
}
.kb-key.mod { font-family: var(--font); font-size: 12px; color: var(--muted); }
.kb-key.hot { color: var(--text); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--tone) 55%, transparent); }
.kb-key.down {
  transform: translateY(2px); border-bottom-width: 1px; background: var(--tone); color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 30%, transparent);
}
.kb-key.down .jamo { color: rgba(255, 255, 255, .8); }
.kb-gap { flex: 0.5 1 0; }
.w15 { flex-grow: 1.5; } .w2 { flex-grow: 2; } .w25 { flex-grow: 2.5; } .wspace { flex-grow: 5; }

.demo-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.tone-track { display: flex; gap: 6px; flex-wrap: wrap; }
.tone-pill {
  font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); transition: all .2s;
}
.tone-pill.on.friendly { background: var(--friendly); border-color: var(--friendly); color: #fff; }
.tone-pill.on.firm { background: var(--firm); border-color: var(--firm); color: #fff; }
.tone-pill.on.pro { background: var(--pro); border-color: var(--pro); color: #fff; }
#demo-pause { font-size: 13px; }

.tray-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin: 0 2px 0 10px; }
.tray-dot:first-child { margin-left: 0; }
.tray-dot.ready { background: var(--ready); }
.tray-dot.working { background: var(--working); animation: pulse 1s ease-in-out infinite; }
.tray-dot.error { background: var(--error); }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- sections ---------- */
.section { padding: 88px 0; }
.section.alt { background: var(--surface-2); }
.section-lead { color: var(--muted); font-size: 18px; max-width: 640px; margin-bottom: 36px; }
.center .section-lead { margin-left: auto; margin-right: auto; }
.note { margin-top: 20px; color: var(--muted); font-size: 14px; }

.steps { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step p { color: var(--muted); font-size: 15px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-weight: 800;
  margin-bottom: 14px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.feature p { color: var(--muted); }

.tone-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.tone-card {
  background: var(--surface); border: 1px solid var(--border); border-top: 4px solid; border-radius: var(--radius);
  padding: 24px;
}
.tone-card .keys { margin-bottom: 16px; }
.tone-card p { color: var(--muted); }
.tone-card.friendly { border-top-color: var(--friendly); }
.tone-card.firm { border-top-color: var(--firm); }
.tone-card.pro { border-top-color: var(--pro); }

/* ---------- setup ---------- */
.os-tabs { display: flex; gap: 6px; margin: 8px 0 28px; }
.os-tabs .chip { font-size: 15px; padding: 7px 18px; }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.setup-steps { list-style: none; margin: 0; padding: 0; counter-reset: setup; }
.setup-steps li { position: relative; padding: 0 0 26px 52px; counter-increment: setup; }
.setup-steps li::before {
  content: counter(setup); position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1.5px solid var(--border); font-weight: 800;
}
.setup-steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 17px; top: 36px; bottom: 4px; width: 1.5px; background: var(--border);
}
.setup-steps p { color: var(--muted); }

.mock-stack { position: relative; min-height: 620px; }
.mock-menu, .mock-window {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  font-size: 14px;
}
.mock-menu { position: absolute; left: 0; top: 0; width: 270px; padding: 6px; z-index: 2; }
.mock-menu::before {  /* the tray icon the menu opens from */
  content: ""; position: absolute; right: 22px; top: -26px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--ready);
}
.mock-menu-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; border-radius: 7px; }
.mock-menu-row.muted { color: var(--muted); }
.mock-menu-row.selected { background: var(--pro); color: #fff; }
.mock-sep { height: 1px; background: var(--border); margin: 5px 8px; }
.mock-window { position: absolute; right: 0; top: 315px; width: 340px; padding: 16px 18px; }
.mock-title { font-weight: 800; margin-bottom: 10px; }
.mock-tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; color: var(--muted); }
.mock-tabs span { padding-bottom: 7px; }
.mock-tabs .on { color: var(--text); border-bottom: 2px solid var(--pro); }
.mock-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-weight: 600; }
.mock-field {
  font-size: 12.5px; font-weight: 500; padding: 5px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); min-width: 130px; text-align: center;
}
.mock-field.recording { outline: 2px solid var(--pro); border-color: var(--pro); }
.mock-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.mock-btn { background: var(--pro); color: #fff; padding: 5px 16px; border-radius: 8px; font-weight: 600; }

.settings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 48px; }
.setting p { color: var(--muted); font-size: 15px; }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; color: var(--muted); font-size: 15px; }
.legend li { display: flex; align-items: baseline; gap: 10px; }
.legend .tray-dot { margin: 0; flex: none; }
.tray-dot.still { animation: none; }

/* ---------- pricing ---------- */
.price-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.price-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px;
}
.price-card.featured { border: 2px solid var(--accent); }
.badge {
  position: absolute; top: -12px; left: 22px; background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.price { font-size: 38px; font-weight: 800; margin: 8px 0 2px; letter-spacing: -0.02em; }
.price-sub { color: var(--muted); font-size: 14px; }

/* ---------- privacy, faq, download ---------- */
.privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.privacy .section-lead { margin-bottom: 0; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 34px; }
.checks li::before {
  content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
  background: color-mix(in srgb, var(--friendly) 18%, transparent); color: var(--friendly);
}
details { border-bottom: 1px solid var(--border); padding: 18px 0; }
summary { cursor: pointer; font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 22px; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); margin-top: 10px; }
.download { text-align: center; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0 36px; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }
.copyright { margin-left: auto; }

/* ---------- legal pages ---------- */
.legal { padding: 48px 0 80px; max-width: 780px; }
.legal h1 { font-size: 34px; margin-bottom: 8px; }
.legal h2 { font-size: 22px; margin: 36px 0 10px; }
.legal p, .legal li { color: var(--text); }
.legal p { margin: 10px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.legal th, .legal td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.draft-banner {
  background: color-mix(in srgb, var(--working) 18%, var(--surface)); padding: 12px 16px;
  border-radius: 10px; margin: 0 0 24px; font-size: 14px;
}
.simple-hero { padding: 96px 0; }
.simple-hero h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 16px; }
.simple-hero p { color: var(--muted); font-size: 18px; max-width: 620px; }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .hero-grid, .setup-grid, .privacy { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .steps, .settings-grid, .price-cards { grid-template-columns: repeat(2, 1fr); }
  .mock-stack { min-height: 620px; max-width: 560px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 40px 0 56px; }
  .section { padding: 64px 0; }
  .steps, .settings-grid, .price-cards, .feature-grid, .tone-cards { grid-template-columns: 1fr; }
  .mock-stack { min-height: 0; display: grid; gap: 16px; }
  .mock-menu, .mock-window { position: static; width: 100%; }
  .mock-menu::before { display: none; }
  .keyboard { padding: 7px; gap: 4px; }
  .kb-row { gap: 4px; }
  .kb-key { height: 30px; font-size: 10.5px; border-radius: 5px; }
  .kb-key.mod { font-size: 10px; }
  .kb-key .jamo { display: none; }
  .demo-steps li { padding: 6px 7px; font-size: 11.5px; gap: 5px; }
  .window-bar { flex-wrap: wrap; }
  .message { min-height: 170px; font-size: 15px; }
  .copyright { margin-left: 0; }
}

/* ---------- business details, policy pages ---------- */
.biz-info { flex-basis: 100%; margin: 4px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.to-fill { background: color-mix(in srgb, var(--working) 35%, transparent); color: var(--text); border-radius: 3px; padding: 0 3px; }
.legal-meta { color: var(--muted); font-size: 14px; }
.legal ol, .legal ul { padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal td, .legal th { font-size: 14px; }
.legal table { display: block; overflow-x: auto; }
.callout {
  margin: 20px 0; padding: 16px 18px; border-radius: 12px; line-height: 1.7;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
}
