/* =========================================================
   Uberlândia Network · Editorial Luxo Claro
   Escala Fibonacci: 3 5 8 13 21 34 55 89 144 233
   Proporção áurea: φ = 1,618 · colunas 1 : 1,618
   ========================================================= */

:root {
  --ice: #f4f4f1;
  --paper: #fbfbf9;
  --ink: #0a0a0b;
  --graphite: #1b1c20;
  --graphite-2: #2a2b30;
  --mute: #6d6e74;
  --mute-2: #9a9ba0;
  --line: rgba(27, 28, 32, .12);
  --line-2: rgba(27, 28, 32, .22);
  --err: #9b2fc9;

  --c1: #00caf2; --c2: #085fbc; --c3: #12227a; --c4: #2e1280; --c5: #6438ae; --c6: #bf51e8;
  --grad: linear-gradient(100deg, #00caf2 0%, #085fbc 24%, #12227a 44%, #2e1280 56%, #6438ae 76%, #bf51e8 100%);
  --grad-soft: linear-gradient(100deg, #00caf2, #085fbc 30%, #6438ae 70%, #bf51e8);

  --f1: 3px; --f2: 5px; --f3: 8px; --f4: 13px; --f5: 21px; --f6: 34px; --f7: 55px; --f8: 89px; --f9: 144px;
  --gutter: 21px;
  --mast-h: 55px;
  --dock-h: 102px;

  --serif: 'Bodoni Moda', 'Didot', 'Bodoni 72', 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --ease: cubic-bezier(.22, .8, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  --bg: var(--ice);
  --fg: var(--graphite);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-variant-numeric: lining-nums;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .9s var(--ease), color .9s var(--ease);
}
button { font: inherit; color: inherit; }
::selection { background: rgba(100, 56, 174, .18); }
:focus-visible { outline: 2px solid var(--c2); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
/* Bodoni Moda: tamanho óptico fixo para fios que não somem em telas de baixa densidade */
.mast-name, .lvl, .motto, .step-hint, .field input, .list .opt .t, .tile .t, .riddle, .pact-list li, .seal-txt strong { font-optical-sizing: none; font-variation-settings: 'opsz' 11; }
.display, .step-title, .step-roman, .tile.big .t, .riddle.seq { font-optical-sizing: none; font-variation-settings: 'opsz' 16; }

.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.dim { color: var(--mute); }
.small { font-size: 10px; }
.grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  padding-right: .06em;
}
.linkish { background: none; border: 0; padding: 0 0 1px; min-height: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--graphite); }

/* ---------------- Logo viajante ---------------- */
.traveler {
  position: fixed; left: 0; top: 0; z-index: 6;
  width: 300px; height: 300px;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
}
.is-step .traveler { z-index: 11; }
.traveler canvas, .traveler img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.traveler img { object-fit: contain; padding: 14%; display: none; transition: transform .2s linear; }
.traveler.no-gl canvas { display: none; }
.traveler.no-gl img { display: block; }
.traveler-glow {
  position: absolute; inset: -20%; border-radius: 50%; opacity: 0;
  background:
    radial-gradient(closest-side at 38% 46%, rgba(0, 202, 242, .55), transparent 70%),
    radial-gradient(closest-side at 64% 56%, rgba(191, 81, 232, .55), transparent 72%);
  transition: opacity 1.4s var(--ease);
}
.is-final .traveler-glow { opacity: .55; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08) rotate(8deg); opacity: .8; } }

/* ---------------- Cabeçalho ---------------- */
.mast {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: calc(var(--mast-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  display: flex; align-items: center; gap: var(--f4);
  background: linear-gradient(to bottom, var(--bg) 62%, transparent);
  transition: background .9s var(--ease);
}
.mast-brand { display: flex; align-items: center; gap: var(--f3); min-width: 0; flex: 1; }
.mast-name {
  font-family: var(--serif); font-weight: 500; font-size: 16px; letter-spacing: -.005em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.mast-name i { font-weight: 400; color: var(--mute); display: none; }
.mast-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.3; }
.mast-meta .mono { font-size: 9.5px; }
.slot-mast { width: 0; height: 26px; transition: width .6s var(--ease); flex: none; }
.back {
  display: none; place-items: center; flex: none;
  width: 44px; height: 44px; margin-left: -10px;
  border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--graphite);
  transition: background .2s;
}
.back:hover { background: rgba(27, 28, 32, .06); }
.progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0; height: 1px; background: var(--line); opacity: 0; transition: opacity .5s; }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--grad); transition: width .9s var(--ease); }
.progress i::after { content: ''; position: absolute; right: -2px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--c6); box-shadow: 0 0 0 3px rgba(191, 81, 232, .18); }

.is-step .back { display: grid; }
.is-step .slot-mast { width: 36px; }
.is-step .progress { opacity: 1; }
.is-step .mast-meta .dim { display: none; }

/* ---------------- Telas ---------------- */
main { position: relative; z-index: 3; }
.screen { display: none; }
.screen.is-active { display: block; }
.intro.is-active, .final.is-active { display: block; }
.screen.is-leaving { animation: leave .32s var(--ease-io) forwards; pointer-events: none; }
.dir-back .screen.is-leaving { animation-name: leave-back; }
@keyframes leave { to { opacity: 0; transform: translateY(-21px); filter: blur(4px); } }
@keyframes leave-back { to { opacity: 0; transform: translateY(21px); filter: blur(4px); } }

.is-entering .reveal-up, .is-entering .q, .is-entering .step-head > * {
  animation: rise .9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms + 60ms);
}
.dir-back .is-entering .reveal-up, .dir-back .is-entering .q, .dir-back .is-entering .step-head > * { animation-name: rise-back; }
@keyframes rise { from { opacity: 0; transform: translateY(21px); } }
@keyframes rise-back { from { opacity: 0; transform: translateY(-13px); } }

/* ---------------- Capa ---------------- */
.intro {
  padding: calc(var(--mast-h) + env(safe-area-inset-top)) var(--gutter) calc(var(--dock-h) + env(safe-area-inset-bottom));
}
.intro-art {
  position: relative;
  height: clamp(180px, 29svh, 290px);
  margin: 0 calc(var(--gutter) * -1);
}
.slot-hero {
  position: absolute; inset: 9% 15% 13%;
  pointer-events: auto; cursor: grab; touch-action: pan-y;
}
.slot-hero:active { cursor: grabbing; }
.hero-shadow {
  position: absolute; left: 50%; bottom: 6%; width: 46%; height: 13px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(27, 28, 32, .22), transparent);
  filter: blur(2px); pointer-events: none;
}
.phi { position: absolute; inset: 0; pointer-events: none; }
.phi .h, .phi .v { position: absolute; background: var(--line); }
.phi .h { left: 0; right: 0; height: 1px; }
.phi .v { top: 0; bottom: 0; width: 1px; }
.phi .h1 { top: 38.2%; } .phi .h2 { top: 61.8%; }
.phi .v1 { left: 38.2%; } .phi .v2 { left: 61.8%; }
.phi .h, .phi .v { transform-origin: left; animation: draw-x 1.6s var(--ease) both .2s; }
.phi .v { transform-origin: top; animation-name: draw-y; }
@keyframes draw-x { from { transform: scaleX(0); } }
@keyframes draw-y { from { transform: scaleY(0); } }
.phi .spiral {
  position: absolute; left: 50%; top: 50%; width: 92%; height: 92%; transform: translate(-50%, -50%);
  overflow: visible; opacity: .9;
}
.phi .spiral .sq { stroke: rgba(27, 28, 32, .07); stroke-width: 1; }
.phi .spiral .arc { stroke: rgba(100, 56, 174, .3); stroke-width: .28; stroke-dasharray: 1; stroke-dashoffset: 1; animation: spiral 3.2s var(--ease) .5s forwards; }
@keyframes spiral { to { stroke-dashoffset: 0; } }
.phi-tag { position: absolute; font-size: 9px; text-transform: none; color: var(--mute-2); letter-spacing: .14em; }
.phi-tag.t1 { left: calc(61.8% + 6px); top: calc(38.2% - 16px); }
.phi-tag.t2 { left: var(--gutter); bottom: 6px; }

.kicker { color: var(--mute); margin: var(--f4) 0 var(--f4); display: flex; align-items: center; gap: var(--f3); }
.kicker::before { content: ''; width: 21px; height: 1px; background: var(--grad); flex: none; }

.display {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(36px, 10.6vw, 50px);
  line-height: 1.02; letter-spacing: -.025em; font-weight: 500;
  margin: 0; text-wrap: balance;
}
.display em { font-style: italic; font-weight: 500; }
.lede { font-size: 15px; line-height: 1.618; color: var(--graphite-2); margin: var(--f5) 0 0; max-width: 34em; text-wrap: pretty; }

.levels {
  list-style: none; padding: 0; margin: var(--f5) 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.lvl {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: var(--f4) var(--f3) var(--f4) var(--f4);
}
.lvl:first-child { padding-left: 0; }
.lvl + .lvl { border-left: 1px solid var(--line); }
.lvl-n { font-family: var(--serif); font-size: 17px; line-height: 1; color: var(--mute); padding-right: .1em; }
.lvl-name { font-family: var(--serif); font-size: 17px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.lvl-desc { font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); line-height: 1.4; }
.lvl-here .lvl-n { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lvl-here::after {
  content: ''; position: absolute; left: 0; top: -1px; height: 2px; width: 100%;
  background: var(--grad); transform-origin: left; animation: draw-x 1.4s var(--ease) both 1s;
}
.lvl-here .lvl-desc { color: var(--graphite); }
.intro-foot { margin-top: var(--f5); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--f3) var(--f5); }
.motto { font-family: var(--serif); font-size: 15px; color: var(--mute); margin: 0; }

/* ---------------- Doca / CTA ---------------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: var(--f5) var(--gutter) calc(var(--f4) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 58%, rgba(244, 244, 241, 0));
  transition: transform .6s var(--ease), opacity .4s;
}
.is-final .dock { transform: translateY(110%); opacity: 0; pointer-events: none; }
.dock-inner { display: flex; flex-direction: column; gap: var(--f3); }
.dock-note { margin: 0; color: var(--mute); text-align: center; font-size: 10px; min-height: 15px; transition: color .3s; }
.dock-note.warn { color: var(--err); }
.cta {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: var(--f4);
  width: 100%; height: 56px; padding: 0 var(--f3) 0 var(--f5);
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--graphite); color: var(--ice);
  font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: .02em;
  box-shadow: 0 13px 34px -13px rgba(10, 10, 11, .55);
  transition: transform .25s var(--ease), background .4s, box-shadow .4s, color .4s;
}
.cta::before {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--grad);
  transform: translateX(-101%); transition: transform .7s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .cta:not(.is-muted):hover::before { transform: translateX(0); }
  .cta:not(.is-muted):hover .cta-arrow { transform: translateX(3px); background: rgba(255, 255, 255, .16); }
}
.cta:active { transform: scale(.985); }
.cta-arrow {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad); color: #fff; transition: transform .4s var(--ease);
}
.cta.is-muted { background: #d9d9d4; color: var(--graphite-2); box-shadow: none; }
.cta.is-muted .cta-arrow { background: rgba(27, 28, 32, .12); color: var(--graphite-2); }
.cta.is-ready .cta-arrow { animation: nudge 1.6s var(--ease) infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: translateX(0); } 30% { transform: translateX(4px); } }
.cta.is-busy { pointer-events: none; }
.cta.is-busy .cta-arrow svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cta.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------------- Etapas ---------------- */
.step {
  padding: calc(var(--mast-h) + env(safe-area-inset-top) + var(--f5)) var(--gutter) calc(var(--dock-h) + env(safe-area-inset-bottom) + var(--f5));
}
.step-head { position: relative; margin-bottom: var(--f6); }
.step-num {
  display: flex; align-items: baseline; gap: var(--f4);
}
.step-roman {
  font-family: var(--serif); font-weight: 400; letter-spacing: .02em;
  font-size: 50px; line-height: .8;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .08em;
}
.step-of { color: var(--mute); }
.step-title { font-family: var(--serif); font-weight: 450; font-size: clamp(32px, 9vw, 40px); line-height: 1.04; letter-spacing: -.025em; margin: var(--f4) 0 0; outline: none; }
.step-hint { margin: var(--f3) 0 0; color: var(--mute); font-family: var(--serif); font-style: italic; font-size: 16px; }
.slot-step { display: none; }

.q { margin-top: var(--f6); scroll-margin-top: calc(var(--mast-h) + 34px); }
.q:first-child { margin-top: 0; }
.q-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--f4);
  margin: 0 0 var(--f4); font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute);
}
.q-count { display: inline-flex; align-items: center; gap: 4px; color: var(--graphite); flex: none; }
.q-count i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); transition: background .3s, transform .3s var(--ease); }
.q-count i.on { background: var(--c, var(--c5)); transform: scale(1.3); }
.q-count.bump { animation: bump .4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.18); color: var(--err); } }
.q-err { color: var(--err); font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; margin: var(--f3) 0 0; min-height: 0; }
.q.has-err .q-label { color: var(--err); }

/* campos de texto */
.field { position: relative; }
.field input {
  width: 100%; height: 55px; padding: 8px 0 6px; margin: 0;
  border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; background: transparent;
  font-family: var(--serif); font-size: 23px; font-weight: 400; color: var(--graphite); letter-spacing: -.005em;
  outline: none; -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: #b9b9b4; font-style: italic; font-weight: 400; }
.field::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--grad);
  transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease);
}
.field:focus-within::after { transform: scaleX(1); }
.field.ok .tick { opacity: 1; transform: scale(1); }
.tick {
  position: absolute; right: 0; bottom: 17px; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; background: var(--grad); color: #fff;
  opacity: 0; transform: scale(.4); transition: opacity .3s, transform .5s var(--ease); pointer-events: none;
}
.fields { display: grid; gap: var(--f5); }
.suggest { display: flex; flex-wrap: wrap; gap: var(--f3); margin-top: var(--f4); }
.suggest button {
  min-height: 34px; padding: 0 var(--f4); border-radius: 999px; border: 1px dashed var(--line-2); background: transparent;
  font-size: 13px; color: var(--graphite-2); cursor: pointer; transition: border-color .2s, background .2s;
  position: relative;
}
.suggest button::before { content: ''; position: absolute; inset: -5px 0; }
.suggest button:hover { border-color: var(--c5); background: rgba(100, 56, 174, .05); }

/* segmento deslizante (escolhas curtas) */
.seg {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; border-radius: 999px; background: rgba(27, 28, 32, .055);
}
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 999px;
  background: var(--graphite); box-shadow: 0 8px 21px -8px rgba(10, 10, 11, .5);
  opacity: 0; transition: transform .55s var(--ease), width .55s var(--ease), opacity .3s;
}
.seg-thumb::after { content: ''; position: absolute; left: 50%; bottom: 6px; width: 13px; height: 2px; margin-left: -6.5px; border-radius: 2px; background: var(--grad); }
.seg .opt {
  position: relative; z-index: 1; min-height: 48px; padding: 0 4px; border: 0; background: none; border-radius: 999px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--graphite-2); cursor: pointer;
  transition: color .35s; white-space: nowrap;
}
.seg .opt[aria-checked="true"] { color: var(--ice); }

/* lista editorial (escolhas longas) */
.list { display: grid; border-top: 1px solid var(--line); }
.list .opt {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 34px 1fr 28px; align-items: center; gap: var(--f3);
  min-height: 60px; padding: var(--f4) var(--f3) var(--f4) 0; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer;
  transition: background .3s, padding .45s var(--ease);
}
.list .opt .n { font-family: var(--mono); font-size: 10px; color: var(--mute-2); letter-spacing: .1em; }
.list .opt .t { font-family: var(--serif); font-size: 18px; font-weight: 450; line-height: 1.25; color: var(--graphite); letter-spacing: -.01em; }
.list .opt .d { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--mute); margin-top: 2px; line-height: 1.4; }
.list .opt .mark {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; color: #fff; transition: background .3s, border-color .3s, transform .5s var(--ease);
}
.list .opt .mark svg { opacity: 0; transform: scale(.5); transition: opacity .25s, transform .45s var(--ease); }
.list .opt:hover { background: rgba(27, 28, 32, .025); }
.list .opt[aria-checked="true"] { padding-left: var(--f3); }
.list .opt[aria-checked="true"] .mark { background: var(--grad); border-color: transparent; transform: rotate(-8deg); }
.list .opt[aria-checked="true"] .mark svg { opacity: 1; transform: scale(1); }
.list .opt[aria-checked="true"] .n { color: var(--c5); }
.list .opt::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--grad);
  transform: scaleY(0); transition: transform .45s var(--ease);
}
.list .opt[aria-checked="true"]::before { transform: scaleY(1); }

/* tiles (2×2 / 2×3) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--f3); }
.tile {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 89px; padding: var(--f4); border-radius: 13px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper);
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--f3);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 8px 21px -13px rgba(10, 10, 11, .18);
  transition: transform .35s var(--ease), border-color .3s, box-shadow .4s, background .4s, color .3s;
  transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.tile .t { font-family: var(--serif); font-weight: 450; font-size: 18px; line-height: 1.15; letter-spacing: -.01em; }
.tile.big .t { font-size: 40px; line-height: 1; letter-spacing: -.02em; }
.tile .ix { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--mute-2); display: flex; justify-content: space-between; align-items: center; }
.tile .ico { width: 26px; height: 26px; color: var(--graphite-2); transition: color .3s; }
.tile .ico path, .tile .ico circle, .tile .ico rect { vector-effect: non-scaling-stroke; }
.tile::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.5px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
.tile:hover { border-color: var(--line-2); }
.tile[aria-checked="true"], .tile[aria-pressed="true"] {
  background: var(--graphite); color: var(--ice); border-color: transparent;
  box-shadow: 0 21px 34px -21px rgba(46, 18, 128, .55);
}
.tile[aria-checked="true"] .ico, .tile[aria-pressed="true"] .ico { color: #fff; }
.tile[aria-checked="true"] .ix, .tile[aria-pressed="true"] .ix { color: rgba(255, 255, 255, .55); }
.tile[aria-checked="true"]::after, .tile[aria-pressed="true"]::after { opacity: 1; }
.tile .gem { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg) scale(0); background: var(--grad); transition: transform .5s var(--ease); }
.tile[aria-checked="true"] .gem, .tile[aria-pressed="true"] .gem { transform: rotate(45deg) scale(1); }

/* chips (múltipla escolha) */
.chips { display: flex; flex-wrap: wrap; gap: var(--f3); }
.chip {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: var(--f3);
  min-height: 44px; padding: 0 var(--f4) 0 var(--f4); border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent;
  font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--graphite);
  transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease), opacity .3s;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .9; transition: transform .45s var(--ease), box-shadow .45s; flex: none; }
.chip:hover { border-color: var(--graphite-2); }
.chip[aria-pressed="true"] { background: var(--graphite); color: var(--ice); border-color: var(--graphite); }
.chip[aria-pressed="true"] .dot { transform: scale(1.35); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent); }
.chips.full .chip[aria-pressed="false"] { opacity: .38; }
.all-toggle { margin-top: var(--f4); }

/* ripple de toque */
.rip { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  background: radial-gradient(closest-side, rgba(100, 56, 174, .28), transparent); animation: rip .7s var(--ease) forwards; }
@keyframes rip { to { transform: scale(40); opacity: 0; } }
.opt > *, .chip > *, .tile > * { position: relative; z-index: 1; }

/* ---------------- Enigmas (baralho) ---------------- */
.deck { position: relative; margin: 0 calc(var(--gutter) * -1); overflow: hidden; overflow: clip; touch-action: pan-y; }
.deck { transition: height .55s var(--ease); }
.deck-track { display: flex; align-items: flex-start; transition: transform .7s var(--ease); will-change: transform; }
.deck.dragging .deck-track { transition: none; }
.card { flex: 0 0 100%; padding: 0 var(--gutter); }
.card .q { margin-top: 0; }
.riddle {
  font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.3; letter-spacing: -.01em; margin: 0 0 var(--f5); text-wrap: pretty; color: var(--graphite);
}
.riddle.seq { font-size: 34px; letter-spacing: .02em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.riddle.seq .sep { color: var(--mute-2); font-size: .6em; }
.riddle.seq .qmark {
  display: inline-grid; place-items: center; width: 1.1em; height: 1.1em; border-radius: 8px; font-style: italic;
  border: 1px solid var(--line-2); position: relative;
}
.riddle.seq .qmark::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 1.5px solid var(--c5); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }
.deck-nav { display: flex; align-items: center; justify-content: space-between; margin-top: var(--f5); }
.deck-dots { display: flex; gap: var(--f3); }
.deck-dots button { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; position: relative; padding: 0; }
.deck-dots button::before { content: ''; position: absolute; left: 50%; top: 50%; width: 21px; height: 3px; margin: -1.5px 0 0 -10.5px; border-radius: 3px; background: var(--line-2); transition: background .3s, width .4s var(--ease); }
.deck-dots button.done::before { background: var(--graphite-2); }
.deck-dots button[aria-current="true"]::before { background: var(--grad); width: 34px; margin-left: -17px; }
.deck-hint { color: var(--mute-2); }
.sealed { display: inline-flex; align-items: center; gap: 6px; color: var(--c5); opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .4s var(--ease); }
.card.answered .sealed { opacity: 1; transform: none; }

/* ---------------- Pacto (selo) ---------------- */
.pact-list { list-style: none; margin: 0 0 var(--f6); padding: 0; border-top: 1px solid var(--line); counter-reset: c; }
.pact-list li {
  display: grid; grid-template-columns: 34px 1fr; gap: var(--f3); padding: 10px 0; border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-size: 16px; line-height: 1.35;
}
.pact-list li span { color: var(--mute); }
.seal-wrap { display: flex; align-items: center; gap: var(--f5); }
.seal {
  position: relative; flex: none; width: 89px; height: 89px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--paper); box-shadow: 0 13px 34px -13px rgba(46, 18, 128, .45), inset 0 0 0 1px var(--line);
  display: grid; place-items: center; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: transform .3s var(--ease), background .5s;
}
.seal:active { transform: scale(.96); }
.seal svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.seal svg.ring circle { fill: none; stroke-width: 2.5; }
.seal svg.ring .bg { stroke: var(--line); }
.seal svg.ring .fg { stroke: url(#sealGrad); stroke-linecap: round; stroke-dasharray: 270; stroke-dashoffset: 270; }
.seal img { width: 42px; height: auto; transition: transform .5s var(--ease), filter .5s; filter: grayscale(1) opacity(.55); }
.seal.on { background: var(--graphite); }
.seal.on img { filter: none; transform: scale(1.08); }
.seal.on::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--c5); animation: pulse 1.2s var(--ease) 2; }
.seal-txt strong { display: block; font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.15; }
.seal-txt span { color: var(--mute); font-size: 13px; }

/* ---------------- Final (escuro) ---------------- */
.reveal {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% 30%, rgba(46, 18, 128, .45), transparent 70%),
    radial-gradient(50% 35% at 80% 90%, rgba(191, 81, 232, .14), transparent 70%),
    radial-gradient(50% 35% at 10% 80%, rgba(0, 202, 242, .1), transparent 70%),
    #0a0a0b;
  clip-path: circle(0 at var(--rx, 50%) var(--ry, 90%));
  transition: clip-path 1.3s cubic-bezier(.7, 0, .2, 1);
}
.reveal.on { clip-path: circle(150% at var(--rx, 50%) var(--ry, 90%)); }
.is-final { --bg: #0a0a0b; --fg: #f4f4f1; --line: rgba(244, 244, 241, .12); --line-2: rgba(244, 244, 241, .22); --mute: #9c9da4; color-scheme: dark; }
.is-final .mast { background: none; }
.is-final .back, .is-final .progress { display: none; }
.is-final .slot-mast { width: 0; }
body.is-final { transition-delay: .6s; }

.final {
  min-height: 100svh;
  padding: calc(var(--mast-h) + env(safe-area-inset-top)) var(--gutter) calc(var(--f6) + env(safe-area-inset-bottom));
  color: var(--ice); outline: none;
}
.final-art { position: relative; height: clamp(210px, 34svh, 320px); margin: 0 calc(var(--gutter) * -1); }
.slot-final { position: absolute; inset: 12% 12% 10%; }
.rings { position: absolute; inset: 0; pointer-events: none; }
.rings i {
  position: absolute; left: 50%; top: 50%; border-radius: 50%; aspect-ratio: 1;
  border: 1px solid transparent;
  background: conic-gradient(from var(--a, 0deg), rgba(0, 202, 242, .0), rgba(0, 202, 242, .6), rgba(100, 56, 174, .1), rgba(191, 81, 232, .6), rgba(0, 202, 242, 0)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  translate: -50% -50%; scale: .6; opacity: 0;
}
.rings i:nth-child(1) { width: 61.8%; }
.rings i:nth-child(2) { width: 89%; }
.rings i:nth-child(3) { width: 144%; max-width: 640px; }
.is-final .rings i { animation: ring-in 1.6s var(--ease) forwards, turn 21s linear infinite; }
.is-final .rings i:nth-child(1) { animation-delay: 1.1s, 1.1s; }
.is-final .rings i:nth-child(2) { animation-delay: 1.3s, 1.3s; animation-direction: normal, reverse; }
.is-final .rings i:nth-child(3) { animation-delay: 1.5s, 1.5s; }
@keyframes ring-in { to { opacity: .8; scale: 1; } }
@keyframes turn { to { rotate: 360deg; } }

.final-copy > * { opacity: 0; transform: translateY(21px); }
.is-final .final-copy > * { animation: rise-in 1.1s var(--ease) forwards; }
.is-final .final-copy > :nth-child(1) { animation-delay: 1.2s; }
.is-final .final-copy > :nth-child(2) { animation-delay: 1.35s; }
.is-final .final-copy > :nth-child(3) { animation-delay: 1.5s; }
.is-final .final-copy > :nth-child(4) { animation-delay: 1.65s; }
.is-final .final-copy > :nth-child(5) { animation-delay: 1.8s; }
.is-final .final-copy > :nth-child(6) { animation-delay: 1.95s; }
@keyframes rise-in { to { opacity: 1; transform: none; } }
.final .kicker { color: #9c9da4; }
.final .lede { color: #c9c9cd; }
.final .display { font-size: clamp(38px, 11.4vw, 55px); }
.protocol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--f3) var(--f4); margin-top: var(--f6); padding: var(--f4) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proto-code {
  font-size: 22px; letter-spacing: .32em; color: #fff; background: none; border: 0; padding: 6px 0; min-height: 44px; cursor: copy;
  text-shadow: 0 0 21px rgba(100, 56, 174, .9);
}
.final-actions { margin-top: var(--f5); }
.btn { min-height: 52px; padding: 0 var(--f5); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.btn-light { background: transparent; color: var(--ice); border: 1px solid rgba(244, 244, 241, .3); transition: background .3s, border-color .3s; }
.btn-light:hover { background: rgba(244, 244, 241, .08); border-color: rgba(244, 244, 241, .6); }
.final .motto { margin-top: var(--f6); color: #8d8e95; }

/* ---------------- Utilitários ---------------- */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.toast {
  position: fixed; left: 50%; top: calc(var(--mast-h) + 8px + env(safe-area-inset-top)); z-index: 20; transform: translate(-50%, -13px);
  padding: 10px 17px; border-radius: 999px; background: var(--graphite); color: var(--ice); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease); max-width: calc(100vw - 42px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- Telas pequenas ---------------- */
@media (max-width: 370px) {
  :root { --gutter: 18px; }
  .lvl-name { font-size: 15.5px !important; }
  .lvl { padding-left: var(--f3); }
  .kicker { font-size: 9.5px; letter-spacing: .08em; }
  .display { font-size: 36px; }
  .lvl { padding: 10px 0; }
  .lvl-name { font-size: 21px; }
  .seg .opt { font-size: 13px; }
  .field input { font-size: 21px; }
  .riddle.seq { font-size: 30px; }
  .mast-meta { display: none; }
}
@media (max-height: 760px) and (max-width: 700px) {
  .intro-art { height: clamp(170px, 27svh, 230px); }
  .levels { margin-top: var(--f5); }
  .lede { margin-top: var(--f4); font-size: 14.5px; }
}

/* ---------------- Tablet / PC: colunas 1 : φ ---------------- */
@media (min-width: 900px) {
  :root { --gutter: 55px; --mast-h: 89px; }
  .mast-name { font-size: 19px; }
  .mast-meta .mono { font-size: 10px; }
  .intro {
    grid-template-columns: 1.618fr 1fr; align-items: center; gap: var(--f7);
    min-height: 100svh; padding: var(--mast-h) var(--gutter) var(--f8);
  }
  .intro-art { height: min(68svh, 640px); margin: 0; }
  .slot-hero { inset: 12% 13% 14%; }
  .phi-tag.t2 { left: 0; bottom: 0; }
  .intro-copy { padding-bottom: var(--f8); }
  .display { font-size: clamp(50px, 4.7vw, 80px); }
  .lede { font-size: 16px; }
  .levels { display: block; border-bottom: 0; margin-top: var(--f6); }
  .lvl { display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; gap: var(--f4); padding: var(--f4) 0; border-bottom: 1px solid var(--line); }
  .lvl + .lvl { border-left: 0; }
  .lvl-n { font-size: 19px; }
  .lvl-name { font-size: 22px; }
  .lvl-desc { font-size: 10px; letter-spacing: .12em; }
  .lvl-here::after { top: auto; bottom: -1px; height: 1px; }
  .intro.is-active { display: grid; }
  .phi .spiral .arc { stroke-width: .14; }
  .final.is-active { display: grid; }
  .mast-name i { display: inline; }

  .dock {
    left: auto; right: var(--gutter); bottom: var(--f6); width: min(400px, calc(38.2vw - 55px)); padding: 0; background: none;
  }
  .is-intro .dock { width: calc((100vw - 2 * var(--gutter) - 55px) / 2.618); }
  .dock-note { text-align: left; }
  .cta { height: 60px; font-size: 16px; }

  .step {
    grid-template-columns: 1fr 1.618fr; gap: var(--f8);
    max-width: 1440px; margin: 0 auto; min-height: 100svh;
    padding: calc(var(--mast-h) + var(--f6)) var(--gutter) calc(var(--f9) + var(--f5));
  }
  .step.is-active { display: grid; }
  .is-step .dock { left: calc(max(0px, (100vw - 1440px) / 2) + var(--gutter)); right: auto; width: min(400px, calc((min(100vw, 1440px) - 2 * var(--gutter) - 89px) / 2.618)); }
  .step-head { position: sticky; top: calc(var(--mast-h) + var(--f6)); align-self: start; margin: 0; }
  .step-roman { font-size: 144px; }
  .step-title { font-size: clamp(48px, 4vw, 64px); margin-top: var(--f5); }
  .step-hint { font-size: 19px; }
  .slot-step { display: block; width: 144px; height: 106px; margin-top: var(--f7); }
  .is-step .slot-mast { width: 0; }
  .step-body { padding-top: var(--f5); max-width: 720px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tiles.six { grid-template-columns: repeat(3, 1fr); }
  .tile { min-height: 110px; }
  .tile.big .t { font-size: 50px; }
  .riddle { font-size: 28px; }
  .riddle.seq { font-size: 50px; }
  .list .opt .t { font-size: 20px; }
  .field input { font-size: 26px; }
  .deck { margin: 0; }
  .card { padding: 0 2px; }
  .final {
    grid-template-columns: 1.618fr 1fr; align-items: center; gap: var(--f7);
    padding: var(--mast-h) var(--gutter) var(--f7);
  }
  .final-art { height: min(66svh, 620px); margin: 0; }
  .final .display { font-size: clamp(55px, 5vw, 84px); }
}
@media (min-width: 1500px) {
  .intro, .final { max-width: 1600px; margin: 0 auto; }
}
@media (hover: hover) and (pointer: fine) {
  .tile:hover { transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { transition: none; }
}

/* =========================================================
   Enxerto "Inconfidência": grid X/Y, coordenadas, serra, selo do lema
   ========================================================= */
/* papel milimetrado: grid X/Y sutil em toda a página (Fibonacci 34/89) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(to right, rgba(27, 28, 32, .045) 1px, transparent 1px) 0 0 / 89px 89px,
    linear-gradient(to bottom, rgba(27, 28, 32, .045) 1px, transparent 1px) 0 0 / 89px 89px,
    linear-gradient(to right, rgba(27, 28, 32, .022) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(to bottom, rgba(27, 28, 32, .022) 1px, transparent 1px) 0 0 / 34px 34px;
  -webkit-mask: radial-gradient(120% 80% at 50% 20%, #000 30%, transparent 85%);
  mask: radial-gradient(120% 80% at 50% 20%, #000 30%, transparent 85%);
  transition: opacity 1s;
}
.is-final::before { opacity: 0; }

/* aura atrás da logo */
.aura {
  position: absolute; left: 50%; top: 46%; width: 62%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 200deg, rgba(0, 202, 242, .16), rgba(100, 56, 174, .1), rgba(191, 81, 232, .16), rgba(8, 95, 188, .1), rgba(0, 202, 242, .16));
  filter: blur(34px); opacity: .9;
  animation: aura 21s linear infinite;
}
@keyframes aura { to { rotate: 360deg; } }

/* serra do Triângulo: linhas de contorno */
.serra { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 38.2%; pointer-events: none; overflow: visible; }
.serra path { fill: none; stroke: rgba(27, 28, 32, .1); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: spiral 2.6s var(--ease) forwards; animation-delay: calc(.3s + var(--k) * .12s); }
.serra path.top { stroke: url(#sg); stroke-width: 1.2; opacity: .55; }

/* marcas de coordenada nos cantos (régua de agrimensor) */
.ticks { position: absolute; inset: 0; pointer-events: none; }
.ticks i { position: absolute; width: 13px; height: 13px; border-color: var(--line-2); border-style: solid; border-width: 0; }
.ticks i:nth-child(1) { left: var(--gutter); top: 8px; border-left-width: 1px; border-top-width: 1px; }
.ticks i:nth-child(2) { right: var(--gutter); top: 8px; border-right-width: 1px; border-top-width: 1px; }
.ticks i:nth-child(3) { left: var(--gutter); bottom: 8px; border-left-width: 1px; border-bottom-width: 1px; }
.ticks i:nth-child(4) { right: var(--gutter); bottom: 8px; border-right-width: 1px; border-bottom-width: 1px; }
.ticks span { position: absolute; font-size: 8.5px; color: var(--mute-2); letter-spacing: .16em; }
.ticks .tk1 { left: calc(var(--gutter) + 18px); top: 9px; }
.ticks .tk2 { right: calc(var(--gutter) + 18px); top: 9px; }
.ticks .tk3 { right: calc(var(--gutter) + 18px); bottom: 9px; }
.phi-tag.t2 { left: calc(var(--gutter) + 18px); bottom: 9px; }

/* etapas: arte lateral e mapa (desktop) */
.step-art { display: none; }
.step-map { display: none; }
.mini-spiral { position: absolute; inset: -21px -34px; width: calc(100% + 68px); height: calc(100% + 42px); pointer-events: none; }
.mini-spiral path { stroke: rgba(100, 56, 174, .28); stroke-width: .5; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.is-entering .mini-spiral path, .step.is-active .mini-spiral path { animation: spiral 2.4s var(--ease) .3s forwards; }

/* selo circular do lema na tela final */
.motto-ring {
  position: absolute; left: 50%; top: 50%; height: 100%; width: auto; max-width: 92%; aspect-ratio: 1; translate: -50% -50%;
  pointer-events: none; opacity: 0; overflow: visible;
}
.motto-ring text { font-family: var(--mono); font-size: 6.6px; letter-spacing: .32em; fill: rgba(244, 244, 241, .42); }
.is-final .motto-ring { animation: ring-in 1.8s var(--ease) 1.6s forwards, turn 55s linear 1.6s infinite; scale: .9; }

/* tela final: grid X/Y e coordenadas sobre o escuro */
.final-art::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background:
    linear-gradient(to right, rgba(244, 244, 241, .06) 1px, transparent 1px) 50% 50% / 34px 34px,
    linear-gradient(to bottom, rgba(244, 244, 241, .06) 1px, transparent 1px) 50% 50% / 34px 34px;
  -webkit-mask: radial-gradient(closest-side, #000, transparent);
  mask: radial-gradient(closest-side, #000, transparent);
}
.final-art::after {
  content: 'X 18°55′S  ·  Y 48°16′W  ·  863 M'; position: absolute; left: calc(var(--gutter) - 4px); top: 50%; translate: 0 -50%; writing-mode: vertical-rl; rotate: 180deg; white-space: nowrap;
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em; color: rgba(244, 244, 241, .38); opacity: 0;
}
.is-final .final-art::before, .is-final .final-art::after { animation: rise-in 1.6s var(--ease) 1s forwards; transform: none; }
.proto-code { position: relative; }

@media (min-width: 900px) {
  .step-art { display: block; position: relative; width: 144px; margin-top: var(--f7); }
  .step-art .slot-step { margin-top: 0; }
  .step-map { display: grid; gap: 0; list-style: none; margin: var(--f7) 0 0; padding: 0; border-top: 1px solid var(--line); max-width: 340px; }
  .step-map li { display: grid; grid-template-columns: 34px 1fr; align-items: baseline; padding: var(--f3) 0; border-bottom: 1px solid var(--line); color: var(--mute-2); transition: color .4s; }
  .step-map .sm-n { font-family: var(--serif); font-size: 14px; }
  .step-map .sm-t { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
  .step-map li.done { color: var(--graphite-2); }
  .step-map li.done .sm-n::after { content: ' ·'; color: var(--c5); }
  .step-map li.now { color: var(--graphite); }
  .step-map li.now .sm-n { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .ticks span { font-size: 9.5px; }
  .ticks i:nth-child(1), .ticks i:nth-child(3) { left: 0; }
  .ticks i:nth-child(2), .ticks i:nth-child(4) { right: 0; }
  .ticks .tk1 { left: 18px; } .ticks .tk2, .ticks .tk3 { right: 18px; }
  .phi-tag.t2 { left: 18px; bottom: 9px; }
  .motto-ring { height: 92%; }
  .motto-ring text { font-size: 6px; }
  .final-art::after { left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .aura { animation: none; }
  .serra path, .mini-spiral path { stroke-dashoffset: 0; }
}
/* anéis e selo nunca geram rolagem horizontal */
main, .final-art, .intro-art { overflow-x: clip; }
html { overflow-x: clip; }
