/* BaltDeck site. Palette = app tokens (src/styles.css). Motion rules: Emil Kowalski skills (MIT). */
:root {
  color-scheme: dark;
  --bg: #262624;
  --surface: #1b1b19;
  --hover: #34342f;
  --border: #3e3e38;
  --fg: #c3c0b6;
  --strong: #eeeae0;
  --muted: #b7b5a9;
  --primary: #d97757;
  --on-primary: #1b1b19;
  --primary-soft: rgba(217, 119, 87, 0.14);
  --danger: #f08b7a;
  --ok: #7fc98f;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --radius: 12px;
  --gutter: 20px;
  --sans: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #faf9f5;
    --surface: #ede9de;
    --hover: #e9e6dc;
    --border: #dad9d4;
    --fg: #3d3929;
    --strong: #302d22;
    --muted: #69685f;
    --primary: #b45435;
    --on-primary: #ffffff;
    --primary-soft: rgba(180, 84, 53, 0.1);
    --danger: #b3261e;
    --ok: #2f7a3e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { color: var(--strong); line-height: 1.15; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px; background: var(--primary); color: var(--on-primary); border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Buttons: press feedback scale(0.97) 160ms ease-out; hover only on fine pointers. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 10px;
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-ghost { background: transparent; color: var(--strong); border-color: var(--border); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.55; }
.btn[aria-disabled="true"]:active, .btn[disabled]:active { transform: none; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, var(--strong)); }
  .btn-ghost:hover { background: var(--hover); }
  .btn[aria-disabled="true"]:hover { background: transparent; }
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { color: var(--fg); text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 8px; transition: color 150ms ease, background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .nav a:not(.btn):hover { color: var(--strong); background: var(--hover); } }
.nav .btn { margin-left: 8px; }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }

/* Hero: one-time entrance, short stagger (rare/first-time tier). */
.hero { position: relative; padding: 72px 0 40px; text-align: center; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -80px 0 auto; height: 560px; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 30%, var(--primary-soft), transparent 70%);
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.hero h1 { font-size: clamp(34px, 5.4vw, 58px); max-width: 21ch; margin: 22px auto 0; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lead { font-size: clamp(17px, 2.1vw, 20px); color: var(--fg); max-width: 62ch; margin: 20px auto 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }
.fineprint { margin-top: 16px; font-size: 14px; color: var(--muted); }
.hero-enter > * { animation: rise 600ms var(--ease-out) both; }
.hero-enter > :nth-child(2) { animation-delay: 60ms; }
.hero-enter > :nth-child(3) { animation-delay: 110ms; }
.hero-enter > :nth-child(4) { animation-delay: 150ms; }
.hero-enter > :nth-child(5) { animation-delay: 185ms; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* Terminal demo (always dark: it depicts the app's dark terminal). */
.demo {
  --t-bg: #1b1b19; --t-head: #232321; --t-border: #3e3e38; --t-fg: #eeeae0; --t-muted: #9c9a90;
  margin: 48px auto 0; max-width: 1080px; text-align: left;
  background: #262624; border: 1px solid var(--t-border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.02);
  animation: rise 700ms var(--ease-out) 220ms both;
}
.demo-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--t-border); color: var(--t-muted); font-size: 13px; }
.demo-bar .lights { display: flex; gap: 6px; }
.demo-bar .lights span { width: 10px; height: 10px; border-radius: 50%; background: #3e3e38; }
.demo-bar .title { flex: 1; color: #c3c0b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-replay { background: transparent; border: 1px solid var(--t-border); color: #c3c0b6; border-radius: 8px; font: 500 12px/1 var(--sans); padding: 6px 10px; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease, opacity 200ms ease; }
.demo-replay:active { transform: scale(0.97); }
.demo-replay[hidden] { display: inline-block; visibility: hidden; opacity: 0; }
@media (hover: hover) and (pointer: fine) { .demo-replay:hover { background: #34342f; } }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(2, 256px); gap: 10px; padding: 10px; }
.pane { display: flex; flex-direction: column; min-width: 0; background: var(--t-bg); border: 1px solid var(--t-border); border-radius: 8px; overflow: hidden; transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out), border-color 200ms ease; }
.pane[data-state="waiting"] { opacity: 0; transform: scale(0.97); }
.pane[data-active="true"] { border-color: rgba(217, 119, 87, 0.7); }
.pane-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--t-head); border-bottom: 1px solid var(--t-border); font-size: 12px; color: var(--t-muted); white-space: nowrap; overflow: hidden; }
.pane-head strong { color: var(--t-fg); font-weight: 600; }
.pane-head .cwd { overflow: hidden; text-overflow: ellipsis; }
.pane-head .status { margin-left: auto; color: #7fc98f; font-weight: 600; font-size: 11px; letter-spacing: 0.04em; }
.term { margin: 0; padding: 10px 12px; font: 13px/1.5 var(--mono); color: var(--t-fg); white-space: pre; overflow: hidden; flex: 1; }
.t-cmd { color: #f2d45c; }
.t-arg { color: var(--t-muted); }
.t-dim { color: var(--t-muted); }
.t-red { color: #f07a6a; }
.cursor { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.2em; border: 1px solid #d97757; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 720px) {
  .demo-grid { grid-template-columns: 1fr; grid-template-rows: repeat(2, 232px); }
  .pane:nth-child(n + 3) { display: none; }
  .term { font-size: 12px; }
}

/* Sections */
section { scroll-margin-top: 80px; }
.section { padding: 88px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 18px; }
.kicker { display: block; color: var(--primary); font-weight: 600; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }

/* Screens: tabs + crossfade (opacity only, interruptible transition). */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 20px; }
.tab { font: 600 14px/1 var(--sans); color: var(--fg); background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.tab:active { transform: scale(0.97); }
.tab[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
@media (hover: hover) and (pointer: fine) { .tab[aria-selected="false"]:hover { background: var(--hover); } }
.screens { display: grid; max-width: 1080px; margin: 0 auto; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #1b1b19; }
.screen { grid-area: 1 / 1; margin: 0; opacity: 1; transition: opacity 220ms ease; }
.screen[hidden] { display: block; opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 220ms ease, visibility 0s linear 220ms; }
.screen-caption { text-align: center; color: var(--muted); font-size: 15px; margin: 16px auto 0; max-width: 70ch; min-height: 3.2em; }

/* Feature cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.section-alt .card { background: var(--bg); }
.card-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-soft); color: var(--primary); margin-bottom: 16px; }
.card-icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 19px; }
.card p { margin-top: 8px; color: var(--fg); font-size: 15.5px; }
.more { margin-top: 48px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; }
.more h3 { grid-column: 1 / -1; font-size: 20px; margin-bottom: 8px; }
.more-item { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.more-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--primary); margin-top: 4px; }
.more-item strong { color: var(--strong); }
.more-item p { font-size: 15px; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards, .more { grid-template-columns: 1fr; } .section { padding: 64px 0; } }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); counter-increment: step; }
.step::before { content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 700; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.step h3 { font-size: 18px; }
.step p { margin-top: 6px; font-size: 15px; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* Pricing */
.price-card { max-width: 480px; margin: 0 auto; padding: 36px 32px; border-radius: 18px; background: var(--bg); border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--border)); box-shadow: 0 0 0 6px var(--primary-soft); text-align: center; }
.price-card h3 { font-size: 20px; }
.price { margin-top: 18px; display: flex; align-items: baseline; justify-content: center; gap: 4px; color: var(--strong); font-variant-numeric: tabular-nums; }
.price .currency { font-size: 22px; font-weight: 600; }
.price .amount { font-size: 64px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.price .period { font-size: 18px; color: var(--muted); }
.price-note { margin-top: 8px; color: var(--muted); font-size: 15px; }
.checklist { list-style: none; padding: 0; margin: 26px 0 28px; text-align: left; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist svg { width: 18px; height: 18px; color: var(--ok); flex-shrink: 0; margin-top: 4px; }
.price-card .btn { width: 100%; }
.price-card .btn + .btn { margin-top: 10px; }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; padding: 20px 2px; font-weight: 600; font-size: 17px; color: var(--strong); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 22px; line-height: 1; transition: transform 200ms var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 2px 20px; color: var(--fg); max-width: 68ch; }
.faq .answer p + p { margin-top: 10px; }
.faq details[open] .answer { animation: fade-down 200ms var(--ease-out); }
@keyframes fade-down { from { opacity: 0; transform: translateY(-4px); } }

/* Final CTA + footer */
.final { text-align: center; }
.final h2 { font-size: clamp(26px, 4vw, 38px); }
.final p { margin-top: 12px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; font-size: 14px; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-row a { color: var(--fg); }
.footer-brand img { height: 28px; width: auto; }

/* Scroll reveal: fire once, marketing surface only. JS only hides elements below the fold. */
[data-reveal="hidden"] { opacity: 0; transform: translateY(16px); }
[data-reveal="shown"] { transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.cards > [data-reveal="shown"]:nth-child(3n + 2), .steps > [data-reveal="shown"]:nth-child(2) { transition-delay: 50ms; }
.cards > [data-reveal="shown"]:nth-child(3n + 3), .steps > [data-reveal="shown"]:nth-child(3) { transition-delay: 90ms; }
.steps > [data-reveal="shown"]:nth-child(4) { transition-delay: 120ms; }
.screens[data-reveal="hidden"] { opacity: 1; transform: none; clip-path: inset(0 0 100% 0 round 14px); }
.screens[data-reveal="shown"] { clip-path: inset(0 0 0 0 round 14px); transition: clip-path 700ms var(--ease-in-out); }

/* Checkout dialog: centered (modals keep origin center), 250ms enter, faster exit. */
.dialog {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid var(--border); border-radius: 16px;
  background: var(--bg); color: var(--fg);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6);
  opacity: 0; transform: scale(0.96);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.dialog[data-state="open"] { opacity: 1; transform: none; transition-duration: 250ms; }
.dialog::backdrop { background: rgba(10, 10, 9, 0.6); opacity: 0; transition: opacity 180ms var(--ease-out); }
.dialog[data-state="open"]::backdrop { opacity: 1; transition-duration: 250ms; }
.dialog-inner { padding: 28px; }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dialog-head h2 { font-size: 24px; }
.dialog-head p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.icon-btn { flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center; background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--fg); cursor: pointer; transition: transform 160ms var(--ease-out), background-color 150ms ease; }
.icon-btn:active { transform: scale(0.97); }
.icon-btn svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--hover); } }
.form { margin-top: 22px; display: grid; gap: 16px; }
.field label { display: block; font-weight: 600; color: var(--strong); font-size: 15px; margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"] {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: 16px/1.3 var(--sans); color: var(--strong);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color 150ms ease;
}
.field input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.hint { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.field-error { margin-top: 6px; font-size: 14px; color: var(--danger); }
.field-error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.form-error { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--danger); color: var(--strong); background: color-mix(in srgb, var(--danger) 12%, transparent); font-size: 15px; }
.form-error:empty { display: none; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.secure-note { font-size: 13.5px; color: var(--muted); text-align: center; }

/* Simple pages (obrigado, privacidade) */
.page { padding: 64px 0 88px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h1 { font-size: clamp(30px, 5vw, 44px); }
.prose h2 { font-size: 22px; margin-top: 36px; }
.prose p, .prose ul, .prose ol { margin-top: 12px; }
.prose li + li { margin-top: 6px; }
.prose .updated { color: var(--muted); margin-top: 10px; }
.thanks { max-width: 640px; margin: 0 auto; text-align: center; }
.thanks .badge { width: 64px; height: 64px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); animation: pop 400ms var(--ease-out) both; }
.thanks .badge svg { width: 30px; height: 30px; }
@keyframes pop { from { opacity: 0; transform: scale(0.9); } }
.thanks h1 { font-size: clamp(30px, 5vw, 42px); }
.thanks .lead { margin-top: 14px; font-size: 18px; }
.thanks ol { text-align: left; margin: 28px auto 0; max-width: 440px; padding-left: 1.3em; display: grid; gap: 8px; }
.thanks .cta-row { margin-top: 32px; }

@media (max-width: 400px) {
  :root { --gutter: 16px; }
  .hero { padding-top: 48px; }
  .cta-row .btn { width: 100%; }
  .price-card { padding: 28px 20px; }
  .dialog-inner { padding: 20px; }
  .form-actions .btn { flex: 1; }
}

/* Reduced motion: keep opacity changes that aid comprehension, drop movement. */
@media (prefers-reduced-motion: reduce) {
  .hero-enter > *, .demo, .thanks .badge { animation-name: fade; }
  .faq details[open] .answer { animation-name: fade; }
  .cursor { animation: none; }
  .pane, .dialog { transform: none !important; }
  .pane[data-state="waiting"] { transform: none; }
  [data-reveal="hidden"] { transform: none; }
  .screens[data-reveal="hidden"] { clip-path: none; opacity: 0; }
  .screens[data-reveal="shown"] { clip-path: none; transition: opacity 300ms ease; }
  .btn:active, .tab:active, .icon-btn:active, .demo-replay:active { transform: none; }
  .faq summary::after { transition: none; }
}
@keyframes fade { from { opacity: 0; } }
