/* ============================================================
   Laboratórios da Alegria — folha de estilo compartilhada
   Usada por todas as páginas do site (index.html, /neurotec/, etc.)
   ============================================================ */

:root {
  --verde-escuro: #33402A;
  --verde-musgo: #5C6E45;
  --verde-musgo-claro: #8A9A6E;
  --terracota: #B85C3C;
  --dourado: #C39A5C;
  --dourado-suave: #DCC79A;
  --creme: #FAF6EC;
  --branco: #FFFDF8;
  --texto: #2B2A24;
  --texto-suave: #635F53;
  --borda: #E6DDC6;
  --sombra: 0 12px 32px rgba(51, 64, 42, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--creme);
  color: var(--texto);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  color: var(--verde-escuro);
  margin: 0;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--terracota); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header / Nav ---------- */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--borda);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  max-width: 1220px;
  margin: 0 auto;
}

.brand {
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
}

nav.primary-nav {
  display: flex;
  gap: 17px;
  flex-wrap: wrap;
}

nav.primary-nav a {
  color: var(--verde-escuro);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 2px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

nav.primary-nav a:hover,
nav.primary-nav a:focus-visible {
  color: var(--terracota);
  border-bottom-color: var(--terracota);
}

nav.primary-nav a.is-current {
  color: var(--terracota);
  border-bottom-color: var(--dourado);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--borda);
  border-radius: 8px;
  width: 42px;
  height: 38px;
  cursor: pointer;
  position: relative;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  height: 2px;
  background: var(--verde-escuro);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle::before { top: 13px; }
.nav-toggle span { top: 18px; }
.nav-toggle::after { top: 23px; }

.nav-toggle[aria-expanded="true"]::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span { opacity: 0; }
.nav-toggle[aria-expanded="true"]::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 1200px) {
  .nav-toggle { display: block; }
  nav.primary-nav {
    display: none;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 8px 0 18px;
  }
  nav.primary-nav.is-open { display: flex; }
  nav.primary-nav a { padding: 10px 4px; border-bottom: 1px solid var(--borda); }
  .nav-row { flex-wrap: wrap; }
}

/* ---------- Sections ---------- */

section {
  padding: 88px 0;
}

section.alt { background: var(--branco); }

.eyebrow {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracota);
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  margin-bottom: 22px;
}

.lede {
  font-size: 1.08rem;
  color: var(--texto-suave);
  max-width: 62ch;
}

.section-head {
  max-width: 720px;
  margin-bottom: 48px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.divider {
  width: 64px;
  height: 3px;
  background: linear-gradient(90deg, var(--dourado), var(--terracota));
  border-radius: 2px;
  margin: 22px 0;
}

.section-head.center .divider { margin-left: auto; margin-right: auto; }

/* reveal-on-scroll (progressive enhancement, safe if JS is off) */
.js-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 96px 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(220, 199, 154, 0.35), transparent 45%),
    radial-gradient(circle at 88% 82%, rgba(184, 92, 60, 0.12), transparent 42%),
    var(--creme);
  border-bottom: 1px solid var(--borda);
  overflow: hidden;
}

.hero.center-hero { text-align: center; }

.hero-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(1100px, 130vw);
  transform: translate(-50%, -50%);
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

.hero .container,
.hero-inner { position: relative; z-index: 1; }

.hero .eyebrow { letter-spacing: 0.2em; }

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.08;
  margin-bottom: 24px;
}

.hero .tagline {
  font-family: 'Lora', serif;
  font-style: italic;
  color: var(--verde-musgo);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.65;
  max-width: 40ch;
  margin: 0 0 30px;
}

.center-hero .tagline,
.center-hero .lede { margin-left: auto; margin-right: auto; }

.hero .lede { margin: 0 0 40px; }

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.center-hero .hero-actions { justify-content: center; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
  text-align: left;
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-inner .hero-actions { justify-content: center; }
  .hero-inner .tagline,
  .hero-inner .lede { margin-left: auto; margin-right: auto; }
}

.hero-figure img {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: block;
  border-radius: 22px;
  box-shadow: 0 24px 48px rgba(51, 64, 42, 0.22);
}

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--verde-escuro);
  color: var(--branco);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--sombra); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--verde-escuro);
  border: 1.5px solid var(--verde-musgo-claro);
}
.btn-ghost:hover { border-color: var(--terracota); color: var(--terracota); }

/* ---------- Numbered / pillar card grids ---------- */

.framework-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px;
}
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 900px) {
  .framework-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .pillar-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .framework-grid { grid-template-columns: 1fr; }
}

.framework-card {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 16px;
  padding: 26px 22px;
  box-shadow: var(--sombra);
}

.framework-card .num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--dourado);
  color: var(--terracota);
  font-family: 'Lora', serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 0.98rem;
}

.framework-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.framework-card p {
  font-size: 0.92rem;
  color: var(--texto-suave);
  margin: 0;
}

/* ---------- Media block (text + photo, either order) ---------- */

.media-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
}
@media (max-width: 760px) {
  .media-block { grid-template-columns: 1fr; }
  .media-block .media-figure { order: -1; }
}

.media-figure img {
  width: 100%;
  max-width: 480px;
  display: block;
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: var(--sombra);
}

.media-figure figcaption {
  font-size: 0.8rem;
  color: var(--texto-suave);
  text-align: center;
  margin-top: 10px;
}

/* ---------- Responsive video embed (16:9) ---------- */

.video-embed {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sombra);
  background: var(--verde-escuro);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Two-column concept blocks ---------- */

.concept-block {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 760px) {
  .concept-block { grid-template-columns: 1fr; gap: 24px; }
}

.concept-tag {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--verde-musgo);
  border-left: 3px solid var(--dourado);
  padding-left: 20px;
}

/* ---------- Bridge / quote section ---------- */

.bridge {
  background: var(--verde-escuro);
  color: var(--creme);
  text-align: center;
}

.bridge .eyebrow { color: var(--dourado-suave); }
.bridge h2 { color: var(--branco); }
.bridge .lede { color: rgba(250, 246, 236, 0.82); margin: 0 auto; }

/* ---------- Applications list ---------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 760px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .app-grid { grid-template-columns: 1fr; }
}

.app-item {
  background: var(--creme);
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 20px 18px;
  font-family: 'Lora', serif;
  font-weight: 600;
  color: var(--verde-escuro);
  font-size: 0.98rem;
}

/* ---------- Placeholder / fill-in cards ---------- */

.fill-card {
  background: var(--branco);
  border: 1.5px dashed var(--dourado);
  border-radius: 16px;
  padding: 26px;
}

.fill-card h3 { font-size: 1.05rem; margin-bottom: 10px; }

.fill-note {
  display: inline-block;
  background: #FFF3E2;
  border: 1px solid var(--dourado);
  color: #8A5A20;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------- Sobre / institutional ---------- */

.sobre-box {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 18px;
  padding: 40px;
  box-shadow: var(--sombra);
}

.sobre-box dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
  margin: 22px 0 0;
  font-size: 0.95rem;
}
.sobre-box dt { color: var(--texto-suave); font-weight: 500; }
.sobre-box dd { margin: 0; color: var(--texto); font-weight: 600; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--borda);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
}
.contact-list li span:first-child { color: var(--texto-suave); }

.fill {
  background: #FFF3E2;
  border: 1px solid var(--dourado);
  color: #8A5A20;
  padding: 1px 8px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.92em;
}

/* ---------- Info / safety note box ---------- */

.info-box {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-left: 4px solid var(--terracota);
  border-radius: 12px;
  padding: 20px 24px;
  font-size: 0.92rem;
  color: var(--texto-suave);
}
.info-box strong { color: var(--texto); }

/* ---------- Web Audio demo player ---------- */

.player-box {
  background: var(--branco);
  border: 1px solid var(--borda);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--sombra);
}

.preset-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 0;
}

.preset-btn {
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--verde-musgo-claro);
  background: transparent;
  color: var(--verde-escuro);
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.preset-btn:hover:not(.is-active) { border-color: var(--terracota); color: var(--terracota); }
.preset-btn.is-active { background: var(--verde-escuro); color: var(--branco); border-color: var(--verde-escuro); }
.preset-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.player-transport {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--borda);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.volume-control input[type="range"] {
  accent-color: var(--terracota);
  width: 120px;
}

.player-status {
  font-size: 0.86rem;
  color: var(--texto-suave);
  margin-top: 16px;
  min-height: 1.3em;
}

.player-status.is-playing { color: var(--verde-musgo); font-weight: 600; }

/* ---------- Footer ---------- */

footer.site-footer {
  background: var(--verde-escuro);
  color: rgba(250, 246, 236, 0.75);
  padding: 44px 0 30px;
  font-size: 0.86rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-row .brand { color: var(--branco); font-size: 1rem; margin-bottom: 6px; }
footer.site-footer a { color: var(--dourado-suave); }
.footer-note { max-width: 46ch; color: rgba(250, 246, 236, 0.6); }

.top-note {
  background: #FFF3E2;
  border-bottom: 1px solid var(--dourado);
  color: #8A5A20;
  text-align: center;
  font-size: 0.85rem;
  padding: 10px 16px;
}
