/* ============================================
   EstudaMath — style.css
   ============================================ */

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

/* ---- VARIÁVEIS ---- */
:root {
  --ink: #1a1a2e;
  --ink2: #3d3d5c;
  --muted: #8888aa;
  --bg: #f7f6f0;
  --surface: #ffffff;
  --accent: #4f46e5;
  --accent2: #06b6d4;
  --warm: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 2px 16px rgba(79, 70, 229, 0.08);
}

/* ---- BASE ---- */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent2);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   NAV
   ============================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 246, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.nav-logo,
.nav-logo:visited { text-decoration: none; }
.nav-logo span { color: var(--ink); }

.nav-simple-link {
  text-decoration: none;
  color: var(--ink2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-simple-link:hover { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-cta {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, transform 0.1s;
}
.nav-cta:hover {
  background: #3730a3;
  transform: translateY(-1px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  right: -200px;
  top: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent);
  padding: 0.35rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(1.4); }
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  font-size: 1.125rem;
  color: var(--ink2);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Botões globais */
.btn-primary {
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s, transform 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Hero visual */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.formula-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  position: relative;
}

.formula-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.formula-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
  animation: fadeFormula 6s infinite;
}
@keyframes fadeFormula {
  0%, 20%  { opacity: 1; }
  25%, 75% { opacity: 0; }
  80%, 100%{ opacity: 1; }
}

.formula-display-2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 0.5rem;
  animation: fadeFormula2 6s infinite;
  position: absolute;
}
@keyframes fadeFormula2 {
  0%, 20%  { opacity: 0; }
  25%, 75% { opacity: 1; }
  80%, 100%{ opacity: 0; }
}

.formula-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 1rem;
}

.floating-badge {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.badge-top    { top: -1rem; right: -2rem; animation-delay: 0.5s; }
.badge-bottom { bottom: -1rem; left: -2rem; animation-delay: 1.5s; }
.badge-icon   { font-size: 1.1rem; }

/* ============================================
   STATS
   ============================================ */
.stats {
  padding: 3rem 4rem;
  background: var(--ink);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.stat { text-align: center; }

.stat-number {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem;
  color: white;
  margin-bottom: 0.25rem;
}
.stat-number span { color: var(--accent2); }

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   SEÇÕES GERAIS
   ============================================ */
section { padding: 5rem 4rem; }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-sub {
  color: var(--ink2);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 3rem;
}

/* ============================================
   TRILHA
   ============================================ */
.learning-path {
  padding-top: 4rem;
  padding-bottom: 4rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.path-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.path-step {
  display: grid;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--bg);
  transition: border-color 0.2s, transform 0.15s;
}
.path-step:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.path-step-num {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
}
.path-step strong { color: var(--ink); }
.path-step span:last-child {
  color: var(--ink2);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ============================================
   TÓPICOS
   ============================================ */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.topic-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
  transform: scaleX(0);
  transition: transform 0.3s;
}
.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.topic-card:hover::after { transform: scaleX(1); }

.topic-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.topic-title {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.topic-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.topic-count {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

/* ============================================
   CALCULADORA
   ============================================ */
.calc-section {
  background: var(--ink);
  color: white;
}
.calc-section .section-label { color: var(--accent2); }
.calc-section .section-title { color: white; }
.calc-section .section-sub   { color: rgba(255, 255, 255, 0.6); }

.calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.calc-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.calc-tab {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s;
}
.calc-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.calc-input-group { margin-bottom: 1.25rem; }

.calc-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.5rem;
  display: block;
}

.calc-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.calc-input:focus { border-color: var(--accent2); }

.calc-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--accent2);
  color: var(--ink);
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.calc-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.calc-result {
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  min-height: 80px;
}

.result-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 0.5rem;
}

.result-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  color: var(--accent2);
  font-weight: 500;
  line-height: 1.5;
}

.calc-visual {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

canvas#calcCanvas { width: 100%; max-width: 360px; }

/* ============================================
   QUIZ
   ============================================ */
.quiz-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.quiz-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 100px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.4s;
}

.quiz-question {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  margin-bottom: 2rem;
  line-height: 1.4;
}

.quiz-options { display: grid; gap: 0.75rem; }

.quiz-option {
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  background: transparent;
  text-align: left;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.quiz-option:hover {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.04);
}
.quiz-option.correct {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.08);
  color: #065f46;
}
.quiz-option.wrong {
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.08);
  color: #991b1b;
}

.opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.quiz-score {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(79, 70, 229, 0.1);
  padding: 0.35rem 1rem;
  border-radius: 100px;
}

.quiz-feedback {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  display: none;
}
.quiz-feedback.show    { display: block; }
.quiz-feedback.correct { background: rgba(16, 185, 129, 0.1); color: #065f46; }
.quiz-feedback.wrong   { background: rgba(239, 68, 68, 0.1);  color: #991b1b; }

.quiz-next {
  margin-top: 1.5rem;
  width: 100%;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.875rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: none;
  transition: background 0.2s;
}
.quiz-next:hover { background: var(--accent); }
.quiz-next.show  { display: block; }

/* ============================================
   INFO PAGES
   ============================================ */
.info-page {
  min-height: calc(100vh - 64px);
}

.info-hero {
  padding: 4rem;
  border-bottom: 1px solid var(--border);
}

.info-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.info-hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}

.info-hero p {
  max-width: 760px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink2);
}

.info-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.info-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.info-section + .info-section {
  margin-top: 2rem;
}

.info-section h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.65rem;
  margin-bottom: 0.9rem;
}

.info-section p,
.info-section li {
  color: var(--ink2);
  line-height: 1.8;
}

.info-section ul {
  padding-left: 1.2rem;
}

.info-section li + li,
.info-section p + p,
.info-section p + ul,
.info-section ul + p {
  margin-top: 0.75rem;
}

.info-cta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer,
footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 3rem 4rem;
  font-size: 0.875rem;
  line-height: 1.7;
}
.site-footer strong,
footer strong { color: white; }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
}

/* ── Cabeçalho de área ── */
.area-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2.75rem 0 1rem;
}
.area-header:first-of-type { margin-top: 0; }
.area-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.area-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink2);
}
.area-ver-tudo {
  margin-left: auto;
  font-size: 0.8rem; font-weight: 600;
  color: var(--accent); text-decoration: none;
  transition: opacity 0.2s;
}
.area-ver-tudo:hover { opacity: 0.7; }

/* Grid de 3 colunas para geometria plana */
.topics-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Card desabilitado (em breve) */
.topic-card--soon {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.topic-card--soon::after { display: none; }

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 2rem;
    min-height: auto;
  }
  .hero-visual { display: none; }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    padding: 2rem;
  }
  .topics-grid { grid-template-columns: repeat(2, 1fr); }
  .topics-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .calc-container { grid-template-columns: 1fr; }
  .path-grid { grid-template-columns: 1fr; }
  section { padding: 3rem 2rem; }
  nav { padding: 0 1.5rem; }
  .nav-links { display: none; }
  .info-hero { padding: 3rem 2rem; }
  .site-footer,
  footer { padding: 2.5rem 2rem; }
}

@media (max-width: 600px) {
  .topics-grid   { grid-template-columns: 1fr; }
  .topics-grid-3 { grid-template-columns: 1fr; }
  .stats         { grid-template-columns: repeat(2, 1fr); }
  .info-content  { padding: 2rem 1rem 3rem; }
  .info-section  { padding: 1.25rem; }
}
