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

:root {
  --bg: #0a0f1e;
  --surface: #111827;
  --border: #1e293b;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --font: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-h: 64px;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ─────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-name {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-name:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

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

.nav-links a.active {
  color: var(--text-primary);
}

.nav-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ── Hero / Globe ────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: var(--nav-h);
}

#globe-container {
  width: min(700px, 92vw);
  aspect-ratio: 1;
  cursor: grab;
  position: relative;
  margin-bottom: -3rem;
}

#globe-container:active {
  cursor: grabbing;
}

.intro {
  margin-top: 1rem;
  max-width: 580px;
  text-align: center;
  padding: 0 1.5rem 2.5rem;
}

.intro p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.intro strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Projects page ───────────────────────────────────────── */
.projects-page {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

.projects-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.projects-inner h1 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.projects-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 3rem;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08),
              0 4px 24px rgba(0, 0, 0, 0.4);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.card-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.3em;
  transition: color 0.2s;
}

.card-link:hover {
  color: #7dd3fc;
}

.card-link svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* placeholder link style */
.card-link.placeholder {
  color: var(--text-muted);
  pointer-events: none;
  cursor: default;
}

/* ── Layer toggle controls ───────────────────────────────── */
.layer-controls {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 50;
}

.layer-btn {
  background: rgba(10, 15, 30, 0.75);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.layer-btn:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
}

.layer-btn.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  nav {
    padding: 0 1.25rem;
  }

  .card-header {
    flex-direction: column;
  }

  .card-link {
    align-self: flex-start;
  }
}
