/* Astute4AI Games — segue o design system de astute4ai.com (tokens, tipografia e componentes a4-*). */

:root {
  color-scheme: light;
  --surface: #fff;
  --surface-alt: #f3f6f5;
  --ink: #10201e;
  --ink-muted: #4e5f5c;
  --line: #dce3e1;
  --petrol: #0f5e57;
  --petrol-deep: #0a433e;
  --petrol-tint: #e3efec;
  --petrol-text: #0f5e57;
  --on-petrol: #fff;
  --font-sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-6: 48px;
  --space-12: 96px;
  --radius-xs: 2px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #0c1716;
    --surface-alt: #111f1d;
    --ink: #e8efed;
    --ink-muted: #9db0ac;
    --line: #22332f;
    --petrol: #0f5e57;
    --petrol-deep: #0d7369;
    --petrol-tint: #133430;
    --petrol-text: #5cc2b4;
  }
}

/* --- Base ---------------------------------------------------------------- */

*, ::before, ::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 26px;
}
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--ink-muted); }

/* --- Tipografia ---------------------------------------------------------- */

.t-display-xl { font-size: 72px; line-height: 76px; font-weight: 600; letter-spacing: -.03em; }
.t-display-l { font-size: 44px; line-height: 50px; font-weight: 600; letter-spacing: -.02em; }
.t-heading { font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; }
.t-body-l { font-size: 19px; line-height: 30px; }
.t-body { font-size: 16px; line-height: 26px; }
.t-small { font-size: 14px; line-height: 20px; }

/* --- Componentes a4 ------------------------------------------------------ */

.a4-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 48px;
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: 600 16px/24px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.a4-btn--primary { background: var(--petrol); color: var(--on-petrol); }
.a4-btn--primary:hover, .a4-btn--primary:active { background: var(--petrol-deep); }
.a4-btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--ink-muted); }
.a4-btn--secondary:hover, .a4-btn--secondary:active { background: var(--surface-alt); }
.a4-btn[aria-disabled="true"] {
  background: var(--surface-alt);
  color: var(--ink-muted);
  border-color: var(--line);
  cursor: not-allowed;
}

.a4-link {
  color: var(--petrol-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s;
}
.a4-link:hover { color: var(--petrol-deep); text-decoration-thickness: 2px; }
.a4-link--quiet { color: var(--ink-muted); text-decoration: none; }
.a4-link--quiet:hover { color: var(--petrol-text); text-decoration: underline; text-decoration-thickness: 1px; }

.a4-btn:focus-visible, .a4-link:focus-visible, .a4-wordmark:focus-visible, .game-card__cover:focus-visible,
.a4-locale a:focus-visible {
  outline: 2px solid var(--petrol-text);
  outline-offset: 2px;
}

.a4-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.a4-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  height: 72px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.a4-wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.a4-logo { display: block; width: auto; height: 24px; }
.a4-tag {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--petrol-tint);
  color: var(--petrol-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.a4-header__end { display: flex; align-items: center; gap: var(--space-3); }

/* Seletor de idioma (mesmo componente do site principal). */
.a4-locale {
  display: inline-flex; gap: 2px; padding: 2px; margin: 0; list-style: none;
  border: 1px solid var(--line); border-radius: var(--radius-full);
}
.a4-locale a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 36px;
  border-radius: var(--radius-full); font-size: 14px; line-height: 20px; font-weight: 600;
  color: var(--ink-muted); text-decoration: none; transition: color .15s ease, background-color .15s ease;
}
.a4-locale a:hover { color: var(--ink); }
.a4-locale a[aria-current="true"] { background: var(--petrol-tint); color: var(--petrol-text); }

.a4-slots { display: grid; grid-template-columns: repeat(4, 48px); gap: var(--space-3); flex-shrink: 0; }
.a4-slot { width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--petrol-tint); }
.a4-slot--building { background: var(--ink); }
.a4-slot--launched { background: var(--petrol); }

.a4-footer { background: var(--surface); border-top: 1px solid var(--line); }
.a4-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) calc(var(--space-6) + env(safe-area-inset-bottom));
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 20px;
}
.a4-footer__links { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* --- Layout -------------------------------------------------------------- */

.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--space-6); }
.section { padding: var(--space-12) 0; }
.section--alt { background: var(--surface-alt); }
.stack { display: flex; flex-direction: column; gap: var(--space-6); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); }
.hero__text { display: flex; flex-direction: column; gap: var(--space-3); max-width: 680px; }
.hero__subtitle { color: var(--ink-muted); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.cols { display: grid; gap: var(--space-3); }
.cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.item { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-3); border-top: 1px solid var(--line); }

/* --- Cards de jogos ------------------------------------------------------ */

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-3); }

.game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color .15s, transform .15s;
}
.game-card:hover { border-color: var(--petrol-text); }
.game-card__cover { display: block; aspect-ratio: 16 / 10; background: var(--ink); }
.game-card__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.game-card__body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: var(--space-3); }
.game-card__title { display: flex; flex-direction: column; gap: 2px; }
.game-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.game-card__tags li {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--petrol-tint);
  color: var(--petrol-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}
.game-card__actions { display: flex; gap: 12px; margin-top: auto; padding-top: var(--space-1); }
.game-card__actions .a4-btn { flex: 1; }

.game-card--soon {
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 320px;
  padding: var(--space-3);
  border-style: dashed;
  background: transparent;
  text-align: center;
}
.game-card--soon:hover { border-color: var(--line); }
.game-card--soon .a4-slots { grid-template-columns: repeat(2, 32px); gap: 8px; }
.game-card--soon .a4-slot { width: 32px; height: 32px; border-radius: 7px; }

.game-card--skeleton { min-height: 420px; background: var(--surface); animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .5; } }

/* --- Responsivo ---------------------------------------------------------- */

@media (max-width: 899px) {
  .t-display-xl { font-size: 56px; line-height: 60px; }
  .hero { gap: var(--space-6); }
}

@media (max-width: 639px) {
  .a4-header__inner { height: 64px; padding: 0 16px; }
  .a4-logo { height: 20px; }
  .container { padding: 0 16px; }
  .section { padding: var(--space-6) 0; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero__title { font-size: 44px; line-height: 50px; letter-spacing: -.02em; }
  .hero__actions .a4-btn { flex: 1; }
  .section__title { font-size: 32px; line-height: 38px; }
  .cols--3 { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .games { grid-template-columns: minmax(0, 1fr); }
  .a4-slot--desktop-only { display: none; }
  .a4-footer__inner { flex-direction: column; align-items: flex-start; padding-inline: 16px; }
  .header-site { display: none; }
}

@media (max-width: 479px) {
  .a4-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .a4-btn, .a4-link, .a4-locale a, .game-card { transition: none; }
  .game-card--skeleton { animation: none; }
}
