/* iFun Quiz – Promotional site (matches app branding) */

:root {
  /* App colors from lib/src/core/resources/colors.dart */
  --green: #02C39A;
  --yellow: #FDD85D;
  --grey: #48495F;
  --dark-bg: #1D1F25;
  --red: #D1323A;
  --orange: #F5793A;
  --blue: #85C0F9;
  --tertiary: #E7EFF6;
  --primary: #6F7276;
  --secondary: #CED5DB;

  --text: #1D1F25;
  --text-muted: #6F7276;
  --bg: #ffffff;
  --bg-soft: #f8fafb;
  --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(2, 195, 154, 0.12);
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--green);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.nav-links a:hover {
  color: var(--green);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--grey);
  border-radius: 1px;
}

/* Hero */
.hero {
  padding: 64px 0 80px;
  background: linear-gradient(160deg, var(--bg-soft) 0%, var(--bg) 50%);
}

.hero-inner {
  text-align: center;
}

.hero-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 16px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.hero-tagline {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--grey);
}

.hero-tagline strong {
  color: var(--green);
}

.hero-desc {
  margin: 0 0 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-apple {
  background: #000;
  color: #fff;
  border: none;
}

.btn-apple:hover {
  background: #333;
}

.btn-apple .apple-logo {
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.63 1.96-1.42 3.5-2.94 4.5'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  flex-shrink: 0;
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-large .apple-logo {
  width: 24px;
  height: 24px;
}

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

.section-title {
  margin: 0 0 40px;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Features grid */
.features {
  background: var(--bg-soft);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* How to play */
.how-intro {
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 24px;
}

.how-list {
  max-width: 520px;
  margin: 0 auto 24px;
  padding-left: 1.2em;
  color: var(--text-muted);
}

.tile-demo {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 16px;
  flex-wrap: wrap;
}

.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-weight: 700;
  font-size: 1.5rem;
  border-radius: 6px;
  color: #fff;
}

.tile.small {
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
}

.tile-correct {
  background: var(--green);
}

.tile-wrong-spot {
  background: var(--yellow);
  color: var(--grey);
}

.tile-absent {
  background: var(--grey);
}

.tile-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 32px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Download */
.download {
  background: linear-gradient(160deg, var(--green) 0%, #01a884 100%);
  color: #fff;
  text-align: center;
}

.download .section-title {
  color: #fff;
}

.download-desc {
  margin: 0 0 24px;
  opacity: 0.95;
}

.download .btn-apple {
  background: #fff;
  color: #000;
}

.download .btn-apple .apple-logo {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.63 1.96-1.42 3.5-2.94 4.5'/%3E%3C/svg%3E");
}

.download .btn-apple:hover {
  background: var(--tertiary);
  color: #000;
}

/* Contact */
.contact {
  background: var(--bg-soft);
}

.contact p {
  margin: 0 0 12px;
  color: var(--text-muted);
}

.contact a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.contact a:hover {
  text-decoration: underline;
}

.contact-credit {
  margin-top: 8px;
}

.contact-email {
  font-size: 1.1rem;
}

/* Footer */
.footer {
  padding: 24px 0;
  background: var(--dark-bg);
  color: var(--secondary);
  text-align: center;
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--tertiary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Scroll animation (optional) */
.animate-on-scroll {
  opacity: 0.97;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile */
@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links.is-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--secondary);
  }

  .nav-links.is-open a {
    padding: 12px 0;
    border-bottom: 1px solid var(--secondary);
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-tagline {
    font-size: 1.25rem;
  }

  .section {
    padding: 48px 0;
  }

  .section-title {
    font-size: 1.6rem;
    margin-bottom: 28px;
  }
}
