/* ==========================================================================
   Curto Circuito — folha de estilo do site
   Paleta: #ffff00 #0606fc #ff10ca #23ff10 #fff9f9 #000000
   Cada página usa uma cor neutra de fundo + uma cor de destaque (--accent).
   ========================================================================== */

/* ---------- Fontes ---------- */
/* Haffer Trial: coloque os arquivos na pasta assets/fonts/ com estes nomes.
   Se os arquivos não existirem, o site usa Inter no lugar. */
@font-face {
  font-family: "Haffer Trial";
  src: url("../fonts/HafferTrial-Regular.woff2") format("woff2"),
       url("../fonts/HafferTrial-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Haffer Trial";
  src: url("../fonts/HafferTrial-Medium.woff2") format("woff2"),
       url("../fonts/HafferTrial-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Haffer Trial";
  src: url("../fonts/HafferTrial-SemiBold.woff2") format("woff2"),
       url("../fonts/HafferTrial-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Variáveis ---------- */
:root {
  --yellow: #ffff00;
  --blue: #0606fc;
  --pink: #ff10ca;
  --green: #23ff10;
  --cream: #fff9f9;
  --black: #000000;
  --white: #ffffff;

  --bg: var(--white);
  --fg: var(--black);
  --accent: var(--pink);
  --line: rgba(0, 0, 0, 0.18);
  --muted: rgba(0, 0, 0, 0.6);

  --font-display: "Haffer Trial", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --sidebar: 64px;
  --gutter: clamp(20px, 5vw, 72px);
  --maxw: 1320px;
}

/* temas por página */
body.theme-pink   { --bg: var(--white); --fg: var(--black); --accent: var(--pink);
                    --line: rgba(0,0,0,.18); --muted: rgba(0,0,0,.6); }
body.theme-blue   { --bg: var(--cream); --fg: var(--black); --accent: var(--blue);
                    --line: rgba(0,0,0,.18); --muted: rgba(0,0,0,.6); }
body.theme-yellow { --bg: var(--black); --fg: var(--white); --accent: var(--yellow);
                    --line: rgba(255,255,255,.22); --muted: rgba(255,255,255,.65); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.05; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--black); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; background: var(--accent); color: var(--black);
  padding: 8px 12px; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: calc(var(--sidebar) + 8px); }

/* ---------- Barra lateral ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar);
  background: var(--black); color: var(--white); z-index: 50;
  display: flex; flex-direction: column; align-items: center;
}
.menu-btn {
  width: var(--sidebar); height: var(--sidebar); border: 0; background: transparent; color: var(--white);
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.menu-btn span { display: block; width: 26px; height: 2px; background: currentColor; margin: 3px 0; transition: transform .25s, opacity .25s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.sidebar-label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--font-display); font-size: 16px; letter-spacing: .01em; margin-top: 18px; white-space: nowrap;
}
.sidebar-home { margin-top: auto; margin-bottom: 18px; color: var(--white); display: grid; place-items: center; width: 40px; height: 40px; }
.sidebar-home:hover { color: var(--accent); }

/* ---------- Menu (gaveta) ---------- */
.nav-drawer {
  position: fixed; top: 0; left: var(--sidebar); bottom: 0; width: min(420px, calc(100vw - var(--sidebar)));
  background: var(--black); color: var(--white); z-index: 49;
  transform: translateX(-110%); transition: transform .3s ease; overflow-y: auto;
  padding: 32px 36px 40px; border-right: 1px solid rgba(255,255,255,.15);
}
.nav-drawer.is-open { transform: translateX(0); }
.nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 48; opacity: 0; pointer-events: none; transition: opacity .3s; }
.nav-backdrop.is-open { opacity: 1; pointer-events: auto; }
.nav-drawer .wordmark { font-size: 28px; margin-bottom: 40px; display: inline-block; }
.nav-drawer ul li { margin: 0; }
.nav-drawer a { display: block; padding: 10px 0; }
.nav-drawer .nav-top > li > a { font-family: var(--font-display); font-size: 26px; border-top: 1px solid rgba(255,255,255,.18); padding: 16px 0; }
.nav-drawer .nav-top > li:last-child > a { border-bottom: 1px solid rgba(255,255,255,.18); }
.nav-drawer .nav-sub { padding: 0 0 14px 0; }
.nav-drawer .nav-sub a { font-size: 16px; color: rgba(255,255,255,.78); padding: 6px 0 6px 18px; position: relative; }
.nav-drawer .nav-sub a::before { content: "/"; position: absolute; left: 0; color: var(--accent); }
.nav-drawer .nav-sub a:hover { color: var(--accent); }
.nav-drawer a[aria-current="page"] { color: var(--accent); }
.nav-drawer .nav-contact { margin-top: 36px; font-size: 14px; color: rgba(255,255,255,.65); line-height: 1.8; }
.nav-drawer .nav-contact a:hover { color: var(--accent); }

/* ---------- Estrutura ---------- */
.page { margin-left: var(--sidebar); min-height: 100vh; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: clamp(56px, 8vw, 120px) 0; }
section + section { border-top: 1px solid var(--line); }
.wordmark { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; }
.hairline { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* títulos de seção */
.section-title { font-size: clamp(44px, 7vw, 96px); margin-bottom: clamp(28px, 4vw, 56px); }
.section-title .slash { color: var(--accent); }
.kicker { font-family: var(--font-display); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; display: block; }
.lead { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 34px); line-height: 1.25; max-width: 24em; }
.text { max-width: 62ch; }
.text-lg { font-size: 19px; }
.muted { color: var(--muted); }

/* grades */
.grid { display: grid; gap: clamp(24px, 3vw, 48px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(32px, 5vw, 96px); align-items: start; }
.sticky { position: sticky; top: 32px; }

/* linhas com texto (referência do Figma) */
.rules > * { padding: 28px 0; border-top: 1px solid var(--line); margin: 0; }
.rules > *:last-child { border-bottom: 1px solid var(--line); }

/* estrela decorativa: PNG usado como máscara, cor vem do --accent */
.star {
  display: inline-block; width: 120px; aspect-ratio: 1 / 1; background: var(--accent);
  -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat;
}
.star-1 { --star: url("../img/stars/star-1.png"); }
.star-2 { --star: url("../img/stars/star-2.png"); }
.star-3 { --star: url("../img/stars/star-3.png"); }
.star-4 { --star: url("../img/stars/star-4.png"); }
.star-5 { --star: url("../img/stars/star-5.png"); }
.star-6 { --star: url("../img/stars/star-6.png"); }
.star-7 { --star: url("../img/stars/star-7.png"); }
.star-8 { --star: url("../img/stars/star-8.png"); }

/* ---------- Capa (landing) ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; padding: 0; background: var(--pink); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-text {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(32px, 6vh, 72px); color: var(--white);
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.hero-text h1 { font-size: clamp(34px, 5.2vw, 76px); max-width: 14em; color: var(--white); }
.hero-text p { font-size: clamp(16px, 1.6vw, 22px); margin-top: 16px; max-width: 32em; }
.scroll-hint {
  position: absolute; right: var(--gutter); bottom: clamp(32px, 6vh, 72px); color: var(--white);
  font-family: var(--font-display); font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px; text-shadow: 0 2px 16px rgba(0,0,0,.4);
}
.scroll-hint svg { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint svg { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Apresentação (landing) ---------- */
.intro .section-title { margin-bottom: 40px; }
.intro .rules p { font-size: 18px; }
.intro-cols { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: clamp(24px, 3vw, 48px); padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.intro-cols .highlight { font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; color: var(--accent); }
.intro-cols h3 { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; font-weight: 600; }
.intro-cols p { font-size: 15px; color: var(--muted); }
.intro-cols p strong { color: var(--fg); }

/* chamadas para as páginas */
.cta-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cta-row a { background: var(--bg); padding: 36px 28px; display: flex; flex-direction: column; gap: 60px; min-height: 240px; transition: background .2s, color .2s; }
.cta-row a:hover { background: var(--accent); color: var(--black); }
.cta-row a:hover .muted { color: rgba(0,0,0,.65); }
.cta-row .cta-title { font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 34px); margin-top: auto; }
.cta-row .cta-label { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Cards genéricos ---------- */
.card { border: 1px solid var(--line); padding: 28px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.card h3 { font-size: 22px; }
.card .star { width: 56px; }
.card-accent { background: var(--accent); color: var(--black); border-color: var(--accent); }
.card-accent .muted { color: rgba(0,0,0,.65); }

/* ---------- Quem somos ---------- */
.publics .card h3 { font-size: 26px; }
.publics .num { font-family: var(--font-display); font-size: clamp(48px, 6vw, 84px); line-height: 1; color: var(--accent); }

.method-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.method-steps article { background: var(--bg); padding: 32px 28px 40px; }
.method-steps .step-num { font-family: var(--font-display); font-size: 14px; letter-spacing: .14em; color: var(--accent); margin-bottom: 36px; display: block; }
.method-steps h3 { font-size: clamp(30px, 3vw, 44px); margin-bottom: 18px; }
.method-steps p { font-size: 16px; }
.method-title { font-family: var(--font-display); font-size: clamp(36px, 5vw, 72px); margin-bottom: 36px; line-height: 1; }
.method-title em { font-style: normal; color: var(--accent); }

.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 48px); }
.team article { border-top: 2px solid var(--fg); padding-top: 20px; }
.team h3 { font-size: 26px; margin-bottom: 6px; }
.team .role { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 14px; display: block; }
.team p { font-size: 16px; }

.figure { margin: 0; }
.figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.figure figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }

.contact-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 40px; }
.contact-list a { background: var(--bg); padding: 28px; display: block; }
.contact-list a:hover { background: var(--accent); color: var(--black); }
.contact-list a:hover .muted { color: rgba(0,0,0,.65); }
.contact-list .label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; display: block; margin-bottom: 10px; }
.contact-list .value { font-family: var(--font-display); font-size: clamp(17px, 1.5vw, 22px); overflow-wrap: anywhere; }

/* ---------- Ações: painel de impacto ---------- */
.impact { border: 1px solid var(--line); padding: clamp(28px, 4vw, 56px); }
.impact .kicker { margin-bottom: 36px; }
.impact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.impact-grid > div { padding: 28px 24px 32px 0; border-top: 1px solid var(--line); }
.impact-grid > div:nth-child(-n+3) { border-top: 0; padding-top: 0; }
.impact .num { font-family: var(--font-display); font-size: clamp(44px, 5.5vw, 84px); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.impact .label { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-top: 14px; display: block; max-width: 22em; }
.impact-note { font-size: 13px; color: var(--muted); margin-top: 32px; max-width: 70ch; }
details.detail { margin-top: 28px; border-top: 1px solid var(--line); }
details.detail summary { cursor: pointer; padding: 18px 0; font-family: var(--font-display); font-size: 18px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.detail summary::-webkit-details-marker { display: none; }
details.detail summary::after { content: "+"; color: var(--accent); font-size: 26px; }
details.detail[open] summary::after { content: "–"; }
details.detail ul { padding-bottom: 20px; columns: 2; column-gap: 48px; }
details.detail li { font-size: 15px; padding: 8px 0; border-top: 1px solid var(--line); break-inside: avoid; display: flex; gap: 14px; }
details.detail li b { font-family: var(--font-display); color: var(--accent); min-width: 4em; font-weight: 500; }

/* ---------- Ações: portfólio ---------- */
.sub-title { font-family: var(--font-display); font-size: clamp(28px, 3.2vw, 44px); margin: 0 0 32px; padding-top: 48px; border-top: 1px solid var(--line); }
.sub-title:first-of-type { padding-top: 0; border-top: 0; }
.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(24px, 3vw, 48px); }
.action { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); }
.action-media { aspect-ratio: 4 / 3; overflow: hidden; background: rgba(127,127,127,.12); position: relative; }
.action-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.action:hover .action-media img { transform: scale(1.03); }
.action-media.is-empty { display: grid; place-items: center; }
.action-media.is-empty .star { width: 34%; opacity: .9; }
.action-media .pair { display: grid; grid-template-columns: 1fr 1fr; height: 100%; }
.action-media .pair img { height: 100%; }
.action-body { padding: 24px 24px 28px; }
.tag { display: inline-block; font-family: var(--font-display); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; background: var(--accent); color: var(--black); padding: 5px 10px; margin-bottom: 14px; }
.tag.tag-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.action h3 { font-size: clamp(22px, 2vw, 28px); margin-bottom: 8px; }
.action .meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: block; }
.action p { font-size: 15px; }
.action.is-wide { grid-column: 1 / -1; grid-template-columns: 1.2fr 1fr; grid-template-rows: none; }
.action.is-wide .action-media { aspect-ratio: auto; min-height: 320px; }

.materials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.materials article { background: var(--bg); padding: 28px; display: flex; flex-direction: column; gap: 10px; min-height: 280px; }
.materials .count { font-family: var(--font-display); font-size: clamp(40px, 4vw, 64px); line-height: 1; color: var(--accent); }
.materials h3 { font-size: 22px; }
.materials p { font-size: 15px; color: var(--muted); }
.materials a.more { margin-top: auto; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }

.research li { border-top: 1px solid var(--line); padding: 22px 0; display: grid; grid-template-columns: 120px 1fr; gap: 24px; }
.research li:last-child { border-bottom: 1px solid var(--line); }
.research .type { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); padding-top: 6px; }
.research h3 { font-size: 20px; font-family: var(--font-text); font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
.research p { font-size: 14px; color: var(--muted); }

/* ---------- Ações: horizonte (PNAB) ---------- */
.horizon { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 96px); align-items: start; }
.horizon .seal { display: inline-block; font-family: var(--font-display); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--accent); color: var(--accent); padding: 8px 12px; margin-bottom: 28px; }
.horizon h3 { font-size: clamp(30px, 3.6vw, 52px); margin-bottom: 24px; }
.horizon h4 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 28px 0 10px; font-family: var(--font-text); font-weight: 600; }
.horizon .figure img { aspect-ratio: 4 / 5; }
.horizon .figure.wide img { aspect-ratio: 16 / 10; }

/* ---------- Parceiros ---------- */
.partners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.partners li { background: var(--bg); padding: 32px 28px; font-family: var(--font-display); font-size: clamp(18px, 1.8vw, 24px); min-height: 150px; display: flex; align-items: flex-end; }
.partners li::before { content: "/"; color: var(--accent); margin-right: 8px; }

/* ---------- Rodapé ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px; align-items: center; }
.footer .wordmark { font-size: 22px; }
.footer ul { display: flex; gap: 24px; flex-wrap: wrap; }
.footer a:hover { color: var(--accent); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .intro-cols { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  body { padding-top: 56px; }
  .sidebar { top: 0; bottom: auto; right: 0; width: 100%; height: 56px; flex-direction: row; }
  .menu-btn { width: 56px; height: 56px; }
  .sidebar-label { writing-mode: horizontal-tb; transform: none; margin: 0 0 0 4px; font-size: 15px; }
  .sidebar-home { margin: 0 12px 0 auto; }
  .nav-drawer { left: 0; top: 56px; width: 100%; padding: 24px var(--gutter) 40px; }
  .page { margin-left: 0; }
  .hero { height: calc(100svh - 56px); min-height: 480px; }
  .hero-text { bottom: 72px; }
  .scroll-hint { left: var(--gutter); right: auto; bottom: 22px; }
  .grid-2, .grid-3, .grid-4, .split, .team, .actions, .horizon, .method-steps, .cta-row, .contact-list, .materials { grid-template-columns: 1fr; }
  .impact-grid { grid-template-columns: 1fr 1fr; }
  .impact-grid > div:nth-child(-n+3) { border-top: 1px solid var(--line); padding-top: 28px; }
  .impact-grid > div:nth-child(-n+2) { border-top: 0; padding-top: 0; }
  .intro-cols { grid-template-columns: 1fr; }
  .action.is-wide { grid-template-columns: 1fr; }
  .partners { grid-template-columns: 1fr 1fr; }
  details.detail ul { columns: 1; }
  .research li { grid-template-columns: 1fr; gap: 6px; }
  .sticky { position: static; }
}
@media (max-width: 520px) {
  .impact-grid, .partners { grid-template-columns: 1fr; }
  .impact-grid > div:nth-child(-n+2) { border-top: 1px solid var(--line); padding-top: 28px; }
  .impact-grid > div:first-child { border-top: 0; padding-top: 0; }
  .sidebar-label { font-size: 13px; }
}
