:root {
  --paper: #f2f0e9;
  --ink: #151515;
  --muted: #64635e;
  --line: #cbc8bd;
  --orange: #ff6600;
  --purple: #663399;
  --green: #b7b700;
  --flow-contour: rgba(21, 21, 21, .115);
  --hero-wash-purple: rgba(102, 51, 153, .075);
  --hero-wash-orange: rgba(255, 102, 0, .065);
  --project-bg: #20201f;
  --project-text: #f7f5ed;
  --project-muted: #aaa89f;
}

@font-face {
  font-family: "Lexend Deca";
  src: url("/assets/fonts/LexendDeca.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

html[data-theme="dark"] {
  --paper: #111210;
  --ink: #f2f0e9;
  --muted: #aaa9a2;
  --line: #3a3b37;
  --flow-contour: rgba(242, 240, 233, .105);
  --hero-wash-purple: rgba(102, 51, 153, .085);
  --hero-wash-orange: rgba(255, 102, 0, .06);
  --project-bg: #e8e6df;
  --project-text: #151515;
  --project-muted: #65645e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Lexend Deca", ui-sans-serif, sans-serif;
}
a { color: inherit; }
main:focus { outline: none; }
#psicologia, #atendimento, #trajetoria, #projetos, #contato { scroll-margin-top: 1rem; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: .8rem 1rem;
  color: #fff;
  background: #151515;
}
.skip-link:focus { top: 1rem; }

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 5.5rem;
  padding: 0 clamp(1.25rem, 4vw, 4rem);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.mark { font-size: 1.5rem; font-weight: 900; text-decoration: none; }
.mark span { color: var(--orange); }
nav { display: flex; gap: clamp(.9rem, 2vw, 1.7rem); align-items: center; }
nav a { font-size: .76rem; font-weight: 750; text-decoration: none; text-transform: uppercase; }
nav a:hover, nav a:focus-visible { text-decoration: underline; text-underline-offset: .3rem; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: #151515; background: var(--green); border-color: #151515; }

.hero {
  position: relative;
  isolation: isolate;
  min-height: max(46rem, 100svh);
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--paper) 0%, var(--paper) 30%, color-mix(in srgb, var(--paper) 72%, transparent) 54%, transparent 78%),
    radial-gradient(circle at 82% 22%, var(--hero-wash-purple), transparent 31rem),
    radial-gradient(circle at 74% 82%, var(--hero-wash-orange), transparent 29rem);
}
#lab-canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-copy {
  position: relative;
  z-index: 2;
  width: min(70rem, calc(100% - 2.5rem));
  padding: clamp(8.5rem, 15vh, 10.5rem) 0 clamp(4rem, 8vh, 6rem) clamp(1.25rem, 8vw, 8rem);
  pointer-events: none;
}
.kicker {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1.3rem;
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.kicker::before { content: ""; width: 1.4rem; height: .45rem; border-top: 2px solid var(--orange); border-radius: 50%; transform: rotate(-8deg); }
h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3.8rem, 7.2vw, 7.4rem);
  font-weight: 480;
  line-height: .86;
  letter-spacing: -.045em;
}
.intro {
  max-width: 44rem;
  margin: 2rem 0 1.7rem;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.7vw, 1.28rem);
  line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; pointer-events: auto; }
.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: .8rem 1.1rem;
  border: 1px solid currentColor;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .2s, color .2s, background .2s;
}
.button:hover { transform: translateY(-.18rem); }
.button-primary { color: #fff; background: var(--purple); border-color: var(--purple); }
.button-primary:hover { color: #151515; background: var(--orange); border-color: #151515; }
.button-secondary { color: var(--ink); background: color-mix(in srgb, var(--paper) 85%, transparent); }
.button-secondary:hover { color: #151515; background: var(--green); }
.button-ink { color: #fff; background: #151515; border-color: #151515; }
.button-ink:hover { color: #151515; background: var(--green); }
.launch-status {
  max-width: 48rem;
  margin: 1.35rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
  border-left: 3px solid var(--green);
  font-size: .76rem;
  line-height: 1.55;
}
.launch-status span { display: block; margin-bottom: .12rem; color: var(--ink); font-weight: 800; text-transform: uppercase; }

.section-index { margin: 0; color: var(--muted); font: 700 .75rem/1.25 monospace; letter-spacing: .02em; }
.about {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1.5fr) minmax(17rem, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(4.5rem, 9vw, 8rem) clamp(1.25rem, 8vw, 8rem);
  border-bottom: 1px solid var(--ink);
}
.about h2, .future-care h2, .projects h2, .history h2, .contact h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.25rem, 4.5vw, 4.7rem);
  font-weight: 450;
  line-height: .98;
  letter-spacing: -.035em;
}
.about-copy p { max-width: 43rem; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.about-copy p:last-child { margin-bottom: 0; color: var(--ink); }
.signals { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.signals li { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: .78rem; }
.signals span { font-weight: 700; }
.signals b { color: var(--muted); font-family: monospace; font-weight: 400; text-align: right; }

.psychology {
  padding: clamp(4.5rem, 9vw, 8rem) clamp(1.25rem, 8vw, 8rem);
  color: #fff;
  background: var(--purple);
}
.psychology :focus-visible { outline-color: var(--green); }
.psychology .section-index { color: rgba(255, 255, 255, .8); }
.psychology-head { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); }
.psychology-head > div { max-width: 69rem; }
.overline { display: flex; align-items: center; gap: .7rem; margin: 0 0 1rem; color: #fff; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.overline::before { content: ""; width: 1.5rem; height: .15rem; background: var(--green); transform: rotate(-4deg); }
.psychology h2 {
  max-width: 16ch;
  margin: 0 0 2rem;
  font-size: clamp(3rem, 6.5vw, 7.2rem);
  font-weight: 430;
  line-height: .88;
  letter-spacing: -.045em;
}
.psychology-lead { max-width: 64ch; margin: 0; color: rgba(255, 255, 255, .82); font-size: clamp(1.05rem, 1.8vw, 1.34rem); line-height: 1.65; }
.behavior-grid { display: grid; grid-template-columns: 4fr 5fr 3fr; margin-top: clamp(3rem, 7vw, 6rem); border-top: 1px solid rgba(255, 255, 255, .38); }
.behavior-card, .skinner-note { min-height: 24rem; padding: clamp(1.4rem, 2.5vw, 2.3rem); }
.behavior-card { display: flex; flex-direction: column; border-right: 1px solid rgba(255, 255, 255, .38); }
.card-number { margin: 0 0 auto; color: var(--orange); font: 500 3.2rem/1 monospace; }
.behavior-card-wide .card-number { color: var(--green); }
.behavior-card h3, .skinner-note h3 { margin: 2rem 0 1rem; font-size: clamp(1.4rem, 2.4vw, 2.4rem); font-weight: 500; line-height: 1.05; }
.behavior-card p:last-child { max-width: 48ch; margin: 0; color: rgba(255, 255, 255, .76); line-height: 1.65; }
.skinner-note { display: flex; flex-direction: column; justify-content: flex-end; color: #151515; background: var(--green); }
.skinner-note span { margin-bottom: auto; font: 700 .76rem/1 monospace; }
.skinner-note p { margin: 0; color: #343430; font-size: .9rem; line-height: 1.6; }
.reading-links { display: flex; flex-wrap: wrap; gap: .8rem 2rem; align-items: center; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .38); font-size: .72rem; }
.reading-links span { color: #fff; font-weight: 800; text-transform: uppercase; text-decoration: underline var(--green) .2rem; text-underline-offset: .35rem; }
.reading-links a { text-underline-offset: .3rem; }

.future-care { padding: clamp(4.5rem, 9vw, 8rem) clamp(1.25rem, 8vw, 8rem); border-bottom: 1px solid var(--ink); }
.care-head { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); margin-bottom: clamp(3rem, 6vw, 5rem); }
.care-head > div { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.care-head h2 { margin: 0; }
.care-head p { max-width: 50ch; margin: 0; color: var(--muted); line-height: 1.7; }
.care-steps { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.care-steps li { min-height: 18rem; padding: 1.5rem; border-right: 1px solid var(--line); }
.care-steps li:last-child { border-right: 0; }
.care-steps span { color: var(--purple); font: 700 .8rem/1 monospace; }
.care-steps h3 { margin: 4.5rem 0 1rem; font-size: clamp(1.35rem, 2vw, 2rem); font-weight: 550; }
.care-steps p { max-width: 40ch; margin: 0; color: var(--muted); line-height: 1.65; }
.registration-note { display: grid; grid-template-columns: minmax(16rem, .8fr) minmax(0, 1.2fr); gap: 2rem; align-items: center; margin-top: 2rem; padding: clamp(1.5rem, 3vw, 2.5rem); color: #151515; background: var(--green); }
.registration-note span { display: block; margin-bottom: .6rem; font: 700 .72rem/1 monospace; text-transform: uppercase; }
.registration-note strong { display: block; max-width: 24ch; font-size: clamp(1.3rem, 2.5vw, 2.4rem); font-weight: 520; line-height: 1.05; }
.registration-note p { max-width: 62ch; margin: 0; color: #343430; font-size: .92rem; line-height: 1.65; }

.science-feature { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(22rem, .75fr); min-height: 44rem; overflow: hidden; color: #151515; background: var(--orange); border-bottom: 1px solid #151515; }
.science-feature :focus-visible { outline-color: var(--purple); }
.science-copy { z-index: 1; padding: clamp(4.5rem, 9vw, 8rem) clamp(1.25rem, 8vw, 8rem); }
.science-feature .section-index { color: #3f210d; }
.science-feature h2 { margin: 2.3rem 0 2rem; font-size: clamp(4rem, 9vw, 9.2rem); font-weight: 480; line-height: .77; letter-spacing: -.065em; }
.science-copy > p:not(.section-index) { max-width: 57ch; font-size: clamp(1rem, 1.5vw, 1.18rem); line-height: 1.65; }
.science-copy .science-role { margin-bottom: 2rem; font-size: .85rem; font-weight: 700; }
.layers-art { position: relative; min-height: 35rem; }
.layers-art span { position: absolute; width: min(38vw, 34rem); height: min(38vw, 34rem); border: clamp(.65rem, 1.3vw, 1.25rem) solid; border-radius: 43% 57% 61% 39% / 55% 38% 62% 45%; }
.layers-art span:nth-child(1) { top: 4%; right: -24%; border-color: var(--purple); transform: rotate(14deg); }
.layers-art span:nth-child(2) { top: 22%; right: -4%; border-color: var(--green); transform: rotate(-16deg); }
.layers-art span:nth-child(3) { top: 40%; right: -20%; border-color: #f2f0e9; transform: rotate(29deg); }
.layers-art b { position: absolute; right: 16%; bottom: 11%; font: 600 clamp(1.5rem, 3vw, 3.2rem)/.95 monospace; text-align: right; }

.history { padding: clamp(4.5rem, 9vw, 8rem) clamp(1.25rem, 8vw, 8rem); border-bottom: 1px solid var(--ink); }
.history-head { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); margin-bottom: 4rem; }
.history-head > div { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(15rem, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.history-head h2 { margin: 0; }
.history-head div p { margin: 0; color: var(--muted); line-height: 1.65; }
.history-grid { display: grid; grid-template-columns: repeat(12, 1fr); border-top: 1px solid var(--ink); }
.history-item { position: relative; grid-column: span 4; min-height: 11rem; display: flex; flex-direction: column; justify-content: space-between; padding: 1.25rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; transition: background .2s, color .2s; }
.history-item:nth-child(2), .history-item:nth-child(5), .history-item:nth-child(8) { border-right: 0; }
.history-item.featured { grid-column: span 6; min-height: 15rem; }
.history-item.current { color: #151515; background: var(--green); }
.history-item.science-history { color: #151515; background: var(--orange); }
.history-item[href]:hover { color: #fff; background: var(--purple); }
.history-item span { color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.history-item:hover span { color: rgba(255, 255, 255, .72); }
.history-item.current span, .history-item.science-history span { color: #343430; }
.history-item strong { font-size: clamp(1.45rem, 3vw, 3.2rem); font-weight: 500; overflow-wrap: anywhere; }
.history-item b { align-self: flex-end; font: 400 .68rem/1 monospace; }

.projects { padding: clamp(4.5rem, 9vw, 8rem) clamp(1.25rem, 8vw, 8rem); color: var(--project-text); background: var(--project-bg); }
.projects-head { display: grid; grid-template-columns: 8rem minmax(0, 1fr) minmax(15rem, 24rem); gap: clamp(2rem, 6vw, 6rem); align-items: end; margin-bottom: 4rem; }
.projects-head .section-index, .projects-head > p:last-child { color: var(--project-muted); }
.projects-head h2, .projects-head p { margin-bottom: 0; }
.projects-head > p:last-child { line-height: 1.55; }
.project-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; min-height: 15rem; }
.project-card { position: relative; grid-column: span 6; min-height: 20rem; padding: 1.5rem; overflow: hidden; border: 1px solid #5e5d59; text-decoration: none; transition: transform .25s, border-color .25s; }
.project-card:hover { transform: translateY(-.35rem); border-color: var(--accent); }
.project-card::before { content: ""; position: absolute; width: 12rem; height: 12rem; right: -3rem; top: -3rem; border: 1px solid var(--accent); border-radius: 50%; transition: transform .4s; }
.project-card:hover::before { transform: scale(1.25) rotate(20deg); }
.project-meta { display: flex; justify-content: space-between; color: var(--project-muted); font: .68rem monospace; }
.project-card h3 { position: absolute; left: 1.5rem; right: 1.5rem; bottom: 4.5rem; margin: 0; font-size: clamp(2.2rem, 5vw, 5rem); font-weight: 500; line-height: .9; overflow-wrap: anywhere; }
.project-card p { position: absolute; left: 1.5rem; bottom: 1.25rem; margin: 0; color: var(--project-muted); }
.project-arrow { position: absolute; right: 1.5rem; bottom: 1.25rem; color: var(--accent); font-size: 1.5rem; }
.loading { color: var(--project-muted); }

.contact { display: grid; grid-template-columns: 8rem minmax(0, 1.15fr) minmax(19rem, .85fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; padding: clamp(4.5rem, 8vw, 7rem) clamp(1.25rem, 8vw, 8rem); color: #151515; background: var(--green); }
.contact .section-index { color: #3b3b10; }
.contact h2 { margin-bottom: 1.2rem; }
.contact > div > p { max-width: 56ch; margin: 0; color: #343430; line-height: 1.65; }
.contact-action { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; }
.contact-action > span { font: 700 .82rem/1.2 monospace; }
.contact-action small { max-width: 40ch; color: #454511; line-height: 1.45; }
.contact :focus-visible { outline-color: var(--purple); }

footer { display: grid; grid-template-columns: 1fr auto auto; gap: 2rem; align-items: center; padding: 2rem clamp(1.25rem, 4vw, 4rem); color: #f2f0e9; background: #151515; font-size: .75rem; font-weight: 700; }
footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
footer a { text-underline-offset: .25rem; }
#local-clock { font-family: monospace; }

@media (max-width: 1040px) {
  .about { grid-template-columns: 6rem minmax(0, 1fr); }
  .about .signals { grid-column: 2; }
  .psychology-head, .care-head, .history-head { grid-template-columns: 6rem minmax(0, 1fr); }
  .behavior-grid { grid-template-columns: 1fr 1fr; }
  .behavior-card-wide { border-right: 0; }
  .skinner-note { grid-column: 1 / -1; min-height: 17rem; }
  .care-head > div, .history-head > div { grid-template-columns: 1fr; }
  .projects-head { grid-template-columns: 6rem minmax(0, 1fr); }
  .projects-head > p:last-child { grid-column: 2; }
  .contact { grid-template-columns: 6rem minmax(0, 1fr); }
  .contact-action { grid-column: 2; }
}

@media (max-width: 760px) {
  .topbar { min-height: 4.75rem; }
  nav { gap: .9rem; }
  nav a { font-size: .68rem; }
  nav .nav-optional { display: none; }
  .hero { min-height: 100svh; }
  .hero::before { background: linear-gradient(90deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 82%, transparent) 66%, transparent 100%); }
  #lab-canvas { opacity: .78; }
  .hero-copy { width: 100%; padding: 7.7rem 1.25rem 3.5rem; }
  h1 { max-width: 10ch; font-size: clamp(3.35rem, 15.5vw, 5rem); }
  .intro { max-width: 33rem; margin-top: 1.6rem; font-size: 1rem; }
  .hero-actions { align-items: stretch; flex-direction: column; max-width: 24rem; }
  .hero-actions .button { width: 100%; }
  .launch-status { max-width: 34rem; }
  .about, .psychology-head, .care-head, .history-head, .projects-head, .contact { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .about .signals, .projects-head > p:last-child, .contact-action { grid-column: auto; }
  .about h2, .future-care h2, .projects h2, .history h2, .contact h2 { font-size: clamp(2.1rem, 11vw, 3.4rem); }
  .psychology h2 { max-width: 100%; font-size: clamp(2.35rem, 11vw, 4.5rem); }
  .behavior-grid { grid-template-columns: 1fr; }
  .behavior-card, .behavior-card-wide { min-height: 20rem; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .38); }
  .skinner-note { grid-column: auto; min-height: 18rem; }
  .reading-links { align-items: flex-start; flex-direction: column; }
  .care-steps { grid-template-columns: 1fr; }
  .care-steps li { min-height: auto; padding: 1.5rem 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .care-steps li:last-child { border-bottom: 0; }
  .care-steps h3 { margin-top: 2.5rem; }
  .registration-note { grid-template-columns: 1fr; }
  .science-feature { grid-template-columns: 1fr; min-height: auto; }
  .science-copy { padding-bottom: 2rem; }
  .science-feature h2 { font-size: clamp(3.7rem, 18vw, 6rem); }
  .layers-art { min-height: 20rem; }
  .layers-art span { width: 17rem; height: 17rem; border-width: .65rem; }
  .layers-art span:nth-child(1) { right: -3rem; }
  .layers-art span:nth-child(2) { right: 4rem; }
  .layers-art span:nth-child(3) { right: -4rem; }
  .layers-art b { right: 1.25rem; }
  .history-head { margin-bottom: 2.5rem; }
  .history-item, .history-item.featured { grid-column: 1 / -1; min-height: 10rem; border-right: 0; }
  .project-card { grid-column: 1 / -1; min-height: 17rem; }
  .contact-action { margin-top: .5rem; }
  footer { grid-template-columns: 1fr; gap: .9rem; }
}

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