/* ============================================================
   QRデコ — 公開サイト
   方針：外部フォント・外部スクリプト・解析タグを読み込まない
  （アプリの「通信しない」と同じ立場。プライバシーを謳うページが第三者へ接続しに行かない）。
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;

  --paper:   #f5f3ee;
  --paper-2: #ebe8e1;
  --paper-3: #dedbd2;
  --ink:     #101114;
  --ink-2:   #3b3d44;
  --muted:   #61646e;
  --line:    rgb(16 17 20 / .12);
  --line-2:  rgb(16 17 20 / .26);
  --accent:  #2448ff;
  --accent-ink: #ffffff;
  --accent-soft: rgb(36 72 255 / .10);
  --warn:    #8a4f00;
  --warn-soft: rgb(154 91 0 / .09);
  --band-bg: var(--ink);
  --band-fg: var(--paper);
  --band-fg-2: #c9c7c0;
  --tile-bg: #ffffff;
  --shadow:  0 1px 2px rgb(16 17 20 / .06), 0 12px 40px -12px rgb(16 17 20 / .18);

  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs--1: .875rem;
  --fs-0:  1.0625rem;
  --fs-1:  1.25rem;
  --fs-2:  1.5rem;
  --fs-3:  clamp(1.75rem, 1.25rem + 1.8vw, 2.375rem);
  --fs-4:  clamp(2.25rem, 1rem + 4.6vw, 4.75rem);

  --s-1: .5rem; --s0: 1rem; --s1: 1.5rem; --s2: 2rem; --s3: 3rem; --s4: 4rem;
  --section: clamp(4.5rem, 10vw, 9rem);
  --gutter:  clamp(1.25rem, 4vw, 2.5rem);
  --max:     72rem;
  --prose:   42rem;
  --radius:  1.125rem;
  --ease:    cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #0e0f12;
    --paper-2: #16181d;
    --paper-3: #22252c;
    --ink:     #ecebe6;
    --ink-2:   #c6c5bf;
    --muted:   #8d909a;
    --line:    rgb(236 235 230 / .13);
    --line-2:  rgb(236 235 230 / .28);
    --accent:  #8aa6ff;
    --accent-ink: #0e0f12;
    --accent-soft: rgb(138 166 255 / .14);
    --warn:    #f0c27a;
    --warn-soft: rgb(240 194 122 / .10);
    --band-bg: #ecebe6;
    --band-fg: #101114;
    --band-fg-2: #4a4c53;
    --tile-bg: #ffffff;
    --shadow:  0 1px 2px rgb(0 0 0 / .4), 0 16px 48px -12px rgb(0 0 0 / .6);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  hanging-punctuation: allow-end;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-0);
  line-height: 1.9;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.012em;
  font-feature-settings: "palt" 1, "kern" 1;
  text-wrap: balance;
}
h2 { font-size: var(--fs-3); }
/* 見出しは句の途中で折り返さない：.nw で区切った句の間だけで改行する（「テキス／トに。」を防ぐ） */
.nw { display: inline-block; white-space: nowrap; }
h1, h2, h3 { text-spacing-trim: trim-start; }
h3 { font-size: var(--fs-1); }
p  { margin: 0; text-wrap: pretty; overflow-wrap: anywhere; }
p + p { margin-top: 1em; }
a  { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
svg { display: block; }
strong { font-weight: 700; }
code { font-family: var(--mono); font-size: .92em; background: var(--paper-2); padding: .1em .4em; border-radius: .35em; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }
.prose { max-width: var(--prose); }
.eyebrow {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .1em;
  color: var(--muted);
}
.skip {
  position: absolute; left: var(--gutter); top: -3rem;
  background: var(--ink); color: var(--paper); padding: .5rem .9rem; border-radius: .5rem;
  text-decoration: none; z-index: 100; transition: top .2s;
}
.skip:focus { top: .75rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: var(--s2); min-height: 3.75rem; }
.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.01em;
}
.brand .mark { width: 1.2rem; height: 1.2rem; }
.site-nav { margin-left: auto; display: flex; gap: clamp(1.1rem, 3vw, 2rem); }
.site-nav a {
  position: relative; color: var(--ink-2); text-decoration: none;
  font-size: var(--fs--1); font-weight: 500; padding: .4rem 0;
}
.site-nav a::after {
  content: ""; position: absolute; inset: auto 0 .1rem 0; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: clamp(3rem, 7vw, 6.5rem) var(--section); isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 65% 40%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 80% at 65% 40%, #000 0%, transparent 70%);
  opacity: .9;
}
.hero .wrap { display: grid; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
@media (min-width: 60em) { .hero .wrap { grid-template-columns: 1.12fr .88fr; } }
.hero h1 { font-size: var(--fs-4); margin-top: var(--s0); line-height: 1.16; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { font-size: var(--fs-1); color: var(--ink-2); max-width: 32em; margin-top: var(--s1); line-height: 1.8; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s0); align-items: center; margin-top: var(--s2); }
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: var(--fs-0);
  text-decoration: none; transition: transform .25s var(--ease), background .25s, border-color .25s;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { color: var(--ink); border-color: var(--line-2); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.btn svg { width: 1.05em; height: 1.05em; }
@media (max-width: 30em) { .cta-row .btn { flex: 1 1 100%; justify-content: center; } }
.hero-note { margin-top: var(--s1); font-size: var(--fs--1); color: var(--muted); }

/* 見出し・本文の入場（一度きり） */
.enter { opacity: 0; transform: translateY(10px); animation: enter .8s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes enter { to { opacity: 1; transform: none; } }

/* ---------- demo（本物のQR3枚） ---------- */
.demo { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.6rem, 2vw, 1rem); }
.tile { display: grid; gap: .45rem; }
.tile .qr {
  position: relative; overflow: hidden;
  background: var(--tile-bg); border-radius: .9rem; padding: 12%;   /* クワイエットゾーン≒2モジュール以上 */
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px) scale(.985);
  animation: tile-in .7s var(--ease) forwards;
  animation-delay: calc(.25s + var(--i) * .22s);
}
.tile .qr > svg { width: 100%; height: auto; color: #000; shape-rendering: crispEdges; }
.tile-label {
  display: flex; align-items: center; justify-content: space-between; padding-inline: .15rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; color: var(--muted);
}
.tile .scan {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--accent); box-shadow: 0 0 14px 2px var(--accent); opacity: 0;
  animation: scan .55s linear forwards;
  animation-delay: calc(1.0s + var(--i) * .42s);
}
.tile .ok {
  width: 1rem; height: 1rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; opacity: 0; transform: scale(.6);
  animation: pop .35s var(--ease) forwards;
  animation-delay: calc(1.45s + var(--i) * .42s);
}
.tile .ok svg { width: .62rem; height: .62rem; color: var(--accent-ink); }
@keyframes tile-in { to { opacity: 1; transform: none; } }
@keyframes scan { 0% { opacity: 1; top: 0; } 100% { opacity: 0; top: 100%; } }
@keyframes pop { to { opacity: 1; transform: none; } }
.restored {
  margin-top: var(--s1); padding: var(--s0) var(--s1);
  border: 1px dashed var(--line-2); border-radius: .9rem; background: transparent;
  font-feature-settings: "palt" 1; line-height: 1.7;
  animation: slot-fill .6s var(--ease) forwards; animation-delay: 2.65s;
}
.restored .t { display: block; opacity: 0; transform: translateY(6px); animation: enter .7s var(--ease) forwards; animation-delay: 2.75s; }
@keyframes slot-fill { to { border-style: solid; border-color: var(--line); background: var(--paper-2); } }
.restored .k { display: flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; color: var(--muted); margin-bottom: .35rem; }
.restored .k b { font-weight: 600; color: var(--accent); }
.demo figcaption { margin-top: var(--s0); font-size: var(--fs--1); color: var(--muted); line-height: 1.7; }
@media (prefers-reduced-motion: reduce) {
  .enter, .tile, .tile .ok, .restored .t { animation: none; opacity: 1; transform: none; }
  .restored { animation: none; border-style: solid; border-color: var(--line); background: var(--paper-2); }
  .tile .scan { display: none; }
}

/* ---------- sections ---------- */
section { padding-block: var(--section); }
section + section { padding-top: 0; }
.section-head { margin-bottom: var(--s3); }
.section-head p { margin-top: var(--s0); color: var(--ink-2); max-width: var(--prose); }

/* features */
.features { display: grid; gap: var(--s0); list-style: none; margin: 0; padding: 0; }
@media (min-width: 48em) { .features { grid-template-columns: repeat(2, 1fr); } }
.card {
  position: relative; padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card .head { display: flex; align-items: center; justify-content: space-between; gap: var(--s0); }
.card .ico { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: .85rem; background: var(--accent-soft); color: var(--accent); }
.card .ico svg { width: 1.5rem; height: 1.5rem; }
.card .num { font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; color: var(--muted); }
.card h3 { margin-top: 1rem; }
.card p { margin-top: .75rem; color: var(--ink-2); font-size: var(--fs-0); line-height: 1.8; }

/* band（通信しません） */
.band { background: var(--band-bg); color: var(--band-fg); padding-block: var(--section); }
.band .wrap { display: grid; gap: var(--s3); }
@media (min-width: 60em) { .band .wrap { grid-template-columns: 1.1fr .9fr; align-items: start; } }
.band .big { font-size: var(--fs-4); line-height: 1.12; letter-spacing: -.02em; }
.band .big .thin { font-weight: 400; opacity: .55; }
.band p { color: var(--band-fg-2); }
.band a { color: inherit; }
.proof { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s0); }
.proof li { display: grid; grid-template-columns: 1.25rem 1fr; gap: .9rem; align-items: start; padding: var(--s0) 0; border-top: 1px solid rgb(128 128 128 / .35); border-top-color: color-mix(in srgb, var(--band-fg) 18%, transparent); }
.proof li:last-child { border-bottom: 1px solid rgb(128 128 128 / .35); border-bottom-color: color-mix(in srgb, var(--band-fg) 18%, transparent); }
.proof .mark { width: 1.25rem; height: 1.25rem; margin-top: .45rem; }
.proof b { display: block; font-weight: 700; color: var(--band-fg); }
.proof span { color: var(--band-fg-2); font-size: var(--fs--1); line-height: 1.7; }

/* pricing */
.plans { display: grid; gap: var(--s0); grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.plan { padding: clamp(1.4rem, 3vw, 2rem); border-radius: var(--radius); border: 1px solid var(--line); }
.plan.pro { background: var(--paper-2); }
.plan .k { font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; color: var(--muted); }
.plan .price { font-size: var(--fs-3); font-weight: 700; letter-spacing: -.02em; margin-top: .35rem; line-height: 1.2; }
.plan .price small { font-size: .5em; font-weight: 500; color: var(--muted); margin-left: .35em; }
.plan ul { margin: var(--s1) 0 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.plan li { display: grid; grid-template-columns: 1.1rem 1fr; gap: .6rem; color: var(--ink-2); line-height: 1.7; }
.plan li svg { width: 1.1rem; height: 1.1rem; margin-top: .4rem; color: var(--accent); }
.plan .foot { margin-top: var(--s1); font-size: var(--fs--1); color: var(--muted); line-height: 1.7; }

/* spec（定義リスト） */
.spec { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0 var(--s2); border-top: 1px solid var(--line); }
.spec dt, .spec dd { margin: 0; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--muted); font-size: var(--fs--1); white-space: nowrap; }
.spec dd { color: var(--ink-2); }
@media (max-width: 32em) { .spec { grid-template-columns: 1fr; } .spec dt { padding-bottom: 0; border: 0; } }

/* note */
.note {
  display: grid; grid-template-columns: 1.25rem 1fr; gap: .8rem; align-items: start;
  background: var(--warn-soft); border-left: 3px solid var(--warn); border-radius: .6rem;
  padding: .95rem 1.1rem; font-size: var(--fs--1); line-height: 1.75; color: var(--ink-2);
}
.note svg { width: 1.25rem; height: 1.25rem; color: var(--warn); margin-top: .25rem; }
.note b { color: var(--warn); }

/* ---------- doc pages ---------- */
.doc-head { padding-block: clamp(2.5rem, 6vw, 5rem) var(--s3); border-bottom: 1px solid var(--line); }
.doc-head h1 { font-size: var(--fs-3); margin-top: var(--s0); }
.doc-head .meta { margin-top: var(--s0); font-size: var(--fs--1); color: var(--muted); }
.doc { display: grid; gap: var(--s4); padding-block: var(--s3) var(--section); }
@media (min-width: 60em) { .doc { grid-template-columns: 14rem minmax(0, var(--prose)); gap: var(--s4); } }
.toc { position: sticky; top: 5rem; align-self: start; font-size: var(--fs--1); }
.toc .k { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: .3rem 0 .3rem .9rem; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; margin-left: -1px; }
.toc a:hover { color: var(--ink); border-left-color: var(--line-2); }
.toc a[aria-current="location"] { color: var(--ink); border-left-color: var(--accent); }
@media (max-width: 59.99em) { .toc { position: static; } .toc ol { display: flex; flex-wrap: wrap; gap: .25rem .9rem; border: 0; } .toc a { padding: .2rem 0; border: 0; margin: 0; } }
.doc article h2 { font-size: var(--fs-2); margin-top: var(--s4); padding-top: var(--s2); border-top: 1px solid var(--line); scroll-margin-top: 5rem; }
.doc article h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.doc article h2 + p, .doc article h2 + .summary, .doc article h2 + dl, .doc article h2 + details { margin-top: var(--s0); }
.doc article p + .note, .doc article dl + p, .doc article p + dl { margin-top: var(--s1); }
.summary { padding: clamp(1.2rem, 3vw, 1.75rem); border-radius: var(--radius); background: var(--paper-2); }
.summary ul { margin: .5rem 0 0; padding-left: 1.2em; }
.summary li + li { margin-top: .35rem; }

/* contact */
.contact { padding: clamp(1.4rem, 3vw, 2rem); border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper-2); }
.contact .addr { font-size: var(--fs-2); font-weight: 700; letter-spacing: -.01em; margin-top: .35rem; word-break: break-all; }
.contact .addr a { color: var(--ink); text-decoration-color: var(--accent); }
.contact p.small { margin-top: var(--s0); font-size: var(--fs--1); color: var(--muted); }

/* faq */
.faq { display: grid; gap: .5rem; margin-top: var(--s1); }
details { border: 1px solid var(--line); border-radius: .9rem; background: var(--paper); transition: border-color .3s; }
details[open] { border-color: var(--line-2); }
details { interpolate-size: allow-keywords; }
details::details-content { block-size: 0; overflow: hidden; transition: block-size .4s var(--ease), content-visibility .4s allow-discrete; }
details[open]::details-content { block-size: auto; }
summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr 1.5rem; gap: var(--s0); align-items: center;
  padding: 1rem 1.2rem; font-weight: 600; line-height: 1.6;
}
summary::-webkit-details-marker { display: none; }
summary .plus { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; transition: transform .35s var(--ease), background .3s; }
summary .plus svg { width: .8rem; height: .8rem; }
details[open] summary .plus { transform: rotate(45deg); background: var(--ink); color: var(--paper); border-color: var(--ink); }
details .body { padding: 0 1.2rem 1.1rem; color: var(--ink-2); }
details .body p + p { margin-top: .6em; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s3) var(--s4); font-size: var(--fs--1); color: var(--muted); }
.site-footer .wrap { display: grid; gap: var(--s1); }
@media (min-width: 48em) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: end; } }
.site-footer .brand { color: var(--ink); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s1); }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); }
.site-footer .tag { margin-top: .5rem; }

/* ---------- scroll reveal（JSがあるときだけ・無ければ常に表示） ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- 404 ---------- */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding-block: var(--section); }
.lost .mark { width: 3rem; height: 3rem; margin-inline: auto; }
.lost h1 { font-size: var(--fs-3); margin-top: var(--s1); }
.lost p { margin-top: var(--s0); color: var(--ink-2); }

/* ---------- print（プライバシーポリシーを印刷・PDF化する人向け） ---------- */
@media print {
  :root { --paper: #fff; --paper-2: #f4f4f4; --ink: #000; --ink-2: #222; --muted: #555; --line: #ccc; --warn-soft: #fafafa; --warn: #333; }
  .site-header, .site-footer, .toc, .skip { display: none !important; }
  body { font-size: 11pt; line-height: 1.6; }
  .doc { display: block; }
  a { color: inherit; text-decoration: none; }
  .summary { border: 1px solid #ccc; }
}
