/* Ratatá landing — design tokens and styles.
 * Single source of brand values (mirrors src/app/src/theme/tokens.ts). */

:root {
  --teal: #0f766e;
  --teal-pressed: #115e59;
  --teal-soft: #ccfbf1;
  --ink: #0f172a;
  --ink-muted: #475569;
  --ink-subtle: #526072;
  --surface: #ffffff;
  --bg: #f5f7f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --focus: #0b6bcb;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-card: 0 4px 12px rgba(15, 23, 42, 0.06);

  --maxw: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--teal);
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.brand__mark {
  width: 26px;
  height: 26px;
  color: var(--teal);
  flex: none;
}

.brand__wordmark {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--ink);
}

/* Mobile nav toggle (checkbox hack — no JS, CSP-safe).
 * Desktop: hidden; the nav renders inline. Mobile: a hamburger button
 * opens a full-width dropdown panel below the sticky header. */
.nav-toggle,
.nav-toggle-btn {
  display: none;
}

.nav-toggle-btn {
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  cursor: pointer;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle-btn__icon {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: background-color 0.15s ease;
}

.nav-toggle-btn__icon::before,
.nav-toggle-btn__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.15s ease, top 0.15s ease;
}

.nav-toggle-btn__icon::before {
  top: -7px;
}

.nav-toggle-btn__icon::after {
  top: 7px;
}

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

.nav-toggle:focus-visible ~ .nav-toggle-btn {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.nav-toggle:checked ~ .nav-toggle-btn .nav-toggle-btn__icon {
  background-color: transparent;
}

.nav-toggle:checked ~ .nav-toggle-btn .nav-toggle-btn__icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle:checked ~ .nav-toggle-btn .nav-toggle-btn__icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--teal) 0%, #0b5f58 100%);
  color: #fff;
  padding: 72px 0 88px;
}

/* O hero acompanha a largura das seções abaixo (o container já usa
 * var(--maxw) = 1080px). A medida de leitura fica no título e no
 * subtítulo, que não esticam até a borda. */
.hero__overline {
  margin: 0 0 16px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--teal-soft);
}

.hero__title {
  margin: 0 0 20px;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 720px;
}

.hero__title-accent {
  color: var(--teal-soft);
}

.hero__subtitle {
  margin: 0 0 32px;
  font-size: 1.2rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  max-width: 560px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Store badges (locked "em breve" state) */
.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #0f172a;
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  min-height: 56px;
  cursor: default;
  opacity: 0.9;
}

.store-badge__glyph {
  width: 22px;
  height: 22px;
  flex: none;
  color: #fff;
}

.store-badge__copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-badge__soon-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-soft);
}

.store-badge__name {
  font-size: 1.05rem;
  font-weight: 700;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  min-height: 52px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.button--primary {
  background: #fff;
  color: var(--teal-pressed);
}

.button--primary:hover {
  background: var(--teal-soft);
}

.button--secondary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.button--secondary:hover {
  background: var(--teal-pressed);
  border-color: var(--teal-pressed);
}

.button__arrow {
  width: 18px;
  height: 18px;
}

/* Sections */
.section {
  padding: 64px 0;
}

.section--muted {
  background: var(--surface);
}

.section__title {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.section__lede {
  margin: 0 0 32px;
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 620px;
}

.section__note {
  margin: 32px 0 0;
  padding: 16px 20px;
  border-left: 4px solid var(--teal);
  background: var(--teal-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--ink-subtle);
}

/* Steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* "Como usar" — passo a passo operacional */
.steps--how-to .step__number {
  background: var(--teal-soft);
  color: var(--teal-pressed);
}

.step__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  line-height: 1.3;
}

.step__text {
  margin: 0;
  color: var(--ink-muted);
}

/* Screens */
.screens {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.screen figure {
  margin: 0;
}

.screen img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.screen figcaption {
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-align: center;
}

/* Privacy CTA */
.privacy-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.privacy-cta__text {
  max-width: 640px;
}

.privacy-cta__text .section__title {
  margin-bottom: 8px;
}

.privacy-cta__text p {
  margin: 0;
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 48px 0 0;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 32px;
  padding-bottom: 32px;
}

.brand--footer {
  color: #fff;
}

.brand--footer .brand__mark {
  color: var(--teal-soft);
}

.site-footer__tagline {
  margin: 10px 0 0;
  color: #94a3b8;
}

.site-footer__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__nav a {
  color: #cbd5e1;
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: #fff;
}

.site-footer__contact-title {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.site-footer__contact-value {
  margin: 0;
  color: #cbd5e1;
  word-break: break-word;
}

.site-footer__legal {
  border-top: 1px solid #1e293b;
  padding-top: 20px;
  padding-bottom: 20px;
  color: #64748b;
  font-size: 0.9rem;
}

.site-footer__legal p {
  margin: 0;
}

/* Privacy page */
.policy {
  padding: 56px 0 72px;
  background: var(--surface);
}

.policy__inner {
  max-width: 760px;
}

.policy__title {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.policy__updated {
  color: var(--ink-muted);
  margin: 0 0 28px;
}

.policy h2 {
  margin: 36px 0 12px;
  font-size: 1.35rem;
  color: var(--ink);
}

.policy p,
.policy li {
  color: var(--ink-subtle);
}

.policy ul {
  padding-left: 20px;
}

.policy li + li {
  margin-top: 6px;
}

.policy blockquote {
  margin: 16px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--teal);
  background: var(--bg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--ink-muted);
}

.policy code {
  font-family: ui-monospace, "SFMono-Regular", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

.policy table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 520px;
}

.policy th,
.policy td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.policy thead th {
  background: var(--bg);
  font-weight: 700;
  color: var(--ink);
}

.policy__back {
  margin-top: 40px;
  font-weight: 600;
}

/* Documentation page */
.docs {
  padding: 56px 0 72px;
  background: var(--bg);
}

.docs__lede {
  margin: 0 0 28px;
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 680px;
}

.features {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.feature__title {
  margin: 0 0 16px;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--ink);
}

.feature__fields {
  margin: 0;
  display: grid;
  gap: 14px;
}

.feature__field dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 2px;
}

.feature__field dd {
  margin: 0;
  color: var(--ink-subtle);
}

/* Responsive */
@media (max-width: 880px) {
  .steps {
    grid-template-columns: 1fr;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .screens {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  /* Mobile nav: hamburger opens a full-width dropdown below the header. */
  .nav-toggle {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .nav-toggle-btn {
    display: inline-flex;
  }

  .site-nav {
    display: none;
  }

  .nav-toggle:checked ~ .site-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 8px 20px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 24px rgba(15, 23, 42, 0.08);
  }

  .site-nav a {
    display: block;
    padding: 12px 8px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .site-nav a:hover {
    background: var(--bg);
  }
}

@media (max-width: 480px) {
  .screens {
    grid-template-columns: 1fr;
  }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .store-badges {
    flex-direction: column;
  }

  .store-badge,
  .button {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
