/* --- Variables --- */
:root {
  --bg: #0a0e17;
  --bg-subtle: #0d1220;
  --text: #f5f5f4;
  --text-muted: #a1a1aa;
  --accent: #e4e4e7;
  --line: rgba(255, 255, 255, 0.08);
  --radius: 2px;
  --font: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --max-width: 42rem;
  --navy: #0a0e17;
}

/* --- Reset & base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.35;
  cursor: none;
  letter-spacing: -0.02em;
  transition: background-color 0.7s ease, color 0.7s ease;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(30, 58, 100, 0.25), transparent),
    radial-gradient(circle at 100% 100%, rgba(15, 23, 42, 0.4), transparent 50%);
}

body.no-cursor-animation,
body.no-cursor-animation * {
  cursor: auto;
}

/* Subtle grid texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* --- Custom cursor --- */
.cursor {
  position: fixed;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s cubic-bezier(0.25, 0.1, 0.2, 1),
              height 0.25s cubic-bezier(0.25, 0.1, 0.2, 1),
              border-color 0.7s ease,
              background 0.7s ease;
}

.cursor.hover {
  width: 40px;
  height: 40px;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

body.light-theme .cursor {
  border-color: rgba(10, 14, 23, 0.35);
}

body.light-theme .cursor.hover {
  border-color: rgba(10, 14, 23, 0.2);
  background: rgba(10, 14, 23, 0.04);
}

.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--text);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: transform 0.15s cubic-bezier(0.25, 0.1, 0.2, 1),
              background 0.7s ease;
}

.cursor.hover + .cursor-dot {
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0.6;
}

body.light-theme .cursor-dot {
  background: var(--navy);
}

/* --- Layout --- */
.header,
.main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-lg);
  padding-bottom: var(--space-md);
}

.logo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.7s ease;
}

.logo:hover {
  color: var(--text);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.7s ease;
}

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

.theme-toggle {
  background: none;
  border: none;
  padding: var(--space-xs);
  cursor: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.7s ease;
}

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

/* --- Hero --- */
.hero {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-xl);
}

.hero-name {
  margin: 0 0 var(--space-md);
  font-size: clamp(2.3rem, 7vw, 2.5rem);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  transition: color 0.7s ease;
}

.hero-tagline {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 40ch;
  transition: color 0.7s ease;
}

/* --- Content sections --- */
.content {
  padding-bottom: var(--space-xl);
}

.content--outline {
  padding-bottom: var(--space-2xl);
}

.section-label {
  margin: 0 0 var(--space-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  transition: color 0.7s ease;
}

/* --- Outline (notes-app style list) --- */
.outline {
  list-style: none;
  margin: 0 0 0;
  padding: 0;
}

.outline > li {
  margin-bottom: var(--space-sm);
}

.outline-bullet {
  color: var(--text-muted);
  margin-right: var(--space-sm);
  font-size: 0.65em;
  vertical-align: 0.15em;
}

.outline ul {
  list-style: none;
  margin: var(--space-xs) 0 0 var(--space-lg);
  padding: 0;
}

.outline > li {
  font-weight: 500;
}

.outline-arrow {
  color: var(--text-muted);
  margin-right: var(--space-sm);
  font-size: 0.9em;
}

.outline a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: border-color 0.7s ease, color 0.7s ease;
}

.outline a:hover {
  border-color: var(--text-muted);
}

/* --- Light theme (all navy blue) --- */
body.light-theme {
  --bg: #f5f5f4;
  --bg-subtle: #eaeaea;
  --text: #0a0e17;
  --text-muted: #0f1629;
  --accent: #0a0e17;
  --line: rgba(10, 14, 23, 0.2);
  --navy: #0a0e17;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(30, 58, 100, 0.06), transparent),
    radial-gradient(circle at 100% 100%, rgba(15, 23, 42, 0.08), transparent 50%);
}

body.light-theme .logo,
body.light-theme .nav a,
body.light-theme .hero-name,
body.light-theme .hero-tagline,
body.light-theme .section-label,
body.light-theme .outline a,
body.light-theme .outline-bullet,
body.light-theme .outline-arrow,
body.light-theme .theme-toggle {
  color: var(--text);
}

body.light-theme .logo,
body.light-theme .nav a,
body.light-theme .hero-tagline,
body.light-theme .section-label,
body.light-theme .outline-bullet,
body.light-theme .outline-arrow,
body.light-theme .theme-toggle {
  color: var(--text-muted);
}

body.light-theme .hero-name,
body.light-theme .outline a {
  color: var(--text);
}

body.light-theme .logo:hover,
body.light-theme .nav a:hover,
body.light-theme .theme-toggle:hover {
  color: var(--text);
}

body.light-theme::before {
  background-image:
    linear-gradient(rgba(10, 14, 23, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 14, 23, 0.03) 1px, transparent 1px);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .header,
  .main {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .nav {
    gap: var(--space-md);
  }
}

@media (hover: none) {
  body {
    cursor: auto;
  }

  .cursor,
  .cursor-dot {
    display: none;
  }
}
