/* ====== RESET & ROOT VARIABLES ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink: #1C1625;
  --ink2: #4A4060;
  --ink3: #8A7FA8;
  --parchment: #F7F5F0;
  --parchment2: #EFECF4;
  --lav: #E8E2F5;
  --lav2: #D4CBF0;
  --lav3: #BFB4E8;
  --plum: #6B5FA0;
  --plum2: #4E4580;
  --plum3: #332D55;
  --rose: #E8DFEE;
  --border: #CEC6E6;
  --border2: #B5ABDA;
  --sh: 0 2px 8px rgba(76,60,140,0.07), 0 1px 3px rgba(76,60,140,0.05);
  --sh2: 0 6px 20px rgba(76,60,140,0.10), 0 2px 8px rgba(76,60,140,0.07);
  --tr: 180ms cubic-bezier(0.4,0,0.2,1);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--parchment);
  background-image: url('assets/main-bg.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

/* ====== NAVIGATION ====== */
nav {
  background: rgba(247,245,240,0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  height: 56px;
  position: fixed; /* keep navbar fixed to top */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: none; /* disable hide/show transform */
}

/* Prevent scripts from hiding the navbar via the .hidden class */
nav.hidden { transform: none !important; }

/* Ensure navbar remains visible and fixed when scrolling (override scripts) */
nav {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: translateY(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure page content doesn't sit beneath the fixed navbar */
body { padding-top: 56px; }

.nb {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--plum3);
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.nl { display: flex; gap: 2px; align-items: center; }

.nl a {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink2);
  text-decoration: none;
  padding: 5px 13px;
  border-radius: 30px;
  transition: all var(--tr);
  white-space: nowrap;
}

.nl a:hover { background: var(--lav); color: var(--plum2); transform: scale(1.05); }

.nl a.on {
  background: var(--lav);
  color: var(--plum2);
  font-weight: 500;
  box-shadow: inset 0 2px 8px rgba(107,95,160,0.2);
}

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  padding: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  transition: background var(--tr);
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 100%; height: 2px;
  background: var(--plum3);
  border-radius: 2px;
  transition: all 250ms ease;
  transform-origin: center;
}

.nav-toggle:hover { background: var(--lav); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ====== HERO ====== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 56px);
  max-width: 1200px;
  margin: 0px auto 0;
  padding: 2rem 3rem 4rem;
  gap: 4rem;
  align-items: center;
}

.h-left { padding-right: 2rem; }

.h-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plum);
  border: 1px solid var(--lav3);
  background: var(--lav);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 3px;
}

.h-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 72px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.75rem;
}

.h-name em { font-style: italic; color: var(--plum); }

.h-desc {
  font-size: 15px;
  color: var(--ink2);
  line-height: 1.75;
  max-width: 420px;
  margin-bottom: 2.5rem;
}

.h-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-a, .btn-b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--plum2);
  padding: 11px 24px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--tr);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.25);
  border-top: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-a:hover, .btn-b:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.4);
}

.h-right {
  display: flex;
  height: 90%;
  border: 3px solid #8A7FA8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(0,0,0,0.15);
  opacity: 0;
  animation: fadeSlideUp 1.2s cubic-bezier(0.2,0.8,0.2,1) forwards;
}

.h-right img { width: 100%; height: 100%; object-fit: cover; display: block; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== SHARED SECTION WRAPPER ====== */
.sec-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 3rem;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--lav3);
  padding-bottom: 1.25rem;
}

.sec-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  font-weight: 400;
  font-style: italic;
  color: var(--ink3);
}

.sec-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  font-weight:800;
  color: var(--ink3);
  letter-spacing: -0.01em;
}

.hidden { display: none !important; }

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(107,95,160,0.92);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--tr), transform var(--tr), background var(--tr);
  z-index: 1100;
}

.back-to-top:hover {
  background: #8259d3;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 720px) {
  .back-to-top {
    right: 1rem;
    bottom: 1rem;
    width: 42px;
    height: 42px;
  }
}

/* ====== EDUCATION TIMELINE ====== */

.edu-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 1.5rem;
}

/* Vertical line */
.edu-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: var(--border2);
}

/* Each row */
.edu-entry {
  display: flex;
  gap: 1.5rem;
  position: relative;
  padding-bottom: 2.5rem;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.edu-entry:last-child { padding-bottom: 0; }

.edu-entry.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Dot */
.edu-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--plum);
  border: 2px solid var(--parchment);
  box-shadow: 0 0 0 1.5px var(--plum);
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
  left: -1.5rem;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
              background 300ms ease,
              box-shadow 300ms ease;
}

.edu-entry:hover .edu-dot {
  transform: scale(1.4);
  background: var(--plum2);
  box-shadow: 0 0 0 2px var(--plum2), 0 0 10px rgba(107,95,160,0.35);
}

/* Content row: main left, period right */
.edu-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex: 1;
  margin-left: -0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  transition: background 300ms ease;
}

.edu-entry:hover .edu-content {
  background: rgba(232, 226, 245, 0.45);
}

.edu-content-main { flex: 1; }

/* Degree title */
.edu-degree {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.35rem;
  display: inline-block;
  transition: color 300ms ease;
}

.edu-entry:hover .edu-degree {
  color: var(--plum2);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--plum);
  text-decoration-thickness: 1.5px;
}

/* School + location */
.edu-school-line {
  font-size: 13px;
  margin-bottom: 0.65rem;
  line-height: 1.5;
}

.edu-school {
  font-weight: 600;
  color: var(--plum);
  transition: color 300ms ease;
}

.edu-entry:hover .edu-school { color: var(--plum2); }

.edu-location {
  color: var(--ink3);
  font-weight: 400;
}

/* Period — right aligned */
.edu-period {
  font-size: 12px;
  color: var(--ink3);
  white-space: nowrap;
  padding-top: 3px;
  flex-shrink: 0;
  font-style: italic;
}

.edu-period em {
  font-style: italic;
  color: var(--ink3);
}

/* Bullet list */
.edu-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edu-bullets li {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.55;
  padding-left: 1rem;
  position: relative;
}

.edu-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--plum);
  font-size: 12px;
}

/* Mobile */
@media (max-width: 768px) {
  .edu-content {
    flex-direction: column;
    gap: 0.4rem;
  }

  .edu-period {
    order: -1;
    padding-top: 0;
  }

  .edu-degree { font-size: 16px; }
}

/* ====== EXPERIENCE CARDS ====== */

.exp-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.exp-card {
  background: var(--parchment);
  border: 1.5px solid var(--ink3);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow 400ms cubic-bezier(0.4,0,0.2,1),
              border-color 400ms cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  --mx: 50%; --my: 50%;
}

/* Spotlight */
.exp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    220px circle at var(--mx) var(--my),
    var(--lav2) 0%,
    var(--lav) 45%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

.exp-card:hover::before { opacity: 1; }
.exp-card > * { position: relative; z-index: 1; }

.exp-card:hover {
  box-shadow: var(--sh2);
  border-color: var(--border2);
}

/* Active/highlighted card — purple */
/* .exp-card--active {
  background: var(--plum3);
  border-color: var(--plum2);
}

.exp-card--active::before {
  background: radial-gradient(
    220px circle at var(--mx) var(--my),
    rgba(255,255,255,0.08) 0%,
    rgba(255,255,255,0.03) 45%,
    transparent 100%
  );
} */

/* Top row: role + arrow */
.exp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.exp-card-role {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.exp-card--active .exp-card-role { color: #fff; }

.exp-card-company {
  font-size: 12px;
  font-weight: 500;
  color: var(--plum);
}

.exp-card--active .exp-card-company { color: var(--lav3); }

.exp-card-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--plum);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 300ms ease;
}

.exp-card:hover .exp-card-arrow { background: var(--plum2); }
.exp-card--active .exp-card-arrow { background: #f5a623; }

/* Meta: period + type badge */
.exp-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.exp-card-period {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  font-style: italic;
  color: var(--ink3);
}

.exp-card--active .exp-card-period { color: rgba(255,255,255,0.55); }

.exp-card-type {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--plum);
  background: var(--lav);
  border: 1px solid var(--lav2);
  padding: 2px 8px;
  border-radius: 100px;
}

.exp-card--active .exp-card-type {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
}

/* Description */
.exp-card-desc {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.65;
  flex: 1;
}

.exp-card--active .exp-card-desc { color: rgba(255,255,255,0.7); }

/* Tags */
.exp-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.exp-card-tags span {
  font-size: 10px;
  font-weight: 500;
  color: var(--plum);
  background: var(--lav);
  border: 1px solid var(--lav2);
  padding: 3px 9px;
  border-radius: 100px;
}

.exp-card--active .exp-card-tags span {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
}

/* Image */
.exp-card-img {
  display: flex;
  width: 80%;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink3);
}

.exp-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exp-card--active .exp-card-img { opacity: 0.85; }

/* Responsive */
@media (max-width: 1024px) {
  .exp-card-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .exp-card-grid { grid-template-columns: 1fr; }
}

/* Experience card entrance */
.exp-card {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 600ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 400ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.exp-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====== PROJECTS ====== */
.proj-bg {
  background: var(--parchment2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.proj-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 3rem;
}

.proj-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--lav);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 2rem;
}

.ptab {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink2);
  background: transparent;
  border: none;
  padding: 7px 18px;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--tr);
}

.ptab.on { background: var(--plum3); color: #fff; font-weight: 500; }
.ptab:not(.on):hover { background: var(--lav2); }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.proj-card {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: box-shadow 400ms ease, border-color 400ms ease;
}

.proj-card:hover {
  box-shadow: var(--sh2);
  border-color: var(--border2);
}

.proj-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.proj-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 400ms ease, transform 400ms ease;
}

.proj-card:hover .proj-img img {
  filter: blur(3px) brightness(0.5);
  transform: scale(1.04);
}

.proj-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--plum2);
  background: rgba(247,245,240,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 100px;
  z-index: 2;
  transition: opacity 300ms ease;
}

.proj-card:hover .proj-cat { opacity: 0; }

.proj-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 1.75rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease, transform 400ms ease;
  gap: 0.6rem;
}

.proj-card:hover .proj-overlay {
  opacity: 1;
  transform: translateY(0);
}

.proj-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0;
  line-height: 1.2;
}

.proj-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  line-height: 1.65;
  margin-bottom: 0;
}

.proj-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.proj-stack span {
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 2px 8px;
  border-radius: 100px;
}

/* Repo + Website buttons */
.proj-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.proj-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  text-decoration: none;
  transition: background 300ms ease,
              border-color 300ms ease,
              transform 300ms ease;
  background: rgba(255,255,255,0.9);
  color: var(--plum3);
  border: 1px solid rgba(255,255,255,0.9);
}

.proj-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.proj-btn--outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
}

.proj-btn--outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.8);
  transform: translateY(-1px);
}

.proj-card--text {
  background: var(--plum3);
  border-color: var(--plum2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  aspect-ratio: unset;
  height: auto;
  min-height: 280px;
}

.proj-card--text .proj-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  opacity: 1;
}

/* Keep cat visible — don't fade on hover */
.proj-card--text:hover .proj-cat { opacity: 1; }

.proj-card--text .proj-card-text-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.proj-card--text .proj-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}

.proj-card--text .proj-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.65;
  margin: 0;
}

.proj-card--text .proj-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.proj-card--text .proj-stack span {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 100px;
}

.proj-card--text .proj-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.proj-card--text .proj-btn {
  background: #fff;
  color: var(--plum3);
  border-color: #fff;
}

.proj-card--text .proj-btn:hover {
  background: var(--lav);
  transform: translateY(-1px);
}

.proj-card--text .proj-btn--outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.proj-card--text .proj-btn--outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.8);
  transform: translateY(-1px);
}

/* No image effects */
.proj-card--text:hover { border-color: var(--plum2); }
.proj-card--text:hover .proj-overlay { opacity: 0; }


/* Responsive */
@media (max-width: 1024px) {
  .proj-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .proj-grid { grid-template-columns: 1fr; }
  .proj-inner { padding: 3rem 1.25rem; }

  .proj-card {
    aspect-ratio: unset;
    height: 200px;
    width: 100%;
    /* margin-left: -2%;
    margin-right: -3%; */
  }

  .proj-title { font-size: 14px; }
  .proj-desc { font-size: 11px; }
  .proj-stack span { font-size: 9px; padding: 1.5px 6px; }
  .proj-btn { font-size: 9px; padding: 4px 10px; }

  .proj-card--text {
    aspect-ratio: unset;
    height: 30px;
    width: 100%;
    /* margin-left: -5%;
    margin-right: -5%; */
    font-size: 10px;
  }
  .proj-card--text .proj-title { font-size: 12px; }
  .proj-card--text .proj-desc { font-size: 10px; }
  .proj-card--text .proj-stack span { font-size: 8px; }
  .proj-card--text .proj-btns { flex-wrap: wrap; }
}

/* ====== GALLERY CAROUSEL ====== */

.gal-section {
  margin-bottom: 3rem;
  overflow: visible; /* ← critical */
}

.gal-section:last-child { margin-bottom: 0; }

.gal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.gal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 25px;
  font-weight: 500;
  font-style: italic;
  color: var(--plum3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gal-title::after {
  content: '';
  width: 60px;
  height: 1px;
  background: var(--ink3);
}

.gal-controls {
  display: flex;
  gap: 6px;
}

.gal-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--parchment);
  color: var(--ink2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 300ms ease,
              border-color 300ms ease,
              color 300ms ease,
              transform 300ms ease;
}

.gal-btn:hover {
  background: var(--lav);
  border-color: var(--border2);
  color: var(--plum2);
  transform: scale(1.05);
}

/* Scrollable track */
.gal-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 12px 8px 16px 8px; 
  cursor: grab;
  -webkit-overflow-scrolling: touch;
 
  -webkit-overflow-scrolling: touch;
}

.gal-track:active { cursor: grabbing; }
.gal-track::-webkit-scrollbar { display: none; }


.gal-item-wrap {
  flex-shrink: 0;
  border-radius: 12px;
  scroll-snap-align: start;
  filter: drop-shadow(0 0 10px rgba(107, 95, 160, 0.45));
  transition: filter 300ms ease, transform 300ms ease;
  isolation: isolate; 
}

.gal-item-wrap:hover {
  filter: drop-shadow(0 0 22px rgba(107, 95, 160, 0.75));
  transform: translateY(-4px);
}

.gal-item {
  position: relative;
  width: 290px;
  aspect-ratio: 7/6;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}

.gal-item img,
.gal-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}

.gal-item-wrap:hover .gal-item img,
.gal-item-wrap:hover .gal-item video {
  transform: scale(1.04);
}

/* Label overlay */
.gal-item-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1rem 0.85rem;
  background: linear-gradient(to top, rgba(51,45,85,0.75) 0%, transparent 100%);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.92);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.gal-item-wrap:hover .gal-item-label {
  opacity: 1;
  transform: translateY(0);
}

.gal-folder-bar {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--lav3);
}

.gal-folder-btn {
  position: relative;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--ink2);
  font-size: 0.78rem;
  font-family: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s;
}

.gal-folder-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--plum);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.gal-folder-btn:hover {
  color: rgba(255, 255, 255, 0.75);
}

.gal-folder-btn.active {
  color: var(--plum);
  font-weight: 500;
}

.gal-folder-btn.active::after {
  transform: scaleX(1);
}

/* Mobile */
@media (max-width: 768px) {
  .gal-item {
    width: 220px;
    aspect-ratio: 4/5;
  }
  .gal-section-head { flex-wrap: wrap; gap: 0.75rem; }
}

/* ====== LIGHTBOX ====== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20, 15, 35, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transform: scale(0.92);
  transition: transform 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox.open .lightbox-content {
  transform: scale(1);
}

.lightbox-content img,
.lightbox-content video {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  display: block;
}

.lightbox-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 300ms ease, transform 300ms ease;
  z-index: 10000;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(90deg);
}

/* ====== HOBBIES & INTERESTS SECTION ====== */

.hob-categories {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ===== CATEGORY CARD ===== */
.hob-category {
  background: rgba(255, 255, 255, 0.04);

  border: 1px solid #d9cdf7;

  border-radius: 22px;

  padding: 1.75rem;

  display: flex;
  flex-direction: column;
  gap: 1.25rem;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Category header */
.hob-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hob-cat-icon {
  width: 34px;
  height: 34px;

  border-radius: 10px;

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid #d9cdf7;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--plum, #7b61d1);

  flex-shrink: 0;
}

.hob-cat-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.hob-cat-desc {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.6;
  margin: 0;
}

/* ===== LOGOS ===== */
.hob-logo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hob-logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hob-logo {
  width: 54px;
  height: 54px;

  border-radius: 16px;

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid #d9cdf7;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hob-logo img {
  width: 50%;
  height: 50%;
  object-fit: contain;
}

.hob-logo-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink2);
  text-align: center;
  max-width: 65px;
  line-height: 1.3;
}

/* ===== TAGS ===== */
.hob-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hob-tag {
  display: inline-flex;
  align-items: center;

  padding: 6px 14px;

  background: rgba(255, 255, 255, 0.04);

  border: 1px solid #d9cdf7;

  border-radius: 999px;

  font-size: 12px;
  font-weight: 500;

  color: var(--plum2, #6b5fa0);

  white-space: nowrap;
}

/* ===== LINKS ===== */
.hob-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hob-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 7px 14px;

  background: rgba(255, 255, 255, 0.04);

  border: 1px solid #d9cdf7;

  border-radius: 12px;

  font-size: 12px;
  font-weight: 500;

  color: var(--plum2, #6b5fa0);

  text-decoration: none;
}

/* Favorite artists line */
.hob-fav {
  font-size: 12px;
  color: var(--ink2);
  line-height: 1.7;
  margin: 0;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {

  .hob-category {
    padding: 1.3rem;
    border-radius: 18px;
  }

  .hob-cat-title {
    font-size: 20px;
  }

  .hob-logo {
    width: 48px;
    height: 48px;
  }

  .hob-logo-name {
    font-size: 10px;
  }
}

@media (max-width: 480px) {

  .hob-logo {
    width: 44px;
    height: 44px;
  }

  .hob-tag {
    font-size: 11px;
    padding: 5px 11px;
  }

  .hob-cat-title {
    font-size: 18px;
  }
}

/* ====== CONTACT ====== */
.contact-bg {
  background: #9B8EC7;
}

.contact-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.c-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 44px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

.c-title em { font-style: italic; color: var(--plum2); }

.c-sub { font-size: 14px; color: var(--ink2); line-height: 1.75; margin-bottom: 2rem; }

.c-links { display: flex; flex-direction: column; gap: 8px; }

.c-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
  color: var(--ink2);
  font-size: 14px;
  transition: all var(--tr);
}

.c-link:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); transform: translateY(-1px); }
.c-link-ico { color: var(--ink2); flex-shrink: 0; }
.c-link-lbl { font-size: 11px; color: var(--ink2); }

.c-form-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink2);
  display: block;
  margin-bottom: 7px;
  margin-top: 1rem;
}

.c-form-label:first-child { margin-top: 0; }

.c-form-input, .c-form-ta {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  background: rgba(255,255,255,0.07);
  color: var(--ink2);
  border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 7px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
  margin-bottom: 0;
}

.c-form-input::placeholder, .c-form-ta::placeholder { color: var(--ink2); }
.c-form-input:focus, .c-form-ta:focus { border-color: var(--lav3); box-shadow: 0 0 0 3px rgba(191,180,232,0.15); }
.c-form-ta { min-height: 110px; resize: none; }

.c-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 1.25rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  color: var(--plum3);
  border: none;
  border-radius: 7px;
  padding: 13px;
  cursor: pointer;
  transition: all var(--tr);
}

.c-btn:hover { background: var(--lav); transform: scale(1.01); }

/* ====== FOOTER ====== */
footer {
  background: #9B8EC7;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 2rem 1.5rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink2);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  transition: color 300ms ease,
              background 300ms ease,
              border-color 300ms ease,
              transform 300ms ease;
}

.footer-links a:hover {
  color: var(--plum2);
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-3px);
}

.footer-copy {
  font-size: 15px;
  color: var(--ink2);
}
/* ====== TABLET (max 1024px) ====== */
@media (max-width: 1024px) {
  .sec-wrap, .proj-inner, .contact-inner { padding: 4rem 2rem; }
  .hero { gap: 2rem; padding: 2rem 2rem 3rem; }
  .h-name { font-size: 56px; }
  .h-desc { max-width: 100%; }
  .h-right { min-height: 360px; }
  .edu-wrap { grid-template-columns: 1fr 1fr; }
  .proj-grid { grid-template-columns: 1fr 1fr; }
  .hob-grid { grid-template-columns: 1fr 1fr; }
  .contact-inner { gap: 3rem; }
  .c-title { font-size: 38px; }
  .gal-grid-graphic { grid-template-columns: repeat(2, 1fr); }
}

/* ====== MOBILE (max 768px) ====== */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  body {
    background-attachment: scroll;
  }

  /* Nav */
  nav {
    padding: 0 1.25rem;
    height: 56px;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .nl {
    display: none;
    position: fixed;
    top: 56px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: rgba(247,245,240,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    padding: 0.75rem 1rem;
    z-index: 999;
  }

  nav.open .nl { display: flex; }

  .nl a {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 10px;
    width: 100%;
  }

  .nav-toggle { display: flex; }

  /* Hero */
  .hero {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding: 1.5rem 1.25rem 3rem;
    margin-top: 56px;
    min-height: auto;
    width: 100%;
  }

  .h-left { padding-right: 0; }

  .h-right {
    order: -1;
    height: auto;
    min-height: 240px;
    max-height: 360px;
    width: 100%;
  }

  .h-name { font-size: 40px; margin-bottom: 1rem; }
  .h-eyebrow { font-size: 10px; }
  .h-desc { font-size: 14px; max-width: 100%; margin-bottom: 1.5rem; }
  .h-btns { flex-direction: column; width: 100%; }
  .btn-a, .btn-b { justify-content: center; width: 100%; }

  /* Sections */
  .sec-wrap, .proj-inner, .contact-inner {
    padding: 3rem 1.25rem;
    width: 100%;
  }

  .sec-title { font-size: 30px; }

  /* Education */
  .edu-wrap { grid-template-columns: 1fr; }

  /* Experience */
  .exp-list { width: 100%; }
  .exp-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.25rem;
  }
  .exp-meta { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
  .exp-arrow { display: none; }

  /* Projects */
  .proj-grid { grid-template-columns: 1fr; }
  .proj-tabs { width: 100%; }
  .ptab { flex: 1; text-align: center; }

  /* Gallery */
  .gal-grid-photo { grid-template-columns: 1fr 1fr; }
  .gi-lg { grid-row: span 1; aspect-ratio: 7/6; }
  .gal-grid-graphic { grid-template-columns: 1fr 1fr; }

  /* Hobbies */
  .hob-grid { grid-template-columns: 1fr 1fr; }

  /* Contact */
  .contact-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .c-title { font-size: 32px; }
  .c-sub { max-width: 100%; }
  .c-btn { width: 100%; justify-content: center; }
}

/* ====== SMALL PHONES (max 480px) ====== */
@media (max-width: 480px) {
  .h-name { font-size: 34px; }
  .hob-grid { grid-template-columns: 1fr; }
  .gal-grid-photo { grid-template-columns: 1fr; }
  .gal-grid-graphic { grid-template-columns: 1fr 1fr; }
  .sec-title { font-size: 26px; }
  .c-title { font-size: 28px; }
}

/* ====== PRINT STYLES ====== */
@media print {
  /* Hide interactive/non-content UI */
  nav, .nav-toggle, .back-to-top,
  .gal-controls, .gal-folder-bar,
  .lightbox, #emailModal,
  .c-form-label, .c-form-input, .c-form-ta, .c-btn,
  .proj-tabs {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 12px;
  }

  /* Force all sections/content to be visible regardless of JS state */
  .hidden,
  #personal.hidden,
  .gal-item-wrap,
  .edu-entry,
  .exp-card,
  .proj-card,
  .proj-overlay {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    filter: none !important;
    position: static !important;
  }

  /* Show BOTH project tabs stacked, with labels */
  #school, #personal {
    display: block !important;
  }
  #personal::before {
    content: "Personal Projects";
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 600;
    margin: 2rem 0 1rem;
    page-break-before: always;
  }

  /* Project grid -> simple stacked/wrapping layout */
  .proj-grid {
    display: block !important;
  }
  .proj-card {
    aspect-ratio: unset !important;
    height: auto !important;
    width: 100% !important;
    margin-bottom: 1.5rem;
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
  }
  .proj-img {
    position: static !important;
    width: 100% !important;
    height: 220px !important;
  }
  .proj-overlay {
    position: static !important;
    background: #fff !important;
    padding: 1rem !important;
  }
  .proj-title, .proj-desc, .proj-stack span {
    color: #1C1625 !important;
  }
  .proj-stack span {
    background: #EFECF4 !important;
    border: 1px solid #ccc !important;
  }
  .proj-btn, .proj-btn--outline {
    color: #4E4580 !important;
    border: 1px solid #ccc !important;
    background: #fff !important;
  }

  /* Galleries: turn horizontal carousels into wrapping grids */
  .gal-track {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
    gap: 12px;
    padding: 0 !important;
  }
  .gal-item-wrap {
    filter: none !important;
    width: 200px;
    page-break-inside: avoid;
  }
  .gal-item {
    width: 200px !important;
    height: 180px !important;
    aspect-ratio: unset !important;
  }
  .gal-item-label {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    background: none !important;
    color: #4A4060 !important;
    padding: 0.4rem 0 !important;
    font-size: 10px;
  }

  /* Experience cards: full width, no spotlight effects */
  .exp-card-grid {
    display: block !important;
  }
  .exp-card {
    width: 100% !important;
    margin-bottom: 1rem;
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
  }
  .exp-card::before { display: none !important; }
  .exp-card-img { border: 1px solid #ccc !important; }

  /* Hobbies grid -> simple flow */
  .hob-logo, .hob-tag, .hob-link {
    border: 1px solid #ccc !important;
    background: #fff !important;
  }

  /* Avoid breaking inside key blocks */
  .edu-entry, .gal-section, .hob-category {
    page-break-inside: avoid;
  }

  /* Section spacing tighter for print */
  .sec-wrap, .proj-inner, .contact-inner {
    padding: 1.5rem 0 !important;
    max-width: 100% !important;
  }

  /* Contact: drop the form entirely, keep links */
  .contact-inner {
    display: block !important;
  }
}