:root {
  --bg-color: #0d1117;
  --card-bg: #161b22;
  --text-main: #c9d1d9;
  --text-highlight: #ffffff;
  --accent-primary: #58a6ff;
  --accent-secondary: #bc8cff;
  --accent-tertiary: #3fb950;
  --border-color: #30363d;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-speed: 0.3s;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-speed) ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
header {
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
}

.logo {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-domain {
  font-weight: 600;
  font-size: 0.85em;
  -webkit-text-fill-color: initial;
  background: none;
  color: #8b949e;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--accent-primary);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--text-highlight);
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  max-width: 650px;
  margin: 0 auto 3rem;
  color: #8b949e;
}

.hero p a {
  color: var(--accent-primary);
  border-bottom: 1px dotted var(--accent-primary);
}

.hero p a:hover {
  border-bottom-style: solid;
}

.cta-button {
  display: inline-block;
  background: var(--accent-primary);
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(88, 166, 255, 0.5);
}

/* Featured Grid */
.grid-section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2.5rem;
  color: var(--text-highlight);
  margin-bottom: 3rem;
  text-align: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition-speed), border-color var(--transition-speed);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
}

.card-image {
  height: 200px;
  background-color: #21262d;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  /* Ensure CSS patterns don't spill out */
}

/* Planisphere CSS Art */
.pattern-space {
  background: radial-gradient(circle at bottom, #302b63 0%, #0f0c29 100%);
  position: relative;
}

.pattern-space::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(white, rgba(255, 255, 255, .2) 2px, transparent 3px),
    radial-gradient(white, rgba(255, 255, 255, .15) 1px, transparent 2px),
    radial-gradient(white, rgba(255, 255, 255, .1) 2px, transparent 3px);
  background-size: 550px 550px, 350px 350px, 250px 250px;
  background-position: 0 0, 40px 60px, 130px 270px;
  opacity: 0.8;
}

.pattern-space::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    40px 20px 0 -45px white,
    140px 80px 0 -45px white,
    200px 50px 0 -45px white;
  filter: blur(1px);
}

/* Track & Trace CSS Art */
.pattern-globe {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  position: relative;
}

.pattern-globe::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 140%;
  background-image:
    linear-gradient(#3b82f6 1px, transparent 1px),
    linear-gradient(90deg, #3b82f6 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center center;
  opacity: 0.1;
  mask-image: radial-gradient(circle, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle, black 40%, transparent 80%);
}

.pattern-globe::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 30% 70%, rgba(59, 130, 246, 0.4) 0%, transparent 40%),
    radial-gradient(circle at 70% 30%, rgba(147, 51, 234, 0.4) 0%, transparent 40%);
}

.card-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-content {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-highlight);
}

.card p {
  color: #8b949e;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card h3 a {
  color: var(--text-highlight);
  transition: color 0.2s;
}

.card h3 a:hover {
  color: var(--accent-primary);
}

.card-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-link {
  font-weight: 600;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.card-link:hover {
  text-decoration: underline;
}

.card-link-primary {
  font-size: 1rem;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 4rem 0;
  margin-top: 4rem;
  text-align: center;
  color: #6e7681;
}

.footer-nav {
  margin-top: 1rem;
}

.footer-nav a {
  color: #8b949e;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--accent-primary);
}

/* Utilities */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.badge-strategy {
  background: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
}

.badge-puzzle {
  background: rgba(188, 140, 255, 0.15);
  color: #bc8cff;
}

.badge-tools {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .grid-section {
    padding: 2rem 0;
  }
}