/* ============================================================
   Design tokens (sampled from the original site)
   ============================================================ */
:root {
  --bg: #000000;
  --card: #111111;
  --text: #ffffff;
  --muted: #a3a3a3;
  --line: #2a2a2a;
  --accent: #97b58b;
  --radius: 28px;
  --container: 1345px;
  --pad: clamp(20px, 5vw, 80px);
  --font-display: "Chakra Petch", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(16px, 1.05vw + 8px, 18px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, iframe { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; margin: 0; }
p { margin: 0; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; transition: color .2s, text-shadow .2s; }
a:hover { text-shadow: 0 0 12px rgba(151, 181, 139, .55); }
a.plain { color: var(--text); text-decoration: none; }
a.plain:hover { color: var(--accent); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sep { color: var(--text); }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}

.hud-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--muted);
  margin-bottom: 14px;
}
.hud-label::before { content: "> "; color: var(--accent); }

.section { padding-block: clamp(72px, 9vw, 140px) 0; }
.section h2 { font-size: clamp(34px, 3vw + 10px, 48px); }

/* Subtle scanline texture over the whole page */
.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
}

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; overflow: hidden; }
/* Phones and small tablets: photo on top, text below (overlapping the photo's dark fade) */
.hero-img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  max-height: 380px;
  object-fit: cover;
  object-position: 80% top;
}
.hero-content { position: relative; margin-top: -40px; padding-bottom: 8px; }
.hero h1 { font-size: clamp(38px, 3vw + 14px, 56px); margin-bottom: 28px; }
.hero-content > p:not(.hud-label) { max-width: 650px; margin-bottom: 24px; }
.contact-lines { line-height: 1.7; }

/* 900px and up: text on the left, photo on the right (like the original site) */
@media (min-width: 900px) {
  .hero { --hero-h: clamp(440px, 36.5vw, 700px); min-height: var(--hero-h); }
  .hero-img {
    position: absolute; top: 0; right: 0;
    width: auto; max-width: none; height: var(--hero-h); max-height: none;
    aspect-ratio: auto;
  }
  .hero-content { margin-top: 0; padding-top: clamp(80px, 9vw, 170px); padding-bottom: 40px; }
  .hero-content > p:not(.hud-label) { max-width: min(560px, 46vw); }
}

/* ============================================================
   Featured projects
   ============================================================ */
.subtitle { margin-top: 18px; }
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  margin-top: 48px;
  max-width: 640px;
}
@media (min-width: 900px) {
  .projects { grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3.3vw, 65px); max-width: none; }
}

.media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.media video { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .3s ease; }
.media .logo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; filter: grayscale(1);
  transition: opacity .3s ease; pointer-events: none;
}
.media:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (hover: hover) {
  .media:hover, .media:focus-visible { transform: scale(1.04); box-shadow: 0 14px 44px rgba(151, 181, 139, .2); z-index: 2; }
  .media:hover video, .media:focus-visible video { filter: none; }
  .media:hover .logo, .media:focus-visible .logo { opacity: 0; }
}

.project h3 { font-family: var(--font-body); font-weight: 600; font-size: 18px; margin-top: 26px; }
.project .meta { margin-top: 14px; }
.project .links { margin-top: 4px; }

details { margin-top: 14px; }
summary {
  cursor: pointer; list-style: none;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
  display: inline-flex; align-items: center; gap: 8px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; width: 7px; height: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .2s ease;
}
details[open] summary::after { transform: rotate(45deg) translate(-2px, -2px); }
details ul { margin: 12px 0 0; padding-left: 20px; color: #e6e6e6; }
details li { margin-bottom: 6px; }
details li::marker { color: var(--accent); }

/* ============================================================
   Tools marquee
   ============================================================ */
.marquee {
  margin-top: 44px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}
.track { display: flex; width: max-content; animation: scroll 40s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.tools {
  display: flex; align-items: center; gap: 48px;
  margin: 0; padding: 8px 48px 8px 0; list-style: none;
}
.tools li {
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text); opacity: .6; transition: opacity .2s, filter .2s;
}
.tools li:hover { opacity: 1; filter: drop-shadow(0 0 8px rgba(151, 181, 139, .5)); }
.tools img { width: 28px; height: 28px; object-fit: contain; }
.tools li.pill { border: 1px solid #555; border-radius: 999px; padding: 4px 14px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ============================================================
   Coursework
   ============================================================ */
.course-groups {
  display: grid; grid-template-columns: 1fr; gap: 32px 64px; margin-top: 40px;
}
@media (min-width: 768px) { .course-groups { grid-template-columns: repeat(2, 1fr); } }
.course-group h3 {
  font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.course-group ul { margin: 0; padding: 0; list-style: none; }
.course-group li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ============================================================
   Resume
   ============================================================ */
.resume-actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.button {
  display: inline-block; padding: 10px 22px; border: 1px solid var(--accent); border-radius: 999px;
  text-decoration: none; font-family: var(--font-display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 14px;
}
.button:hover { background: var(--accent); color: #000; text-shadow: none; box-shadow: 0 0 20px rgba(151, 181, 139, .35); }
.resume-frame {
  display: none;
  width: 100%; height: 80vh; margin-top: 28px;
  border: 1px solid var(--line); border-radius: 12px; background: #1a1a1a;
}
@media (min-width: 768px) {
  .resume-frame { display: block; }
  .resume-open { display: none; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer { padding-block: clamp(80px, 9vw, 140px) 48px; }
.copyright { margin-top: 18px; color: var(--muted); font-size: 14px; }

/* ============================================================
   Scroll reveal (only when JS is running; content stays visible otherwise)
   ============================================================ */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .media, .media:hover, .media:focus-visible { transform: none !important; }
  .track { animation: none; width: auto; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .tools { flex-wrap: wrap; justify-content: flex-start; gap: 20px 36px; padding: 0; }
  .tools[aria-hidden="true"] { display: none; }
}
