/* Tofit: site provisório (tofit.fit)
   Tokens da seção 4.5 de docs/DESIGN_TOFIT_V1.md, ajustados para contraste AA. */

:root {
  /* Paleta */
  --tofu: #FBF8F1;
  --tinta: #1C1B19;
  --pimenta: #D63A26;
  --pimenta-forte: #B92E1C;
  --matcha: #6FA83A;
  --matcha-texto: #3F6B1A;
  --curcuma: #F2B21B;
  --beterraba: #B8256E;
  --mirtilo: #3B55D9;
  --treino-escuro: #141413;

  /* Papéis (modo claro) */
  --bg: var(--tofu);
  --fg: var(--tinta);
  --muted: #5A564E;
  --surface: #FFFFFF;
  --line: #E6DECD;
  --accent: var(--pimenta);
  --on-accent: #FFFFFF;
  --green-text: var(--matcha-texto);
  --green-soft: #E6F0DA;
  --shadow: rgba(28, 27, 25, 0.10);
  --focus: var(--mirtilo);

  /* Forma */
  --r-xl: 36px;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --gutter: 16px;
  --max: 1080px;

  --font-title: "Bricolage Grotesque", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--treino-escuro);
    --fg: var(--tofu);
    --muted: #BDB7AB;
    --surface: #1F1E1C;
    --line: #34322E;
    --green-text: var(--matcha);
    --green-soft: #22301A;
    --shadow: rgba(0, 0, 0, 0.45);
    --focus: #8FA2FF;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-title);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

/* Cabeçalho */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  display: block;
}

.lang {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang button {
  appearance: none;
  border: 0;
  margin: 0;
  min-width: 44px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 0.875rem/1 var(--font-body);
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}

/* Hero */
.hero {
  display: grid;
  gap: 28px;
  align-items: center;
  padding-block: 20px 48px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-text);
  font-weight: 600;
  font-size: 0.875rem;
}

.badge::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--matcha);
}

.hero h1 {
  margin-top: 18px;
  font-size: clamp(4.25rem, 22vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.promise {
  margin-top: 16px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(1.625rem, 6.4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 18ch;
}

.promise em {
  font-style: normal;
  color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  .promise em {
    color: #FF7A66;
  }
}

.sub {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.0625rem;
  max-width: 40ch;
}

.actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 24px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--pimenta-forte);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--pimenta-forte);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--pimenta-forte);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.note {
  color: var(--muted);
  font-size: 0.9375rem;
}

.hero-art {
  position: relative;
  justify-self: center;
  width: min(100%, 420px);
  aspect-ratio: 1;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 30% 25%, rgba(242, 178, 27, 0.20), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(59, 85, 217, 0.14), transparent 55%),
    var(--surface);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
}

.hero-art svg {
  width: 82%;
  height: auto;
  overflow: visible;
}

/* Seções */
section {
  padding-block: 40px;
}

.kicker {
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  margin-top: 8px;
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  word-spacing: 0.06em;
  max-width: 20ch;
}

.cards {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}

.card h3 {
  margin-top: 16px;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.card p {
  margin-top: 8px;
  color: var(--muted);
}

.icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
}

.icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--matcha {
  background: var(--matcha);
  color: var(--tinta);
}

.icon--mirtilo {
  background: var(--mirtilo);
  color: #FFFFFF;
}

.icon--beterraba {
  background: var(--beterraba);
  color: #FFFFFF;
}

/* Estágios do tofu */
.stages {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stage {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stage svg {
  width: 100%;
  max-width: 132px;
  height: auto;
}

.stage-name {
  margin-top: 6px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.meter {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.meter span {
  width: 14px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.meter span.on {
  background: var(--accent);
}

.stages-note {
  margin-top: 16px;
  color: var(--muted);
  max-width: 52ch;
}

/* Contato */
.contact {
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--r-xl);
  padding: 28px 22px;
  display: grid;
  gap: 18px;
}

.contact h2 {
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  word-spacing: 0.06em;
}

.contact p {
  margin-top: 10px;
  opacity: 0.86;
  max-width: 46ch;
}

.contact .btn {
  justify-self: start;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
}

/* Rodapé */
.foot {
  padding-block: 32px 40px;
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

.foot a {
  overflow-wrap: anywhere;
}

/* 404 */
.lost {
  display: grid;
  gap: 24px;
  justify-items: start;
  padding-block: 24px 56px;
}

.lost > svg {
  width: min(70vw, 260px);
  height: auto;
}

.q-mark {
  fill: none;
  stroke: var(--fg);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.q-dot {
  fill: var(--fg);
}

.lost .code {
  color: var(--fg);
  font-family: var(--font-title);
  font-weight: 800;
  font-size: clamp(4.5rem, 24vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.lost h1 {
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 18ch;
}

.lost p {
  color: var(--muted);
  max-width: 40ch;
}

/* Mascote: cores fixas, iguais nos dois temas */
.tf-body {
  fill: #FFFDF8;
}

.tf-shade {
  fill: #ECDDBD;
}

.tf-stroke {
  stroke: #1C1B19;
  stroke-width: 3;
  stroke-linejoin: round;
}

.tf-line {
  fill: none;
  stroke: #1C1B19;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tf-ink {
  fill: #1C1B19;
}

.tf-shine {
  fill: #FFFFFF;
}

.tf-cheek {
  fill: #F08A7B;
  opacity: 0.6;
}

.tf-arm-out {
  fill: none;
  stroke: #1C1B19;
  stroke-width: 11;
  stroke-linecap: round;
}

.tf-arm-in {
  fill: none;
  stroke: #FFFDF8;
  stroke-width: 5.5;
  stroke-linecap: round;
}

.tf-ground {
  fill: var(--shadow);
}

.bean--matcha { fill: var(--matcha); }
.bean--curcuma { fill: var(--curcuma); }
.bean--beterraba { fill: var(--beterraba); }
.bean--mirtilo { fill: var(--mirtilo); }
.bean--pimenta { fill: var(--pimenta); }

/* Movimento: curto e só quando a pessoa permite */
@media (prefers-reduced-motion: no-preference) {
  .tf-bounce {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: tf-bounce 3.6s cubic-bezier(0.3, 0, 0.3, 1) infinite;
  }

  .tf-eyes {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: tf-blink 5.2s steps(1, end) infinite;
  }

  .tf-float {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: tf-float 6s ease-in-out infinite;
  }

  .tf-float:nth-of-type(2n) {
    animation-delay: -2s;
  }

  .tf-float:nth-of-type(3n) {
    animation-delay: -4s;
  }

  .tf-ground--live {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: tf-ground 3.6s cubic-bezier(0.3, 0, 0.3, 1) infinite;
  }
}

@keyframes tf-bounce {
  0%, 62%, 100% { transform: translateY(0) scale(1, 1); }
  70% { transform: translateY(0) scale(1.05, 0.94); }
  80% { transform: translateY(-10%) scale(0.97, 1.04); }
  90% { transform: translateY(0) scale(1.03, 0.97); }
}

@keyframes tf-ground {
  0%, 62%, 100% { transform: scale(1); opacity: 1; }
  80% { transform: scale(0.8); opacity: 0.6; }
}

@keyframes tf-blink {
  0%, 94%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

@keyframes tf-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(8deg); }
}

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

/* Telas maiores */
@media (min-width: 560px) {
  :root {
    --gutter: 24px;
  }

  .stages {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 820px) {
  :root {
    --gutter: 32px;
  }

  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    padding-block: 40px 72px;
  }

  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .card {
    padding: 26px;
  }

  section {
    padding-block: 56px;
  }

  .contact {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 44px;
  }

  .lost {
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 48px;
    padding-block: 64px 96px;
  }

  .lost > svg {
    grid-row: span 4;
  }
}
