/* Layout concept: o site é um mergulho. Cada seção fica mais funda e mais escura que a anterior,
   e um medidor de profundidade (0 a 40 m) acompanha a rolagem. Os níveis A1 a C2 viram profundidades. */
:root {
  --bg: #EAF3F2;
  --surface: #F8FCFB;
  --ink: #0A2433;
  --muted: #46606C;
  --line: #BFD5D6;
  --teal: #0B6F82;
  --accent: #FF6A2B;
  --accent-hover: #FF8450;
  --accent-ink: #0A2433;
  --deep: #0B3A50;
  --deep-surface: #10475F;
  --deep-ink: #E6F3F2;
  --deep-muted: #9FC4CC;
  --deep-line: #24607A;
  --deep-teal: #5CCBDD;
  --abyss: #06202F;
  --abyss-surface: #0A2D40;
  --abyss-line: #17445A;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #061722; --surface: #0C2433; --ink: #E4F1F0; --muted: #93B3BB; --line: #1D3B4A;
    --teal: #54C6D8; --accent: #FF7A3D; --accent-hover: #FF9460;
    --deep: #082B3E; --deep-surface: #0D3A52; --deep-line: #1D4D66;
    --abyss: #040F18; --abyss-surface: #081C2A; --abyss-line: #123447;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #061722; --surface: #0C2433; --ink: #E4F1F0; --muted: #93B3BB; --line: #1D3B4A;
  --teal: #54C6D8; --accent: #FF7A3D; --accent-hover: #FF9460;
  --deep: #082B3E; --deep-surface: #0D3A52; --deep-line: #1D4D66;
  --abyss: #040F18; --abyss-surface: #081C2A; --abyss-line: #123447;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--bg);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.7rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--teal); }
.wrap {
  max-width: 1152px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.section { padding-block: clamp(3.5rem, 8vw, 6rem); position: relative; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }

/* Zonas de profundidade: cada uma redefine os tokens de leitura */
.z-light { background: var(--bg); }
.z-surface { background: var(--surface); }
.z-deep { background: var(--deep); color: var(--deep-ink); --ink: var(--deep-ink); --muted: var(--deep-muted); --line: var(--deep-line); --surface: var(--deep-surface); --teal: var(--deep-teal); }
.z-abyss { background: var(--abyss); color: var(--deep-ink); --ink: var(--deep-ink); --muted: var(--deep-muted); --line: var(--abyss-line); --surface: var(--abyss-surface); --teal: var(--deep-teal); }

.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); font-weight: 500; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.28rem); color: var(--muted); max-width: 38rem; }
.section-head { display: grid; gap: 1rem; max-width: 44rem; margin-bottom: 2.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.4rem; border-radius: 10px; border: 2px solid transparent;
  font: 600 1rem/1.2 var(--font-body); background: var(--accent); color: var(--accent-ink);
  text-decoration: none; cursor: pointer; transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { min-height: 40px; padding: 0.45rem 1rem; font-size: 0.95rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Cabeçalho */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; flex: none; color: var(--teal); }
.brand em { font-style: normal; font-weight: 500; color: var(--teal); }
.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.98rem; padding-block: 0.4rem; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); }
@media (max-width: 720px) { .nav .btn { display: none; } .nav { gap: 1rem; } }

/* Hero */
.hero { overflow: hidden; padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; position: relative; z-index: 1; }
.hero-copy { display: grid; gap: 1.5rem; padding-top: 0.5rem; }
.deeper { color: var(--teal); text-decoration: underline wavy var(--accent); text-decoration-thickness: 3px; text-underline-offset: 0.14em; text-decoration-skip-ink: none; }
.facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 0; margin: 0; list-style: none; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.facts li::before { content: "\25BE"; color: var(--accent); margin-right: 0.45rem; }
.bubble { position: absolute; border: 1.5px solid var(--teal); border-radius: 50%; opacity: 0.3; pointer-events: none; }
.b1 { width: 90px; height: 90px; right: 6%; top: 8%; }
.b2 { width: 34px; height: 34px; right: 22%; top: 3%; }
.b3 { width: 56px; height: 56px; left: 46%; bottom: 6%; }
.b4 { width: 18px; height: 18px; left: 4%; bottom: 14%; }
@media (prefers-reduced-motion: no-preference) {
  .bubble { animation: rise 7s ease-in-out infinite alternate; }
  .b2 { animation-duration: 9s; } .b3 { animation-duration: 8s; animation-delay: -3s; } .b4 { animation-duration: 6s; }
}
@keyframes rise { from { transform: translateY(0); } to { transform: translateY(-22px); } }
@media (max-width: 880px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

/* Formulário */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.25rem, 3vw, 1.9rem); display: grid; gap: 1.1rem; box-shadow: 0 18px 40px -28px var(--ink); }
.card h2 { font-size: 1.6rem; }
.card .sub { color: var(--muted); font-size: 0.98rem; }
.field { display: grid; gap: 0.35rem; min-width: 0; }
.field label { font-size: 0.85rem; font-weight: 600; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 0.55rem 0.8rem; font: 400 1rem var(--font-body);
  color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px;
}
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
@media (max-width: 480px) { .two { grid-template-columns: minmax(0, 1fr); } }
.form-error { color: var(--ink); background: var(--bg); border: 1.5px solid var(--accent); border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.93rem; }
.fine { font-size: 0.85rem; color: var(--muted); }
.result textarea { width: 100%; min-height: 168px; resize: vertical; padding: 0.8rem; font: 400 0.95rem/1.5 var(--font-body); color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; }
.status { min-height: 1.4em; font-size: 0.9rem; color: var(--teal); }

/* Benefícios */
.rows { display: grid; }
.row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1rem 3rem; padding-block: 1.6rem; border-top: 1px solid var(--line); align-items: baseline; }
.row:last-child { border-bottom: 1px solid var(--line); }
.row p { color: var(--muted); max-width: 34rem; }
@media (max-width: 720px) { .row { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; } }

/* Níveis como profundidade */
.levels { display: grid; margin: 0; padding: 0; list-style: none; }
.level { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.5rem 1.5rem; padding-block: 1.4rem; border-top: 1px solid var(--line); transition: background 0.2s ease; }
.level:last-child { border-bottom: 1px solid var(--line); }
.depth-n { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 500; color: var(--teal); line-height: 1.2; font-variant-numeric: tabular-nums; }
.level h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; }
.code { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.1em; color: var(--accent); }
.level p { color: var(--muted); margin-top: 0.3rem; max-width: 36rem; }
.bar-track { height: 4px; background: var(--line); border-radius: 2px; margin-top: 0.9rem; max-width: 36rem; }
.bar-track span { display: block; height: 100%; border-radius: 2px; background: var(--teal); width: calc(var(--d) / 40 * 100%); min-width: 4px; }
.level:hover .bar-track span { background: var(--accent); }
.caption { margin-top: 1.5rem; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--muted); }
@media (max-width: 480px) { .level { grid-template-columns: minmax(0, 1fr); } }

/* Fases */
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.phase { border-top: 3px solid var(--teal); padding-top: 1rem; display: grid; gap: 0.5rem; align-content: start; }
.phase .min { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); letter-spacing: 0.08em; }
.phase p { color: var(--muted); }
@media (max-width: 760px) { .phases { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: end; margin-bottom: 2.5rem; }
@media (max-width: 760px) { .split { grid-template-columns: minmax(0, 1fr); align-items: start; } }

/* FAQ */
.faq { max-width: 52rem; }
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.15rem; font-weight: 600; font-size: 1.1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.4rem; color: var(--accent); flex: none; }
details[open] summary::after { content: "\2212"; }
details p { padding-bottom: 1.2rem; color: var(--muted); max-width: 42rem; }

/* CTA e rodapé */
.cta { text-align: left; display: grid; gap: 1.5rem; justify-items: start; }
.footer { padding-block: 2.25rem; border-top: 1px solid var(--abyss-line); font-size: 0.92rem; color: var(--muted); }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; }
.footer a { color: var(--deep-ink); }
.footer .brand { color: var(--deep-ink); font-size: 1.05rem; }
.footer .brand svg, .footer .brand em { color: var(--deep-teal); }

/* Como funciona */
.page-hero { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.page-hero .wrap { display: grid; gap: 1.25rem; max-width: 1152px; }
.steps { display: grid; max-width: 46rem; }
.step { position: relative; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1.25rem; padding-bottom: 2.25rem; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 1.5rem; top: 3.2rem; bottom: 0.4rem; width: 2px; background: var(--line); }
.node { width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid var(--teal); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 500; color: var(--teal); background: var(--surface); }
.step h3 { margin-bottom: 0.4rem; padding-top: 0.55rem; }
.step p { color: var(--muted); }
.needs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.need { border-top: 1px solid var(--line); padding-top: 1rem; display: grid; gap: 0.4rem; align-content: start; }
.need p { color: var(--muted); }
@media (max-width: 760px) { .needs { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
.seg-bar { display: flex; gap: 6px; margin-bottom: 0.9rem; }
.seg { flex: var(--min) 1 0; min-width: 0; min-height: 64px; padding: 0.6rem 0.8rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 600 0.95rem var(--font-body); text-align: left; cursor: pointer; display: grid; gap: 0.1rem; align-content: center; }
.seg small { font-family: var(--font-mono); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted); }
.seg[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg[aria-pressed="true"] small { color: var(--accent-ink); }
.scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-bottom: 2rem; }
.panel { max-width: 46rem; display: grid; gap: 0.75rem; }
.panel p { color: var(--muted); }

/* Medidor de profundidade */
.depth-pill {
  position: fixed; z-index: 15; bottom: max(12px, env(safe-area-inset-bottom, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  display: flex; align-items: baseline; gap: 0.35rem; padding: 0.35rem 0.8rem; border-radius: 999px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.82rem; font-variant-numeric: tabular-nums; pointer-events: none;
}
.depth-pill b { color: var(--accent); font-weight: 500; }
.gauge { display: none; }
@media (min-width: 1360px) {
  .depth-pill { display: none; }
  .gauge {
    display: block; position: fixed; z-index: 15; top: 50%; transform: translateY(-50%);
    right: max(16px, env(safe-area-inset-right, 0px)); width: 4.2rem; height: min(54vh, 420px);
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px; pointer-events: none;
  }
  .gauge-line { position: absolute; left: 1.2rem; top: 1.1rem; bottom: 1.1rem; width: 2px; background: var(--line); }
  .tick { position: absolute; left: 0.95rem; width: 0.6rem; height: 2px; background: var(--muted); }
  .tick span { position: absolute; left: 1rem; top: -0.55em; font-family: var(--font-mono); font-size: 0.65rem; color: var(--muted); }
  .gauge-dot { position: absolute; left: 0.95rem; width: 0.6rem; height: 0.6rem; margin-left: 0.0rem; border-radius: 50%; background: var(--accent); transform: translate(0, -50%); }
  .gauge-read { position: absolute; left: 0; right: 0; bottom: 0.5rem; text-align: center; font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); }
}
