/* ==========================================================================
   Game Spot - Neutral premium light
   Display: Instrument Serif  |  Body: Outfit
   ========================================================================== */

:root {
  --bg: #fdfcf9;
  --surface: #ffffff;
  --ink: #181a1f;
  --ink-soft: #2c2f36;
  --muted: #6b7280;
  --accent: #0d8a7d;
  --accent-hover: #0a6f64;
  --accent-soft: #e0f0ed;
  --divider: #e6e3dc;
  --footer-bg: #f4f1e9;

  --container: min(1200px, 92%);
  --radius-card: 14px;
  --radius-soft: 10px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.03), 0 14px 28px -20px rgba(0, 0, 0, 0.12);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.04), 0 22px 40px -22px rgba(0, 0, 0, 0.18);
  --shadow-fixed: 0 -2px 8px rgba(0, 0, 0, 0.04), 0 -12px 28px -16px rgba(0, 0, 0, 0.12);

  --display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --body: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--accent-hover); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--accent-soft); color: var(--ink); }

.hidden { display: none !important; }

/* ---------- Layout ---------- */
.container { width: var(--container); margin-inline: auto; }

main > section { padding: 96px 0; }
main > section + section { border-top: 1px solid var(--divider); }

/* ---------- Header ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  backdrop-filter: saturate(160%) blur(8px);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.site-logo {
  font-family: var(--display);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.site-logo:hover { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0;
  position: relative;
}
.nav-links a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
#hero { padding: 120px 0 96px; border-top: none; }

.hero-content {
  max-width: 880px;
  animation: fadeUp .8s cubic-bezier(.2,.6,.2,1) both;
}

.hero-content h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(54px, 8vw, 100px);
  line-height: 0.95;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 28px;
}

/* Italicise the closing word of the H1 via CSS only */
.hero-content h1 {
  /* fallback: whole h1 stays regular; visual italic accent done with ::after below */
}

.hero-content p {
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 600px;
}

/* ---------- Section headings ---------- */
section h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 5.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 14px;
  max-width: 22ch;
}

/* Italicise the final word of section H2s using ::first-line trick is unreliable;
   instead apply a subtle italic accent to the heading's last word with a pseudo-element fallback.
   When HTML is fixed, we leave the H2 regular for a clean serif look. */

section > .container > p {
  font-family: var(--body);
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 48px;
  max-width: 60ch;
}

/* ---------- Card base ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  padding: 26px;
  box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

/* ---------- Games ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.catalog-grid .card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp .7s cubic-bezier(.2,.6,.2,1) both;
}
.catalog-grid .card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: #d8d4ca;
}

.game-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.game-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--divider);
  flex-shrink: 0;
}

.game-head > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.game-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  line-height: 1;
}

.developer {
  font-family: var(--body);
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.game-desc {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.screenshots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.screenshots img {
  border-radius: var(--radius-soft);
  border: 1px solid var(--divider);
  aspect-ratio: 9/16;
  object-fit: cover;
  width: 100%;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
  padding: 14px 22px;
  border-radius: var(--radius-soft);
  text-decoration: none;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
  border: none;
  cursor: pointer;
  line-height: 1;
}
.btn:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: scale(1.01);
  box-shadow: 0 8px 20px -10px rgba(13, 138, 125, 0.55);
}
.btn:active { transform: scale(0.99); }

.btn-block { width: 100%; margin-top: auto; }

/* ---------- Reviews ---------- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.review-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp .7s cubic-bezier(.2,.6,.2,1) both;
}
.review-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.review-stars {
  color: var(--accent);
  font-size: 16px;
  letter-spacing: 0.12em;
}

.review-card p {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
}

.review-meta {
  font-family: var(--body);
  font-size: 13px;
  color: var(--muted);
  margin-top: auto;
}

/* ---------- FAQ ---------- */
.faq-list { max-width: 820px; }

.faq-item {
  border-bottom: 1px solid var(--divider);
  padding: 22px 0;
}
.faq-item:first-child { border-top: 1px solid var(--divider); }

.faq-item summary {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-right: 4px;
  transition: color .18s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--muted);
  font-family: var(--body);
  font-weight: 300;
  font-size: 28px;
  line-height: 1;
  transition: transform .25s ease, color .25s ease;
}
.faq-item[open] summary::after {
  content: "−";
  color: var(--accent);
}
.faq-item summary:hover { color: var(--accent); }

.faq-item p {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 14px;
  max-width: 70ch;
}
.faq-item p a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- About ---------- */
#about .about-content {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 64px;
  align-items: start;
}

#about h2 {
  position: sticky;
  top: 100px;
  margin-bottom: 0;
}

#about .about-content > p {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
}
#about .about-content > p + p { margin-top: 20px; }

/* ---------- Subscribe ---------- */
#subscribe .form-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.form-card {
  padding: 36px;
  box-shadow: var(--shadow-card);
}

.form-card h2 {
  font-size: clamp(36px, 4vw, 44px);
  margin-bottom: 8px;
  max-width: none;
}

.form-subtitle {
  font-family: var(--body);
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 28px;
}

#subscribeForm {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#subscribeForm label {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 14px;
}
#subscribeForm label:first-of-type { margin-top: 0; }

#subscribeForm input[type="text"],
#subscribeForm input[type="email"],
#subscribeForm input[type="tel"] {
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-soft);
  padding: 12px 14px;
  width: 100%;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
  margin-top: 6px;
}
#subscribeForm input::placeholder { color: #b6b3aa; }
#subscribeForm input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 138, 125, 0.14);
}

.form-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 20px;
  cursor: pointer;
}
.form-agree input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  margin-top: 2px;
}
.form-agree a { text-decoration: underline; text-underline-offset: 2px; }

#subscribeForm .btn { margin-top: 22px; }

.form-success {
  display: none;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-soft);
}
.form-success.visible { display: block; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  width: min(720px, calc(100% - 32px));
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05), 0 24px 48px -20px rgba(0,0,0,0.18);
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-soft);
}
.cookie-banner a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner #cookieAccept {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-soft);
  transition: background .18s ease;
  white-space: nowrap;
}
.cookie-banner #cookieAccept:hover { background: var(--accent-hover); }

/* ---------- Footer ---------- */
footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--divider);
  padding: 56px 0 48px;
  margin-top: 0;
}
footer .container > * + * { margin-top: 14px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  margin-bottom: 8px;
}
.footer-links a {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.footer-links a:hover { color: var(--accent); }

footer p {
  font-family: var(--body);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
footer p a { color: var(--ink-soft); border-bottom: 1px solid transparent; transition: color .18s, border-color .18s; }
footer p a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.catalog-grid .card:nth-child(1) { animation-delay: .02s; }
.catalog-grid .card:nth-child(2) { animation-delay: .08s; }
.catalog-grid .card:nth-child(3) { animation-delay: .14s; }
.catalog-grid .card:nth-child(4) { animation-delay: .20s; }
.reviews-grid .review-card:nth-child(1) { animation-delay: .02s; }
.reviews-grid .review-card:nth-child(2) { animation-delay: .08s; }
.reviews-grid .review-card:nth-child(3) { animation-delay: .14s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  main > section { padding: 72px 0; }
  #hero { padding: 88px 0 64px; }

  .navbar .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
  }
  .nav-links { gap: 18px 22px; }

  #about .about-content {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  #about h2 { position: static; top: auto; }

  section > .container > p { margin-bottom: 36px; }
}

@media (max-width: 480px) {
  :root { --container: min(1200px, 94%); }
  main > section { padding: 56px 0; }
  #hero { padding: 64px 0 48px; }

  .card { padding: 20px; }
  .form-card { padding: 24px; }

  .nav-links { gap: 14px 18px; font-size: 13px; }
  .nav-links a { font-size: 13px; }

  .hero-content p { font-size: 16px; }
  section > .container > p { font-size: 15px; }

  .game-icon { width: 56px; height: 56px; }
  .game-title { font-size: 20px; }

  .faq-item summary { font-size: 19px; gap: 16px; }
  .faq-item summary::after { font-size: 24px; }

  .cookie-banner {
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 14px;
  }
  .cookie-banner #cookieAccept { width: 100%; }

  footer { padding: 40px 0 32px; }
}
