:root {
  --bg: #F5F9FF;
  --surface: #FFFFFF;
  --accent: #2049C9;
  --accent-soft: rgba(32, 73, 201, 0.08);
  --text-muted: #5B6B8C;
  --text: #0D1B3E;
  --border: #D3E1F7;
  --shadow: rgba(13, 27, 62, 0.08);
  --footer-bg: #0D1B3E;
  --footer-text: #8CA0C4;
  --font-heading: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Typography scale */
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 1.875rem;
  --font-size-3xl: 2.25rem;
  --font-size-4xl: 3rem;

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.6;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Radius scale */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 999px;

  --touch-target: 44px;
}

[data-theme="dark"] {
  --bg: #0C1428;
  --surface: #17233F;
  --accent: #4C7DFF;
  --accent-soft: rgba(76, 125, 255, 0.14);
  --text-muted: #8CA0C4;
  --text: #EAF1FF;
  --border: #263559;
  --shadow: rgba(0, 0, 0, 0.35);
  --footer-bg: #060B18;
  --footer-text: #8CA0C4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*,
*::before,
*::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  background: var(--bg);
  color: var(--text);
  line-height: var(--leading-normal);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--accent);
  color: #FFFFFF;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: 100;
  text-decoration: none;
  transition: top 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.skip-link:focus {
  top: var(--space-4);
}

header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px -8px var(--shadow);
  z-index: 10;
}

nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: start;
  text-decoration: none;
}

.brand-icon {
  display: block;
  border-radius: var(--radius-md);
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: var(--font-size-md);
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  flex-wrap: wrap;
  justify-self: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: var(--weight-medium);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: var(--touch-target);
  height: var(--touch-target);
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-8) var(--space-8);
}

#hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  margin: 0 calc(var(--space-8) * -1);
  padding: 0 var(--space-8);
  background: radial-gradient(60% 60% at 50% 0%, var(--accent-soft), transparent 70%);
}

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.hero-logo {
  display: block;
  border-radius: var(--radius-xl);
}

.hero-brand-name {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: var(--font-size-md);
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

#hero h1 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-4xl));
  line-height: var(--leading-tight);
  max-width: 22ch;
}

.accent-text {
  color: var(--accent);
}

#hero p {
  color: var(--text-muted);
  max-width: 40ch;
}

#about {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

#about h2 {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-3);
}

#about p {
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto;
}

#explore {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-6);
  padding: var(--space-16) 0;
}

.explore-card {
  display: block;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 3px var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.explore-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.explore-card:hover,
.explore-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 8px 24px -10px var(--shadow);
  transform: translateY(-4px);
}

.explore-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.explore-icon svg {
  width: 22px;
  height: 22px;
}

.explore-card h3 {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
  color: var(--text);
}

.explore-card p {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

footer {
  text-align: center;
  padding: var(--space-8);
  background: var(--footer-bg);
  color: var(--footer-text);
}

.footer-links {
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
}

.footer-links a {
  color: inherit;
  text-decoration: underline;
  opacity: 0.8;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  opacity: 1;
}

.footer-links span {
  margin: 0 var(--space-2);
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  .explore-card {
    opacity: 1;
    transform: none;
  }
}
