:root {
  --bg: #fafaf8;
  --text: #2b2b28;
  --muted: #6b6b64;
  --line: #ddd8ce;
  --accent: #4f7a6b;
  --card-bg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --text: #e8e6df;
    --muted: #9a9890;
    --line: #33342f;
    --accent: #7fc4ab;
    --card-bg: #1f2022;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

/* ---------- Hero ---------- */
/* Deliberately dark/immersive regardless of light/dark mode -- an aurora
   sky doesn't have a "light theme". Layers, back to front:
   1. dark scrim (keeps text legible over the photo)
   2. images/NuukDownlinks.jpg -- satellite downlink radomes, Nuuk. Swap
      this filename any time for a different hero photo; if the file
      doesn't exist the browser just skips this layer, no broken-image icon
   3. CSS aurora gradient fallback, always present
   4. a faint SVG overlay suggesting radio waves / orbiting electrons */
.hero {
  position: relative;
  min-height: 42vh;
  display: flex;
  align-items: flex-end;
  color: #eef7f2;
  background-image:
    linear-gradient(180deg, rgba(6,10,12,0.45) 0%, rgba(6,10,12,0.8) 100%),
    url('images/NuukDownlinks.jpg'),
    radial-gradient(ellipse at 20% 20%, rgba(70,220,160,0.35), transparent 55%),
    radial-gradient(ellipse at 80% 10%, rgba(120,90,220,0.30), transparent 50%),
    linear-gradient(160deg, #0a1a1f 0%, #0d1420 60%, #05080d 100%);
  background-size: cover, cover, cover, cover, cover;
  background-position: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='400' viewBox='0 0 600 400'%3E%3Cg fill='none' stroke='%237fe8c4' stroke-width='1'%3E%3Ccircle cx='480' cy='90' r='14'/%3E%3Cellipse cx='480' cy='90' rx='40' ry='16' transform='rotate(20 480 90)'/%3E%3Cellipse cx='480' cy='90' rx='40' ry='16' transform='rotate(80 480 90)'/%3E%3Ccircle cx='500' cy='78' r='3' fill='%237fe8c4' stroke='none'/%3E%3C/g%3E%3Cg fill='none' stroke='%23b9a3ff' stroke-width='1' opacity='0.8'%3E%3Ccircle cx='90' cy='300' r='18'/%3E%3Ccircle cx='90' cy='300' r='34'/%3E%3Ccircle cx='90' cy='300' r='50'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5% top 10%, left 5% bottom 10%;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2.75rem;
  width: 100%;
}
.hero h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.hero-role {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  color: #cdeee0;
}
.hero-tags {
  margin: 0;
  font-size: 0.92rem;
  color: #a9c4bb;
}

/* ---------- Layout: left nav + content ---------- */
.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.sidenav {
  position: sticky;
  top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.75rem 0;
}
.sidenav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.3rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
}
.sidenav a:hover,
.sidenav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

main {
  padding: 2rem 0 5rem;
  min-width: 0;
}
section { margin-bottom: 3rem; scroll-margin-top: 1rem; }
h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
  margin-bottom: 1.2rem;
}
#about p { margin: 0 0 1rem; }
.about-flex {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}
.about-photo {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.about-text { min-width: 0; }
@media (max-width: 560px) {
  .about-flex { flex-direction: column; align-items: center; text-align: center; }
}

/* ---------- Experience ---------- */
.job {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.1rem;
}
.job-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 0.15rem;
}
.job-title { font-weight: 600; }
.job-dates {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.job-where {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}
.job p { margin: 0 0 0.7rem; font-size: 0.97rem; }

/* ---------- Tag chips ---------- */
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}
.tags li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg);
}
.tags-large li {
  font-size: 0.88rem;
  padding: 0.4rem 0.85rem;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.1rem;
}
.gallery-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
}
.gallery-card img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--line);
}
.gallery-card .cap {
  padding: 0.65rem 0.8rem;
}
.gallery-card h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}
.gallery-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.gallery-card .src-links {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
}
.gallery-card .src-links a {
  color: var(--accent);
  text-decoration: none;
}
.gallery-card .src-links a:hover { text-decoration: underline; }
.gallery-empty {
  color: var(--muted);
  font-size: 0.92rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

#contact a { color: var(--accent); }

/* ---------- Narrow screens: sidenav becomes a horizontal strip ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--line);
  }
  .sidenav a {
    border-left: none;
    padding-left: 0;
    border-bottom: 2px solid transparent;
  }
  .sidenav a:hover,
  .sidenav a.active {
    border-bottom-color: var(--accent);
  }
}

html { scroll-behavior: smooth; }
