/* FlickDuo — site styles. No external dependencies. */
:root {
  --indigo: #2F4F8A;
  --indigo-d: #243E6E;
  --indigo-l: #7A9BE0;
  --ink: #1C1C1E;
  --sub: #5F5F66;
  --paper: #F2F3F6;
  --white: #FFFFFF;
  --line: rgba(0, 0, 0, 0.10);
  --crease: linear-gradient(90deg, rgba(0,0,0,0.18), rgba(0,0,0,0.04) 50%, rgba(255,255,255,0.9) 51%, rgba(255,255,255,0) 100%);

  /* keyboard (light) — docs/design.md 3.2 */
  --kb-bg: #D4D7DD;
  --kb-key: #FFFFFF;
  --kb-key-down: #EDEFF3;
  --kb-fn: #AEB4BE;
  --kb-fn-down: #FFFFFF;
  --kb-ink: #1C1C1E;
  --kb-hint: rgba(28, 28, 30, 0.38);
  --kb-shadow: rgba(0, 0, 0, 0.30);
  --kb-sep: rgba(0, 0, 0, 0.10);
  --kb-accent: #2F4F8A;
  --kb-on-accent: #FFFFFF;
  --kb-panel: #F2F3F6;

  --col: 1120px;
  --gutter: clamp(16px, 6vw, 48px);
  --font-ja: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-display: "Avenir Next", "Helvetica Neue", -apple-system, "Hiragino Sans", sans-serif;
}

.theme-dark {
  --kb-bg: #2A2A2D;
  --kb-key: #6A6A6E;
  --kb-key-down: #8B8B90;
  --kb-fn: #46464A;
  --kb-fn-down: #6A6A6E;
  --kb-ink: #F2F2F7;
  --kb-hint: rgba(242, 242, 247, 0.42);
  --kb-shadow: rgba(0, 0, 0, 0.45);
  --kb-sep: rgba(255, 255, 255, 0.12);
  --kb-accent: #7A9BE0;
  --kb-on-accent: #0E1424;
  --kb-panel: #1C1C1E;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.9;
  font-feature-settings: "palt";
  overflow-x: hidden;
}
a { color: inherit; }
img, svg { display: block; }
button { font: inherit; color: inherit; }

/* language switch */
html[data-lang="ja"] .en { display: none !important; }
html[data-lang="en"] .ja { display: none !important; }
html[data-lang="en"] body { font-family: var(--font-display); line-height: 1.7; }
html[data-lang="en"] .h1, html[data-lang="en"] .h2 { letter-spacing: -0.01em; }

.wrap { max-width: var(--col); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(242, 243, 246, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: 0.02em; }
.mark-fold { width: 18px; height: 22px; position: relative; }
.mark-fold::before, .mark-fold::after { content: ""; position: absolute; top: 0; bottom: 0; width: 8px; border-radius: 2px; background: var(--indigo); }
.mark-fold::before { left: 0; transform: skewY(8deg); opacity: 0.72; }
.mark-fold::after { right: 0; transform: skewY(-8deg); }
.nav { display: flex; gap: 22px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--sub); }
.nav a:hover { color: var(--ink); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--white); }
.lang button { border: 0; background: transparent; padding: 5px 11px; font-size: 12px; letter-spacing: 0.06em; color: var(--sub); cursor: pointer; min-height: 30px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
@media (max-width: 720px) { .nav { display: none; } }

/* type */
.eyebrow { font-size: 13px; letter-spacing: 0.08em; color: var(--indigo); margin: 0 0 14px; font-weight: 600; }
.h1 { font-size: clamp(34px, 5.6vw, 60px); line-height: 1.22; margin: 0; font-weight: 600; letter-spacing: 0.01em; }
.h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.3; margin: 0 0 18px; font-weight: 600; }
.lead { font-size: clamp(16px, 1.6vw, 18px); color: var(--ink); margin: 20px 0 0; max-width: 34em; }
.body { color: var(--sub); max-width: 34em; margin: 0; }
.body + .body { margin-top: 12px; }
.body b { color: var(--ink); font-weight: 600; }
.note { font-size: 13px; color: var(--sub); margin: 14px 0 0; }
.cap { font-size: 13px; color: var(--sub); margin: 12px 0 0; line-height: 1.7; }

/* crease — the signature. a vertical paper fold the headings hang from */
.crease { position: relative; padding-left: 28px; }
.crease::before { content: ""; position: absolute; left: 0; top: 0.35em; bottom: 0.35em; width: 6px; border-radius: 1px; background: var(--crease); }

/* sections */
.sec { padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); }
.sec:first-of-type { border-top: 0; }
.grid { display: grid; gap: clamp(28px, 5vw, 72px); align-items: center; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.grid.rev > .fig-wrap { order: -1; }
@media (max-width: 860px) { .grid, .grid.rev { grid-template-columns: minmax(0, 1fr); } .grid.rev > .fig-wrap { order: 0; } }
.stack { display: grid; gap: clamp(28px, 4vw, 48px); }

/* hero */
.hero { padding: clamp(56px, 8vw, 110px) 0 clamp(56px, 7vw, 96px); }
.hero-grid { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
.badge-row { display: flex; align-items: center; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--white); border-radius: 10px; padding: 10px 16px 10px 12px;
  text-decoration: none; min-height: 48px; opacity: 0.92; cursor: default;
}
.badge-ico { width: 22px; height: 22px; }
.badge small { display: block; font-size: 10px; letter-spacing: 0.04em; opacity: 0.8; line-height: 1.2; }
.badge span { display: block; font-size: 16px; font-weight: 600; line-height: 1.2; font-family: var(--font-display); }
.badge-note { font-size: 13px; color: var(--sub); }

/* hand switch */
.hand { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--white); overflow: hidden; margin-top: 18px; }
.hand button { border: 0; background: transparent; padding: 9px 18px; min-height: 44px; cursor: pointer; font-size: 14px; color: var(--sub); }
.hand button[aria-pressed="true"] { background: var(--indigo); color: var(--white); }

/* figures: drawn at native pt size and scaled to fit */
.fig-wrap { min-width: 0; }
.fig { position: relative; width: 100%; overflow: hidden; touch-action: pan-y; }
.fig > .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.device {
  background: #000; border-radius: 22px; padding: 10px;
}
.screen { background: #fff; border-radius: 14px; overflow: hidden; position: relative; }
.screen-body { padding: 20px 20px 0; min-height: 120px; color: var(--ink); font-size: 17px; line-height: 1.6; }
.screen-body .line { display: inline-block; position: relative; }
.caret { display: inline-block; width: 2px; height: 1.15em; background: var(--indigo); vertical-align: -0.2em; margin-left: 1px; }
.composing { text-decoration: underline; text-decoration-color: var(--indigo); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* keyboard primitives (1pt = 1px at scale 1) */
.kb { position: relative; background: var(--kb-bg); color: var(--kb-ink); font-family: var(--font-ja); user-select: none; -webkit-user-select: none; }
.bar { height: 44px; display: flex; align-items: center; position: relative; }
.bar-btn { width: 36px; height: 44px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.bar-btn.paste { width: 40px; }
.bar-btn svg { width: 18px; height: 18px; stroke: var(--kb-ink); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cands { flex: 1; display: flex; overflow: hidden; height: 44px; align-items: stretch; }
.cand { padding: 0 12px; min-width: 44px; display: flex; align-items: center; justify-content: center; font-size: 17px; white-space: nowrap; position: relative; gap: 4px; }
.cand + .cand::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 1px; background: var(--kb-sep); }
.cand svg { width: 13px; height: 13px; stroke: var(--kb-ink); fill: none; stroke-width: 1.6; stroke-linecap: round; }
.bar-msg { position: absolute; left: 0; right: 0; top: 0; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 13px; }

.block { position: absolute; }
.key {
  position: absolute; height: 48px; border-radius: 11px; background: var(--kb-key);
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; line-height: 1; font-weight: 400; color: var(--kb-ink);
}
.key.fn { font-size: 15px; font-weight: 500; }
.key.fn svg { width: 20px; height: 20px; stroke: var(--kb-ink); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.key.small { font-size: 15px; }
.key.sym { font-size: 17px; }
.key.down, .key.fn.down { background: var(--kb-key-down); }
.key.center, .key.fn.center { background: #0086FE; color: #fff; border-radius: 0; }
.block.petals .key:not(.center) { color: var(--kb-hint); }
.block.petals .key.fn svg { opacity: 0.38; }
.key.accent { background: var(--kb-accent); color: var(--kb-on-accent); }
.key.tall { height: 102px; }

.emoji-grid { position: absolute; display: grid; }
.emoji-cell { display: flex; align-items: center; justify-content: center; font-size: 24px; height: 48px; position: relative; }
.emoji-cell.down::before { content: ""; position: absolute; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,0.08); }
.theme-dark .emoji-cell.down::before { background: rgba(255,255,255,0.12); }

.home-ind { position: absolute; left: 50%; bottom: 8px; width: 134px; height: 5px; border-radius: 3px; background: rgba(0,0,0,0.28); transform: translateX(-50%); }
.theme-dark .home-ind { background: rgba(255,255,255,0.5); }
.fold { position: absolute; top: 0; bottom: 0; width: 2px; background: linear-gradient(90deg, rgba(0,0,0,0.22), rgba(255,255,255,0.35)); }
.fold::before { content: ""; position: absolute; top: 0; bottom: 0; left: -14px; width: 30px; background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.10) 48%, rgba(0,0,0,0) 100%); }

/* flick petals: same look as the system keyboard. White, no gaps, only the outer corners are round */
.petal { position: absolute; height: 48px; background: var(--kb-key); display: flex; align-items: center; justify-content: center; font-size: 23px; color: var(--kb-ink); }
.petal.t { border-radius: 11px 11px 0 0; } .petal.b { border-radius: 0 0 11px 11px; }
.petal.l { border-radius: 11px 0 0 11px; } .petal.r { border-radius: 0 11px 11px 0; }
.petal.on { background: #0086FE; color: #fff; }

/* adjust mode */
.dim { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
.frame { position: absolute; border: 2px solid var(--kb-accent); border-radius: 10px; }
.handle { position: absolute; top: 50%; width: 12px; height: 44px; border-radius: 6px; background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,0.3); transform: translateY(-50%); }
.round { position: absolute; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; top: 50%; transform: translateY(-50%); }
.round svg { width: 22px; height: 22px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.round.undo { background: #fff; } .round.undo svg { stroke: var(--kb-ink); }
.round.ok { background: var(--kb-accent); } .round.ok svg { stroke: #fff; }

/* candidate grid */
.cgrid { position: absolute; display: grid; grid-template-columns: repeat(4, 1fr); }
.cgrid > div { height: 44px; display: flex; align-items: center; justify-content: center; font-size: 17px; border-right: 1px solid var(--kb-sep); border-bottom: 1px solid var(--kb-sep); white-space: nowrap; overflow: hidden; }
.cgrid > div:nth-child(4n) { border-right: 0; }
.cgrid > div svg { width: 18px; height: 18px; stroke: var(--kb-ink); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* phrase panel */
.panel { position: absolute; background: var(--kb-panel); }
.seg { position: absolute; top: 8px; left: 12px; right: 12px; height: 32px; border-radius: 8px; background: rgba(0,0,0,0.06); display: flex; padding: 2px; font-size: 13px; }
.seg > div { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.seg > div.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.prow { position: absolute; left: 0; right: 0; height: 44px; display: flex; align-items: center; padding: 0 16px; font-size: 17px; border-bottom: 1px solid rgba(0,0,0,0.08); white-space: nowrap; overflow: hidden; }
.prow span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.prow svg { width: 13px; height: 13px; stroke: var(--kb-hint); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.prow.foot { font-size: 13px; justify-content: space-between; border-bottom: 0; }
.prow.foot svg { stroke: var(--kb-ink); width: 15px; height: 15px; }
.prow.foot div { display: flex; align-items: center; gap: 6px; }

/* feature triplet */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: 36px; }
@media (max-width: 860px) { .trio { grid-template-columns: minmax(0, 1fr); } }
.trio h3 { font-size: 17px; margin: 18px 0 6px; font-weight: 600; }
.trio p { margin: 0; color: var(--sub); font-size: 14px; }

/* statement */
.statement { background: var(--ink); color: var(--paper); }
.statement .h2 { color: #fff; }
.statement .body { color: rgba(242,243,246,0.78); }
.statement .body b { color: #fff; }
.statement .crease::before { background: linear-gradient(90deg, rgba(0,0,0,0.6), rgba(0,0,0,0.1) 50%, rgba(255,255,255,0.35) 51%, rgba(255,255,255,0) 100%); }
.statement .eyebrow { color: var(--indigo-l); }
.perm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
@media (max-width: 600px) { .perm { grid-template-columns: minmax(0, 1fr); } }
.perm div { border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 18px 20px; }
.perm h3 { margin: 0 0 8px; font-size: 15px; color: #fff; font-weight: 600; }
.perm p { margin: 0; font-size: 14px; color: rgba(242,243,246,0.78); }

/* faq */
.faq { max-width: 760px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 36px 18px 0; list-style: none; font-weight: 600; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 1.5px solid var(--sub); border-bottom: 1.5px solid var(--sub); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .a { padding: 0 0 20px; color: var(--sub); max-width: 40em; }
.faq .a p { margin: 0; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 48px 0 56px; font-size: 13px; color: var(--sub); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: minmax(0, 1fr); } }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.08em; color: var(--ink); font-weight: 600; }
.foot .legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.8; }

/* legal pages */
.doc { max-width: 760px; padding-top: clamp(40px, 6vw, 72px); padding-bottom: 96px; }
.doc h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px; line-height: 1.3; }
.doc .meta { color: var(--sub); font-size: 14px; margin: 0 0 36px; }
.doc h2 { font-size: 20px; margin: 44px 0 12px; }
.doc h3 { font-size: 16px; margin: 24px 0 8px; }
.doc p, .doc li { color: var(--ink); }
.doc ul { padding-left: 1.3em; }
.doc li { margin: 4px 0; }
.doc .todo { background: #FFF3C4; color: #5a4a00; padding: 1px 6px; border-radius: 4px; font-size: 0.92em; }
.doc .toc { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; background: #fff; font-size: 14px; }
.doc .toc ol { margin: 0; padding-left: 1.4em; columns: 2; column-gap: 24px; }
@media (max-width: 600px) { .doc .toc ol { columns: 1; } }
.doc .toc a { text-decoration: none; color: var(--sub); }
.doc .biz { border-top: 1px solid var(--line); padding-top: 20px; }
.doc .biz dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.doc .biz dt { color: var(--sub); }
.doc .biz dd { margin: 0; }

:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
