/* =============================================================
   style.css — Main stylesheet for Twenty Two landing page
   Imports tokens.css for all design tokens.
   ============================================================= */

@import url('tokens.css');

/* =============================================================
   1. RESET & BASE
   ============================================================= */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}

/* =============================================================
   2. UTILITY CLASSES
   ============================================================= */

.accent-text {
  color: var(--color-accent);
}

.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.section {
  padding: var(--space-24) 0;
}

/* =============================================================
   3. BUTTONS
   ============================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
  white-space: nowrap;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* App Store button — black bg, two-line text */
.btn-store {
  background-color: #000;
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.15);
  padding: 0.78rem 1rem;   /* +20%: 0.65→0.78 / 1.5→1.8 */
  gap: 0.9rem;               /* +20%: 0.75→0.9 */
  border-radius: var(--radius-md);
}

.btn-store svg {
  width: 26px;               /* +20%: 22→26 */
  height: 26px;
  flex-shrink: 0;
}

.btn-store:hover {
  background-color: #111;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Google Play — em breve: cores invertidas, não clicável */
.btn-store--soon {
  background-color: transparent;
  color: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.15);
  cursor: default;
  pointer-events: none;
}

.btn-store--soon:hover {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-store-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.btn-store-text .btn-store-sub {
  font-size: 0.78rem;        /* +20%: 0.65→0.78 */
  font-weight: 300;
  opacity: 0.75;
}

.btn-store-text .btn-store-main {
  font-size: 1.14rem;        /* +20%: 0.95→1.14 */
  font-weight: 600;
}

/* =============================================================
   4. NAVBAR
   ============================================================= */

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: var(--z-navbar);
  padding: var(--space-4) 0;
  transition: background-color var(--transition-slow), backdrop-filter var(--transition-slow), border-bottom var(--transition-slow);
}

#navbar.scrolled {
  background-color: rgba(5, 10, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

/* Logo / Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
  user-select: none;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 1.05rem;
  font-weight: 400;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
}

/* Hamburger toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  justify-self: end;
  grid-column: 3; /* garante coluna 3 mesmo quando nav-links some do grid */
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.menu-toggle:hover {
  border-color: var(--color-accent);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile dropdown menu */
.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  z-index: var(--z-overlay);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu a {
  color: var(--color-text-muted);
  font-size: 1rem;
  font-weight: 400;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: color var(--transition-fast);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--color-accent);
}

/* =============================================================
   5. HERO SECTION
   ============================================================= */

/* ── Moldura escura externa que cria o efeito de card flutuante ── */
.hero-card-bg {
  background-color: var(--color-surface); /* #050a10 — contrasta com o card */
  /* top: empurra o card abaixo da navbar fixa (72px) + gap visual (12px)
     sides: 12px criam as margens laterais do card
     bottom: 0 — a seção seguinte começa logo abaixo */
  padding: calc(72px + 12px) 12px 0;
}

.hero {
  height: calc(120svh - 72px - 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding-top: var(--space-8);
  padding-bottom: 0; /* sem padding reservado — wrapper usa margin-top:auto */
  text-align: center;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(168deg, #1e4060 0%, #152c45 60%, #0c1e30 100%);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
}

/* Fade suave que integra a imagem com a base arredondada */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: clamp(80px, 14vw, 160px); /* min < ideal < max — corrigido */
  background: linear-gradient(to bottom, transparent, rgba(12, 30, 48, 0.55));
  pointer-events: none;
  z-index: 3; /* acima da imagem para fundir suavemente */
}

/* Radial background glow */
.hero-bg-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(212, 234, 24, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 4; /* acima da imagem (1), do gradient overlay (3) e do glow (0) */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);  /* 12px — espaçamento base entre todos os filhos */
}

/* Badge pill above headline */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border: 1px solid rgba(212, 234, 24, 0.35);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  background-color: rgba(212, 234, 24, 0.06);
  letter-spacing: 0.04em;
  /* badge bem próximo do headline — reduz o gap abaixo */
  margin-bottom: calc(-1 * var(--space-2));
}

/* Main headline */
.hero-headline {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 5rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  max-width: 700px;
}

/* Subheadline */
.hero-subheadline {
  color: var(--color-text);
  font-size: 1.5rem;
  font-weight: 300;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
  /* margin-top removido — o gap do pai já controla o espaço */
}

/* CTA button group */
.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* ── Mockup wrapper: clip container — SEMPRE no fluxo, NUNCA colide ──
   margin-top: auto empurra para o fundo do hero (flex column).
   overflow: hidden + height fixa mostra só o topo da imagem (efeito clip).
   Image aspect ratio: 750/2414 ≈ 0.3107 → topo 50% ≈ largura × 0.1553
   height clamp: proporcional a 88vw (fórmula da largura da imagem)
     108px = 696px img (800vw viewport) × 0.155
     170px = 1100px img (cap) × 0.155
   ── */
.hero-mockup-wrapper {
  position: relative;
  flex: 1;                     /* cresce para preencher todo o espaço restante */
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;     /* ancora imagem ao topo do wrapper */
  overflow: hidden;            /* clip: corta o fundo da imagem */
  min-height: 80px;            /* garante mínimo visível */
  pointer-events: none;
  z-index: 1;
  margin-top: 40px;
}

/* ── Imagem preenche a largura disponível; altura natural clipada pelo wrapper ── */
.hero-mockup-img {
  width: 100%;                 /* ocupa toda a largura da section */
  max-width: none;
  height: auto;
  flex-shrink: 0;
  object-fit: cover;
  object-position: top center;
  filter:
    drop-shadow(0 -6px 40px rgba(212, 234, 24, 0.07))
    drop-shadow(0 32px 64px rgba(0, 0, 0, 0.65));
  user-select: none;
}

/* Glow atrás da imagem (na base da section) */
.phone-glow {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  height: 380px;
  background: radial-gradient(ellipse at center, rgba(212, 234, 24, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}

/* =============================================================
   6. FEATURES SECTION
   ============================================================= */

.features {
  background-color: var(--color-surface);
}

/* Section header */
.section-header {
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* ── Tab navigation ── */
.features-tabs-wrap {
  margin-bottom: 0.75rem;
}

.features-tabs {
  display: flex;
  background-color: #ffffff;
  border-radius: var(--radius-full);
  padding: 0.25rem;
  gap: 0;
}

.features-tab {
  flex: 1;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base), font-weight var(--transition-base);
  white-space: nowrap;
  text-align: center;
  background: none;
  border: none;
}

.features-tab.active {
  background-color: var(--color-accent);
  color: #000;
  font-weight: 700;
}

.features-tab:hover:not(.active) {
  background-color: rgba(0, 0, 0, 0.07);
}

/* ── Panels viewport ── */
.features-viewport {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background-color: #0d1b2a;
}

.features-track {
  display: flex;
  transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  cursor: grab;
  user-select: none;
}

.features-track.is-dragging {
  cursor: grabbing;
  transition: none;
}

/* ── Single panel ── */
.features-panel {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: 600px;
  padding: 0;
  gap: 0;
  align-items: stretch;
}

/* Left: step instructions */
.features-panel-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 0rem 0rem 0rem 3.5rem;
  justify-content: center;
  height: 100%; /* Safari: grid stretch doesn't propagate height to flex children without this */
}

.features-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.features-step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: #000;
  font-weight: 800;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.features-step-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.features-step-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.32rem;
  color: var(--color-text);
  line-height: 1.25;
}

.features-step-desc {
  color: var(--color-text-muted);
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.5;
}

/* Right: mockup image */
.features-panel-mockup {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.features-panel-mockup img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  pointer-events: none;
  display: block;
}

/* =============================================================
   9. FOOTER (formerly Screenshots section)
   ============================================================= */

.footer {
  background-color: var(--color-surface);
  padding-top: var(--space-20);
  padding-bottom: var(--space-8);
  padding: 0;
}

.footer-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
  padding-bottom: var(--space-12);
  border-bottom: 1px solid var(--color-border);
}

/* Brand column */
.footer-brand {
  display: flex;
  flex-direction: column;
}

.footer-logo-wrap {
  display: flex;
  align-items: center;
}

.footer-logo-img {
  height: 36px;
  width: auto;
  display: block;
  user-select: none;
}

/* Social icons row */
.footer-socials {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.footer-social-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.footer-social-link svg {
  width: 18px;
  height: 18px;
}

/* Links columns */
.footer-links h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
  transition: color var(--transition-fast);
  display: inline-block;
}

.footer-links a:hover {
  color: var(--color-text);
}

/* Download column */
.footer-download {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-download h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* Footer bottom bar */
.footer-bottom {
  text-align: center;
  padding-top: var(--space-8);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 300;
}
