/* =========================================================
   Theme variables
   ========================================================= */

:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e5e7eb;
  --card-bg: #ffffff;

  --accent: #2563eb;
  --accent-hover: #1e40af;
}

.dark {
  --bg: #020617;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1e293b;
  --card-bg: #020617;
}

/* =========================================================
   Background gradients (landing only)
   ========================================================= */

:root {
  --landing-bg:
    radial-gradient(
      900px 500px at 10% -10%,
      rgba(37, 99, 235, 0.18),
      transparent 60%
    ),
    radial-gradient(
      700px 450px at 90% 15%,
      rgba(99, 102, 241, 0.12),
      transparent 65%
    );
}

.dark {
  --landing-bg:
    radial-gradient(
      900px 500px at 10% -10%,
      rgba(56, 189, 248, 0.22),
      transparent 60%
    ),
    radial-gradient(
      700px 450px at 90% 15%,
      rgba(99, 102, 241, 0.18),
      transparent 65%
    );
}

/* =========================================================
   Base layout
   ========================================================= */

body {
  background: var(--bg);
  color: var(--text);
}

body.home {
  background:
    var(--landing-bg),
    var(--bg);
}

.home {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.5rem 6rem;
  position: relative;
  z-index: 1;
}

/* =========================================================
   Top navigation
   ========================================================= */

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  margin-bottom: 6rem;
  padding: 4rem 3rem;
  border-radius: 28px;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.9),
      rgba(255, 255, 255, 0.75)
    );

  backdrop-filter: blur(6px);
}

.dark .hero {
  /* Use a single solid (semi-opaque) background in dark mode
     instead of the layered linear gradient to remove colour tinting. */
  background: color-mix(in srgb, var(--card-bg) 80%, black 10%);
}

/* Accent line */
.hero::before {
  content: "";
  position: absolute;
  top: 1.75rem;
  left: 3rem;
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--accent),
    rgba(37, 99, 235, 0.35)
  );
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 1.5rem 0 1.1rem;

  /* Use theme text color (solid) instead of gradient text */
  color: var(--text);
}

.dark .hero h1 {
  /* Dark mode: use theme text color */
  color: var(--text);
}

.tagline {
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  line-height: 1.75;
  color: var(--muted);
  max-width: 720px;
}

/* =========================================================
   Buttons
   ========================================================= */

.actions {
  margin-top: 2.75rem;
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.9rem 1.6rem;
  border-radius: 14px;
  font-weight: 500;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.btn.primary {
  background: var(--accent);
  color: white;
  box-shadow:
    0 10px 30px rgba(37, 99, 235, 0.35);
}

.btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn.secondary {
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* =========================================================
   Cards (navigation-style)
   ========================================================= */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.6rem;
  margin-top: 5rem;
}

.card {
  position: relative;
  padding: 1.6rem;
  border-radius: 22px;

  background: var(--card-bg);
  border: 1px solid var(--border);

  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.06);

  color: inherit;
  text-decoration: none;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.7rem;
}

.card p {
  color: var(--muted);
  line-height: 1.65;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

/* =========================================================
   Muted / coming soon
   ========================================================= */

.card.muted {
  cursor: default;
  background: transparent;
}

.card.muted:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.coming-soon {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  .hero {
    padding: 3rem 2rem;
  }

  .hero::before {
    left: 2rem;
  }

  .hero h1 {
    font-size: 2.6rem;
  }

  .tagline {
    font-size: 1.15rem;
  }

  .home {
    padding-top: 4rem;
  }
}

/* Mobile readability improvements: force vertical stacking and increase type */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
  }

  .card p {
    font-size: 1.1rem;
    line-height: 1.6;
  }

  .hero h1 {
    font-size: 4.2rem;
  }

  .tagline {
    font-size: 1.3rem;
  }
}

/* Target touch devices (large-DPR phones) to ensure stacked layout and larger type */
@media (hover: none) and (pointer: coarse) {
  .cards {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .card h3 {
    font-size: clamp(3rem, 4.8vw, 1.6rem);
    margin-bottom: 0.5rem;
  }

  .card p {
    font-size: clamp(2.2rem, 3.8vw, 1.15rem);
    line-height: 1.6;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 12vw, 5.2rem);
  }

  .tagline {
    font-size: clamp(2.6rem, 4.2vw, 1.5rem);
  }
 
  /* Scale buttons for touch devices */
  .btn {
    font-size: 2.2rem;
    padding: 1.2rem 2.2rem;
  }

  .btn.primary, .btn.secondary {
    font-size: 2.2rem;
  }
}