:root {
  --accent: #1a73eb;
  --accent-2: #2b82f6;
  --accent-glow: rgba(26, 115, 235, 0.55);
  --bg: #000000;
  --bg-elev: #0d0d10;
  --bg-elev-2: #15161a;
  --fg: #ffffff;
  --fg-muted: #b9bbc1;
  --border: rgba(255, 255, 255, 0.1);
  --cta-fill: rgba(217, 217, 217, 0.18);
  --cta-shadow: 0 4px 14px rgba(26, 115, 235, 0.45);
  --ring: rgba(26, 115, 235, 0.5);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f6f7fb;
  --bg-elev-2: #ffffff;
  --fg: #0b0d12;
  --fg-muted: #545865;
  --border: rgba(11, 13, 18, 0.1);
  --cta-fill: rgba(11, 13, 18, 0.04);
  --cta-shadow: 0 6px 18px rgba(26, 115, 235, 0.25);
  --ring: rgba(26, 115, 235, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { display: block; }
::selection { background: var(--accent); color: #fff; }

.accent { color: var(--accent); }
.italic { font-style: italic; font-weight: 600; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: inline-flex; align-items: center; justify-self: start; }
.brand-logo { display: inline-flex; height: 38px; width: 56px; color: var(--fg); }
.brand-logo svg { width: 100%; height: 100%; display: block; }

.nav-links {
  display: flex;
  gap: 2rem;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  justify-self: center;
}
.nav-links a {
  position: relative;
  opacity: 0.85;
  padding: 0.25rem 0;
  transition: opacity 0.2s, color 0.2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-links a:hover { opacity: 1; color: var(--accent); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: end;
}

/* ---------- Pill buttons (Login / Sign up) ---------- */
.btn-login,
.btn-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(217, 217, 217, 0.16);
  color: #fff;
  font-style: italic;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  box-shadow: 0 2px 8px rgba(26, 115, 235, 0.35);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.22s, background 0.2s, color 0.2s;
}
.btn-login:hover,
.btn-signup:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26, 115, 235, 0.5);
}
.btn-login:focus-visible,
.btn-signup:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.btn-signup {
  color: var(--accent-2);
  background: rgba(217, 217, 217, 0.18);
  box-shadow: 0 2px 8px rgba(26, 115, 235, 0.35), inset 0 0 0 1px rgba(43, 130, 246, 0.25);
}
[data-theme="light"] .btn-login {
  color: var(--fg);
  background: rgba(11, 13, 18, 0.04);
  text-shadow: none;
}

/* ---------- Theme toggle (icon switch) ---------- */
.theme-toggle {
  appearance: none;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.theme-toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 999px; }

.theme-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 60px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(120, 120, 130, 0.18);
  border: 1px solid var(--border);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
[data-theme="light"] .theme-toggle-track {
  background: rgba(43, 130, 246, 0.08);
  border-color: rgba(43, 130, 246, 0.18);
}

.theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  transition: color 0.3s var(--ease), opacity 0.3s var(--ease), transform 0.4s var(--ease);
  position: relative;
  z-index: 1;
}
.theme-toggle-icon svg { width: 100%; height: 100%; }

/* Active icon = full opacity in brand colour. Inactive = dim. */
.theme-toggle .icon-moon { color: #ffffff; opacity: 1; transform: scale(1); }
.theme-toggle .icon-sun { color: var(--fg-muted); opacity: 0.55; transform: scale(0.9); }
[data-theme="light"] .theme-toggle .icon-moon { color: var(--fg-muted); opacity: 0.55; transform: scale(0.9); }
[data-theme="light"] .theme-toggle .icon-sun { color: var(--accent-2); opacity: 1; transform: scale(1); }

.theme-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(26, 115, 235, 0.6);
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1),
              background 0.3s var(--ease), box-shadow 0.3s var(--ease);
  z-index: 0;
}
[data-theme="light"] .theme-toggle-knob {
  transform: translateX(30px);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(43, 130, 246, 0.45), 0 0 0 1px rgba(43, 130, 246, 0.2);
}
.theme-toggle:hover .theme-toggle-knob { box-shadow: 0 4px 14px rgba(26, 115, 235, 0.85); }

/* ---------- Hamburger ---------- */
.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  align-items: center;
  justify-content: center;
}
.hamburger:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.hamburger span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform 0.4s var(--ease), opacity 0.25s var(--ease), top 0.4s var(--ease);
}
.hamburger span:nth-child(1) { top: calc(50% - 6px); }
.hamburger span:nth-child(3) { top: calc(50% + 6px); }
.hamburger[aria-expanded="true"] span:nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(0.2);
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 65px 0 0 0;
  background: var(--bg);
  z-index: 49;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem 1.5rem 2.5rem;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.mobile-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 360px;
}
.mobile-menu-links a {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.75rem 1rem;
  width: 100%;
  text-align: center;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s, transform 0.25s var(--ease), opacity 0.3s;
  opacity: 0;
  transform: translateY(8px);
}
.mobile-menu.is-open .mobile-menu-links a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu.is-open .mobile-menu-links a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.is-open .mobile-menu-links a:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu.is-open .mobile-menu-links a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu-links a:hover {
  background: var(--bg-elev);
  color: var(--accent);
}
.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  max-width: 280px;
  margin-top: 0.5rem;
}
.mobile-menu-actions .btn-login,
.mobile-menu-actions .btn-signup {
  width: 100%;
  height: 44px;
  font-size: 0.85rem;
}
body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  min-height: calc(80vh - 65px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1.5rem 4rem;
  gap: 1.75rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -10% 10% auto 10%;
  height: 60%;
  background: radial-gradient(ellipse at top, var(--accent-glow), transparent 60%);
  filter: blur(80px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero-headline {
  font-weight: 500;
  font-size: clamp(2.2rem, 6.5vw, 5.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  max-width: 1080px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2em 0.4em;
}

.hero-sub {
  margin: 0;
  max-width: 620px;
  color: var(--fg-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.75rem;
  min-width: 200px;
  height: 52px;
  border-radius: 999px;
  background: var(--cta-fill);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  box-shadow: var(--cta-shadow);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.2s;
}
.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px var(--accent-glow);
}
.cta:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.cta--inline { align-self: start; height: 48px; min-width: 180px; }

/* ---------- Sections ---------- */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}
.lead {
  max-width: 620px;
  margin: 0 auto 2rem;
  color: var(--fg-muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

/* About cards */
.about-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  text-align: left;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(26, 115, 235, 0.16);
}
.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.card p { margin: 0; color: var(--fg-muted); line-height: 1.55; font-size: 0.93rem; }

/* Categories */
.categories {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  text-align: left;
}
.category {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.category::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 70%;
  height: 140%;
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.category:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(26, 115, 235, 0.2);
}
.category:hover::after { opacity: 0.18; }

.category-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(26, 115, 235, 0.12);
  color: var(--accent);
}
.category-icon svg { width: 22px; height: 22px; }
.category h3 { margin: 0; font-size: 1.2rem; font-weight: 600; }
.category p { margin: 0; color: var(--fg-muted); line-height: 1.55; font-size: 0.95rem; }
.category-cta {
  margin-top: auto;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* Contact form */
.contact-form {
  display: grid;
  gap: 0.9rem;
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.75rem;
}
.contact-form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.contact-form label { display: grid; gap: 0.35rem; font-size: 0.88rem; font-weight: 500; }
.contact-form label > span { color: var(--fg-muted); letter-spacing: 0.02em; }
.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  color: var(--fg);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.form-status { margin: 0; color: var(--accent); font-size: 0.92rem; min-height: 1.2em; }

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.75rem 1.5rem 2.25rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.88rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav { grid-template-columns: auto 1fr auto; padding: 0.6rem 1rem; gap: 0.5rem; }
  .nav-links { display: none; }
  .nav-actions .btn-login,
  .nav-actions .btn-signup { display: none; }
  .nav-actions { gap: 0.5rem; }
  .hamburger { display: inline-flex; }
}

@media (max-width: 640px) {
  .contact-form .row { grid-template-columns: 1fr; }
  .section { padding: 2.75rem 1.25rem; }
  .hero { padding: 2.25rem 1.25rem 3rem; min-height: auto; gap: 1.4rem; }
  .hero-headline { font-size: clamp(2rem, 9vw, 3.4rem); }
  .contact-form { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
