/* ============================================================
   PORTFOLIO — design tokens
   ------------------------------------------------------------
   Dark, electric/thunder theme. Edit these variables to reskin
   the whole site.
   ============================================================ */

:root {
  /* Backgrounds */
  --bg:            #0A0D13;   /* page background — near-black navy */
  --bg-raised:     #12151d;   /* cards / boxed sections */
  --bg-raised-2:   #171b25;

  /* Text */
  --text:          #B7C0D1;   /* body / sidebar text */
  --text-heading:  #F5F7FA;   /* names, "Hello" — near white */
  --text-muted:    #6E7787;   /* small / supporting text */
  --rule:          rgba(255,255,255,0.09); /* hairline rules + borders */

  /* Section / nav accent colors — electric / thunder palette */
  --c-about:       #FFD400;   /* About Me   — electric yellow (lightning) */
  --c-coursework:  #38BDF8;   /* Coursework — electric blue */
  --c-projects:    #A78BFA;   /* Projects   — electric violet */
  --c-resume:      #22D3EE;   /* Resume     — electric cyan */

  /* Glow accents (box-shadows) */
  --glow-blue:     rgba(56, 189, 248, 0.35);
  --glow-yellow:   rgba(255, 212, 0, 0.30);

  /* Fonts */
  --font-display:        'Montserrat', system-ui, sans-serif; /* headings */
  --font-display-chunky: 'Montserrat', system-ui, sans-serif; /* nav + big titles */
  --font-sans:           'Inter', system-ui, sans-serif;      /* body */

  /* Spacing scale */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;

  /* Layout */
  --page-max:      1180px;
  --gutter:        clamp(20px, 4vw, 56px);
  --sidebar-w:     300px;
}

/* ============================================================
   RESET-ISH
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  /* faint radial glow for a techy backdrop */
  background-image:
    radial-gradient(ellipse 900px 500px at 12% -10%, rgba(56,189,248,0.08), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(255,212,0,0.06), transparent 55%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4, p { margin: 0; }

/* ============================================================
   TOP NAV (shared across all pages — injected by /js/nav.js)
   Nav scrolls away with the page (not sticky).
   ============================================================ */
.site-nav {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.nav-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  color: var(--text-heading);
  line-height: 0;
}

/* pokeball ↔ thunderbolt-pokeball hover swap — both SVGs share one
   bounding box so the circle silhouette is identical between states */
.brand-icon {
  position: relative;
  width: 46px;
  height: 46px;
  display: inline-block;
}
.brand-icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity .22s ease, transform .22s ease, filter .22s ease;
}
.brand-icon .icon-pokeball {
  opacity: 1;
  transform: scale(1);
}
.brand-icon .icon-thunderball {
  opacity: 0;
  transform: scale(0.88) translateY(2px);
}
.nav-brand:hover .icon-pokeball {
  opacity: 0;
  transform: scale(0.9);
}
.nav-brand:hover .icon-thunderball {
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: drop-shadow(0 0 8px var(--glow-yellow));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 30px);
}
.nav-link {
  font-family: var(--font-display-chunky);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
  background: transparent;
}
.nav-link:hover,
.nav-link.is-active {
  background: var(--link-c);
  color: #04050a;
  box-shadow: 0 0 18px -4px var(--link-c);
}
.nav-about      { --link-c: var(--c-about);      color: var(--c-about); }
.nav-coursework { --link-c: var(--c-coursework); color: var(--c-coursework); }
.nav-projects   { --link-c: var(--c-projects);   color: var(--c-projects); }
.nav-resume     { --link-c: var(--c-resume);     color: var(--c-resume); }

/* pokemon peeking over each nav tab on hover — anchored above the pill
   so it never overlaps (and never blocks) the link text itself */
.nav-item {
  position: relative;
  display: inline-flex;
}
.nav-peek {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 28px;
  height: 28px;
  object-fit: contain;
  transform: translate(-50%, 16px) scale(0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 3;
}
.nav-item:hover .nav-peek {
  opacity: 1;
  transform: translate(-50%, 8px) scale(1);
}

/* ============================================================
   PAGE SHELL
   ============================================================ */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter) var(--s-9);
}

.page-title {
  font-family: var(--font-display-chunky);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  margin-bottom: var(--s-7);
}
.page-title.is-about      { color: var(--c-about); }
.page-title.is-coursework { color: var(--c-coursework); }
.page-title.is-projects   { color: var(--c-projects); }
.page-title.is-resume     { color: var(--c-resume); }

/* ============================================================
   ABOUT ME / HOME — sidebar + content layout
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}

/* ---- Sidebar ---- */
.sidebar {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.sidebar .photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.sidebar .photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 22%;
}
.sidebar .photo .photo-placeholder {
  width: 42%;
  height: 42%;
  opacity: 0.5;
}
.sidebar .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.15;
  color: var(--text-heading);
  margin-top: var(--s-2);
}
.sidebar .role {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.sidebar .role-item + .role-item {
  margin-top: 2px;
}

/* social icon links */
.sidebar .socials {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: 0;
}
.sidebar .socials a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  padding: 4px 0;
  transition: color .15s ease;
}
.sidebar .socials a:hover { color: var(--c-about); }
.sidebar .socials .icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
  flex-shrink: 0;
}
.sidebar .socials .icon svg { width: 18px; height: 18px; }
.sidebar .socials li.email-row { position: relative; }
.sidebar .socials a.email-link { cursor: pointer; }
.copy-toast {
  position: absolute;
  left: 28px;
  top: calc(100% + 6px);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--bg);
  background: var(--c-about);
  border-radius: 999px;
  padding: 5px 12px;
  box-shadow: 0 6px 16px -6px var(--glow-yellow);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease;
  white-space: nowrap;
}
.copy-toast.is-visible { opacity: 1; transform: translateY(0); }

/* ---- Right content ---- */
.about-content {
  max-width: 640px;
  padding-top: clamp(16px, 2.5vw, 40px);
}
.about-content .hello {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 50px);
  line-height: 1;
  color: var(--text-heading);
  margin-bottom: var(--s-5);
}
.about-content p {
  font-family: var(--font-sans);
  font-size: 16.5px;
  color: var(--text);
  line-height: 1.75;
}
.about-content p + p { margin-top: var(--s-4); }
.about-content strong {
  font-weight: 600;
  color: var(--text-heading);
}
.about-content a.inline-link {
  color: var(--c-about);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.about-content a.inline-link:hover { opacity: 0.75; }

.pd-text a.inline-link,
.proj-section a.inline-link {
  color: var(--c-projects);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.pd-text a.inline-link:hover,
.proj-section a.inline-link:hover { opacity: 0.75; }

.about-content .closer {
  margin-top: var(--s-6);
  color: var(--text-muted);
}

/* ============================================================
   COURSEWORK PAGE
   ============================================================ */
body[data-page="coursework"] main.page,
body[data-page="about"] main.page {
  padding-top: var(--s-5);
}
.coursework-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 50px);
  line-height: 1.05;
  color: var(--text-heading);
  margin-bottom: var(--s-6);
  font-weight: 700;
}
.coursework-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
}
.coursework-semester {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.coursework-semester .term {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  color: var(--c-coursework);
  letter-spacing: 0.005em;
}
.coursework-semester ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 0;
}
.coursework-semester li {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  padding-left: 22px;
  position: relative;
}
.coursework-semester li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-coursework);
}
.coursework-semester li .code {
  font-weight: 600;
  color: var(--text-heading);
}

/* ============================================================
   PROJECTS PAGE
   ============================================================ */
body[data-page="projects"] main.page {
  max-width: 1400px;
  padding-top: clamp(40px, 5vw, 64px);
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
}
.project-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 10px;
  display: block;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}
.project-tile .ph,
.project-tile img.cover {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: filter .35s ease, transform .6s ease;
}
.project-tile .ph {
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: var(--s-3);
}
.project-tile .overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s-5);
  opacity: 0;
  transition: opacity .3s ease, background-color .3s ease;
  z-index: 1;
}
.project-tile:hover .overlay,
.project-tile:focus-visible .overlay {
  opacity: 1;
  background: rgba(6, 8, 12, 0.75);
}
.project-tile:hover .ph,
.project-tile:hover img.cover {
  filter: brightness(0.55);
  transform: scale(1.03);
}
.project-tile .pt-name {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.1;
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}
.project-tile .pt-date {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-projects);
}

@media (max-width: 820px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PROJECT DETAIL PAGE (per-project subpages in /projects/)
   ============================================================ */
.pd-head {
  margin-bottom: clamp(24px, 3vw, 40px);
}
.pd-eyebrow {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.15;
  color: var(--text-heading);
  font-weight: 700;
}
.pd-eyebrow .sub {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
  font-size: 0.85em;
}

.pd-media {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(16px, 2vw, 28px);
  margin-bottom: clamp(28px, 4vw, 44px);
  align-items: start;
}
.pd-video {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.25),
    0 0 28px var(--glow-blue),
    0 14px 38px -6px rgba(56, 189, 248, 0.35);
}
.pd-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.pd-images {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3vw, 44px);
}
.pd-img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg-raised);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.22),
    0 0 22px rgba(56, 189, 248, 0.28),
    0 12px 30px -6px rgba(56, 189, 248, 0.35);
}
.pd-img-1 { align-self: center; width: 88%; }
.pd-img-2 { align-self: center; width: 100%; }

.pd-text {
  border: 1px solid var(--rule);
  background: var(--bg-raised);
  padding: clamp(24px, 3vw, 36px) clamp(24px, 3vw, 40px);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.pd-text p {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  margin: 0;
}
.pd-text p.pd-note {
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
}
.pd-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  margin-top: clamp(28px, 4vw, 44px);
  transition: color .15s ease;
}
.pd-back:hover { color: var(--c-projects); }

@media (max-width: 820px) {
  .pd-media { grid-template-columns: 1fr; }
  .pd-img-1, .pd-img-2 { width: 100%; }
}

/* ============================================================
   PROJECT SUBPAGE — SHARED SECTION SYSTEM
   ============================================================ */
.proj-img {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.22),
    0 0 22px rgba(56, 189, 248, 0.28),
    0 12px 30px -6px rgba(56, 189, 248, 0.35);
}

.proj-section { margin-top: clamp(48px, 6vw, 80px); }
.proj-section + .proj-section {
  border-top: 1px solid var(--rule);
  padding-top: clamp(40px, 5vw, 64px);
}
.proj-section.proj-hero { margin-top: clamp(16px, 2vw, 24px); }

.proj-kicker {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-3);
}
.proj-section h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 36px);
  color: var(--text-heading);
  margin: 0 0 var(--s-2) 0;
  line-height: 1.1;
  font-weight: 700;
}
.proj-section p {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  margin: 0;
}
.proj-section p + p { margin-top: var(--s-4); }
.proj-section .gap { height: clamp(20px, 3vw, 32px); }

.proj-hero-figure {
  margin-bottom: clamp(24px, 3vw, 36px);
}

.proj-blurb {
  border: 1px solid var(--rule);
  background: var(--bg-raised);
  border-radius: 8px;
  padding: clamp(24px, 3vw, 36px) clamp(24px, 3vw, 40px);
}

.proj-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 2.4vw, 32px);
  align-items: center;
  margin-bottom: clamp(24px, 3vw, 36px);
}
.proj-grid-2 .proj-img { max-height: 420px; width: auto; margin: 0 auto; }

.proj-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  margin-top: clamp(20px, 3vw, 32px);
}
.proj-split.reverse { grid-template-columns: 1fr 1.1fr; }
.proj-split.reverse .proj-media { order: 2; }
.proj-media { display: flex; justify-content: center; }
.proj-media .proj-img { max-height: 380px; width: auto; }

@media (max-width: 820px) {
  .proj-split,
  .proj-split.reverse { grid-template-columns: 1fr; }
  .proj-split.reverse .proj-media { order: 0; }
  .proj-grid-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   RESUME PAGE
   ============================================================ */
body[data-page="resume"] main.page {
  max-width: 900px;
  padding-top: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(40px, 5vw, 64px);
}
.resume-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: clamp(14px, 1.8vw, 22px);
  flex-wrap: wrap;
}
.resume-head .title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.1;
  color: var(--text-heading);
  font-weight: 700;
}
.resume-head .meta {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.resume-head .meta a {
  color: var(--c-resume);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity .15s ease;
}
.resume-head .meta a:hover { opacity: 0.75; }
.resume-head .meta .dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  opacity: 0.6;
}
.resume-frame {
  width: 100%;
  height: calc(100vh - 160px);
  min-height: 900px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-raised);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 18px 40px -22px rgba(34, 211, 238, 0.25);
}
.resume-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg-raised);
}
.resume-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: center;
  padding: var(--s-6);
}
@media (max-width: 640px) {
  .resume-frame { min-height: 480px; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-foot {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--s-7) var(--gutter) var(--s-6);
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.site-foot a { color: var(--text-muted); border-bottom: 1px solid currentColor; }
.site-foot a:hover { color: var(--c-about); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--s-7);
  }
  .sidebar {
    position: static;
    max-width: 320px;
  }
  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-3);
    padding: 18px var(--gutter);
  }
  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
}
