:root {
  --t-hero: clamp(1.875rem, 0.4rem + 5.9vw, 6rem);
  --t-head: clamp(1.625rem, 1rem + 1.6vw, 2.5rem);
  --t-lead: var(--text-xl);
  --t-body: 1.0625rem;

  --m: clamp(1rem, 2.2vw, 2rem);
  --section: clamp(6rem, 12vw, 11rem);
}

html { scroll-behavior: smooth; }
body { font-size: var(--t-body); line-height: 1.5; }
h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
::selection { background: var(--color-accent); color: var(--color-on-accent); }

section { margin-top: var(--section); scroll-margin-top: var(--space-8); }
h1, h2 { color: inherit; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
h1 { font-size: var(--t-hero); }
h2 { font-size: var(--t-head); }
.soft { color: var(--color-fg-muted); }

.cta {
  --bs-btn-padding-x: 1.375rem;
  --bs-btn-font-size: var(--t-body);
  height: 3rem;
}
.btn { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.more { font-weight: 500; text-underline-offset: 0.3em; text-decoration-thickness: 2px; }

.top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding-block: var(--space-5); }
.brand { display: inline-flex; align-items: center; gap: 0.625rem; font-size: var(--t-lead); font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.top-nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.top-nav a:not(.btn) { text-decoration: none; transition: color 0.15s; }
.top-nav a:not(.btn):hover, .more:hover { color: var(--color-accent); }

.hero { margin-top: clamp(2.5rem, 7vw, 6rem); display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero h1 { max-width: 13em; }
.hero-lead { margin-top: var(--space-8); max-width: 38rem; font-size: var(--t-lead); line-height: 1.45; text-wrap: balance; }
.hero-actions { margin-top: var(--space-8); display: flex; justify-content: center; align-items: center; gap: var(--space-6); flex-wrap: wrap; }

:root { --shop-max: 72rem; }
body { background: var(--color-surface); color: var(--color-fg); }
.shop { max-width: var(--shop-max); margin-inline: auto; padding-inline: var(--m); }
.shop section { margin-top: clamp(4rem, 8vw, 7rem); }

.top { border-bottom: 1px solid var(--color-divider); }
.brand img { width: 1.875rem; height: 1.875rem; padding: 2px; border-radius: var(--radius-md); background: #0b0d12; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-dark { display: block; }
  .logo-light { display: none; }
}
.brand small { margin-left: var(--space-2); padding: 0.125rem 0.5rem; border-radius: var(--radius-full); background: var(--color-fill-quiet); color: var(--color-fg-muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0; }
.top-nav { font-size: var(--text-sm); }
.top-nav .btn { height: 2.25rem; }

.hero { margin-top: clamp(3rem, 6vw, 5rem); }
.hero h1 { font-size: clamp(2.25rem, 1rem + 4.5vw, 4.5rem); max-width: 14em; }
.hero-lead { margin-top: var(--space-6); }
.seller-line { margin-top: var(--space-6); color: var(--color-fg-muted); font-size: var(--text-sm); }

.eyebrow { color: var(--color-accent); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.section-head { display: grid; gap: var(--space-3); margin-bottom: var(--space-10); max-width: 46rem; }
.section-head h2 { font-size: var(--t-head); }
.section-head p { color: var(--color-fg-muted); font-size: var(--text-lg); }

.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.product { display: flex; flex-direction: column; gap: var(--space-6); padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--color-border); border-radius: var(--radius-xl); background: var(--color-surface-raised); }
.product-head { display: flex; align-items: center; gap: var(--space-3); }
.product-head img { width: 2.5rem; height: 2.5rem; }
.product-head h3 { margin: 0; font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.02em; }
.product-head p { margin: 0; color: var(--color-fg-muted); font-size: var(--text-sm); }
.product-desc { margin: 0; color: var(--color-fg-secondary); }
.product-price { display: flex; align-items: baseline; gap: var(--space-2); margin: 0; }
.product-price b { font-size: 3rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.product-price span { color: var(--color-fg-muted); line-height: 1.3; }
.product-facts { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); }
.product-facts li { display: flex; gap: var(--space-2); }
.product-facts li::before { content: ""; flex: none; width: 1rem; height: 1rem; margin-top: 0.15rem; border-radius: 50%; background: var(--color-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.9' fill='none' stroke='%2321a36d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.875rem no-repeat; }
.product-cta { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.product-cta small { color: var(--color-fg-muted); }

.examples { width: 100%; border-collapse: separate; border-spacing: 0 3px; font-size: var(--text-sm); }
.examples caption { caption-side: top; padding: 0 0 var(--space-2); color: var(--color-fg-muted); font-size: var(--text-xs); }
.examples th, .examples td { padding: 0.5rem 0.875rem; background: var(--color-surface-sunken); }
.examples th { border-radius: var(--radius-md) 0 0 var(--radius-md); font-weight: 400; text-align: left; }
.examples td { border-radius: 0 var(--radius-md) var(--radius-md) 0; font-weight: 600; text-align: right; }

.shot { padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-surface-sunken); }
.shot .card { margin: 0 auto; max-width: 22rem; padding: 1.25rem; box-shadow: 0 10px 30px rgb(0 0 0 / 0.08); }
.shot-title { margin: 0 0 var(--space-1); font-size: var(--text-lg); font-weight: 600; }
.shot-help { margin: 0 0 var(--space-4); color: var(--color-fg-muted); font-size: var(--text-sm); }
.shot-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--color-divider); font-size: var(--text-sm); }
.shot-row span { color: var(--color-fg-muted); }
.shot-key { margin-top: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-fill-quiet); font-family: var(--font-mono); font-size: var(--text-xs); overflow-wrap: anywhere; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); counter-reset: step; margin: 0; padding: 0; list-style: none; }
.steps li { padding: var(--space-6); border-radius: var(--radius-xl); background: var(--color-surface-sunken); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; margin-bottom: var(--space-4); border-radius: 50%; background: var(--color-accent); color: var(--color-on-accent); font-weight: 600; }
.steps b { display: block; margin-bottom: var(--space-2); font-size: var(--text-lg); }
.steps p { margin: 0; color: var(--color-fg-muted); font-size: var(--text-sm); }

.facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.fact { padding: var(--space-5) var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-xl); }
.fact h3 { margin: 0 0 var(--space-2); font-size: var(--text-base); font-weight: 600; }
.fact p { margin: 0; color: var(--color-fg-muted); font-size: var(--text-sm); }
.fact a { color: inherit; }

.payu-mark { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.375rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-raised); color: var(--color-fg); font-size: var(--text-sm); text-decoration: none; }
.payu-mark img { height: 2rem; width: auto; margin: -0.375rem -0.25rem; }

.foot { margin-top: clamp(5rem, 10vw, 8rem); padding: var(--space-10) 0 var(--space-8); border-top: 1px solid var(--color-divider); font-size: var(--text-sm); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: var(--space-8); }
.foot h4 { margin: 0 0 var(--space-3); color: var(--color-fg-muted); font-size: var(--text-xs); font-weight: 500; }
.foot ul { display: grid; gap: var(--space-2); }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--color-accent); }
.foot address { margin: 0; color: var(--color-fg-muted); font-style: normal; line-height: 1.6; }
.foot address b { color: var(--color-fg); font-weight: 600; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--color-divider); color: var(--color-fg-muted); }

.order { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; margin-top: var(--space-10); }
.order h1 { font-size: var(--t-head); }
.panel { padding: clamp(1.25rem, 3vw, 1.75rem); border: 1px solid var(--color-border); border-radius: var(--radius-xl); background: var(--color-surface-raised); }
.panel + .panel { margin-top: var(--space-5); }
.panel h2 { margin: 0 0 var(--space-4); font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.01em; }
.panel-note { margin: calc(var(--space-2) * -1) 0 var(--space-4); color: var(--color-fg-muted); font-size: var(--text-sm); }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.choice label { display: grid; gap: var(--space-1); padding: var(--space-4); border: 1px solid var(--color-control-border); border-radius: var(--radius-lg); cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-ring); }
.choice b { font-weight: 600; }
.choice small { color: var(--color-fg-muted); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.fields .wide { grid-column: 1 / -1; }
.fields label { display: grid; gap: var(--space-1); font-size: var(--text-sm); font-weight: 500; }
.fields small { color: var(--color-fg-muted); font-weight: 400; }
.summary { position: sticky; top: var(--space-6); }
.sum-rows { display: grid; gap: var(--space-2); margin: 0; font-size: var(--text-sm); }
.sum-rows div { display: flex; justify-content: space-between; gap: var(--space-4); }
.sum-rows dt { color: var(--color-fg-muted); font-weight: 400; }
.sum-rows dd { margin: 0; text-align: right; font-weight: 500; }
.sum-total { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-divider); font-size: var(--text-lg); }
.sum-total dd { font-weight: 700; }
.schedule { margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--color-surface-sunken); font-size: var(--text-sm); }
.schedule p { margin: 0; }
.schedule p + p { margin-top: var(--space-2); }
.seller { margin-top: var(--space-4); color: var(--color-fg-muted); font-size: var(--text-xs); line-height: 1.5; }
.consents { display: grid; gap: var(--space-3); margin-top: var(--space-5); font-size: var(--text-sm); }
.consents .form-check { margin: 0; }
.consents .form-check-label { line-height: 1.45; }
.payu-notice { margin-top: var(--space-4); color: var(--color-fg-muted); font-size: var(--text-xs); line-height: 1.5; }
.pay-btn { width: 100%; height: 3rem; margin-top: var(--space-5); font-size: var(--text-base); }
.payments-closed { margin-top: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--color-warn-bg); border: 1px solid var(--color-warn-border); color: var(--color-warn-fg); font-size: var(--text-sm); }
.preview-note { margin-top: var(--space-3); color: var(--color-fg-muted); font-size: var(--text-xs); text-align: center; }

.legal { max-width: 46rem; margin: var(--space-12) auto 0; }
.legal h1 { font-size: var(--t-head); }
.legal .version { margin-top: var(--space-3); color: var(--color-fg-muted); font-size: var(--text-sm); }
.legal h2 { margin: var(--space-10) 0 var(--space-3); font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.01em; }
.legal p, .legal li { line-height: 1.65; }
.legal p { margin: var(--space-3) 0; }
.legal ul, .legal ol { margin: var(--space-3) 0; padding-left: var(--space-6); }
.legal ul { list-style: disc; }
.legal ol { list-style: decimal; }
.legal li + li { margin-top: var(--space-2); }
.legal table { width: 100%; margin: var(--space-4) 0; border-collapse: collapse; font-size: var(--text-sm); }
.legal th, .legal td { padding: var(--space-3); border-bottom: 1px solid var(--color-divider); text-align: left; vertical-align: top; }
.legal th { color: var(--color-fg-muted); font-weight: 500; }
.legal-tools { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.table-scroll { overflow-x: auto; }

@media (max-width: 860px) {
  .products, .order, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .steps, .facts-grid { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .top-nav a:not(.btn):not(.keep) { display: none; }
}
@media (max-width: 520px) {
  .fields, .choice { grid-template-columns: minmax(0, 1fr); }
  .brand small { display: none; }
}

.order-start { max-width: 46rem; margin: var(--space-12) auto 0; }
.order-start h1 { margin-top: var(--space-2); font-size: var(--t-head); }
.lead-soft { margin: var(--space-4) 0 var(--space-8); color: var(--color-fg-muted); font-size: var(--text-lg); }

.legal h1 + p { margin-top: var(--space-3); color: var(--color-fg-muted); font-size: var(--text-sm); }
.legal table { display: block; overflow-x: auto; }
.legal a { overflow-wrap: anywhere; }
.payu-methods { margin-top: var(--space-3); }
.order-errors { margin-top: var(--space-5); }
.order-errors ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); list-style: disc; }
.order-line { margin-top: var(--space-5); }
.received-rows { margin-bottom: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-divider); }
.back { margin-top: var(--space-6); }
.order:has(input[name="product"][value="cloud"]:checked) .for-self-hosted,
.order:has(input[name="product"][value="self-hosted"]:checked) .for-cloud { display: none; }
