/* dopakagi.com: built on the app's design system. Tokens come from assets/tokens.css
   (generated from design/system/tokens.json by scripts/tokens.py). */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--surface); color: var(--text-primary);
  font-family: var(--font-words); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
strong { font-weight: 500; }
.jp, [lang="ja"] { font-family: var(--font-jp); }
.label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-secondary);
}
.soft { color: var(--text-secondary); }
:focus-visible { outline: 2px solid var(--brand-glow-mid); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--surface-inverse); color: var(--text-on-inverse); padding: 10px 14px; border-radius: var(--radius-medium); }
.skip-link:focus { left: 12px; }

.container {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(var(--space-l), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-l), env(safe-area-inset-right, 0px));
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color var(--motion-state) ease;
}
.site-header.scrolled { border-bottom-color: var(--line-hairline); }
.site-header .container { display: flex; align-items: center; gap: var(--space-l); height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.brand span { font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.site-nav { display: flex; gap: var(--space-l); }
.site-nav a {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-secondary); text-decoration: none; padding: 14px 0;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text-primary); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
@media (max-width: 720px) { .site-nav .optional { display: none; } .site-nav { gap: var(--space-m); } }

/* ---------- Buttons (the app's pill) ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 28px; border-radius: var(--radius-capsule); border: 0;
  font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--surface-inverse); color: var(--text-on-inverse);
  transition: transform var(--motion-tap) var(--ease-out);
}
.pill:active { transform: scale(.97); }
.pill.outlined { background: transparent; color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--line-strong); }
.pill.raised { background: var(--surface-raised); color: #111110; box-shadow: var(--shadow-float); }
.pill.soon { cursor: default; }
.pill.soon:active { transform: none; }
.pill svg { flex-shrink: 0; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: var(--space-xxl) 0 var(--space-xl); position: relative; }
.hero .kicker { margin: 40px 0 var(--space-m); }
.hero h1 {
  font-weight: 500; font-size: clamp(46px, 9vw, 96px); line-height: .98; letter-spacing: -.045em;
  margin: 0 auto; max-width: 11em; text-wrap: balance;
}
.hero h1 .jp { color: var(--brand-glow-mid); font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.hero .lede {
  font-size: clamp(17px, 2.2vw, 20px); line-height: 1.45; color: var(--text-secondary);
  max-width: 30em; margin: var(--space-l) auto 0; text-wrap: balance;
}
.hero .actions { display: flex; gap: var(--space-s); justify-content: center; flex-wrap: wrap; margin-top: var(--space-xl); }
.hero .facts { margin-top: var(--space-l); display: flex; gap: 8px 20px; justify-content: center; flex-wrap: wrap; }
.hero .facts span { display: inline-flex; align-items: center; gap: 8px; }
.float-key {
  position: absolute; width: 150px; top: 18px; left: max(-10px, calc(50% - 620px)); rotate: -8deg;
  pointer-events: none;
}
@media (max-width: 900px) { .float-key { width: 96px; top: 0; left: -14px; } }
@media (max-width: 560px) { .float-key { display: none; } }

/* ---------- Stage: three phones on the brand glow ---------- */
.stage {
  position: relative; margin: var(--space-xl) auto 0; border-radius: 32px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(255, 255, 255, .55), transparent 60%),
    linear-gradient(160deg, var(--brand-glow-top), var(--brand-glow-mid) 55%, var(--brand-glow-bottom));
  padding: 64px var(--space-l) 0; display: flex; justify-content: center; align-items: flex-end; gap: 28px;
  min-height: 560px;
}
.stage::after { /* paper grain, like the icon */
  content: ""; position: absolute; inset: 0; opacity: .12; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.phone {
  position: relative; z-index: 1; width: 280px; flex-shrink: 0; border-radius: 46px; padding: 9px;
  background: #111110; box-shadow: 0 30px 60px rgba(70, 20, 5, .35), inset 0 0 0 1.5px #3a3a38;
  margin-bottom: -120px;
}
.phone img { border-radius: 38px; width: 100%; }
.phone.side { width: 240px; margin-bottom: -170px; opacity: .97; }
.phone.side.left { rotate: -4deg; }
.phone.side.right { rotate: 4deg; }
@media (max-width: 900px) { .phone.side { display: none; } .stage { min-height: 0; } }

/* ---------- Steps (01–04) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-l); padding: var(--space-xxl) 0; }
.step { border-top: 1px solid var(--line-hairline); padding-top: var(--space-m); }
.step .n { font-family: var(--font-mono); font-size: 12px; color: var(--brand-glow-mid); }
.step h3 { font-size: 20px; font-weight: 500; letter-spacing: -.02em; line-height: 1.2; margin: 6px 0 6px; }
.step p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text-secondary); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; gap: var(--space-m); } }

/* ---------- Section heads ---------- */
.section { padding: var(--space-xxl) 0; }
.section-head { text-align: center; max-width: 34em; margin: 0 auto var(--space-xl); }
.section-head h2 {
  font-weight: 500; font-size: clamp(34px, 5vw, 52px); line-height: 1.04; letter-spacing: -.04em;
  margin: var(--space-s) 0 0; text-wrap: balance;
}
.section-head p { color: var(--text-secondary); margin: var(--space-m) auto 0; font-size: 17px; text-wrap: balance; }

/* ---------- Feature rows ---------- */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xxl); align-items: center;
  padding: var(--space-xl) 0; border-top: 1px solid var(--line-hairline);
}
.feature:nth-of-type(even) .shot { order: -1; }
.feature h3 { font-weight: 500; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.08; letter-spacing: -.035em; margin: var(--space-s) 0 var(--space-m); text-wrap: balance; }
.feature p { color: var(--text-secondary); margin: 0; max-width: 26em; }
.feature .shot { display: flex; justify-content: center; padding: var(--space-xl) 0; border-radius: 28px;
  background: var(--surface-raised); box-shadow: var(--shadow-card); }
.feature .shot .phone { margin: 0; width: 250px; box-shadow: 0 24px 48px rgba(17, 17, 16, .16), inset 0 0 0 1.5px #3a3a38; }
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; gap: var(--space-l); }
  .feature:nth-of-type(even) .shot { order: 0; }
}

/* ---------- Levels ---------- */
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-s); }
.level {
  border-radius: var(--radius-card); padding: var(--space-m) var(--space-m) var(--space-l);
  background: var(--surface-raised); box-shadow: var(--shadow-card); text-align: center; position: relative; overflow: hidden;
}
.level::before {
  content: ""; position: absolute; inset: auto -20% -40% -20%; height: 70%; filter: blur(30px); opacity: .35;
  background: var(--glow);
}
.level img { position: relative; width: 100%; max-width: 150px; margin: 0 auto; rotate: -6deg; }
.level .code { position: relative; font-size: 30px; font-weight: 500; letter-spacing: -.03em; margin-top: 4px; }
.level .label { position: relative; }
@media (max-width: 820px) { .levels { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .levels { grid-template-columns: repeat(2, 1fr); } .level:last-child { grid-column: span 2; } .level:last-child img { max-width: 120px; } }

/* ---------- Extras grid ---------- */
.extras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 var(--space-l); margin-top: var(--space-xxl); }
.extra { border-top: 1px solid var(--line-hairline); padding: var(--space-m) 0 var(--space-l); }
.extra h3 { font-size: 17px; font-weight: 500; margin: 0 0 4px; }
.extra p { margin: 0; font-size: 15px; color: var(--text-secondary); line-height: 1.45; }
@media (max-width: 820px) { .extras { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .extras { grid-template-columns: 1fr; } }

/* ---------- Proverb ---------- */
.proverb { text-align: center; padding: 120px 0; }
.proverb .jp { font-weight: 300; font-size: clamp(32px, 6vw, 60px); letter-spacing: .06em; line-height: 1.25; margin: var(--space-m) 0 0; text-wrap: balance; }
.proverb .reading { margin-top: var(--space-m); }
.proverb .en { font-size: clamp(18px, 2.4vw, 22px); margin: var(--space-s) 0 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; }
details { border-bottom: 1px solid var(--line-hairline); }
details:first-of-type { border-top: 1px solid var(--line-hairline); }
summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: var(--space-m);
  padding: 20px 0; font-size: 19px; font-weight: 500; letter-spacing: -.01em;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--font-mono); font-weight: 400; color: var(--text-secondary); transition: rotate var(--motion-state) var(--ease-out); }
details[open] summary::after { rotate: 45deg; }
details > div { padding: 0 0 var(--space-l); color: var(--text-secondary); max-width: 40em; }
details > div p { margin: 0 0 var(--space-s); }

/* ---------- Closing panel ---------- */
.closing {
  position: relative; overflow: hidden; border-radius: 32px; text-align: center; color: #fff;
  padding: 88px var(--space-l) 80px; margin: var(--space-xxl) 0;
  background:
    radial-gradient(90% 80% at 85% 100%, rgba(248, 148, 98, .7), transparent 60%),
    linear-gradient(170deg, var(--brand-glow-mid), var(--brand-glow-bottom));
}
.closing .app-icon { width: 96px; height: 96px; border-radius: 22.37%; margin: 0 auto var(--space-l); box-shadow: 0 16px 40px rgba(80, 20, 5, .35); }
.closing h2 { font-weight: 500; font-size: clamp(36px, 6vw, 64px); line-height: 1; letter-spacing: -.045em; margin: 0 auto; max-width: 10em; text-wrap: balance; }
.closing p { margin: var(--space-m) 0 0; opacity: .85; }
.closing .actions { margin-top: var(--space-xl); display: flex; justify-content: center; gap: var(--space-s); flex-wrap: wrap; }
.closing .pill.raised { color: #111110; }
.closing .pill.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.closing .label { color: rgba(255, 255, 255, .8); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-hairline); padding: var(--space-xl) 0 var(--space-xxl); }
.site-footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-l); }
.site-footer .tag { color: var(--text-secondary); margin: var(--space-s) 0 0; font-size: 15px; }
.site-footer h4 { margin: 6px 0 var(--space-s); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 8px; font-size: 15px; }
.site-footer li a { text-decoration: none; color: var(--text-secondary); }
.site-footer li a:hover { color: var(--text-primary); }
.site-footer .legal-note { grid-column: 1 / -1; font-size: 13px; color: var(--text-secondary); border-top: 1px solid var(--line-hairline); padding-top: var(--space-m); margin-top: var(--space-s); }
@media (max-width: 720px) { .site-footer .container { grid-template-columns: 1fr 1fr; } .site-footer .about { grid-column: 1 / -1; } }

/* ---------- Arrival (Motion.arrive) ----------
   Only when JS runs (html.js) and motion is welcome; the hero arrives by itself on load. */
@media (prefers-reduced-motion: no-preference) {
  .js .rise { opacity: 0; translate: 0 12px; transition: opacity .55s var(--ease-out), translate .55s var(--ease-out); }
  .js .rise.in { opacity: 1; translate: 0 0; }
  .js .rise.d1 { transition-delay: 70ms; } .js .rise.d2 { transition-delay: 120ms; } .js .rise.d3 { transition-delay: 150ms; }
  .js .hero .rise { opacity: 1; translate: 0 0; transition: none; animation: arrive .55s var(--ease-out) both; }
  .js .hero .rise.d1 { animation-delay: 70ms; } .js .hero .rise.d2 { animation-delay: 120ms; } .js .hero .rise.d3 { animation-delay: 150ms; }
}
@keyframes arrive { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }

/* ---------- Reading pages (support, privacy, terms, 特商法) ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: var(--space-xl) max(var(--space-l), env(safe-area-inset-left, 0px)) 96px; }
.wrap h1 {
  font-size: clamp(36px, 7vw, 52px); line-height: 1.02; letter-spacing: -.04em; font-weight: 500;
  margin: var(--space-xl) 0 10px; text-wrap: balance;
}
.wrap h1 .dot { color: var(--brand-glow-mid); }
.wrap .meta { color: var(--text-secondary); margin: 0 0 36px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.wrap h2 {
  font-size: 24px; line-height: 1.2; letter-spacing: -.02em; font-weight: 500;
  margin: 44px 0 10px; padding-top: 22px; border-top: 1px solid var(--line-hairline); text-wrap: balance;
}
.wrap h3 { font-size: 17px; font-weight: 500; margin: 26px 0 4px; }
.wrap p, .wrap ul, .wrap ol { margin: 0 0 14px; }
.wrap ul, .wrap ol { padding-left: 20px; }
.wrap li { margin-bottom: 6px; }
.wrap .lede { font-size: 20px; line-height: 1.45; max-width: 34em; }
.wrap .card { background: var(--surface-raised); border-radius: var(--radius-card); padding: 22px 22px 8px; margin: 22px 0; box-shadow: var(--shadow-card); }
.wrap .card .label { display: block; margin-bottom: 8px; }
.wrap details > div { color: var(--text-primary); }
.wrap summary { font-size: 17px; padding: 16px 0; }
.fill { background: color-mix(in srgb, var(--brand-glow-mid) 16%, transparent); padding: 0 4px; border-radius: 4px; }
.table-wrap { overflow-x: auto; margin: 10px 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line-hairline); }
th { color: var(--text-secondary); font-weight: 400; width: 34%; padding-top: 15px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 480px) {
  body { font-size: 16px; }
  .container, .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  th { width: 40%; }
}
.faq .faq-group { margin: var(--space-xl) 0 var(--space-s); }
.faq .faq-group:first-child { margin-top: 0; }
.faq .faq-group + details { border-top: 1px solid var(--line-hairline); }
