/* ---------- Fonts (Metropolis, SIL Open Font License) ---------- */
@font-face { font-family: "Metropolis"; src: url("Metropolis-Regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("Metropolis-RegularItalic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("Metropolis-Medium.otf") format("opentype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("Metropolis-SemiBold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("Metropolis-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("Metropolis-BoldItalic.otf") format("opentype"); font-weight: 700; font-style: italic; font-display: swap; }

/* ---------- Base ---------- */
:root {
  --bg: #000;
  --fg: #fff;
  --muted: #b8b8b8;
  --card: #0d0d0d;
  --card-border: #262626;
  --sun: #ffd86b;
  --max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Metropolis", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 4px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--fg);
  color: var(--bg);
  padding: .6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.container {
  width: min(var(--max), 100% - 3rem);
  margin-inline: auto;
}

/* ---------- Nav ---------- */
.site-nav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  padding: 1.75rem 0;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
}
.site-nav a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  opacity: .85;
  transition: opacity .2s;
}
.site-nav a:hover { opacity: 1; }
.site-nav a[aria-current="page"] { font-weight: 700; opacity: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: #000 url("maui-sunset.jpg") center 40% / cover no-repeat;
  display: flex;
  align-items: center;
}
.hero::after {
  /* subtle fade into the black page below */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, #000);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }

.hero h1 {
  margin: 0 0 .5rem;
  font-size: clamp(2.2rem, 5vw, 3.15rem);
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 2px 18px rgba(0,0,0,.35);
}
.hero .tagline {
  margin: 0;
  max-width: 22em;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.35;
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
}

.photo-credit {
  position: absolute;
  right: 1.5rem;
  bottom: 30%;
  z-index: 2;
  text-align: right;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  opacity: .85;
}
.photo-credit:hover { opacity: 1; }
.photo-credit em { font-style: italic; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  z-index: 2;
  width: 44px;
  height: 44px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
}
.scroll-cue svg { width: 26px; animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* ---------- Projects ---------- */
.projects { padding: 4rem 0 3rem; }

.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
}
.project-grid li { width: 300px; }

.project-card {
  display: block;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card);
  transition: transform .25s ease, box-shadow .25s ease;
}
.project-card img { width: 100%; height: 100%; object-fit: cover; }
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 40px rgba(255, 216, 107, .12);
}

/* ---------- About ---------- */
.about-intro {
  padding: 8rem 0 4rem;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.about-intro .portrait { border-radius: 4px; width: 100%; }
.about-intro h1 { margin: 0 0 1rem; font-size: clamp(1.9rem, 3.5vw, 2.25rem); line-height: 1.15; }
.about-intro p { margin: 0 0 1.1rem; font-size: 15px; color: #eaeaea; }
.about-intro strong { color: #fff; }

.gallery { padding: 3rem 0; }
.gallery h2 { margin: 0 0 1.5rem; font-size: clamp(1.4rem, 2.6vw, 1.75rem); }
.gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .75rem;
}
.gallery-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-grid.cols-3 { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.gallery-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform .3s ease, filter .3s ease;
}
.gallery-grid li { overflow: hidden; }
.gallery-grid li:hover img { transform: scale(1.04); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem;
  padding: 2.5rem 0 3rem;
  text-align: center;
}
.site-footer hr { border: 0; border-top: 1px solid #fff; margin: 0 0 2rem; }
.site-footer p { margin: 0 0 .9rem; font-size: 14px; font-weight: 600; }
.socials {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: .9rem;
}
.socials a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  opacity: .9;
  transition: opacity .2s, transform .2s;
}
.socials a:hover { opacity: 1; transform: translateY(-2px); }
.socials svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Rising sun behind the last name ----------
   Starts in the clouds below-right, fully transparent, and rises
   up-left to sit behind "Sun." at full opacity. Plays once on load. */
.sun-heading { position: relative; z-index: 0; }  /* own stacking context so the sun can sit behind the text */
.sun-word { position: relative; white-space: nowrap; }
.sun {
  position: absolute;
  z-index: -1;                   /* behind the letters, above the photo */
  left: 100%;
  top: 50%;
  width: 1.05em;
  height: 1.05em;
  margin: -0.6em 0 0 -0.7em;     /* centers it just behind the end of the word */
  border-radius: 50%;
  background: #e8d97a;
  box-shadow:
    0 0 .25em rgba(255, 238, 150, .9),
    0 0 .7em  rgba(255, 222, 115, .6),
    0 0 1.6em rgba(255, 205, 90, .35);
  animation: sunrise 4.8s .3s both;
}
/* 0–82% (~3.9s): rises from the clouds, fading 0 → 80%
   82–100% (~0.9s): holds behind the name, brightening 80% → 100% */
@keyframes sunrise {
  0%   { opacity: 0;  transform: translate(2.9em, 1.6em); animation-timing-function: cubic-bezier(.22, .61, .36, 1); }
  82%  { opacity: .8; transform: translate(0, 0);         animation-timing-function: ease-in-out; }
  100% { opacity: 1;  transform: translate(0, 0); }
}

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .about-intro { grid-template-columns: 1fr; padding-top: 6rem; }
  .gallery-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid.cols-3 { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .photo-credit { bottom: 6rem; }
}
@media (max-width: 480px) {
  .site-nav ul { justify-content: center; gap: 1.5rem; }
  .project-grid li { width: 100%; max-width: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
