:root {
  --background: #dfe7ef;
  --primary: #111111;
  --secondary: #1f1f1f;
  --text: #111111;
  --dim-text: #2b2b2b;
  --border: rgba(0, 0, 0, 0.12);
  --glass-bg: linear-gradient(140deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.18) 100%);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  --glass-blur: 16px;
  --bg-image: url("images/background.png");
  --content-max: 1100px;
  --content-pad: 16px;
  --sidebar-width: 270px;
  --topbar-height: 64px;
}

body {
  font-family: 'Cormorant Garamond', serif;
  background: var(--background);
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  margin: 0;
  padding: 0;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, rgba(226, 236, 245, 0.88), rgba(210, 230, 240, 0.72));
  z-index: -1;
}

.profile-name, h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--text);
}

.section-title-primary { 
  color: var(--primary); 
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.15);
}
.section-title-tight { margin-bottom: -0.6rem; }
.section-title-leadership { margin-top: 1.5rem; margin-bottom: -0.8rem; }

.page-shell {
  padding-bottom: 40px;
}

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0 24px;
  text-align: center;
}

.hero-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(4.5rem, 14vw, 11rem);
  letter-spacing: 0.01em;
  color: var(--primary);
  margin: 0;
}

.hero-subtitle,
.hero-hint {
  margin: 12px 0 0 0;
}
.hero-subtitle {
  font-size: clamp(1.2rem, 2.8vw, 2rem);
  color: rgba(17, 17, 17, 0.8);
}
.hero-hint {
  font-size: 1.1rem;
  color: rgba(17, 17, 17, 0.45);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.hero-hint.show {
  opacity: 1;
  transform: translateY(0);
}

.topbar {
  --topbar-inner-width: min(var(--content-max), calc(100% - (var(--content-pad) * 2)));
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--topbar-mask-height);
  transform: translateY(-140%);
  opacity: 0;
  pointer-events: none;
  transition: none;
  z-index: 20;
  will-change: transform, opacity;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Opacity gradient: 0 from left edge to topbar-inner start, opaque on topbar-inner, 0 from topbar-inner end to right edge; 0 at top then full opacity from 22% down */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(120deg, rgba(226, 236, 245, 0.88), rgba(210, 230, 240, 0.72));
  mask-image:
    linear-gradient(to right, transparent 0, black calc(50% - var(--topbar-inner-width) / 2), black calc(50% + var(--topbar-inner-width) / 2), transparent 100%),
    linear-gradient(to bottom, transparent 0, transparent 22%, black 100%);
  mask-size: 100% 100%;
  mask-position: 0 0;
  mask-composite: intersect;
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, black calc(50% - var(--topbar-inner-width) / 2), black calc(50% + var(--topbar-inner-width) / 2), transparent 100%),
    linear-gradient(to bottom, transparent 0, transparent 22%, black 100%);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-position: 0 0;
  -webkit-mask-composite: source-in;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28), 0 0 12px rgba(0, 0, 0, 0.25);
}

.topbar-inner {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 12px 0 10px;
  width: var(--topbar-inner-width);
}

.container {
  display: grid;
  grid-template-columns: minmax(240px, var(--sidebar-width)) minmax(0, 1fr);
  gap: 32px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 20px) var(--content-pad) 0;
  align-items: start;
}

header {
  background: transparent;
  border-color: transparent;
}

/* Left Sticky Profile Sidebar (no card chrome – inner items are cards) */
.profile {
  border-radius: 28px;
  padding: 28px 22px 30px 22px;
  min-width: 240px;
  max-width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  text-align: center;
  position: sticky;
  top: calc(var(--topbar-height) + 20px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  transform: translateX(-120%);
  opacity: 0;
  transition: none;
  will-change: transform, opacity;
}

.profile-name {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 5px 0 10px 0;
  letter-spacing: -1.5px;
}

.profile-pic {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  border: 2px solid rgba(17, 17, 17, 0.1);
  display: block;
  align-self: center;
}

.subtitle-badge {
  display: inline-block;
  background: rgba(17, 17, 17, 0.1);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 24px 6px 24px;
  margin-bottom: 22px;
  margin-top: 10px;
}

.profile-contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-align: left;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  cursor: pointer;
  position: relative;
  color: var(--text);
  border-radius: 18px;
  font-family: 'Cormorant Garamond', serif;
}

.contact-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.1);
}

a.contact-item {
  text-decoration: none;
  color: inherit;
}

.icon-box {
  min-width: 40px;
  height: 40px;
  background: rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-box svg {
  stroke: var(--primary);
  color: var(--primary);
  fill: none;
}

.contact-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.03em;
  margin-bottom: 2px;
  font-family: 'Cormorant Garamond', serif;
}

.contact-info-text {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 400;
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 10em;
}

.not-link {
  cursor: default;
}

/* Right Main Content */
.main-content {
  flex: 1;
  border-radius: 24px;
  padding: 32px 32px 24px 32px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transform: translateX(48px);
  opacity: 0;
  transition: none;
  will-change: transform, opacity;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 24px;
  width: 100%;
  border-bottom: none;
  margin-bottom: 0;
  justify-content: center;
}

.tab {
  border: none;
  outline: none;
  padding: 10px 22px;
  font-size: 1.05rem;
  cursor: pointer;
  color: rgba(17, 17, 17, 0.7);
  border-radius: 999px;
  transition: box-shadow 0.2s ease, color 0.2s ease;
  font-weight: 600;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  backdrop-filter: blur(6px);
  background: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.tab:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.4);
  outline-offset: 2px;
}
.tab:hover,
.tab.active {
  color: var(--primary);
  text-shadow: 0 0 30px rgba(0, 0, 0, 0.22);
}
.tab.active { font-weight: 700; }

/* Tab Content */
.tab-content {
  display: none;
  animation: fadeIn 0.5s;
}
.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

/* Footer */
footer {
  text-align: center;
  margin: 40px 0 24px 0;
  color: rgba(17, 17, 17, 0.7);
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 900px) {
  :root {
    --topbar-height: 78px;
  }
  .container {
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
  }
  .profile {
    width: 100%;
    max-width: var(--sidebar-width);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 18px;
    padding: 18px 18px 12px 18px;
    position: relative;
    top: 0;
    max-height: none;
    transform: translateY(16px);
  }
  .topbar-inner {
    border-radius: 0;
    padding: 18px var(--content-pad) 12px;
  }
  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    gap: 10px 16px;
  }
  .tab {
    padding: 8px 12px;
    font-size: 0.95rem;
    width: 100%;
    max-width: 140px;
  }
  .profile-pic {
    width: 90px;
    height: 90px;
    margin-right: 18px;
    margin-bottom: 18px;
  }
  .main-content {
    padding: 20px 10px;
  }
  .timeline-pill{
    white-space: normal !important;
  }
}

@media (max-width: 600px) {
  .profile, .main-content {
    border-radius: 0;
    box-shadow: none;
    padding: 12px 4vw;
  }
  .container {
    padding: calc(var(--topbar-height) + 16px) 12px 0;
  }
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 1.5rem;
}

.project-card {
  position: relative;
  display: block;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.project-card:hover {
  transform: translateY(-2px);
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.project-overlay {
  position: static;
  background: transparent;
  padding: 12px 14px 14px 14px;
}

.project-overlay h3 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.project-overlay p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--dim-text);
  opacity: 1;
}

/* Keyboard focus (shared with back-button) */
.project-card:focus-visible,
.back-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245,176,65,0.22);
}

/* Responsive: single column on small screens */
@media (max-width: 800px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Remove default link underline for project tiles */
.project-card,
.project-card:link,
.project-card:visited,
.project-card:hover,
.project-card:active {
  text-decoration: none;
  color: inherit;
}

/* Make sure inner text never gets underlined on hover */
.project-card h3,
.project-card p {
  text-decoration: none;
}

/* Timeline */
.timeline {
  position: relative;
  margin: 2.5rem 0 0 0;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.timeline-card {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 22px;
  min-height: 120px;
  padding: 1.2rem 1.7rem 1.7rem 3.7rem;
  z-index: 1;
}

.timeline-dot {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: rgba(17, 17, 17, 0.08);
  border: 3px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--border);
  z-index: 2;
}

.timeline-card-content {
  width: 100%;
}

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 0.7rem;
}

.timeline-card li > b,
.timeline-card p > b {
  color: var(--secondary);
}

.timeline-pill {
  margin-left: auto; /* For fallback */
  background: rgba(17, 17, 17, 0.08);
  color: var(--primary);
  border-radius: 10px;
  padding: 5px 18px 4px 18px;
  font-weight: 600;
  font-size: 1.08rem;
  display: inline-block;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.timeline-card-header h3 {
  font-size: 1.2rem;
  font-weight: 900;
  margin: 0;
  color: var(--primary);
}

.timeline-card ul {
  margin: 0.7rem 0 0 0;
  padding-left: 1.2em;
  font-size: 1.02rem;
  color: var(--text);
  list-style: none;
}

.timeline-card ul li {
  margin: 0.6em 0;
  line-height: 1.5;
  list-style-type: disc;
}

@media (max-width: 700px) {
  .timeline {
    max-width: 100%;
    padding-left: 0;
  }
  .timeline-card {
    padding-left: 2.7rem;
  }
  .timeline-dot {
    left: 6px;
  }
}

.copy-popup {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: #111111;
  color: #f5f5f5;
  padding: 12px 26px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.28s;
}
.copy-popup.show {
  opacity: 1;
}

.position-title {
  display: block;
  margin-top: -5px;
  margin-bottom: 1rem;
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--primary);
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.01em;
}

/* One-card layout for the project detail */
.project-detail {
  border-radius: 22px;
  padding: 18px;
  display: grid;
  gap: 16px;
}

/* Make inner sections transparent so it reads as one card */
.project-detail-header,
.project-detail-bullets,
.project-detail-demo {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* Soft separators between sections (not after the last one) */
.project-detail > .project-detail-header,
.project-detail > .project-detail-bullets {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.project-detail > .project-detail-demo { padding-top: 4px; }

.back-button {
  width: 90px;
  align-self: start;
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.4);
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.back-button .back-btn-line { margin-top: 2.5px; }
.back-button svg { stroke: var(--primary); }
.back-button:hover {
  border-color: rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.02);
}

/* Keep header layout + polish image inside the single card */
.project-detail-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .project-detail-header { grid-template-columns: 1fr; }
}

.project-detail-image {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 0 30px rgba(0,0,0,0.15);
}

.project-detail-meta h2 {
  margin: 0 0 4px 0;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 6px #18182433;
  text-wrap: balance;
}

.project-title-link,
.project-title-text {
  display: inline-block;
}

.project-title-link {
  color: inherit;
  position: relative;
  cursor: pointer;
}

.project-title-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.project-title-link:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.4);
  outline-offset: 2px;
}

.project-detail-meta {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}
.project-detail-meta-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  align-self: start;
}
.project-detail-meta-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: end;
  position: relative;
  bottom: 0;
}

.project-role { opacity: 0.92; color: var(--text); margin-bottom: 6px; }
.project-tech { opacity: 0.9; color: var(--dim-text); font-size: 1rem; }

/* Bullets & demo content harmonized */
.project-detail-bullets ul {
  margin: 6px 0 0 1rem;
  padding: 0;
  list-style: disc;
  color: var(--text);
}
.project-detail-bullets li { margin: 6px 0; }

.project-detail-demo h3 {
  margin: 2px 0 10px 0;
  color: var(--primary);
  font-size: 1.1rem;
}

/* Video container (glass applied via block below) */
.video-embed,
.video-placeholder {
  border-radius: 16px;
  overflow: hidden;
}
.video-embed { aspect-ratio: 16 / 9; max-width: 900px; }
.video-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-placeholder { opacity: 0.85; padding: 18px; color: var(--dim-text); max-width: 900px; }


/* ===== About Me layout ===== */
#aboutme .about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin-top: 8px;
}
#aboutme .about-card {
  border-radius: 18px;
  padding: 18px 20px;
}
#aboutme .about-card h3.subsection-subtitle {
  margin: 0 0 10px 0;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.5rem;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.02em;
}

/* Make the overview span the row; its paragraphs can sit in 2 cols */
#aboutme .about-overview {
  grid-column: 1 / -1; /* full width top row */
}
#about-description {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

/* Groups card can stretch if needed */
#aboutme .about-groups {
  grid-column: 1 / -1; /* full width bottom row on desktop */
}

/* Groups list spacing */
#groups-list {
  margin: 6px 0 0 1rem;
  padding: 0;
  list-style: disc;
  font-size: 1.15rem;
  font-family: 'Cormorant Garamond', serif;
}
#groups-list li { margin: 4px 0; line-height: 1.4; }

/* Inline label alignment for Skills/Interests */
#aboutme p {
  margin: 6px 0;
  line-height: 1.6;
  font-size: 1.15rem;
  font-family: 'Cormorant Garamond', serif;
}
#aboutme p strong {
  display: inline-block;
  min-width: 90px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 900px) {
  #aboutme .about-grid {
    grid-template-columns: 1fr; /* stack */
  }
  #about-description {
    grid-template-columns: 1fr; /* paragraphs stack */
  }
  #aboutme .about-groups {
    grid-column: auto;
  }
}

/* Glass effect for inner cards only (profile and main-content stay transparent) */
.contact-item,
.project-card,
.timeline-card,
.project-detail,
#aboutme .about-card,
.video-embed,
.video-placeholder {
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}