/* ==========================================================================
   VOLLACHIA — sistema visual
   Conceito: o caderno do observatório aberto sobre a paisagem. A pintura viva é
   fixa; as folhas de papel passam por cima, e a luz das folhas cai sobre elas.
   ========================================================================== */

@font-face { font-family: "Shippori Mincho"; src: url("../assets/fonts/shippori-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Shippori Mincho"; src: url("../assets/fonts/shippori-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("../assets/fonts/zen-maru-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("../assets/fonts/zen-maru-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Klee One"; src: url("../assets/fonts/klee-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Klee One"; src: url("../assets/fonts/klee-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --font-display: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  --font-text: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Segoe UI", system-ui, sans-serif;
  --font-hand: "Klee One", "Segoe Print", cursive;

  /* Pigmentos */
  --ink: #2a241d;
  --ink-soft: #574c3e;
  --paper: #f6efe0;
  --paper-edge: #ece1cb;
  --moss: #3d6a4a;
  --clay: #a84f2c;
  --brass: #8a6410;
  --brass-light: #d4af37;
  --carmine: #a12c2c;
  --sky-ink: #1f4e74;
  --line: rgba(120, 95, 60, .3);

  /* Sobre a pintura (muda com a hora) */
  --on-scene: #20343f;
  --on-scene-soft: #2f4753;
  --scene-glow: rgba(255, 250, 238, .85);
  --bar-bg: rgba(250, 245, 233, .82);
  --bar-solid: #f8f2e4;
  --bar-ink: #2a241d;
  --bar-soft: #574c3e;
  --accent: #1f4e74;
  --accent-ink: #ffffff;
  --paper-light: 1;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --day: 0;
  --bar-h: 64px;
}

html[data-time="day"] { --on-scene: #173344; --on-scene-soft: #23475b; }
html[data-time="dusk"] {
  --on-scene: #fff4e4; --on-scene-soft: #ffe6cc; --scene-glow: rgba(60, 25, 40, .75);
  --bar-bg: rgba(52, 34, 46, .84); --bar-solid: #34222e; --bar-ink: #fdf1e0; --bar-soft: #e9d3bf;
  --accent: #f0ae5c; --accent-ink: #2a1a10; --paper-light: .96;
}
html[data-time="night"] {
  --on-scene: #eef3fb; --on-scene-soft: #cbd8ec; --scene-glow: rgba(6, 12, 30, .8);
  --bar-bg: rgba(13, 21, 42, .86); --bar-solid: #0f1830; --bar-ink: #eef3fb; --bar-soft: #c1cfe4;
  --accent: #ffd98a; --accent-ink: #14203a; --paper-light: .9;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 12px);
}

body {
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: #7fb2cf;
  overflow-x: clip;
  min-height: 100dvh;
}

img, svg, canvas { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.svg-defs { position: absolute; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; border-radius: 8px;
  background: var(--ink); color: var(--paper);
  transform: translateY(-160%);
  transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* ---------- O mundo ---------- */
.world {
  position: fixed; inset: 0; z-index: 0;
  height: 100lvh; overflow: hidden;
  pointer-events: none;
  background: #9cc6da;
}
.world-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% bottom; transition: opacity .6s; }
#painting, #atmosphere { position: absolute; inset: 0; width: 100%; height: 100%; }
#painting { opacity: 0; transition: opacity 1.1s var(--ease-soft); }
.has-webgl #painting { opacity: 1; }
.calm #atmosphere { display: none; }

/* ---------- Barra ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 100;
  color: var(--bar-ink);
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  transition: background-color .9s var(--ease-soft), color .9s var(--ease-soft);
}
.bar-inner {
  max-width: 1440px; min-height: var(--bar-h); margin: 0 auto;
  padding: 8px clamp(16px, 3vw, 32px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 34px; height: 34px; color: var(--accent); transition: transform 1.2s var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(120deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.28rem; letter-spacing: .05em; }
.brand-sub { font-size: .76rem; color: var(--bar-soft); white-space: nowrap; }

.bar-panel { display: flex; align-items: center; gap: 24px; }
.chapters { display: flex; gap: 22px; }
.chapters a {
  position: relative; padding: 8px 2px; text-decoration: none;
  font-weight: 700; font-size: .96rem; color: var(--bar-soft);
  transition: color .25s;
}
.chapters a::after {
  content: ""; position: absolute; inset: auto 0 2px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease-out);
}
.chapters a:hover, .chapters a[aria-current="true"] { color: var(--bar-ink); }
.chapters a:hover::after, .chapters a[aria-current="true"]::after { transform: scaleX(1); }

.bar-controls { display: flex; align-items: center; gap: 12px; }
.time-group { display: flex; padding: 3px; border-radius: 999px; background: rgba(120, 95, 60, .16); }
.time-btn {
  border: 0; background: none; padding: 6px 12px; min-height: 34px; border-radius: 999px;
  font-size: .86rem; font-weight: 700; color: var(--bar-soft);
  transition: background-color .3s, color .3s;
}
.time-btn:hover { color: var(--bar-ink); }
.time-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.sound-group { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--bar-ink);
  transition: background-color .25s, color .25s, transform .3s var(--ease-spring);
}
.icon-btn:hover { transform: scale(1.08); }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.volume { width: 64px; accent-color: var(--accent); }
.sound-on { display: none; }
[aria-pressed="true"] > svg .sound-on { display: inline; }
[aria-pressed="true"] > svg .sound-off { display: none; }
.motion-play { display: none; }
[aria-pressed="true"] > svg .motion-play { display: inline; }
[aria-pressed="true"] > svg .motion-pause { display: none; }

.menu-toggle {
  display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: none;
  font-weight: 700; color: var(--bar-ink);
}
.menu-icon, .menu-icon::before { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s var(--ease-out); }
.menu-icon { transform: translateY(-3px); }
.menu-icon::before { content: ""; transform: translateY(6px); }
.menu-toggle[aria-expanded="true"] .menu-icon { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: rotate(-90deg); }

/* O sol percorre a barra ao longo do dia */
.day-track { position: relative; height: 2px; background: linear-gradient(90deg, #f7c97e, #6cb4e4 34%, #ee8f5a 67%, #27406f); }
.day-sun {
  position: absolute; top: -4px; left: calc(var(--day) * 100%);
  width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: #ffe9a8; box-shadow: 0 0 10px 2px rgba(255, 215, 120, .85);
}
html[data-time="night"] .day-sun { background: #e9eefb; box-shadow: 0 0 10px 2px rgba(190, 210, 255, .8); }

/* ---------- Abertura ---------- */
main { position: relative; z-index: 2; }

.hero {
  position: relative;
  min-height: 100svh;
  padding: calc(var(--bar-h) + clamp(28px, 7vh, 72px)) clamp(20px, 6vw, 96px) 40px;
  display: flex; flex-direction: column; align-items: flex-start;
  color: var(--on-scene);
  transition: color .9s var(--ease-soft);
}
.hero-copy { max-width: min(600px, 41vw); }
.hero-word { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; }
.hero-roman { font-family: var(--font-hand); font-size: 1.1rem; font-weight: 400; letter-spacing: .08em; }
.hero-gloss { font-family: var(--font-hand); font-size: 1.04rem; color: var(--on-scene-soft); margin-bottom: 18px; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.5vw, 3.7rem);
  font-weight: 700; line-height: 1.16; letter-spacing: -.005em;
  margin-bottom: 18px;
  text-shadow: 0 0 22px var(--scene-glow), 0 0 4px var(--scene-glow);
}
.hero-note {
  position: relative; max-width: 30rem; padding: 20px 22px 14px;
  background: var(--paper) url("../assets/ui/paper.webp"); background-blend-mode: multiply;
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(20, 20, 40, .28);
  transform: rotate(-.7deg);
  filter: brightness(var(--paper-light));
}
.hero-lead { font-size: 1.02rem; line-height: 1.6; margin-bottom: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-hint { font-family: var(--font-hand); font-size: .95rem; color: var(--ink-soft); margin-top: 8px; }

.js .hero-copy > * { animation: rise .8s var(--ease-out) both; }
.js .hero-copy > :nth-child(2) { animation-delay: .08s; }
.js .hero-copy > :nth-child(3) { animation-delay: .16s; }
.js .hero-copy > :nth-child(4) { animation-delay: .28s; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 24px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  transition: transform .35s var(--ease-spring), box-shadow .3s, background-color .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--sky-ink); color: #fff; box-shadow: 0 6px 20px rgba(20, 40, 60, .28); }
.btn-primary svg { transition: transform .4s var(--ease-spring); }
.btn-primary:hover svg { transform: translateY(3px); }
.btn-ghost { color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(70, 55, 35, .55); }

/* ---------- Folhas de papel ---------- */
.sheet {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  width: calc(100% - clamp(16px, 5vw, 80px));
  background-color: var(--paper);
  background-image: url("../assets/ui/paper.webp");
  background-blend-mode: multiply;
  box-shadow: 0 30px 70px rgba(18, 16, 30, .34);
  filter: brightness(var(--paper-light));
  transition: filter 1s var(--ease-soft);
}
/* Bordas rasgadas de papel artesanal */
.sheet::before, .sheet::after {
  content: ""; position: absolute; left: 0; right: 0; height: 34px;
  background: var(--paper);
  -webkit-mask: url("../assets/ui/deckle.svg") repeat-x center / 1200px 34px;
  mask: url("../assets/ui/deckle.svg") repeat-x center / 1200px 34px;
}
.sheet::before { top: -33px; }
.sheet::after { bottom: -33px; transform: scaleY(-1); }

.sheet-inner {
  position: relative; overflow: hidden;
  padding: clamp(40px, 6vw, 84px) clamp(18px, 5vw, 72px) clamp(44px, 6vw, 84px);
}
/* Komorebi: sombra de folhagem deslizando sobre o papel */
.sheet-inner::before {
  content: ""; position: absolute; inset: -30%; pointer-events: none;
  background: url("../assets/ui/dapple.webp") 0 0 / 900px;
  opacity: .08;
  -webkit-mask: radial-gradient(70% 60% at 82% 16%, #000 0%, transparent 100%);
  mask: radial-gradient(70% 60% at 82% 16%, #000 0%, transparent 100%);
  animation: dapple 46s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes dapple {
  from { transform: translate3d(-3%, -2%, 0) rotate(-1deg); }
  to { transform: translate3d(4%, 3%, 0) rotate(1.5deg); }
}
.sheet-inner > * { position: relative; }

.sheet-head { max-width: 46rem; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.sheet-kanji {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 1.1rem; letter-spacing: .34em; margin-right: -.34em; color: var(--carmine);
}
.sheet-eyebrow { font-family: var(--font-hand); color: var(--moss); font-size: 1.1rem; margin-bottom: 6px; }
.sheet-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 700; margin-bottom: 14px; }
.sheet-lead { color: var(--ink-soft); }

/* Revelação */
.js .reveal { opacity: 0; transform: translateY(34px) rotate(.4deg); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Interlúdios ---------- */
.interlude {
  min-height: 92vh;
  display: flex; align-items: flex-start;
  padding: calc(var(--bar-h) + 9vh) clamp(20px, 6vw, 96px) 60px;
}
.interlude-line {
  max-width: min(34rem, 42vw);
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.4rem, 2.5vw, 2.1rem); line-height: 1.38;
  color: var(--on-scene);
  text-shadow: 0 0 16px var(--scene-glow), 0 0 6px var(--scene-glow), 0 0 2px var(--scene-glow);
  transition: color .9s;
}
.interlude { overflow-x: clip; }
.interlude-line { position: relative; z-index: 0; }
.interlude-line::before {
  content: ""; position: absolute; z-index: -1; inset: -34px -48px;
  background: radial-gradient(closest-side, var(--scene-glow), transparent);
  opacity: .62;
}
.interlude-hour { display: block; font-family: var(--font-hand); font-size: .68em; font-weight: 400; margin-bottom: 4px; }

/* ---------- Herbário ---------- */
.herbarium { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: clamp(20px, 2.6vw, 32px); }
.noscript-list { grid-column: 1 / -1; padding-left: 1.2em; }

.plate {
  position: relative; display: flex; flex-direction: column; text-align: left;
  width: 100%; padding: 18px 18px 16px; border: 1px solid rgba(160, 130, 90, .35);
  background: #fbf6ea; color: var(--ink);
  box-shadow: 0 10px 24px rgba(50, 35, 15, .16), 0 2px 5px rgba(50, 35, 15, .08);
  transition: transform .6s var(--ease-spring), box-shadow .5s;
  transform: rotate(var(--tilt, 0deg));
}
.plate:hover, .plate:focus-visible { transform: translateY(-8px) rotate(0); box-shadow: 0 24px 44px rgba(50, 35, 15, .26); }
.plate-tape {
  position: absolute; top: -11px; left: 50%; width: 76px; height: 22px; margin-left: -38px;
  background: rgba(214, 190, 140, .62); transform: rotate(var(--tape, -2deg));
  box-shadow: 0 1px 2px rgba(60, 40, 20, .15);
}
.plate-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.plate-no { font-family: var(--font-hand); font-weight: 600; color: var(--clay); }
.plate-seal {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; color: var(--carmine);
  border: 1.5px solid var(--carmine); border-radius: 999px; padding: 0 7px; transform: rotate(-3deg);
}
.plate-art { display: block; aspect-ratio: 4 / 5; margin: 0 -6px 6px; }
.plate-name, .plate-latin, .plate-note { display: block; }
.plate-name { font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; }
.plate-latin { font-style: italic; font-size: .92rem; color: var(--ink-soft); }
.plate-note { font-family: var(--font-hand); font-size: 1rem; line-height: 1.45; color: #4a3c2c; margin-top: 8px; border-left: 2px solid var(--line); padding-left: 10px; }
.plate-cta {
  display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px;
  font-weight: 700; font-size: .92rem; color: var(--brass);
}
.plate-cta svg { transition: transform .45s var(--ease-spring); }
.plate:hover .plate-cta svg { transform: scale(1.22) rotate(-10deg); }

/* Traço de nanquim que se desenha, aquarela que aflora, planta que respira */
.ink { stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .plate:not(.drawn) .ink { stroke-dashoffset: 1; }
.js .plate .ink { transition: stroke-dashoffset 2s var(--ease-soft) .15s; }
.js .plate:not(.drawn) .wash { opacity: 0; }
.js .plate .wash { transition: opacity 1.6s var(--ease-soft) .7s; }
.art-stack { position: relative; display: block; width: 100%; height: 100%; }
.art-stack svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.art-painted { transform-origin: 50% 96%; animation: breeze 7s ease-in-out infinite alternate; will-change: transform; }
.plate:nth-child(2n) .art-painted { animation-duration: 8.6s; animation-delay: -3s; }
.plate:hover .art-painted { animation-duration: 2.6s; }
@keyframes breeze { from { transform: rotate(-.9deg) skewX(.5deg); } to { transform: rotate(1.1deg) skewX(-.6deg); } }
.glow { animation: spore 3.4s ease-in-out infinite alternate; }
.glow:nth-of-type(2n) { animation-delay: -1.5s; }
@keyframes spore { from { opacity: .3; } to { opacity: 1; } }
.drift { transform-box: fill-box; transform-origin: center; animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(-4px, 5px) rotate(-8deg); } to { transform: translate(6px, -7px) rotate(9deg); } }

/* ---------- Instrumentos ---------- */
.instruments { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: clamp(18px, 2.4vw, 28px); }
.instrument {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 26px 22px; border-radius: 10px; background: #fbf6ea;
  border: 1px solid rgba(160, 130, 90, .35);
  box-shadow: 0 10px 24px rgba(50, 35, 15, .14);
}
.instrument-name { font-family: var(--font-display); font-size: 1.32rem; }
.instrument-sub { color: var(--ink-soft); font-size: .95rem; }
.dial { width: 168px; height: 168px; margin: 14px 0; filter: drop-shadow(0 4px 7px rgba(60, 40, 20, .18)); }
.dial-text { font: 700 4.6px var(--font-text); text-anchor: middle; fill: #5d4f3c; }
.dial-compass { font: 700 7.5px var(--font-text); text-anchor: middle; fill: #2b2621; }
#anemometer-cups, #barometer-needle, #vane-pointer { transform-box: view-box; transform-origin: 50px 50px; }
#barometer-needle { transition: transform 1s var(--ease-spring); }
#vane-pointer { transition: transform .9s var(--ease-spring); }

.field-label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.slider { width: 100%; height: 32px; accent-color: var(--moss); }
.readout { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; width: 100%; font-weight: 700; }
.readout span { font-weight: 400; color: var(--ink-soft); }
.readout-center { justify-content: center; font-size: 1.2rem; color: var(--clay); }
.forecast { font-family: var(--font-hand); line-height: 1.45; color: #4a3c2c; margin-top: 6px; }

.compass { display: grid; grid-template-columns: repeat(3, 48px); gap: 6px; }
.compass-btn {
  height: 44px; border-radius: 8px; border: 1px solid rgba(120, 95, 60, .4);
  background: rgba(140, 115, 85, .1); font-weight: 700; font-size: .9rem; color: #3f3425;
  transition: background-color .25s, color .25s, transform .3s var(--ease-spring);
}
.compass-btn:hover { background: #fff; transform: scale(1.06); }
.compass-btn[aria-pressed="true"] { background: var(--sky-ink); border-color: var(--sky-ink); color: #fff; }
.compass-hub { display: grid; place-items: center; }
.compass-hub::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brass-light); }

/* ---------- Caderno ---------- */
.notes-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.notes-title { font-family: var(--font-display); font-size: 1.45rem; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.input {
  display: block; width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 8px;
  border: 1.5px solid rgba(120, 95, 60, .55); background: rgba(255, 255, 255, .82); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { resize: vertical; min-height: 120px; }
.input:focus { outline: none; border-color: var(--sky-ink); box-shadow: 0 0 0 3px rgba(31, 78, 116, .22); }
.input[aria-invalid="true"] { border-color: var(--carmine); }
.field-error { color: var(--carmine); font-size: .92rem; font-weight: 700; min-height: 0; }
.field-error:empty { display: none; }
.btn-seal { width: 100%; background: var(--carmine); color: #fff; box-shadow: 0 6px 18px rgba(120, 30, 30, .3); }
.btn-seal:hover { background: #8d2323; }
.seal-dot { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f0a0a0, #c34a4a 60%, #8d2323); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28); }
.form-status { min-height: 1.6em; margin-top: 8px; font-weight: 700; color: var(--moss); }

.notes-list { list-style: none; padding: 0; display: grid; gap: 14px; max-height: 560px; overflow-y: auto; padding-right: 6px; }
.note {
  position: relative; padding: 14px 16px 14px 18px; background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(160, 130, 90, .3); border-left: 3px solid var(--moss); border-radius: 6px;
}
.note.is-new { animation: note-in .9s var(--ease-spring) both; }
@keyframes note-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } }
.note-sample { border-left-color: var(--brass-light); }
.note-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.note-author { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; }
.note-origin, .note-date { font-size: .86rem; color: var(--ink-soft); }
.note-tag { font-size: .78rem; font-weight: 700; color: var(--brass); }
.note-body { font-family: var(--font-hand); line-height: 1.55; margin-top: 6px; overflow-wrap: anywhere; }
.note-delete {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--ink-soft);
}
.note-delete:hover { background: rgba(161, 44, 44, .12); color: var(--carmine); }
.notes-empty { padding: 28px 12px; text-align: center; font-family: var(--font-hand); color: var(--ink-soft); }

/* ---------- Rodapé ---------- */
.foot { position: relative; z-index: 2; margin-top: 16vh; padding: 56px clamp(20px, 6vw, 80px) 120px; color: var(--on-scene); }
.foot::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, var(--scene-glow) 34%); pointer-events: none; }
.foot-inner { position: relative; max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot-kanji { font-family: var(--font-display); font-weight: 700; letter-spacing: .3em; }
.foot-title { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 10px; }
.foot-text { max-width: 34em; color: var(--on-scene-soft); }
.foot-head { font-size: 1rem; margin-bottom: 10px; }
.foot-list { list-style: none; padding: 0; display: grid; gap: 8px; color: var(--on-scene-soft); }
.foot-list a { display: inline-block; padding: 2px 0; }
kbd { display: inline-block; min-width: 1.9em; padding: 0 6px; text-align: center; border: 1px solid currentColor; border-radius: 5px; font: 700 .82rem var(--font-text); margin-right: 4px; }

/* ---------- Lupa ---------- */
.specimen {
  width: min(960px, calc(100% - 24px)); max-height: calc(100dvh - 24px); margin: auto; padding: 0;
  border: 0; border-radius: 10px; color: var(--ink); overflow: auto;
  background: var(--paper) url("../assets/ui/paper.webp"); background-blend-mode: multiply;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.specimen[open] { animation: sheet-open .55s var(--ease-out); }
@keyframes sheet-open { from { opacity: 0; transform: translateY(30px) scale(.97); } }
.specimen::backdrop { background: rgba(14, 18, 34, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.specimen-close {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .7); color: var(--ink);
}
.specimen-close:hover { background: #fff; }
.specimen-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.specimen-art { position: relative; overflow: hidden; touch-action: none; cursor: none; background: #fbf6ea; min-height: 340px; }
.specimen-plate { height: 100%; aspect-ratio: 4 / 5; margin: 0 auto; max-width: 100%; }
.lens {
  position: absolute; left: 0; top: 0; width: 170px; height: 170px; margin: -85px 0 0 -85px;
  border-radius: 50%; overflow: hidden; pointer-events: none; background: #fbf6ea;
  box-shadow: 0 0 0 6px #b8860b, 0 0 0 8px #6e4f0c, 0 12px 26px rgba(30, 20, 10, .45), inset 0 0 22px rgba(255, 255, 255, .55);
}
.lens::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .45), transparent 42%); }
.lens-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.lens-hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-family: var(--font-hand); font-size: .92rem; color: var(--ink-soft); pointer-events: none; }
.specimen-info { padding: clamp(24px, 4vw, 40px); padding-right: clamp(24px, 4vw, 52px); }
.specimen-no { font-family: var(--font-hand); color: var(--clay); font-weight: 600; }
.specimen-title { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 4px; }
.specimen-latin { font-style: italic; color: var(--moss); margin-bottom: 14px; }
.specimen-facts { margin-top: 16px; display: grid; gap: 8px; font-size: .96rem; }
.specimen-facts dt { font-weight: 700; }
.specimen-facts dd { margin: 0; color: var(--ink-soft); }

/* ---------- Miro ---------- */
.miro {
  position: fixed; z-index: 60; right: clamp(10px, 2vw, 24px); bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none;
  transition: opacity .3s, transform .4s var(--ease-out);
}
.miro.is-hidden { opacity: 0; transform: translateY(24px); }
.miro.is-hidden .miro-btn { pointer-events: none; }
.miro-bubble {
  max-width: 240px; padding: 10px 14px; border-radius: 14px 14px 4px 14px;
  background: #fffaf0; color: var(--ink); font-family: var(--font-hand); line-height: 1.4;
  box-shadow: 0 8px 22px rgba(20, 15, 10, .28);
  opacity: 0; transform: translateY(8px) scale(.94); transform-origin: bottom right;
  transition: opacity .35s, transform .5s var(--ease-spring);
}
.miro-bubble.is-visible { opacity: 1; transform: none; }
.miro-btn {
  position: relative; width: 78px; height: 96px; padding: 0; border: 0; background: none;
  pointer-events: auto; transition: transform .45s var(--ease-spring);
}
.miro-btn:hover { transform: scale(1.08); }
.miro-btn svg { overflow: visible; }
.miro-body { animation: miro-float 4.2s ease-in-out infinite alternate; }
@keyframes miro-float { from { transform: translateY(1px); } to { transform: translateY(-4px); } }
.miro-wing { transform-box: fill-box; animation: miro-wing 2.8s ease-in-out infinite alternate; }
.miro-wing-l { transform-origin: 90% 10%; }
.miro-wing-r { transform-origin: 10% 10%; animation-direction: alternate-reverse; }
@keyframes miro-wing { from { transform: rotate(-5deg); } to { transform: rotate(7deg); } }
.miro-head { transform-box: fill-box; transform-origin: 50% 90%; transition: transform .25s ease-out; }
.miro-sprout { transform-box: fill-box; transform-origin: 20% 100%; animation: miro-wing 2.2s ease-in-out infinite alternate; }
.miro-pupil { transition: transform .12s ease-out; }
.miro-eye { transform-box: fill-box; transform-origin: center; transition: transform .08s; }
.miro-eyes.is-blinking { transform-box: fill-box; transform-origin: center; transform: scaleY(.08); }
.miro-sleep-eyes, .miro-zzz { display: none; }
.miro.is-asleep .miro-eyes { display: none; }
.miro.is-asleep .miro-sleep-eyes { display: inline; }
.miro.is-asleep .miro-body { animation-duration: 6s; }
.miro-zzz { position: absolute; top: -6px; left: -6px; font-family: var(--font-hand); font-weight: 600; color: var(--on-scene); text-shadow: 0 0 8px var(--scene-glow); }
.miro.is-asleep .miro-zzz { display: block; animation: zzz 3s ease-in-out infinite; }
@keyframes zzz { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(-8px, -14px); } }
.miro-btn.is-jumping { animation: miro-jump .7s var(--ease-spring); }
@keyframes miro-jump {
  0% { transform: none; } 30% { transform: translateY(-30px) scale(.92, 1.12); }
  62% { transform: scale(1.14, .88); } 100% { transform: none; }
}

/* ---------- Avisos ---------- */
.toast {
  position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; max-width: calc(100% - 24px);
  border-radius: 999px; background: #2a241d; color: #fdf6e7; box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
}
.toast[hidden] { display: none; }
.toast-undo { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: #f0d9a0; color: #2a241d; font-weight: 700; }

/* ---------- Responsividade ---------- */
@media (max-width: 1240px) {
  .menu-toggle { display: inline-flex; }
  .bar-panel {
    position: absolute; top: 100%; left: 0; right: 0; display: none;
    flex-direction: column; align-items: stretch; gap: 16px;
    padding: 16px clamp(16px, 3vw, 32px) 20px;
    background: var(--bar-solid);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .22);
  }
  .bar-panel.is-open { display: flex; animation: rise .4s var(--ease-out); }
  .chapters { flex-direction: column; gap: 2px; }
  .chapters a { padding: 10px 2px; font-size: 1.08rem; }
  .chapters a::after { right: auto; width: 56px; }
  .bar-controls { flex-wrap: wrap; }
  .time-group { width: 100%; justify-content: space-between; }
  .time-btn { flex: 1; min-height: 42px; padding: 6px 4px; }
  .volume { width: 110px; }
}

@media (max-aspect-ratio: 5/4) {
  .hero-copy { max-width: 620px; }
  .interlude-line { max-width: 34rem; }
}

@media (max-width: 860px) {
  .notes-layout { grid-template-columns: minmax(0, 1fr); }
  .foot-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .specimen-grid { grid-template-columns: minmax(0, 1fr); }
  .specimen-art { height: 54vh; min-height: 300px; }
  .lens { width: 130px; height: 130px; margin: -65px 0 0 -65px; }
  .notes-list { max-height: none; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .brand-sub { display: none; }
  .hero { padding-top: calc(var(--bar-h) + 22px); }
  .hero-title { font-size: clamp(1.86rem, 8.2vw, 2.4rem); margin-bottom: 12px; }
  .hero-lead { font-size: .96rem; margin-bottom: 10px; }
  .hero-note { padding: 14px 16px 10px; }
  .hero-gloss { margin-bottom: 10px; }
  .btn { min-height: 46px; padding: 8px 20px; font-size: .96rem; }
  .interlude { min-height: 82vh; padding-top: calc(var(--bar-h) + 6vh); }
  .miro-btn { width: 60px; height: 74px; }
  .miro-bubble { max-width: 200px; font-size: .94rem; }
  .sheet { width: calc(100% - 12px); }
}

@media (orientation: landscape) and (max-height: 520px) {
  .hero-copy { max-width: 56vw; }
  .hero-title { font-size: 1.7rem; }
  .hero-lead, .hero-hint, .hero-gloss { display: none; }
  .hero-note { padding: 8px 10px; }
}

/* ---------- Conforto ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.calm { scroll-behavior: auto; }
.calm *, .calm *::before, .calm *::after {
  animation: none !important;
  transition-duration: .01ms !important;
}
.calm .reveal { opacity: 1; transform: none; }

@media (forced-colors: active) {
  .sheet::before, .sheet::after, .sheet-inner::before { display: none; }
}
