/* ============================================================
   Orenji Landing — Design System
   Paleta: Laranja Orenji #FF7A00 · Verde Folha · Creme · Neutros cinza
   Tipografia: Poppins (self-hosted)
   ============================================================ */

/* ---------- Tipografia ---------- */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/poppins-500.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/poppins-600.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/poppins-700.woff2") format("woff2");
}

/* ---------- Tokens (claro) ---------- */
:root {
  color-scheme: light dark;

  /* Cores Principais */
  --orange: #ff7a00;
  --orange-strong: #e96a00;
  --leaf: #43836a;
  --cream: #fff3e3;
  --white: #ffffff;

  /* Cores Neutras */
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;

  /* Cores de Estado */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --highlight: #a855f7;

  /* Semânticos */
  --page: var(--cream);
  --surface: var(--white);
  --ink: var(--gray-900);
  --muted: var(--gray-500);
  --line: var(--gray-300);
  --line-soft: rgba(209, 213, 219, 0.55);
  --header-bg: rgba(255, 243, 227, 0.85);
  --header-border: rgba(209, 213, 219, 0.65);
  /* Texto escuro sobre laranja para AA (2.61:1 era sub-AA per Codex review):
     claro→#111827 (6.79:1) · escuro→#0f1319 (7.13:1) · hover ≥5.5:1 */
  --button-text: var(--gray-900);
  --shadow: 0 20px 44px rgba(17, 24, 39, 0.08);
  --shadow-lift: 0 16px 30px rgba(255, 122, 0, 0.18);
  --focus: rgba(255, 122, 0, 0.45);

  --radius-card: 24px;
  --radius-tile: 26%;
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Tokens (escuro) ----------
   Seguem o sistema por omissão; o botão de tema força via data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --leaf: #4caf50;
    --cream: #ffdb83;

    --gray-900: #0f1319;
    --gray-700: #1a1f28;
    --gray-500: #6b7280;
    --gray-300: #9ca3af;
    --gray-100: #e5e7eb;

    --page: var(--gray-900);
    --surface: var(--gray-700);
    --ink: #e5e7eb;
    --muted: var(--gray-300);
    --line: #2a2f37;
    --line-soft: rgba(42, 47, 55, 0.9);
    --header-bg: rgba(15, 19, 25, 0.85);
    --header-border: rgba(42, 47, 55, 0.9);
    --shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
    --shadow-lift: 0 16px 30px rgba(0, 0, 0, 0.35);
    --focus: rgba(255, 122, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --leaf: #4caf50;
  --cream: #ffdb83;

  --gray-900: #0f1319;
  --gray-700: #1a1f28;
  --gray-500: #6b7280;
  --gray-300: #9ca3af;
  --gray-100: #e5e7eb;

  --page: var(--gray-900);
  --surface: var(--gray-700);
  --ink: #e5e7eb;
  --muted: var(--gray-300);
  --line: #2a2f37;
  --line-soft: rgba(42, 47, 55, 0.9);
  --header-bg: rgba(15, 19, 25, 0.85);
  --header-border: rgba(42, 47, 55, 0.9);
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 16px 30px rgba(0, 0, 0, 0.35);
  --focus: rgba(255, 122, 0, 0.5);
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
  scroll-padding-top: 6.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-size: 1rem;
  line-height: 1.5;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

[hidden] {
  display: none !important;
}

/* ---------- Acessibilidade ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 30;
  padding: 0.6rem 1rem;
  border-radius: 0 0 12px 12px;
  background: var(--orange);
  color: var(--button-text);
  font-weight: 600;
  text-decoration: none;
  transition: top 160ms ease;
}

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

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 5.2rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: auto;
  height: 3.2rem;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  margin-left: auto;
}

.site-header nav a {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 140ms ease;
}

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

.site-header nav a[data-current] {
  color: var(--ink);
}

/* Controles do header: língua + tema, alinhados com os links da nav. */
.header-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.25rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  height: 2.35rem;
  gap: 0.1rem;
  padding: 0.18rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-width: 2.1rem;
  padding: 0 0.42rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}

.lang-option:hover {
  color: var(--orange);
}

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

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}

.theme-toggle:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.theme-toggle svg {
  display: none;
}

.theme-toggle[data-state="auto"] svg[data-theme-icon="auto"],
.theme-toggle[data-state="light"] svg[data-theme-icon="light"],
.theme-toggle[data-state="dark"] svg[data-theme-icon="dark"] {
  display: block;
}

/* ---------- Layout ---------- */
main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.content-section {
  padding: clamp(2rem, 6vw, 4rem) 0;
  text-align: center;
}

.content-section > p:not(.eyebrow),
.section-heading > p {
  max-width: 42rem;
  margin-inline: auto;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.content-section h2 {
  max-width: 20ch;
  margin: 0 auto 0.9rem;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.section-heading > p {
  margin: 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(1.4rem, 3vw, 2.2rem);
  padding: clamp(1.6rem, 5vw, 3rem) 0 clamp(1.4rem, 4vw, 2.4rem);
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes hero-in {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .hero-copy,
  .hero-orbit {
    animation: hero-in 480ms ease both;
  }

  .hero-orbit {
    animation-delay: 90ms;
  }
}

.hero-copy p {
  margin: 0;
}

.hero-copy .hero-lead {
  max-width: 34rem;
  margin-inline: auto;
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 400;
  line-height: 1.6;
}

.hero-copy h1 {
  max-width: 17ch;
  margin: 0 auto;
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.primary-button {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  padding: 0 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: var(--button-text);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  background: var(--orange-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.ghost-button {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  padding: 0 1.4rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ghost-button:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-2px);
}

/* ---------- Hero: órbita das apps ---------- */
.hero-orbit {
  --orbit-size: clamp(16rem, 38vw, 23rem);
  --orbit-item: clamp(2.6rem, 6vw, 3.4rem);
  --orbit-radius: calc(var(--orbit-size) / 2 - var(--orbit-item));
  position: relative;
  width: var(--orbit-size);
  aspect-ratio: 1;
}

/* Anel-guia tracejado, por fora dos ícones. */
.hero-orbit::before {
  position: absolute;
  inset: 5%;
  border: 2px dashed color-mix(in srgb, var(--orange) 32%, transparent);
  border-radius: 50%;
  content: "";
}

.orbit-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.orbit-core img {
  width: 36%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 26px rgba(17, 24, 39, 0.16));
}

.orbit-ring {
  position: absolute;
  inset: 0;
}

/* Cada satélite: rodar até à sua posição no círculo. */
.orbit-slot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: rotate(calc(var(--i) * 72deg)) translateX(var(--orbit-radius));
}

.orbit-item {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--orbit-item);
  aspect-ratio: 1;
  margin-top: calc(var(--orbit-item) / -2);
  margin-left: calc(var(--orbit-item) / -2);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 26%;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.orbit-item img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

@media (prefers-reduced-motion: no-preference) {
  /* O anel gira; os ícones contra-rodam para se manterem sempre direitos. */
  .orbit-ring {
    animation: orbit-spin 48s linear infinite;
  }

  .orbit-item {
    animation: orbit-spin-reverse 48s linear infinite;
  }

  .hero-orbit:hover .orbit-ring,
  .hero-orbit:hover .orbit-item {
    animation-play-state: paused;
  }
}

@keyframes orbit-spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes orbit-spin-reverse {
  to {
    transform: rotate(-1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orbit-ring,
  .orbit-item {
    animation: none;
  }
}

/* ---------- Ecossistema: tiles de apps ---------- */
.apps-section {
  padding-top: 1.5rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 1rem;
}

.app-tile {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 1.5rem 0.75rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.app-tile:hover {
  border-color: var(--tile-accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift);
}

.app-tile:active {
  transform: translateY(-1px);
}

.tile-icon {
  display: grid;
  width: min(5.6rem, 70%);
  aspect-ratio: 1;
  place-items: center;
  border-radius: var(--radius-tile);
  background: color-mix(in srgb, var(--tile-accent) 14%, var(--surface));
}

.tile-icon img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.app-tile strong {
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
}

/* Premissas da app, sempre visíveis no tile. */
.tile-premises {
  display: grid;
  gap: 0.3rem;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile-premises li {
  position: relative;
  padding-left: 0.95rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}

.tile-premises li::before {
  position: absolute;
  left: 0.15rem;
  top: 0.42em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--tile-accent);
  content: "";
}

/* ---------- Modal / diálogo ---------- */
.modal {
  border: 0;
  padding: 0;
  outline: none;
  background: transparent;
  max-width: none;
  max-height: none;
}

.modal::backdrop {
  background: rgba(15, 19, 25, 0.5);
  backdrop-filter: blur(6px);
}

@media (prefers-reduced-motion: no-preference) {
  .modal[open] {
    animation: modal-in 220ms ease;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  width: min(23rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 2.2rem 1.7rem 1.9rem;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink);
  overflow: auto;
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-card::before {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tile-accent) 16%, transparent);
  filter: blur(40px);
  content: "";
  pointer-events: none;
}

.modal-icon {
  width: 6.5rem;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(17, 24, 39, 0.16));
}

.modal-card strong[data-modal-title] {
  margin-top: 0.6rem;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.3rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tile-accent) 14%, var(--surface));
  color: var(--tile-accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-chip::before {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--muted);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.modal-close:hover {
  background: color-mix(in srgb, var(--tile-accent) 16%, transparent);
  color: var(--tile-accent);
}

.modal-link {
  margin-top: 0.7rem;
  text-decoration: none;
}

/* ---------- Novidades e rodapé ---------- */
.news-section {
  padding-bottom: 4.5rem;
}

.news-list {
  display: grid;
  gap: 0.9rem;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  text-align: left;
}

.news-item {
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.4rem;
}

.news-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 14%, var(--surface));
  color: var(--orange-strong);
  font-size: 0.74rem;
  font-weight: 600;
}

.news-date {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.news-item h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.news-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 1.3rem clamp(1rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.85rem;
}

footer .footer-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

footer > span {
  justify-self: end;
}

footer .footer-brand img {
  height: 1.5rem;
  width: auto;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 1.1rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  transition: color 140ms ease;
}

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

.footer-links svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
  stroke: none;
}

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

footer a:hover {
  color: var(--orange);
}

/* ---------- Responsivo ---------- */
@media (max-width: 560px) {
  html {
    scroll-padding-top: 8rem;
  }

  main {
    width: min(100% - 1.2rem, 1120px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 0;
    padding-top: 0.95rem;
  }

  .site-header nav {
    margin-left: 0;
    width: 100%;
  }

  .app-tile {
    padding: 1.15rem 0.6rem 1rem;
  }

  .modal-card {
    padding: 1.9rem 1.3rem 1.6rem;
  }

  footer {
    grid-template-columns: 1fr 1fr;
  }

  .footer-links {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
