:root {
  color-scheme: light dark;
  --bg: light-dark(#fdfdfc, #14181c);
  --text: light-dark(#1f2328, #e6e9ec);
  --muted: light-dark(#6a737d, #98a1aa);
  --accent: light-dark(#0b5fa5, #6cb3e8);
  --border: light-dark(#e4e7ea, #2c343c);
}

/* Smooth crossfade between pages (index <-> photos), no JS.
   Browsers without support just navigate normally. */
@view-transition {
  navigation: auto;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(
      56rem 36rem at 50% -8%,
      color-mix(in srgb, var(--accent) 11%, transparent),
      transparent 70%
    ),
    radial-gradient(
        color-mix(in srgb, var(--muted) 13%, transparent) 1.2px,
        transparent 1.4px
      )
      0 0 / 24px 24px,
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.portrait {
  border-radius: 50%;
  width: 140px;
  height: 140px;
  object-fit: cover;
  border: 3px solid var(--border);
}

h1 {
  font-size: 2rem;
  margin: 1rem 0 0.25rem;
  letter-spacing: -0.02em;
}

h1,
h2,
.tagline {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.tagline {
  color: var(--muted);
  margin: 0;
  font-size: 1.05rem;
}

h2 {
  font-size: 1.15rem;
  margin: 2rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

p {
  margin: 0.6rem 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

ul.skills,
ul.links {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

ul.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

ul.skills li {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.9rem;
}

ul.links li {
  margin: 0.35rem 0;
}

ul.projects {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
  display: grid;
  gap: 0.75rem;
}

ul.projects li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
}

ul.projects h3 {
  margin: 0;
  font-size: 1rem;
}

ul.projects .year {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: normal;
}

ul.projects p {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
}

ul.projects .tech {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

.album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.album figure {
  margin: 0;
}

.album img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.album figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Scroll-driven reveal: each photo fades + rises into place as it
   scrolls into view. No JS / IntersectionObserver. Falls back to
   static, fully-visible images where unsupported or when the user
   prefers reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .album figure {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 25%;
    }

    @keyframes reveal {
      from {
        opacity: 0;
        transform: translateY(1.5rem);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
  }
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
