:root {
  --bg: #0a0d14;
  --bg-horizon: #0e1424;
  --bg-zenith: #06080c;
  --text: #c4cee0;
  --text-bright: #e0e6f0;
  --text-dim: #8893a8;
  --accent: #5b8cb8;
  --panel: rgba(10, 14, 22, 0.62);
  --border: rgba(198, 208, 228, 0.07);
  --link: #7ba0d0;
  --heading-font: 'Iowan Old Style', 'Palatino Linotype', 'Palatino', 'URW Palladio L', 'Book Antiqua', Georgia, serif;
  --body-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --mono-font: 'SF Mono', 'Monaco', 'Cascadia Mono', 'Roboto Mono', Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ebe6db;
    --bg-horizon: #e0d9ca;
    --bg-zenith: #f2eee5;
    --text: #2a2f3a;
    --text-bright: #151a24;
    --text-dim: #5a6070;
    --accent: #4a6a92;
    --panel: rgba(235, 230, 219, 0.76);
    --border: rgba(38, 42, 52, 0.08);
    --link: #3a5a82;
  }
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--panel);
  color: var(--text-bright);
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  z-index: 100;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.skip-link:focus {
  top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 80% at 50% 110%, var(--bg-horizon) 0%, var(--bg) 45%, var(--bg-zenith) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

#backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#mountain-canvas,
#sky-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.8s ease-in;
}

#mountain-canvas.ready,
#sky-canvas.ready {
  opacity: 1;
}

#content {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  text-align: center;
  padding: 5rem 0 3rem;
}

.hero h1 {
  font-family: var(--heading-font);
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 400;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
  text-shadow: 0 2px 20px var(--bg);
}

.hero .tagline,
.hero .location {
  text-shadow: 0 1px 12px var(--bg);
}

.contact-links a {
  text-shadow: 0 1px 8px var(--bg);
}

.hero .tagline {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.hero .location {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.contact-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-links a {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
  display: inline-block;
  padding: 0.5rem 0.25rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.contact-links a:hover {
  color: var(--text-bright);
}

.content-section {
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  padding: 2.5rem;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border);
}

h2 {
  font-family: var(--heading-font);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--heading-font);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 0.3rem;
}

h3 .role {
  color: var(--text-dim);
  font-size: 1rem;
}

.dates {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
}

.scope {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

ul {
  list-style: none;
  padding: 0;
}

ul li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.8rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
}

ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 4px;
  height: 1px;
  background: var(--accent);
}

.projects article {
  margin-bottom: 1.5rem;
}

.projects article:last-child {
  margin-bottom: 0;
}

.projects .tech {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  font-family: var(--mono-font);
}

.projects p {
  font-size: 0.92rem;
  line-height: 1.6;
}

.skills p {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.skills strong {
  color: var(--text-bright);
  font-weight: 600;
}

.mono {
  font-family: var(--mono-font);
  font-size: 0.88em;
}

footer {
  text-align: center;
  padding: 2rem 0 4rem;
}

footer .location {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
}

footer .contact-links {
  gap: 1rem;
}

footer .contact-links a {
  font-size: 0.82rem;
}

@media (max-width: 600px) {
  .content-section {
    padding: 1.75rem 1.25rem;
    margin-bottom: 1.25rem;
  }
  .hero {
    padding: 3.5rem 0 2.5rem;
  }
  ul li {
    font-size: 0.88rem;
  }
  .content-section {
    background: var(--panel);
    backdrop-filter: blur(10px) saturate(110%);
    -webkit-backdrop-filter: blur(10px) saturate(110%);
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 2rem 0 1.5rem;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  .content-section {
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mountain-canvas,
  #sky-canvas {
    transition: opacity 0.8s ease-in;
  }
}
