/* Ma 間 — same tokens as the app (MaKit/Design.swift, theme "Washi"). */
:root {
  color-scheme: light dark;
  --bg: #faf7f2; --surface: #efeae2; --track: #e4ddd2; --text: #24211e; --muted: #6e675e;
  --ink: #2a2724; --on-ink: #faf7f2;
  --focus: #c0402a; --short: #2e7a5c; --long: #34558b;
  --radius: 20px; --max: 1080px;
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px; --s7: 104px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "PingFang SC", "Noto Sans", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Songti SC", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b1a; --surface: #2b2a28; --track: #3a3836; --text: #efe9df; --muted: #a39e97;
    --ink: #ede7de; --on-ink: #1c1b1a;
    --focus: #ee6a52; --short: #6cbf98; --long: #8da8d8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--focus); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--s3); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 var(--s3); }
.wrap { width: min(100% - 2 * var(--s3), var(--max)); margin-inline: auto; }
.muted { color: var(--muted); }
.kanji { font-family: var(--serif); color: var(--focus); letter-spacing: 0.05em; }
.skip { position: absolute; inset-inline-start: 8px; top: 8px; transform: translateY(-200%); background: var(--ink); color: var(--on-ink); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-block: var(--s3); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand .kanji { font-weight: 400; }
.top nav { display: flex; gap: var(--s4); align-items: center; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--text); }
@media (max-width: 640px) { .top nav .hide-sm { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 0; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover { color: var(--on-ink); opacity: 0.9; }
.btn-soft { background: var(--surface); color: var(--text); }
.btn svg { width: 20px; height: 20px; }

/* Hero timer */
.hero { text-align: center; padding-block: var(--s4) var(--s6); }
.hero-eyebrow { margin-bottom: var(--s2); font-size: 0.95rem; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.8rem); max-width: 20ch; margin-inline: auto; }
.timer { --tint: var(--focus); width: min(88vw, 440px); margin: var(--s4) auto var(--s4); }
.dial { position: relative; aspect-ratio: 1; }
.dial canvas { width: 100%; height: 100%; display: block; }
.dial-face { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.dial-kanji { font-family: var(--serif); color: var(--tint); font-size: clamp(1rem, 4vw, 1.35rem); }
.dial-label { text-transform: uppercase; letter-spacing: 0.25em; font-size: clamp(0.7rem, 2.6vw, 0.85rem); color: var(--muted); font-weight: 500; }
.dial-time { font-size: clamp(3.4rem, 17vw, 6.4rem); font-weight: 200; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 6px; }
.is-paused .dial-time { opacity: 0.45; }
.dots { display: flex; gap: 9px; justify-content: center; margin-top: 10px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--track); }
.dots i.on { background: var(--tint); }
.controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: var(--s4); }
.round { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.round:disabled { opacity: 0.35; cursor: default; }
.round.main { width: 80px; height: 80px; background: var(--ink); color: var(--on-ink); }
.round svg { width: 22px; height: 22px; fill: currentColor; }
.round.main svg { width: 28px; height: 28px; }
.round[data-state="play"] .i-pause, .round[data-state="pause"] .i-play { display: none; }
.round:active:not(:disabled) { transform: scale(0.94); }
.timer-meta { display: flex; justify-content: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); font-size: 0.9rem; }
.linkish { background: none; border: 0; padding: 8px; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--text); }
.keys { color: var(--muted); }
kbd { font: inherit; font-size: 0.8em; border: 1px solid var(--track); border-radius: 5px; padding: 0 5px; }
.get-app { margin-top: var(--s5); display: flex; flex-direction: column; align-items: center; gap: var(--s2); }

/* Sections */
section { padding-block: var(--s6); }
.section-head { max-width: 640px; margin-bottom: var(--s5); }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.pillars { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.pillar { background: var(--surface); border-radius: var(--radius); padding: var(--s4); }
.pillar .kanji { font-size: 1.6rem; display: block; margin-bottom: var(--s2); }
.pillar p { color: var(--muted); margin: 0; }
.features { display: grid; gap: var(--s5) var(--s4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.feature figure { margin: 0 0 var(--s3); background: var(--surface); border-radius: var(--radius); padding: var(--s3); }
.feature figure img { border-radius: 14px; margin-inline: auto; max-height: 420px; width: auto; }
.feature p { color: var(--muted); margin: 0; }
.list { display: grid; gap: var(--s2) var(--s4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); padding: 0; list-style: none; margin: var(--s5) 0 0; }
.list li { padding-inline-start: 22px; position: relative; }
.list li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.62em; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--focus); }

/* Themes */
.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s4); }
.themes figure { margin: 0; text-align: center; }
.themes img { border-radius: 22px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.12); }
.themes figcaption { margin-top: var(--s2); font-size: 0.95rem; }

/* Pricing */
.plans { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.plan { border-radius: var(--radius); padding: var(--s5) var(--s4); background: var(--surface); }
.plan.plus { background: var(--ink); color: var(--on-ink); }
.plan.plus .muted, .plan.plus li { color: color-mix(in srgb, var(--on-ink) 78%, transparent); }
.plan .price { font-size: 2.2rem; font-weight: 600; margin: var(--s2) 0; }
.plan .price small { font-size: 1rem; font-weight: 400; }
.plan ul { padding-inline-start: 1.1em; margin: var(--s3) 0 0; }
.plan li { margin-bottom: 6px; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--track); padding-block: var(--s3); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: var(--s3); }
.faq summary::after { content: "+"; color: var(--focus); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); margin: var(--s2) 0 0; }

/* Footer */
footer { padding-block: var(--s6) var(--s5); border-top: 1px solid var(--track); margin-top: var(--s6); font-size: 0.93rem; }
.foot { display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between; align-items: flex-start; }
.foot nav { display: flex; gap: var(--s3); flex-wrap: wrap; }
.foot a { color: var(--muted); }
.langs select { font: inherit; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--track); background: var(--bg); color: var(--text); }

/* Dialog */
dialog { border: 0; border-radius: var(--radius); padding: var(--s4); background: var(--bg); color: var(--text); width: min(92vw, 420px); box-shadow: 0 30px 80px rgb(0 0 0 / 0.3); }
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
dialog h2 { font-size: 1.3rem; }
.field { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding-block: 10px; border-bottom: 1px solid var(--track); }
.field input[type="number"] { width: 5.5em; font: inherit; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--track); background: var(--surface); color: var(--text); text-align: right; }
.field input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--focus); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s4); }
.hint { font-size: 0.85rem; color: var(--muted); margin-top: var(--s2); }

/* Text pages */
.page { max-width: 720px; padding-block: var(--s5) var(--s6); }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page h2 { font-size: 1.3rem; margin-top: var(--s5); }
.page li { margin-bottom: 6px; }
.lang-hint { background: var(--surface); text-align: center; padding: 10px var(--s3); font-size: 0.92rem; }
.lang-hint[hidden] { display: none; }

/* Scripts without letter case or with joined letters (Arabic, Devanagari, Bengali, CJK) */
html.other .dial-label { text-transform: none; letter-spacing: 0; font-size: clamp(0.85rem, 3vw, 1rem); }
html.other h1, html.other h2, html.other h3 { letter-spacing: 0; }
.dial-time, .kbd, input[type="number"] { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .field input[type="number"] { text-align: left; }

/* Contact form */
.contact { display: grid; gap: var(--s3); margin-top: var(--s4); }
.contact label { display: grid; gap: 6px; font-weight: 500; }
.contact input, .contact textarea { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--track); background: var(--surface); color: var(--text); width: 100%; }
.contact textarea { resize: vertical; min-height: 9em; }
.contact button { justify-self: start; }
.contact button:disabled { opacity: 0.5; }
.contact .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.form-status { min-height: 1.6em; margin: 0; }
.form-status.ok { color: var(--short); }
.form-status.err { color: var(--focus); }

/* 404 */
.notfound { text-align: center; padding-block: var(--s7); }
.nf-kanji { font-size: clamp(3rem, 12vw, 5rem); margin: 0 0 var(--s3); line-height: 1; }
[dir="rtl"] [data-skip] svg, [dir="rtl"] [data-reset] svg { transform: scaleX(-1); }
