/* Odin Color System */
:root {
  /* Base palette */
  --color-golden-glow: #dde61f;
  --color-golden-glow-dark: #b8bf1a;
  --color-digital-slate: #0f1822;
  --color-nordic-pine: #1A5632;
  --color-nordic-mist: #D6D7D5;
  --color-nordic-mist-s50: #80837C;

  /* Spacing & Typography (constant) */
  --font-heading: 'Lora', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* Dark mode (default) */
  --bg-primary: var(--color-digital-slate);
  --bg-secondary: #151f2b;
  --text-primary: var(--color-nordic-mist);
  --text-muted: var(--color-nordic-mist-s50);
  --accent: var(--color-golden-glow);
  --link: #4DB6AC;
  --link-hover: #80CBC4;
  --border-color: rgba(214, 215, 213, 0.1);
}

/* Light mode */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #e9ecef;
    --text-primary: var(--color-digital-slate);
    --text-muted: #5a6068;
    --accent: var(--color-golden-glow-dark);
    --link: #00897B;
    --link-hover: #00695C;
    --border-color: rgba(15, 24, 34, 0.1);
  }
}

/* Canvas background */
#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.4;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark light;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  margin: 0;
  padding: var(--space-sm);
  min-height: 100vh;
  overflow-x: hidden;
}

main {
  display: flex;
  flex-direction: column;
  max-width: 42rem;
  margin: 0 auto;
  min-height: calc(100vh - var(--space-md) * 2);
  position: relative;
  z-index: 1;
}

/* Header */
header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm) 0 var(--space-md);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-md);
}

header h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

header h1::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}

header h1 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

header h1 a:hover {
  color: var(--accent);
}

/* Navigation */
nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

nav::-webkit-scrollbar {
  display: none;
}

nav ul {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  padding: 0;
  margin: 0;
  list-style: none;
  gap: var(--space-xs);
}

nav li a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-xs) 0;
  position: relative;
  transition: color 0.2s ease;
  white-space: nowrap;
}

nav li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

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

nav li a:hover::after {
  width: 100%;
}

/* Main content area */
section {
  flex: 1;
}

/* Footer */
footer {
  padding: var(--space-lg) 0 var(--space-md);
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

footer div {
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Desktop styles */
@media screen and (min-width: 640px) {
  body {
    padding: var(--space-md) var(--space-lg);
  }

  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-lg);
    padding: var(--space-md) 0;
  }

  header h1 {
    font-size: 1.75rem;
  }

  nav ul {
    justify-content: flex-end;
    gap: var(--space-md);
  }

  nav li a {
    font-size: 0.875rem;
  }
}

@media screen and (min-width: 900px) {
  main {
    max-width: 48rem;
  }
}

/* Selection color */
::selection {
  background: var(--accent);
  color: var(--bg-primary);
}
