:root {
  --sky: #eef3ff;
  --white: #ffffff;
  --navy: #13224d;
  --muted: #46557d;
  --peach: #ff9f7a;
  --peach-soft: #ffe3d7;
  --blue: #7cb8ff;
  --blue-soft: #dceaff;
  --shadow-1: #d7e3ff;
  --shadow-2: #c2d4fb;
  --round: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--navy); font: 400 1.0625rem/1.65 var(--body);
  background:
    radial-gradient(800px 500px at 100% 0, var(--peach-soft), transparent 60%),
    radial-gradient(700px 600px at 0 20%, var(--blue-soft), transparent 60%),
    var(--sky);
}
[hidden] { display: none !important; }
a { color: var(--navy); text-underline-offset: 0.2em; }
h1, h2, h3 { margin: 0; font-family: var(--round); line-height: 1.12; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: var(--gutter); top: -80px; z-index: 20; background: var(--navy); color: #fff; padding: 0.6rem 1rem; border-radius: 12px; }
.skip:focus { top: 12px; }

.eyebrow { font-family: var(--round); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* Header */
.site-header {
  max-width: 1160px; margin: 0 auto; padding: 18px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; font-family: var(--round); font-weight: 600; font-size: 1.2rem; }
.brand svg { width: 32px; height: 32px; }
.brand b { color: #c4532d; }
.site-header ul { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.site-header nav a { display: block; padding: 0.4rem 0.8rem; border-radius: 999px; text-decoration: none; font-family: var(--round); font-weight: 600; font-size: 0.95rem; }
.site-header nav a:hover { background: var(--white); }

/* Hero */
.hero {
  max-width: 1160px; margin: 0 auto; padding: clamp(24px, 5vw, 64px) var(--gutter) clamp(40px, 6vw, 80px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center;
}
.hero h1 { font-size: clamp(2.8rem, 7vw, 5.2rem); letter-spacing: -0.02em; margin: 0.8rem 0 1.2rem; }
.lede { font-size: 1.25rem; color: var(--muted); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0.7rem 1.3rem;
  border-radius: 999px; border: 2px solid var(--navy); background: var(--navy); color: #fff;
  font: 700 1rem/1.1 var(--round); text-decoration: none; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 -1px var(--shadow-2); color: #fff; }
.btn-soft { background: var(--white); color: var(--navy); }
.btn-soft:hover { color: var(--navy); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.hero-art svg { width: 100%; height: auto; display: block; overflow: visible; }
.l2 { animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.dot { animation: zip 3s ease-in-out infinite; opacity: 0; }
.d2 { animation-delay: 1s; }
.d3 { animation-delay: 2s; }
@keyframes zip {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(180px, 0); opacity: 0; }
}
.label { font: 700 15px var(--round); fill: var(--navy); text-anchor: middle; }
.tiny { font: 600 13px var(--round); fill: var(--muted); }

/* Plates */
.plate {
  max-width: 1160px; margin: 0 auto clamp(40px, 6vw, 72px); padding: clamp(24px, 4vw, 52px);
  background: var(--white); border-radius: 28px;
  box-shadow: 0 10px 0 -4px var(--shadow-1), 0 20px 0 -8px var(--shadow-2);
  width: calc(100% - 2 * var(--gutter));
}
.plate h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.015em; margin: 0.6rem 0 1rem; max-width: 26ch; }
.section-lede { color: var(--muted); font-size: 1.15rem; max-width: 62ch; margin-bottom: 1.75rem; }

.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.three article { background: var(--sky); border-radius: 20px; padding: 1.4rem; }
.three article:nth-child(2) { background: var(--peach-soft); }
.three h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.three p { color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 0.9rem; }
.steps li {
  counter-increment: s; display: grid; grid-template-columns: 3rem minmax(0, 12rem) minmax(0, 1fr); gap: 0.5rem 1.25rem; align-items: start;
  padding: 1.1rem 1.25rem; border-radius: 18px; background: var(--sky);
}
.steps li::before {
  content: counter(s); width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font: 700 1.05rem var(--round);
}
.steps h3 { font-size: 1.3rem; padding-top: 0.35rem; }
.steps p { color: var(--muted); padding-top: 0.3rem; }

/* Simulator */
.plate-sim { background: linear-gradient(180deg, #fff, #fbfcff); }
.sim { border: 2px solid var(--blue-soft); border-radius: 22px; padding: clamp(16px, 3vw, 28px); }
.parties { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.party-name { font: 700 1.1rem var(--round); }
.party-bal { font: 700 clamp(1.4rem, 4vw, 2.1rem)/1.1 var(--round); font-variant-numeric: tabular-nums; }
.party-b { text-align: right; }
.party-a .party-name::before, .party-b .party-name::after { content: ""; display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; vertical-align: 0.05em; }
.party-a .party-name::before { background: var(--peach); margin-right: 0.4rem; }
.party-b .party-name::after { background: var(--blue); margin-left: 0.4rem; }

.channel { position: relative; display: flex; height: 54px; border-radius: 999px; overflow: hidden; background: var(--blue-soft); border: 2px solid var(--navy); }
.channel-a { background: var(--peach); width: 0; transition: width 0.6s cubic-bezier(0.3, 1.2, 0.5, 1); }
.channel-b { background: var(--blue); flex: 1; }
.coin { position: absolute; top: 50%; left: 8%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); opacity: 0; pointer-events: none; }
.coin.go-right { animation: coin-right 0.7s ease-in-out; }
.coin.go-left { animation: coin-left 0.7s ease-in-out; }
@keyframes coin-right { 0% { left: 6%; opacity: 1; } 100% { left: 88%; opacity: 0; } }
@keyframes coin-left { 0% { left: 88%; opacity: 1; } 100% { left: 6%; opacity: 0; } }
.channel-closed { position: absolute; inset: 0; display: none; place-items: center; font: 700 1rem var(--round); color: var(--navy); background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.85) 0 10px, rgba(255, 255, 255, 0.6) 10px 20px); }
.channel.is-closed .channel-closed { display: grid; }

.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1.1rem 0; }
.counters div { background: var(--sky); border-radius: 16px; padding: 0.8rem 1rem; display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.count { font: 700 2rem/1 var(--round); font-variant-numeric: tabular-nums; }
.count-label { color: var(--muted); font-size: 0.95rem; }

.controls { display: grid; gap: 1rem; }
.controls > .btn { justify-self: start; }
.amounts { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-width: 0; }
.amounts legend { float: left; margin-right: 0.5rem; padding: 0; font: 700 0.95rem var(--round); }
.amounts label { position: relative; cursor: pointer; }
.amounts input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.amounts span { display: inline-block; padding: 0.45rem 0.9rem; border-radius: 999px; border: 2px solid var(--navy); font: 700 0.95rem var(--round); font-variant-numeric: tabular-nums; }
.amounts input:checked + span { background: var(--navy); color: #fff; }
.amounts input:focus-visible + span { outline: 3px solid var(--peach); outline-offset: 2px; }
.amounts:disabled { opacity: 0.45; }
.pay-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn-pay { background: var(--white); color: var(--navy); }
.btn-pay:hover { color: var(--navy); }

.sim-status { margin: 1.1rem 0 0.75rem; font-weight: 600; min-height: 1.6em; }
.log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; display: grid; gap: 0.35rem; font-size: 0.95rem; }
.log li { padding: 0.45rem 0.8rem; border-radius: 10px; background: var(--sky); color: var(--muted); font-variant-numeric: tabular-nums; }
.log li.chain { background: var(--peach-soft); color: var(--navy); font-weight: 600; }

/* Compare */
.table-wrap { overflow-x: auto; border-radius: 18px; border: 2px solid var(--blue-soft); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; vertical-align: top; padding: 0.9rem 1rem; border-bottom: 1px solid var(--blue-soft); }
thead th { background: var(--navy); color: #fff; font: 700 0.95rem var(--round); }
tbody th { font-family: var(--round); font-size: 1.05rem; width: 22%; }
tbody th span { display: block; font-family: var(--body); font-weight: 400; font-size: 0.85rem; color: var(--muted); }
tbody td { color: var(--muted); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

.questions { margin: 0; padding: 0; list-style: none; counter-reset: q; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.questions li {
  counter-increment: q; position: relative; padding: 1.1rem 1.2rem 1.1rem 3.6rem; border-radius: 18px;
  background: var(--peach-soft); font: 600 1.1rem/1.4 var(--round);
}
.questions li::before { content: counter(q); position: absolute; left: 1rem; top: 1rem; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--white); font: 700 1rem var(--round); }

.glossary { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.glossary div { padding: 0.9rem 0; border-top: 1px dashed var(--shadow-2); }
.glossary dt { font: 700 1.1rem var(--round); }
.glossary dd { margin: 0.2rem 0 0; color: var(--muted); }

.site-footer {
  max-width: 1160px; margin: 0 auto; padding: 1rem var(--gutter) 3rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; color: var(--muted); font-size: 0.95rem;
}
.site-footer strong { color: var(--navy); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-width: 520px; }
  .three { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .steps li p { grid-column: 2; padding-top: 0; }
  .questions, .glossary { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .plate { border-radius: 22px; }
  .counters { grid-template-columns: 1fr; }
  .pay-buttons .btn { flex: 1 1 100%; }
  .label { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .dot { opacity: 1; }
  .d2 { transform: translate(90px, 0); }
  .d3 { transform: translate(180px, 0); }
  .btn:hover { transform: none; }
}
