/* Design pass: dark theme, forest green accent, neutral grays.
   One accent color + neutrals per PROJECT_BRIEF.md — no secondary hues. */

:root {
  /* Surfaces */
  --bg: #0d1310;             /* page background — near-black, slight green cast */
  --bg-elevated: #141d19;    /* nav, footer, cards */
  --bg-elevated-2: #1b2620;  /* hover state on elevated surfaces */

  /* Borders */
  --border: #263029;
  --border-strong: #34453b;

  /* Text */
  --text: #e9efe9;
  --text-muted: #96a89d;

  /* Accent — forest green */
  --accent: #34a865;
  --accent-strong: #4fd087;
  --accent-soft: rgba(52, 168, 101, 0.14);
  --accent-on: #06150d;      /* text color used on top of solid accent fills */

  --max-width: 1080px;
  --radius: 8px;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-body);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  position: relative;
}

a {
  color: var(--accent-strong);
}

a:hover {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Ambient background — a fixed, subtle forest-green glow behind every page,
   consistent site-wide rather than just on the home hero. Structural idea
   (fixed radial-gradient glow + vignette + grain, content promoted onto its
   own stacking layer) adapted from a portfolio the user liked; palette and
   everything else is ours. */

.ambient-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 520px at 20% -8%, var(--accent-soft), transparent 70%),
    radial-gradient(760px 620px at 85% 15%, rgba(52, 168, 101, 0.08), transparent 72%);
}

.ambient-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 30%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.ambient-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.layer {
  position: relative;
  z-index: 3;
}

/* Header / nav */

.site-header {
  background: rgba(20, 29, 25, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav .brand {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Hero */

.hero {
  display: flex;
  align-items: center;
  padding: 3rem 0 2rem;
}

.hero .name {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  line-height: 1.02;
  margin: 0 0 0.75rem;
}

.hero .role-line {
  font-size: 1.25rem;
  color: var(--accent-strong);
  margin: 0 0 1.25rem;
}

.hero .intro {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 38rem;
  margin: 0;
}

/* A thin gradient rule separating sections down the page — quiet but gives
   the long scroll some rhythm instead of hard section boundaries. */
.divider {
  height: 1px;
  max-width: var(--max-width);
  margin: 0 auto;
  background: linear-gradient(to right, transparent, var(--border-strong) 20%, var(--border-strong) 80%, transparent);
}

/* Sections (home page) */

.section {
  padding: 3.5rem 0;
  scroll-margin-top: 5.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  font-size: 1.75rem;
  margin: 0;
  color: var(--accent-strong);
}

.section-head .count {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.about-content {
  max-width: 42rem;
}

.about-content p {
  font-size: 1.1rem;
  margin: 0 0 1.75rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
}

.contact-links a {
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--accent-strong);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.2rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-links a:hover {
  border-color: var(--accent-strong);
}

/* Scroll-reveal: sections fade/lift into place as they enter the viewport
   (see public/js/reveal.js). Scoped to `.js` (set by an inline script in
   <head>, before paint) so content stays fully visible by default and only
   gets hidden-then-revealed once JS has actually confirmed it can run the
   IntersectionObserver that un-hides it — no risk of permanently invisible
   content if the script fails to load. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Buttons */

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  text-decoration: none;
  margin-top: 1rem;
  transition: background 0.15s ease;
}

.button:hover {
  background: var(--accent-strong);
  color: var(--accent-on);
}

/* Project grid / cards */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

/* .reveal is also on .project-card for the scroll-reveal effect, and once
   revealed, '.js .reveal.in' sets transform:translateY(0) at higher
   specificity (3 classes) than a plain '.project-card:hover' (2 classes)
   would have — silently cancelling the hover lift below. Matching that
   specificity here (project-card + reveal + :hover = 3) and relying on
   this rule coming later in the file wins the tie correctly; verified via
   getComputedStyle that the lift actually applies now. */
.project-card.reveal:hover {
  border-color: var(--accent);
  background: var(--bg-elevated-2);
  transform: translateY(-2px);
}

.project-card-media {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 60%), var(--bg-elevated-2);
  border-bottom: 1px solid var(--border);
  color: var(--accent-strong);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  overflow: hidden;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.project-card:hover .project-card-media img {
  transform: scale(1.04);
}

/* Project detail page: video + screenshot gallery */

.project-video {
  margin-top: 1.5rem;
}

.project-video video {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
}

.project-description {
  margin-top: 1.5rem;
  max-width: 42rem;
}

.project-description p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Masonry-style column layout, not a grid: mixed portrait/landscape
   images at natural aspect ratio in a row-based grid left uneven gaps
   whenever one image in a row was much shorter than its neighbor. Columns
   let each image stack immediately under the previous one in its own
   column instead of being locked to a shared row height. */
.project-gallery {
  column-width: 360px;
  column-gap: 1rem;
  margin-top: 1.5rem;
}

h1.has-logo {
  line-height: 0;
}

.project-logo {
  max-width: 320px;
  height: auto;
}

/* Gallery images (main project gallery + Behind the Scenes): a colored
   border highlights whichever image the cursor is over, matching the
   hover "select" feedback from a gallery the user pointed to as a
   reference. Sized larger than a typical thumbnail grid on purpose —
   these are meant to actually be looked at, not act as index cliffnotes.
   No fixed aspect-ratio/object-fit:cover here on purpose — screenshots in
   these galleries mix portrait and landscape shots, and force-cropping
   them to a uniform box was cutting off parts of the image. Each image
   keeps its natural proportions; rows just end up uneven heights, which
   is normal for a mixed-content photo gallery. */
.project-gallery img,
.bts-gallery img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
  break-inside: avoid;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project-gallery img:hover,
.bts-gallery img:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-card-body {
  padding: 1.25rem;
}

.project-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.project-card p {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.tech-stack {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.project-role {
  color: var(--text-muted);
  margin-top: -0.5rem;
}

/* Resume */

.resume-header {
  margin-bottom: 2rem;
}

.resume-contact {
  color: var(--text-muted);
}

.resume-section {
  margin-bottom: 2rem;
}

.resume-section h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.resume-entry {
  margin-bottom: 1.25rem;
}

.resume-entry-heading,
.resume-entry-subheading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.resume-entry-subheading {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.resume-entry ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.resume-skills {
  list-style: none;
  padding: 0;
  margin: 0;
}

.resume-skills li {
  margin-bottom: 0.4rem;
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li {
  margin-bottom: 0.4rem;
}

/* Behind the Scenes (project detail pages) */

.bts {
  margin-top: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 1rem 1.25rem;
}

.bts summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-strong);
  list-style: none;
}

.bts summary::-webkit-details-marker {
  display: none;
}

.bts summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.15s ease;
}

.bts[open] summary::before {
  transform: rotate(90deg);
}

.bts-intro {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0.75rem 0 1.25rem;
}

.bts-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.bts-video-grid video {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
}


.site-footer {
  position: relative;
  z-index: 3;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* Not used by /resume/download (that route serves a pre-made static PDF) —
   this only matters if someone manually prints the /resume page from their
   own browser. A resume is meant to be read on paper or in a viewer with a
   plain white background regardless of the site's dark theme, so print
   output forces the light palette back on. */
@media print {
  :root {
    --bg: #ffffff;
    --bg-elevated: #ffffff;
    --text: #1a1a1a;
    --text-muted: #555555;
    --border: #e2e2e2;
    --accent: #1f6b46;
  }

  .site-header,
  .site-footer,
  .resume-header .button,
  .ambient-glow,
  .ambient-vignette,
  .ambient-grain {
    display: none;
  }

  body {
    font-size: 11pt;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  .resume-entry {
    break-inside: avoid;
  }
}
