/* =====================================================================
   HOUSE OF ANIE — THE PROGRESS LETTER
   Layout: a writing desk in an English country house at night;
   the letter is the only lit, cream object in a dark, warm room.
   ===================================================================== */

/* ---------- Fontes oficiais da marca ---------- */
@font-face { font-family: "Loren Blake Serif"; src: url("../assets/fonts/LorenBlakeSerif-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Loren Blake Script"; src: url("../assets/fonts/LorenBlakeScript-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Harmon"; src: url("../assets/fonts/Harmon.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Altone"; src: url("../assets/fonts/Altone-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Altone"; src: url("../assets/fonts/Altone-Oblique.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Altone"; src: url("../assets/fonts/Altone-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Altone"; src: url("../assets/fonts/Altone-BoldOblique.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  /* Paleta oficial */
  --wine: #4f1f13;
  --rose: #bb8d73;
  --olive: #979952;
  --cream: #fcf4e9;
  /* Complementos discretos */
  --ink: #3a150c;
  --ink-wet: #7a3520;
  --sepia: #7a5a44;
  --gold: #c9a15e;
  --night: #140804;
  --wood: #2c130b;
  --paper-shadow: rgba(20, 8, 4, .55);

  /* Tipografia oficial */
  --f-display: "Loren Blake Serif", "Altone", serif;
  --f-script: "Loren Blake Script", "Loren Blake Serif", cursive;
  --f-caps: "Harmon", "Altone", sans-serif;
  --f-body: "Altone", "Loren Blake Serif", sans-serif;

  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --ease-paper: cubic-bezier(.22, .8, .24, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night);
  color: var(--cream);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
.noscript { padding: 2rem; text-align: center; color: var(--cream); }

/* ---------- O ambiente ---------- */
.room { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.room-wall {
  position: absolute; inset: 0;
  background:
    url("../assets/branding/pattern-cream.png") center top / 150px auto repeat,
    url("../assets/images/paper-brown.jpg") center / cover no-repeat,
    var(--wine);
  background-blend-mode: soft-light, normal, normal;
  opacity: .9;
}
.room-wall::after { /* deixa o pattern discreto e a parede mais escura */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 8, 4, .55), rgba(20, 8, 4, .78));
}
.room-glow {
  position: absolute; left: -20vmax; top: -18vmax; width: 80vmax; height: 80vmax;
  background: radial-gradient(closest-side, rgba(255, 196, 120, .30), rgba(255, 170, 90, .10) 45%, transparent 72%);
  mix-blend-mode: screen;
  animation: candle-breathe 5.5s ease-in-out infinite;
}
.room-desk {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background:
    linear-gradient(180deg, rgba(255, 214, 170, .16) 0, rgba(255, 214, 170, 0) 3px),
    repeating-linear-gradient(91deg, rgba(255, 220, 180, .035) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(89.3deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 17px),
    linear-gradient(180deg, #4b2416 0%, #34170d 18%, #24100a 70%, #1a0b06 100%);
  box-shadow: 0 -30px 60px -10px rgba(0, 0, 0, .55);
}
.room-vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(8, 3, 1, .78) 100%); }

.screen { position: relative; z-index: 1; }

/* ---------- Tela inicial ---------- */
.entry {
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: clamp(8px, 2vh, 20px);
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  padding-block: clamp(20px, 4vh, 44px) clamp(18px, 4vh, 40px);
}
.entry-head { text-align: center; display: grid; justify-items: center; gap: 6px; }
.entry-wordmark { width: clamp(150px, 34vw, 230px); height: auto; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .5)); }
.eyebrow {
  margin: 0; font-family: var(--f-caps); letter-spacing: .32em; text-transform: uppercase;
  font-size: .78rem; color: var(--rose);
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }

.stage {
  --ew: min(78vw, 400px, 52vh * 1.5);
  position: relative; width: 100%; max-width: 980px;
  display: grid; place-items: center;
  min-height: calc(var(--ew) / 1.5 + 40px);
  transform-origin: 50% 55%;
}

/* Objetos da mesa */
.props { position: absolute; inset: 0; pointer-events: none; }
.prop-candle { position: absolute; left: calc(50% - var(--ew) * .5 - 70px); bottom: calc(50% - var(--ew) * .12); width: 52px; }
.candle-svg { width: 100%; height: auto; display: block; filter: drop-shadow(6px 10px 12px rgba(0, 0, 0, .5)); }
.flame { position: absolute; left: 50%; top: -14%; width: 40%; transform: translateX(-50%); transform-origin: 50% 90%; animation: flame-flicker 1.9s ease-in-out infinite; filter: drop-shadow(0 0 10px rgba(255, 200, 110, .9)); }
.flame svg { width: 100%; height: auto; display: block; }
.prop-books { position: absolute; left: calc(50% - var(--ew) * .5 - 210px); bottom: calc(50% - var(--ew) * .36); width: 190px; filter: drop-shadow(8px 12px 14px rgba(0, 0, 0, .5)); }
.prop-inkwell { position: absolute; left: calc(50% + var(--ew) * .5 + 10px); bottom: calc(50% - var(--ew) * .3); width: 110px; filter: drop-shadow(8px 12px 14px rgba(0, 0, 0, .55)); }
.prop-books svg, .prop-inkwell svg { width: 100%; height: auto; display: block; }

@media (max-width: 720px) {
  .prop-books { display: none; }
  .prop-candle { left: 2%; bottom: auto; top: -6%; width: 34px; opacity: .9; }
  .prop-inkwell { left: auto; right: 0; bottom: calc(50% - var(--ew) * .42); width: 74px; }
}

/* Envelope (visto pelo verso, com a aba e o selo) */
.envelope {
  position: relative; width: var(--ew); aspect-ratio: 3 / 2; max-width: 100%;
  perspective: 1400px;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .55)) drop-shadow(0 2px 3px rgba(0, 0, 0, .4));
  transform: rotate(-2.2deg);
  will-change: transform;
}
.env-back {
  position: absolute; inset: 0; border-radius: 3px;
  background: url("../assets/branding/pattern-brown.png") center / 64px auto repeat, var(--rose);
}
.env-back::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .05)); }
.env-letter {
  position: absolute; left: 7%; right: 7%; top: 7%; height: 62%;
  background: url("../assets/images/paper-cream.jpg") center / cover, var(--cream);
  border-radius: 2px;
  box-shadow: 0 -1px 4px rgba(0, 0, 0, .25);
  display: grid; justify-items: center; align-content: start; padding-top: 6%;
}
.env-letter img { width: 18%; opacity: .85; }
.env-pocket {
  position: absolute; inset: 0; border-radius: 3px;
  background:
    linear-gradient(32deg, transparent 49.6%, rgba(79, 31, 19, .10) 50%, transparent 50.6%) left bottom / 50% 100% no-repeat,
    linear-gradient(-32deg, transparent 49.6%, rgba(79, 31, 19, .10) 50%, transparent 50.6%) right bottom / 50% 100% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0) 40%, rgba(122, 90, 68, .12)),
    url("../assets/images/paper-cream.jpg") center / cover,
    var(--cream);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}
.env-name {
  position: absolute; left: 50%; right: 7%; bottom: 7%; margin: 0;
  text-align: right; font-family: var(--f-script); color: var(--wine);
  font-size: calc(var(--ew) * .08); line-height: 1.1;
  min-height: 1.1em;
}
.env-name .to { font-family: var(--f-caps); font-size: .32em; letter-spacing: .3em; display: block; color: var(--sepia); margin-bottom: .2em; text-transform: uppercase; }
.env-flap { position: absolute; left: 0; top: 0; width: 100%; height: 56%; transform-origin: 50% 0; transform-style: preserve-3d; z-index: 3; }
.flap-face { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flap-out {
  background:
    linear-gradient(180deg, rgba(122, 90, 68, .05), rgba(122, 90, 68, .22)),
    url("../assets/images/paper-cream.jpg") center top / cover,
    var(--cream);
}
.flap-in { transform: rotateX(180deg); background: url("../assets/branding/pattern-brown.png") center / 64px auto repeat, var(--rose); }
.flap-in::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .12); }

.seal { position: absolute; left: 50%; top: 56%; width: 23%; aspect-ratio: 1; transform: translate(-50%, -50%) rotate(-8deg); z-index: 4; }
.seal-half { position: absolute; inset: 0; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.seal-half svg { width: 100%; height: 100%; display: block; }
.seal-mono { position: absolute; left: 20%; top: 19%; width: 60%; opacity: .9; filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, .55)) drop-shadow(0 1px 0 rgba(255, 220, 160, .25)); }
.seal-a { clip-path: polygon(0 0, 56% 0, 48% 22%, 58% 38%, 44% 55%, 56% 72%, 47% 100%, 0 100%); }
.seal-b { clip-path: polygon(56% 0, 100% 0, 100% 100%, 47% 100%, 56% 72%, 44% 55%, 58% 38%, 48% 22%); }

/* Formulário */
.unlock { width: 100%; max-width: 460px; text-align: center; display: grid; gap: 10px; }
.tagline { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(1.45rem, 5.4vw, 2.05rem); line-height: 1.2; color: var(--cream); text-wrap: balance; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.unlock-form { display: grid; gap: 10px; }
.unlock-label { font-size: .95rem; color: #e8d6c2; text-wrap: balance; }
.field { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
#code {
  flex: 1 1 210px; min-width: 0;
  font-family: var(--f-body); font-size: 1.08rem; letter-spacing: .14em; text-align: center; text-transform: uppercase;
  color: var(--ink); background: url("../assets/images/paper-cream.jpg") center / cover, var(--cream);
  border: 1px solid rgba(187, 141, 115, .8); border-radius: 2px;
  padding: 13px 12px; min-height: 50px;
  box-shadow: inset 0 2px 6px rgba(79, 31, 19, .18);
}
#code::placeholder { color: rgba(79, 31, 19, .38); letter-spacing: .1em; }
#code[aria-invalid="true"] { border-color: #d4826a; box-shadow: inset 0 2px 6px rgba(79, 31, 19, .18), 0 0 0 2px rgba(212, 130, 106, .45); }

.btn {
  font-family: var(--f-caps); letter-spacing: .18em; text-transform: uppercase; font-size: .82rem;
  min-height: 50px; padding: 12px 20px; border-radius: 2px; cursor: pointer;
  transition: transform .2s var(--ease-paper), background-color .2s, box-shadow .2s, opacity .2s;
}
.btn-seal {
  flex: 1 1 auto;
  background: radial-gradient(120% 140% at 30% 20%, #7c2b1c, var(--wine) 60%, #3a1309);
  color: var(--cream); border: 1px solid rgba(201, 161, 94, .55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 220, 180, .2);
}
.btn-seal:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 220, 180, .25); }
.btn-seal:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--wine); border: 1px solid rgba(79, 31, 19, .45); }
.btn-ghost:hover { background: rgba(79, 31, 19, .06); }
.btn[aria-busy="true"] { pointer-events: none; opacity: .85; }
.btn[aria-busy="true"] .btn-label::after { content: ""; display: inline-block; width: .9em; text-align: left; animation: dots 1.2s steps(4) infinite; }

.form-msg { margin: 0; min-height: 1.4em; font-size: .92rem; color: #f2c7b4; text-wrap: balance; }
.form-msg.is-ok { color: #e3e6b5; }
.demo-hint { margin: 0; font-size: .82rem; color: #cdb7a3; }
.link-btn { background: none; border: 0; padding: 2px; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; letter-spacing: .05em; }

.skip-intro {
  position: fixed; z-index: 60;
  right: calc(var(--gutter-r) + 4px); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  font-family: var(--f-caps); letter-spacing: .2em; text-transform: uppercase; font-size: .72rem;
  background: rgba(20, 8, 4, .7); color: var(--cream); border: 1px solid rgba(252, 244, 233, .35);
  padding: 12px 16px; border-radius: 2px; cursor: pointer; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}

/* Carta desdobrando */
.unfold { position: fixed; z-index: 30; transform-style: preserve-3d; perspective: 1600px; pointer-events: none; }
.uf-panel {
  position: absolute; left: 0; width: 100%; height: 100%;
  background:
    repeating-linear-gradient(180deg, transparent 0 13px, rgba(122, 90, 68, .14) 13px 14px) 12% 24% / 76% 64% no-repeat,
    url("../assets/images/paper-cream.jpg") center / cover,
    var(--cream);
  box-shadow: 0 0 0 .5px rgba(122, 90, 68, .25);
  transform-style: preserve-3d; transform-origin: 50% 0;
}
.uf-1 { top: 0; display: grid; justify-items: center; align-content: start; padding-top: 7%;
  background: url("../assets/images/paper-cream.jpg") center / cover, var(--cream); }
.uf-1 img { width: 16%; }
.uf-2 { top: 100%; }
.uf-3 { top: 100%; }

/* Escolha de som */
.gate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px var(--gutter-r) 20px var(--gutter-l); background: rgba(12, 5, 2, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.gate-card {
  width: min(420px, 100%); text-align: center; color: var(--ink);
  background: url("../assets/images/paper-cream.jpg") center / cover, var(--cream);
  padding: 30px 24px 26px; border-radius: 2px; position: relative;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
  display: grid; gap: 12px; justify-items: center;
}
.gate-card::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(187, 141, 115, .7); outline: 1px solid rgba(187, 141, 115, .35); outline-offset: 3px; pointer-events: none; }
.gate-mono { width: 74px; height: auto; }
.gate-title { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 1.85rem; line-height: 1.15; color: var(--wine); text-wrap: balance; }
.gate-text { margin: 0; font-size: .95rem; color: var(--sepia); text-wrap: balance; }
.gate-actions { display: grid; gap: 10px; width: 100%; margin-top: 6px; }

/* ---------- Tela da carta ---------- */
.reader { min-height: 100vh; min-height: 100dvh; }
body.is-reading .room-desk { opacity: .55; }
body.is-reading .room-glow { opacity: .75; }

body.is-reading::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 41; background: var(--night); }
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) var(--gutter-r) 8px var(--gutter-l);
  background: linear-gradient(180deg, rgba(20, 8, 4, .94), rgba(20, 8, 4, .78));
  border-bottom: 1px solid rgba(201, 161, 94, .22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-brand img { width: 30px; height: auto; }
.topbar-brand span { font-family: var(--f-caps); text-transform: uppercase; letter-spacing: .24em; font-size: .7rem; color: var(--rose); white-space: nowrap; }
@media (max-width: 520px) { .topbar-brand span { display: none; } }
.chapter-dots { display: flex; gap: 4px; flex-wrap: nowrap; }
.chapter-dots button {
  min-width: 36px; height: 36px; padding: 0 4px; border-radius: 50%;
  background: transparent; border: 1px solid transparent; color: rgba(252, 244, 233, .5);
  font-family: var(--f-display); font-size: .95rem; cursor: pointer;
  transition: color .3s, border-color .3s, background-color .3s;
}
.chapter-dots button.is-read { color: rgba(252, 244, 233, .82); }
.chapter-dots button[aria-current="step"] { color: var(--cream); border-color: rgba(201, 161, 94, .7); background: rgba(79, 31, 19, .55); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 1px solid rgba(252, 244, 233, .22); border-radius: 50%; color: var(--cream); cursor: pointer; flex: none; }
.icon-btn svg, .ctl svg { width: 22px; height: 22px; }
.icon-btn[aria-pressed="true"] { border-color: rgba(201, 161, 94, .7); color: var(--gold); }

.sheet-wrap {
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  padding-block: calc(76px + env(safe-area-inset-top, 0px)) calc(112px + env(safe-area-inset-bottom, 0px));
}
.sheet {
  position: relative; max-width: 720px; margin: 0 auto;
  color: var(--ink);
  background:
    radial-gradient(130% 80% at 50% 0%, rgba(255, 255, 255, .35), transparent 60%),
    url("../assets/images/paper-cream.jpg") center / cover,
    var(--cream);
  padding: clamp(46px, 9vw, 78px) clamp(22px, 7.5vw, 80px) clamp(52px, 9vw, 84px);
  border-radius: 2px;
  box-shadow: 0 40px 70px -26px rgba(0, 0, 0, .8), 0 12px 24px rgba(0, 0, 0, .35), inset 0 0 60px rgba(187, 141, 115, .16);
  min-height: 70vh;
  overflow: hidden;
}
.sheet::before { /* moldura dupla */
  content: ""; position: absolute; inset: 12px; pointer-events: none;
  border: 1px solid rgba(187, 141, 115, .55); outline: 1px solid rgba(187, 141, 115, .28); outline-offset: 4px;
}
.sheet::after { /* marca d'água do monograma */
  content: ""; position: absolute; left: 50%; top: 50%; width: min(70%, 420px); aspect-ratio: 785 / 828;
  transform: translate(-50%, -45%);
  background: url("../assets/branding/monogram-rose.png") center / contain no-repeat;
  opacity: .055; pointer-events: none;
}
.sheet-band { position: absolute; left: 24px; right: 24px; height: 18px; pointer-events: none; background: url("../assets/branding/pattern-rose.png") center / 34px auto repeat-x; opacity: .45; }
.sheet-band-top { top: 22px; }
.sheet-band-bottom { bottom: 22px; }
.chapter-host { position: relative; z-index: 1; }

.quill { position: absolute; left: 0; top: 0; width: 64px; height: 64px; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .35s; filter: drop-shadow(4px 8px 5px rgba(58, 21, 12, .28)); will-change: transform; }
.quill.is-writing { opacity: 1; }

/* Capítulos */
.chapter { display: grid; gap: 22px; }
.ch-head { text-align: center; display: grid; justify-items: center; gap: 6px; margin-bottom: 8px; }
.ch-num { margin: 0; font-family: var(--f-caps); letter-spacing: .34em; text-transform: uppercase; font-size: .74rem; color: var(--rose); }
.ch-title { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(1.9rem, 6.4vw, 2.8rem); line-height: 1.1; color: var(--wine); text-wrap: balance; }
.ch-sub { margin: 0; font-family: var(--f-script); font-size: clamp(1.4rem, 4.6vw, 1.8rem); color: var(--olive); line-height: 1.2; }
.ch-ornament { width: 160px; height: 18px; color: var(--rose); margin-top: 4px; }

.letterhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid rgba(187, 141, 115, .45); }
.letterhead-brand { display: flex; align-items: center; gap: 12px; }
.letterhead-brand img { width: 46px; height: auto; }
.letterhead-brand span { font-family: var(--f-caps); letter-spacing: .3em; text-transform: uppercase; font-size: .74rem; color: var(--wine); }
.letterhead-date { text-align: right; font-size: .86rem; color: var(--sepia); line-height: 1.4; margin-left: auto; }
.letterhead-date em { font-style: normal; display: block; font-family: var(--f-caps); letter-spacing: .18em; text-transform: uppercase; font-size: .66rem; color: var(--rose); }

.greeting { margin: 4px 0 0; font-family: var(--f-script); font-weight: 400; font-size: clamp(2.1rem, 8vw, 2.9rem); line-height: 1.15; color: var(--wine); }
.prose { display: grid; gap: 1.05em; }
.prose p { margin: 0; font-family: var(--f-display); font-size: clamp(1.16rem, 3.9vw, 1.32rem); line-height: 1.62; color: var(--ink); max-width: 62ch; }
.lead { margin: 0; font-size: 1.02rem; color: var(--sepia); text-align: center; text-wrap: balance; max-width: 52ch; justify-self: center; }

/* Conquistas */
.achievements { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.ach { display: grid; grid-template-columns: 34px 1fr; gap: 6px 14px; align-items: start; }
.ach-icon { width: 30px; height: 30px; color: var(--olive); margin-top: 2px; }
.ach-body { min-width: 0; display: grid; gap: 6px; }
.ach-title { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 1.36rem; line-height: 1.25; color: var(--wine); }
.ach-desc { margin: 0; font-size: 1.02rem; line-height: 1.68; }
.evidence-note { margin: 4px 0 0; padding: 10px 14px; border-left: 2px solid var(--rose); background: rgba(187, 141, 115, .1); font-style: italic; font-size: .97rem; line-height: 1.6; color: var(--ink); }
.evidence-note .label { display: block; font-style: normal; font-family: var(--f-caps); text-transform: uppercase; letter-spacing: .22em; font-size: .64rem; color: var(--sepia); margin-bottom: 2px; }

/* Habilidades */
.scale-legend { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 460px; width: 100%; }
.scale-legend li { display: grid; justify-items: center; gap: 2px; font-family: var(--f-caps); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; color: var(--sepia); text-align: center; }
.scale-legend svg { width: 30px; height: 30px; color: var(--olive); }
.skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.skill { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 16px 0; border-top: 1px dashed rgba(187, 141, 115, .5); }
.skill:last-child { border-bottom: 1px dashed rgba(187, 141, 115, .5); }
.skill-name { margin: 0; font-family: var(--f-caps); letter-spacing: .2em; text-transform: uppercase; font-size: .86rem; color: var(--wine); }
.skill-rating { font-family: var(--f-script); font-size: 1.45rem; color: var(--olive); line-height: 1; }
.skill-stages { grid-column: 1 / -1; display: flex; gap: 6px; align-items: end; }
.skill-stages svg { width: 34px; height: 34px; color: rgba(151, 153, 82, .22); transition: color .6s var(--ease-paper), transform .6s var(--ease-paper); }
.skill-stages svg.on { color: var(--olive); }
.skill-stages svg.on.current { color: var(--wine); }
.skill-note { grid-column: 1 / -1; margin: 2px 0 0; font-size: .97rem; color: var(--sepia); line-height: 1.6; }
.disclaimer { margin: 6px 0 0; font-size: .82rem; color: var(--sepia); text-align: center; font-style: italic; text-wrap: balance; }

/* Then & Now */
.compares { display: grid; gap: 30px; }
.compare { display: grid; gap: 10px; }
.compare-type { margin: 0; font-family: var(--f-caps); letter-spacing: .26em; text-transform: uppercase; font-size: .7rem; color: var(--rose); text-align: center; }
.compare-pair { display: grid; grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.compare-card { min-width: 0; padding: 16px 16px 18px; border-radius: 2px; display: grid; gap: 6px; align-content: start; }
.compare-card h4 { margin: 0; font-family: var(--f-caps); font-weight: 400; letter-spacing: .2em; text-transform: uppercase; font-size: .66rem; }
.compare-card p { margin: 0; font-size: 1rem; line-height: 1.62; }
.compare-then { background: rgba(122, 90, 68, .08); border: 1px solid rgba(122, 90, 68, .25); color: var(--sepia); }
.compare-then h4 { color: var(--sepia); }
.compare-now { background: rgba(151, 153, 82, .12); border: 1px solid rgba(151, 153, 82, .55); color: var(--ink); }
.compare-now h4 { color: #6c6e33; }
.compare-arrow { align-self: center; color: var(--rose); width: 30px; height: 30px; }
.compare-media { justify-self: center; font-size: .9rem; color: var(--wine); text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
@media (max-width: 600px) {
  .compare-pair { grid-template-columns: minmax(0, 1fr); }
  .compare-arrow { justify-self: center; transform: rotate(90deg); }
}

/* Próximos passos: caminho de jardim */
.path { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 0; position: relative; }
.path::before { content: ""; position: absolute; left: 22px; top: 18px; bottom: 18px; border-left: 2px dotted rgba(151, 153, 82, .7); }
.step { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 16px; padding: 10px 0 22px; }
.step-stone { width: 40px; height: 40px; color: var(--olive); background: var(--cream); border-radius: 50%; position: relative; z-index: 1; }
.step-body { min-width: 0; display: grid; gap: 6px; padding-top: 4px; }
.step-priority { margin: 0; font-family: var(--f-caps); text-transform: uppercase; letter-spacing: .22em; font-size: .62rem; color: var(--rose); }
.step-goal { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 1.36rem; line-height: 1.25; color: var(--wine); }
.step-desc { margin: 0; font-size: 1.02rem; line-height: 1.68; }
.step-tip { margin: 4px 0 0; padding: 10px 14px; background: rgba(151, 153, 82, .12); border-radius: 2px; font-size: .97rem; line-height: 1.6; }
.step-tip .label { font-family: var(--f-script); font-size: 1.3rem; color: #6c6e33; margin-right: 6px; line-height: 1; }

/* Encerramento */
.closing { display: grid; gap: 8px; justify-items: start; margin-top: 6px; }
.sign-off { margin: 0; font-family: var(--f-script); font-size: clamp(1.7rem, 6vw, 2.2rem); color: var(--wine); line-height: 1.2; }
.signature-img { width: min(230px, 62%); height: auto; margin: 2px 0 -6px -8px; }
.signature-text { margin: 0; font-family: var(--f-script); font-size: 2.6rem; color: var(--ink); line-height: 1.1; }
.teacher-name { margin: 0; font-family: var(--f-caps); text-transform: uppercase; letter-spacing: .26em; font-size: .74rem; color: var(--sepia); }
.closing-house { width: 150px; height: auto; margin-top: 10px; }
.closing-line { margin: 26px 0 0; text-align: center; font-family: var(--f-display); font-size: clamp(1.3rem, 4.6vw, 1.6rem); color: var(--wine); text-wrap: balance; }
.closing-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.closing-actions .btn { flex: 1 1 200px; }
.closing-actions .btn-ghost { color: var(--wine); }

/* Fim de capítulo */
.chapter-end { display: flex; justify-content: center; margin-top: 14px; }
.btn-next-chapter { background: transparent; border: 0; color: var(--wine); font-family: var(--f-display); font-size: 1.2rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(79, 31, 19, .3); }
.btn-next-chapter svg { width: 18px; height: 18px; }

/* Controles */
.controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  padding: 8px var(--gutter-r) calc(8px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  background: linear-gradient(0deg, rgba(20, 8, 4, .96), rgba(20, 8, 4, .84));
  border-top: 1px solid rgba(201, 161, 94, .22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ctl {
  min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: transparent; border: 0; border-radius: 4px; color: var(--cream); cursor: pointer;
  font-family: var(--f-caps); letter-spacing: .12em; text-transform: uppercase; font-size: .6rem; line-height: 1.2; text-align: center;
  padding: 4px;
}
.ctl-next { flex-direction: column-reverse; }
.ctl:hover:not(:disabled) { background: rgba(252, 244, 233, .06); }
.ctl:disabled { opacity: .32; cursor: default; }
.ctl.is-ready { color: var(--gold); }
@media (min-width: 720px) {
  .controls { max-width: 720px; margin: 0 auto; left: 50%; transform: translateX(-50%); width: 100%; border-radius: 6px 6px 0 0; border-left: 1px solid rgba(201, 161, 94, .18); border-right: 1px solid rgba(201, 161, 94, .18); }
  .ctl { flex-direction: row; font-size: .66rem; gap: 8px; }
  .ctl-next { flex-direction: row; }
}

/* Avisos */
.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 80; width: max-content; max-width: calc(100% - 32px);
  background: var(--cream); color: var(--ink); padding: 12px 18px; border-radius: 2px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5); font-size: .92rem; text-align: center;
}
.print-letter { display: none; }
