/*
  tangerina.ia.br — styles.css
  Toda cor é custom property e resolve por tema (ver bloco :root / dark abaixo).
  Tipografia e espaçamento usam os valores literais de DESIGN.md > typography / spacing,
  citados em comentário junto de cada regra que os usa.
  Um único ponto de virada: 53.75rem ({spacing.breakpoint}). Não é possível usar
  var() dentro da condição de uma media query, por isso o valor aparece literal
  em cada @media abaixo — ele bate com o token mesmo assim.
*/

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light dark;

  /* {colors.*} — tema claro (registro nativo da marca) */
  --color-bg: #fcfcfb;
  --color-bg-raised: #ffffff;
  --color-bg-muted: #f4f3f1;
  --color-text: #16140f;
  --color-text-muted: #57544c;
  --color-text-faint: #6a6355;
  --color-border: #e5e7eb;
  --color-border-strong: #c9c6be;
  --color-orange: #f54900;
  --color-green: #069452;
  --color-on-orange: #1a0e00; /* sem par -dark: vale nos dois modos */
  --color-focus: #f54900;
  --color-logo-fruit: #f54900;
  --color-logo-leaves: #069452;

  --font: 'Montserrat', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
}

/* Modo escuro pelo sistema, quando não há escolha local salva */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #1c1c1a;
    --color-bg-raised: #232320;
    --color-bg-muted: #282828;
    --color-text: #f2f1ed;
    --color-text-muted: #b7b3a9;
    --color-text-faint: #8a857a;
    --color-border: #3a3a36;
    --color-border-strong: #4c4c46;
    --color-orange: #fb923c;
    --color-green: #4ade80;
    --color-focus: #fb923c;
    --color-logo-fruit: #fb923c;
    --color-logo-leaves: #4ade80;
  }
}

/* Escolha local salva vence o sistema, nos dois sentidos. O color-scheme
   acompanha a escolha: sem isso, quem força escuro numa máquina em modo claro
   continua com barra de rolagem e controles nativos pintados pelo sistema. */
:root[data-theme="light"] { color-scheme: light; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #1c1c1a;
  --color-bg-raised: #232320;
  --color-bg-muted: #282828;
  --color-text: #f2f1ed;
  --color-text-muted: #b7b3a9;
  --color-text-faint: #8a857a;
  --color-border: #3a3a36;
  --color-border-strong: #4c4c46;
  --color-orange: #fb923c;
  --color-green: #4ade80;
  --color-focus: #fb923c;
  --color-logo-fruit: #fb923c;
  --color-logo-leaves: #4ade80;
}

@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/montserrat-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html, body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
}

/* {spacing.gutter-mobile} / {spacing.gutter-desktop} / {spacing.measure-max} */
.stack { padding: 0 1.5rem; }
@media (min-width: 53.75rem) {
  .stack { max-width: 760px; margin: 0 auto; padding: 0 2.5rem; }
}

/* ---- barra superior ---- */
/* {spacing.topbar-top-mobile} / {spacing.topbar-top-desktop} / {spacing.shell-max} */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 1.5rem 0; }
@media (min-width: 53.75rem) {
  .topbar { padding: 2.25rem 2.5rem 0; max-width: 1040px; margin: 0 auto; }
}

/* {components.brand-lockup} */
.brand-lockup { display: flex; align-items: center; gap: 0.65rem; } /* {spacing.lockup-gap} */
.brandmark { width: 26px; height: auto; flex-shrink: 0; } /* {components.brand-lockup.mark-size} */
.mark-fruit { fill: var(--color-logo-fruit); }
.mark-leaves { fill: var(--color-logo-leaves); }
.brand-words { line-height: 1.05; }
.brand-name { font-weight: 700; font-size: 0.98rem; letter-spacing: 0.01em; } /* {typography.brand-name} */
.brand-tag { font-weight: 400; font-size: 0.62rem; letter-spacing: 0.03em; color: var(--color-text-muted); } /* {typography.brand-tag} */

/* {components.theme-toggle} — injetado só se o script rodar (ver theme.js) */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-text-faint);
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.72rem; /* {typography.control} */
  letter-spacing: 0.02em;
  padding: 0.4rem 0.9rem;
  min-height: 44px; /* {spacing.touch-min} */
  display: inline-flex;
  align-items: center;
  border-radius: 3px; /* {rounded.sm} */
  cursor: pointer;
}
.theme-toggle:hover,
.theme-toggle:active { border-color: var(--color-orange); color: var(--color-text); }
.theme-toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---- gomo separador de seção, {components.section-gomo} ---- */
h2 {
  font-weight: 700;
  font-size: 1.3rem; /* {typography.section-title} */
  letter-spacing: -0.005em;
  padding-top: 1.4rem; /* {spacing.title-lead} */
  margin-bottom: 1.25rem; /* {spacing.title-bottom-mobile} */
  display: flex;
  align-items: baseline;
  gap: 0.6rem; /* {spacing.title-gap-mobile} */
}
h2::before {
  content: "";
  flex: none;
  width: 13px; height: 15px; /* {components.section-gomo.size-mobile} */
  background: var(--color-orange);
  clip-path: polygon(50% 0, 100% 27%, 100% 73%, 50% 100%, 0 73%, 0 27%);
  transform: translateY(1px);
}
@media (min-width: 53.75rem) {
  h2 {
    font-size: 1.55rem; /* {typography.section-title-desktop} */
    margin-bottom: 1.75rem; /* {spacing.title-bottom-desktop} */
    gap: 0.7rem; /* {spacing.title-gap-desktop} */
  }
  h2::before { width: 15px; height: 17px; } /* {components.section-gomo.size-desktop} */
}

/* {spacing.block-y-mobile} / {spacing.block-y-desktop} */
section.block { padding-block: 3rem; } /* padding-block, nao shorthand: o shorthand zeraria a goteira de {spacing.gutter-mobile} herdada de .stack */
@media (min-width: 53.75rem) { section.block { padding-block: 4.5rem; } }

/* ---- hero ---- */
/* {spacing.hero-top-mobile} / {spacing.hero-bottom-mobile} / {spacing.hero-top-desktop} / {spacing.hero-bottom-desktop} */
.hero { position: relative; padding-block: 3.5rem 3rem; }
@media (min-width: 53.75rem) { .hero { padding-block: 5rem 4.5rem; } }

/* {components.hex-anchor.clip-wrapper} — recorte vive aqui, nunca no .hero,
   para não cortar o anel de foco do hero-cta */
.hex-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hex-anchor {
  position: absolute; top: -10px; right: -40px; width: 150px; /* {components.hex-anchor.width-mobile} */
  fill: none;
}
.hex-anchor polygon { stroke: var(--color-orange); stroke-width: 1.4; } /* stroke-width-outline */
.hex-anchor polyline { stroke: var(--color-orange); stroke-width: 1; } /* stroke-width-facets */
.hex-anchor { opacity: 0.16; } /* opacity-light */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hex-anchor { opacity: 0.14; } } /* opacity-dark */
:root[data-theme="dark"] .hex-anchor { opacity: 0.14; }
@media (min-width: 53.75rem) { .hex-anchor { top: -30px; right: -30px; width: 220px; } } /* width-desktop */

.hero h1 {
  position: relative; z-index: 1;
  font-weight: 700;
  font-size: 1.65rem; /* {typography.hero} */
  line-height: 1.28;
  letter-spacing: -0.01em;
  max-width: 21ch;
}
@media (min-width: 53.75rem) { .hero h1 { font-size: 2.35rem; max-width: 27ch; } } /* {typography.hero-desktop} */
.hero h1 .accent, .belief .accent { color: var(--color-orange); }

.hero p {
  position: relative; z-index: 1;
  margin-top: 1.1rem; /* {spacing.lede-top} */
  font-size: 1rem; font-weight: 400; line-height: 1.55; /* {typography.hero-lede} */
  color: var(--color-text-muted);
  max-width: 42ch;
}

/* {components.hero-cta} */
.hero-cta {
  position: relative; z-index: 1;
  display: inline-flex;
  align-items: center;
  margin-top: 1.75rem; /* {spacing.cta-top} */
  padding: 0.8rem 1.3rem;
  min-height: 44px; /* {spacing.touch-min} */
  border: 1px solid var(--color-text);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem; /* {typography.action} */
  letter-spacing: 0.01em;
  border-radius: 3px; /* {rounded.sm} */
  /* Sem transição: as cores deste bloco vêm de tokens que mudam com o tema, e
     qualquer duração aqui faria o CTA levar um fade enquanto o resto da página
     troca de tema instantaneamente. A página não anima nada. */
  overflow-wrap: anywhere; /* mesma guarda de .contact-email: contém o mesmo e-mail */
  max-width: 100%;
}
.hero-cta:hover, .hero-cta:active { background: var(--color-orange); border-color: var(--color-orange); color: var(--color-on-orange); }
.hero-cta:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* {typography.section-lede} */
.lede { font-size: 1rem; font-weight: 400; color: var(--color-text-muted); max-width: 46ch; margin-bottom: 2rem; } /* {spacing.lede-bottom} */

/* ---- Quem somos: {components.people-list}, {components.person-photo-fallback}, {components.person-gomo} ---- */
.people { list-style: none; border-top: 1px solid var(--color-border); }
.person {
  border-bottom: 1px solid var(--color-border); /* {components.people-list.divider} */
  padding: 1.5rem 0; /* {spacing.person-y-mobile} */
  display: flex;
  align-items: center;
  gap: 1.1rem; /* {spacing.person-indent-mobile} */
}
@media (min-width: 53.75rem) {
  .person { padding: 1.85rem 0; gap: 1.3rem; } /* {spacing.person-y-desktop} / {spacing.person-indent-desktop} */
}

/* A foto é flex:none porque 96x111 é token e não escala por viewport. Quem cede
   é o texto: sem min-width:0 o item de flex se recusa a encolher abaixo do
   min-content da palavra mais longa e empurra a página em telas de 320px. */
.person-text { min-width: 0; }
.person-name, .person-meta, .person-role { overflow-wrap: break-word; }

/* Fotos reais ainda não existem: as três pessoas usam o fallback hexagonal,
   sempre na mesma forma da foto — a página nunca mistura círculo e gomo. */
.person-photo-fallback {
  flex: none;
  width: 96px; height: 111px; /* {components.person-photo.display-width/height} — tamanho fixo, sem escala por viewport */
  clip-path: polygon(50% 0, 100% 27%, 100% 73%, 50% 100%, 0 73%, 0 27%);
  background: var(--color-bg-muted);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem; /* {typography.person-name}, igual à inicial do nome */
  color: var(--color-orange);
}

.person-text { display: grid; gap: 0.35rem; }
@media (min-width: 53.75rem) {
  .person-text { grid-template-columns: 1fr 2fr; align-items: baseline; gap: 1.5rem; } /* {spacing.person-gap-desktop} */
}

/* {components.person-gomo} — marcador absoluto à esquerda do nome, alinhado com sua linha */
.person-name {
  position: relative;
  padding-left: 1rem;
  font-weight: 700;
  font-size: 1.2rem; /* {typography.person-name} */
}
.person-name::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 9px; height: 10px; /* {components.person-gomo.size} */
  background: var(--color-orange);
  clip-path: polygon(50% 0, 100% 27%, 100% 73%, 50% 100%, 0 73%, 0 27%);
}

.person-role { display: block; color: var(--color-text); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.01em; margin-bottom: 0.2rem; } /* {typography.person-role} */
.person-meta { color: var(--color-text-muted); font-size: 0.95rem; line-height: 1.5; } /* {typography.person-meta} */

/* ---- No que acreditamos ---- */
.belief { font-weight: 700; font-size: 1.35rem; line-height: 1.45; max-width: 30ch; } /* {typography.belief} */
@media (min-width: 53.75rem) { .belief { font-size: 1.65rem; max-width: 34ch; } } /* {typography.belief-desktop} */

/* ---- O que fazemos ---- */
.whatwedo-list { display: flex; flex-direction: column; gap: 1.1rem; max-width: 52ch; } /* {spacing.list-gap} */
.whatwedo-list p { font-size: 1rem; font-weight: 400; line-height: 1.65; color: var(--color-text-muted); } /* {typography.body} */
.whatwedo-list p strong { color: var(--color-text); font-weight: 700; }

/* ---- Como falar com a gente: {components.contact-email} ---- */
.contact-email {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* {spacing.touch-min} */
  font-weight: 700;
  font-size: min(1.4rem, 7vw); /* {typography.contact-email} */
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 2px solid var(--color-orange);
  overflow-wrap: anywhere; /* nunca rolagem horizontal em telas patológicas; não muda selecionar/copiar */
}
@media (min-width: 53.75rem) { .contact-email { font-size: min(1.9rem, 7vw); } } /* {typography.contact-email-desktop} */
.contact-email:hover, .contact-email:active { color: var(--color-orange); }
.contact-email:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }

.contact-note { margin-top: 1.1rem; font-size: 0.88rem; font-weight: 400; color: var(--color-text-faint); } /* {typography.note}, margem reaproveita {spacing.lede-top} */

/* ---- rodapé institucional: {components.footer-institutional} ---- */
footer.institutional {
  background: var(--color-bg-muted);
  border-top: 1px solid var(--color-border-strong);
  padding: 2.75rem 0 3.25rem; /* {spacing.footer-top} / {spacing.footer-bottom} */
}
footer.institutional .stack { padding-top: 0; }
.footer-mark { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1.25rem; } /* {spacing.lockup-gap}; margem reaproveita {spacing.title-bottom-mobile} */
.footer-mark .brandmark { width: 20px; } /* {components.footer-institutional.mark-size} */
.footer-legal-name { font-weight: 700; font-size: 1.05rem; } /* {typography.footer-name} */
.footer-details { font-size: 0.92rem; font-weight: 400; line-height: 1.85; color: var(--color-text-muted); } /* {typography.footer-details} */
.footer-details strong { color: var(--color-text); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- alto contraste do Windows ----
   Em forced-colors o sistema substitui background e fill, e as formas pintadas
   por background — os gomos do título e do nome, e o recorte hexagonal da foto —
   sumiriam. Como o gomo é a única forma da identidade, isso apagaria a
   identidade inteira. Aqui as formas voltam desenhadas em cor de sistema. */
@media (forced-colors: active) {
  h2::before,
  .person-name::before { background: CanvasText; }

  /* Gomo cheio com a inicial vazada: mantém a silhueta e o contraste máximo */
  .person-photo-fallback { background: CanvasText; color: Canvas; forced-color-adjust: none; }

  .mark-fruit, .mark-leaves { fill: CanvasText; }
  .hex-anchor polygon, .hex-anchor polyline { stroke: CanvasText; }
}
