/* Styles for the homepage, share page, owner dashboard and legal pages.
   Colors, fonts and the Markdown styles come from styles.css. */

body.page { overflow-y: auto; height: auto; min-height: 100%; }
.page-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ── Navigation ───────────────────────────────────────────── */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav .page-wrap { display: flex; align-items: center; gap: 22px; height: 64px; }
.nav .brand .mark { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 22px; margin-left: 10px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-spacer { flex: 1; }
.nav-signin { color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border-radius: 999px;
  background: var(--invert); color: var(--invert-text);
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: opacity .15s;
}
.cta:hover { opacity: .9; }
.cta.big { height: 52px; padding: 0 26px; font-size: 16.5px; }
.cta.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.cta.ghost:hover { background: var(--surface); opacity: 1; }

/* ── Homepage ─────────────────────────────────────────────── */
.hero-section { padding-top: 88px; padding-bottom: 40px; text-align: center; }
.hero-section .hero-mark { width: 60px; height: 60px; margin: 0 auto 22px; }
.landing-title { margin: 0 auto; max-width: 20ch; font-family: var(--font-brand); font-size: clamp(34px, 5.4vw, 62px); line-height: 1.08; font-weight: 500; letter-spacing: -.025em; text-wrap: balance; }
.landing-sub { margin: 22px auto 0; max-width: 54ch; font-size: clamp(17px, 2vw, 19.5px); line-height: 1.55; color: var(--muted); }
.hero-ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin: 14px 0 0; font-size: 14px; color: var(--faint); }

.preview { margin: 56px auto 0; max-width: 1040px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: 0 40px 120px -40px rgba(80, 100, 255, .45); background: var(--surface); }
.preview img { display: block; width: 100%; height: auto; }
[data-theme="dark"] .preview .shot-light, [data-theme="light"] .preview .shot-dark { display: none; }

.section { padding-top: 96px; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { margin: 0; font-size: clamp(30px, 4vw, 42px); line-height: 1.1; font-weight: 600; letter-spacing: -.025em; text-wrap: balance; }
.section-head p { margin: 14px 0 0; font-size: 17px; color: var(--muted); text-wrap: pretty; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 36px; }
.feature { display: grid; grid-template-columns: 44px 1fr; gap: 4px 16px; align-items: start; }
.feature-icon { grid-row: span 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.feature-icon svg { width: 22px; height: 22px; fill: none; stroke: url(#vela-grad); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0; font-size: 17px; font-weight: 600; }
.feature p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }

.models { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: 20px; overflow: hidden; }
.model { padding: 26px 22px; border-right: 1px solid var(--line); }
.model:last-child { border-right: 0; }
.model h3 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.model p { margin: 0 0 16px; font-size: 15px; color: var(--muted); line-height: 1.5; min-height: 3em; }
.model-plan { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--text); }
.model-plan.paid { background: var(--grad); color: #fff; }

.pricing .plan-grid { margin-top: 4px; }
a.plan-cta { display: flex; align-items: center; justify-content: center; color: var(--text); text-decoration: none; }
a.plan-cta:not([href]) { color: var(--muted); cursor: default; }
.plan-ultra a.plan-cta { color: #fff; }
.pricing .plans-fine { text-align: center; }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 36px 20px 0; position: relative; font-size: 17px; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { margin: -6px 0 20px; color: var(--muted); line-height: 1.6; }

.final-cta { margin: 110px 0 0; padding: 64px 24px; text-align: center; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); }
.final-cta h2 { margin: 0 0 22px; font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -.02em; }

.footer { margin-top: 80px; padding: 32px 0 44px; border-top: 1px solid var(--line); color: var(--faint); font-size: 14px; }
.footer .page-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer .brand .mark { width: 22px; height: 22px; }
.footer .brand-name { font-size: 15px; }

/* ── Share page ───────────────────────────────────────────── */
.share-main { max-width: 768px; margin: 0 auto; padding: 36px 24px 40px; }
.share-title { margin: 0; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; font-weight: 600; letter-spacing: -.015em; }
.share-meta { margin: 8px 0 30px; color: var(--faint); font-size: 14px; }
.share-main .messages { padding: 0; }
.share-main .msg .msg-actions { display: none; }
.share-cta { margin-top: 40px; padding: 26px; text-align: center; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.share-cta p { margin: 0 0 16px; color: var(--muted); }
.share-missing { padding: 100px 0; text-align: center; color: var(--muted); }

/* ── Owner dashboard ──────────────────────────────────────── */
.admin-main { padding-top: 34px; padding-bottom: 60px; }
.admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.admin-head h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.admin-head p { margin: 0; color: var(--faint); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.tile { padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.tile-label { margin: 0; font-size: 13.5px; color: var(--muted); }
.tile-value { margin: 6px 0 2px; font-size: 32px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-note { margin: 0; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.chart-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.chart-card.full { grid-column: 1 / -1; }
.chart-card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.chart-sub { margin: 2px 0 12px; font-size: 13px; color: var(--faint); }
.bars { position: relative; height: 170px; }
.bars svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bar { fill: #3D7FE6; }
[data-theme="dark"] .bar { fill: #4A90F0; }
.bar-hit { fill: transparent; cursor: default; }
.bar-hit:hover + .bar, .bar.is-hover { opacity: .75; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-label { fill: var(--faint); font-size: 11px; font-family: var(--font-body); }
.chart-tip {
  position: absolute; z-index: 2; pointer-events: none;
  padding: 7px 10px; border-radius: 10px;
  background: var(--invert); color: var(--invert-text);
  font-size: 12.5px; line-height: 1.35; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 8px));
}
.chart-table summary { margin-top: 10px; font-size: 13px; color: var(--muted); cursor: pointer; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { font-weight: 600; color: var(--muted); font-size: 13px; }
.data-table td.num, .data-table th.num { text-align: right; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 12px; }
.panel h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.admin-note { color: var(--faint); font-size: 13px; margin: 12px 0 0; }
.admin-gate { padding: 120px 0; text-align: center; }
.gift-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 4px; }
.gift-field { display: grid; gap: 6px; }
.gift-form select.field { padding: 0 12px; }
.gift-form .primary-btn { height: 46px; }
.gift-status { min-height: 20px; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.gift-status.is-error { color: var(--danger); }
.gift-list-title { margin: 18px 0 4px; font-size: 14px; font-weight: 600; }
.admin-gate p { color: var(--muted); margin: 10px 0 22px; }

/* ── Legal pages ──────────────────────────────────────────── */
.legal { max-width: 760px; margin: 0 auto; padding: 44px 24px 20px; }
.legal h1 { margin: 0; font-size: 38px; letter-spacing: -.02em; font-weight: 600; }
.legal .updated { color: var(--faint); margin: 8px 0 34px; }
.legal h2 { margin: 34px 0 10px; font-size: 21px; font-weight: 600; }
.legal p, .legal li { color: var(--muted); line-height: 1.7; }
.legal li { margin: 4px 0; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--accent-text); }
.missing-info { color: var(--danger); font-weight: 600; }

@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model:nth-child(2) { border-right: 0; }
  .model:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gift-form { grid-template-columns: 1fr 1fr; }
  .gift-form .gift-field:first-child { grid-column: 1 / -1; }
  .gift-form .primary-btn { grid-column: 1 / -1; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-wrap { padding: 0 16px; }
  .nav-links { display: none; }
  .nav .page-wrap { gap: 14px; }
  .nav .cta { height: 38px; padding: 0 16px; font-size: 14px; }
  .hero-section { padding-top: 56px; padding-bottom: 24px; }
  .features { grid-template-columns: 1fr; gap: 28px; }
  .models { grid-template-columns: 1fr; }
  .model { border-right: 0; border-bottom: 1px solid var(--line); }
  .model:last-child { border-bottom: 0; }
  .model p { min-height: 0; }
  .section { padding-top: 72px; }
  .preview { margin-top: 40px; border-radius: 16px; }
  .final-cta { margin-top: 80px; padding: 44px 18px; }
  .admin-head { flex-direction: column; gap: 4px; }
}
