/* RimeLingo product site. Colours follow the app icon: ink blue on paper. */
:root {
  color-scheme: light dark;
  --paper: #f6f4ef;
  --surface: #fdfcfa;
  --surface-2: #efece4;
  --line: #e0dbd0;
  --text: #222220;
  --muted: #555a61;
  --ink: #1f3a5f;
  --ink-soft: #dfe6ef;
  --link: #1f3a5f;
  --on-ink: #f6f4ef;
  --focus: #2f6fbf;
  --shadow: 0 1px 2px rgb(31 58 95 / 6%), 0 8px 28px rgb(31 58 95 / 8%);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10161e;
    --surface: #17202b;
    --surface-2: #1d2835;
    --line: #2b3746;
    --text: #ebe8e1;
    --muted: #a7afba;
    --ink: #f6f4ef;
    --ink-soft: #24344a;
    --link: #a9c4e6;
    --on-ink: #1f3a5f;
    --focus: #8fb6ea;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px rgb(0 0 0 / 35%);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 17px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
:lang(en) body, body:lang(en) { line-height: 1.6; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { line-height: 1.3; margin: 0; color: var(--text); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); letter-spacing: 0.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0; }

kbd {
  font: inherit;
  font-size: 0.92em;
  white-space: nowrap;
  padding: 0.05em 0.45em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
}

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: 16px; top: -48px; z-index: 10; padding: 8px 14px; background: var(--ink); color: var(--on-ink); border-radius: 8px; }
.skip:focus { top: 12px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 12px 20px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); text-decoration: none; margin-right: auto; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.nav a:hover { color: var(--text); }
.lang { font-size: 0.9rem; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); }
@media (max-width: 640px) { .nav .opt { display: none; } }

/* Hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px); }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 920px) { .hero .wrap { grid-template-columns: 1fr 1.05fr; } }
.eyebrow { color: var(--muted); font-size: 0.95rem; margin-bottom: 10px; }
.hero h1 { font-size: clamp(2.3rem, 1.6rem + 3vw, 3.4rem); letter-spacing: 0.02em; }
.hero h1 span { display: block; font-size: 0.42em; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; margin-top: 4px; }
.lead { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.35rem); margin-top: 20px; max-width: 30em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 12px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-1px); text-decoration: none; }
.btn-secondary { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-secondary:hover { border-color: var(--muted); text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn-primary:hover { transform: none; } }
.fine { color: var(--muted); font-size: 0.9rem; margin-top: 14px; }

/* Live translation demo */
.demo { margin: 0; }
.demo-window { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 0.85rem; color: var(--muted); }
.demo-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.demo-bar b { font-weight: 500; margin-left: 8px; }
.demo-body { padding: 22px 18px 24px; min-height: 250px; }
.demo-field { min-height: 3.6em; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 1.02rem; line-height: 1.7; }
.demo-text.is-composing { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 0.25em; }
.caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 1px; vertical-align: -0.2em; background: var(--focus); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-preview { margin-top: 10px; max-width: 413px; transition: opacity 0.25s ease, transform 0.25s ease; }
.demo-preview img { filter: drop-shadow(0 6px 16px rgb(31 58 95 / 14%)); }
.demo-preview[hidden] { display: block; visibility: hidden; opacity: 0; transform: translateY(-4px); }
.demo-preview .alt-lang { display: none; }
.demo.lang-ja .demo-preview .main-lang { display: none; }
.demo.lang-ja .demo-preview .alt-lang { display: block; }
.demo-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 16px; color: var(--muted); font-size: 0.92rem; }
.demo-steps span { display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s ease; }
.demo-steps span.is-active { color: var(--text); }
.demo-steps span.is-active kbd { border-color: var(--focus); background: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } .demo-preview, .demo-steps span { transition: none; } }

/* Sections */
section { scroll-margin-top: 16px; }
.section { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 40em; margin-bottom: 40px; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 1.05rem; }

.feature { display: grid; gap: 22px 56px; align-items: center; padding: 28px 0; }
.feature + .feature { border-top: 1px dashed var(--line); }
@media (min-width: 860px) {
  .feature { grid-template-columns: 1fr 1.25fr; padding: 40px 0; }
  .feature.flip .feature-text { order: 2; }
  /* Settings crops are shown at their own size, below the text, so they stay legible. */
  .feature.wide { grid-template-columns: 1fr; }
}
.feature.wide .feature-text { max-width: 40em; }
.feature-text p { margin-top: 12px; color: var(--muted); }
.feature-text p strong { color: var(--text); font-weight: 600; }
.feature-media { display: flex; justify-content: center; }
.feature-media img { border-radius: 12px; }
.feature-media.window img { box-shadow: var(--shadow); }
.feature-media.panel img { filter: drop-shadow(0 6px 18px rgb(31 58 95 / 14%)); }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.card p { color: var(--muted); font-size: 0.98rem; }
.card figure { margin: 6px 0 0; display: flex; justify-content: center; }
.card figure.crop img { border-radius: 10px; border: 1px solid var(--line); }

/* Install */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: step; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before {
  content: counter(step); display: inline-grid; place-items: center; width: 32px; height: 32px; margin-bottom: 12px;
  border-radius: 50%; background: var(--ink); color: var(--on-ink); font-weight: 700;
}
.steps p { color: var(--muted); margin-top: 6px; font-size: 0.98rem; }
.install-shots { display: grid; gap: 18px; margin-top: 28px; align-items: start; justify-items: center; }
@media (min-width: 860px) { .install-shots { grid-template-columns: 1.4fr 1fr; } }
.install-shots figure { margin: 0; }
.install-shots img { border-radius: 12px; box-shadow: var(--shadow); }
.install-shots figcaption { color: var(--muted); font-size: 0.9rem; text-align: center; margin-top: 10px; }
.note { margin-top: 24px; color: var(--muted); }

/* Requirements and privacy */
.two { display: grid; gap: 18px; }
@media (min-width: 860px) { .two { grid-template-columns: 1fr 1fr; } }
.two h2 { font-size: 1.45rem; }
.two ul { margin: 12px 0 0; padding-left: 1.2em; color: var(--muted); }
.two li + li { margin-top: 6px; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style-position: inside; }
.faq summary::marker { color: var(--muted); }
.faq details p { padding: 0 0 18px; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: grid; gap: 10px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 14px; padding: 48px 0; }
.notfound img { margin-inline: auto; }
.notfound .actions { justify-content: center; }
