/* Shared portfolio language: liquid yellow / violet / cyan, quiet reading surfaces. */
:root {
  --ds-gold: #ecb602;
  --ds-yellow: #ffd524;
  --ds-purple: #55185d;
  --ds-deep-purple: #290849;
  --ds-cyan: #9dd7d1;
  --ds-surface: #100d14;
  --ds-surface-raised: #19151f;
  --ds-radius: 24px;
  --ds-radius-small: 16px;
  --ds-radius-mobile: 18px;
  --ds-text: #efedf1;
  --ds-muted: #b4afbb;
  --ds-line: rgba(239,237,241,.17);
  --ds-reading: 60ch;
  --ds-role-title-size: clamp(26px, 3vw, 42px);
  --ds-role-title-weight: 700;
  --ds-role-title-leading: 1.2;
  --ds-role-title-tracking: -.035em;
  --ds-section-space: clamp(72px, 10vw, 144px);
  --ds-heading: clamp(42px, 6.2vw, 96px);
  --ds-ease: cubic-bezier(.16,1,.3,1);
}
:is([data-page="home"], [data-page="works"]) {
  background: var(--ds-surface);
  color-scheme: dark;
  --display: var(--body);
  --hero-yellow: var(--ds-yellow);
  --portfolio-surface: var(--ds-surface);
  --portfolio-text: var(--ds-text);
  --portfolio-muted: var(--ds-muted);
  --portfolio-line: var(--ds-line);
  --portfolio-heading: var(--ds-heading);
  --paper: var(--ds-surface);
  --muted: var(--ds-muted);
  --line: var(--ds-line);
}
/* Finish the material in exactly the next section's surface color. */
[data-page="home"] .role-home { background: var(--ds-surface); }
[data-page="home"] .role-home::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: clamp(160px, 28svh, 320px);
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--ds-surface));
}
[data-page="home"] :is(.about-section, .experience-section) {
  --portfolio-surface: var(--ds-surface);
  --portfolio-text: var(--ds-text);
  --portfolio-muted: var(--ds-muted);
  --portfolio-line: var(--ds-line);
  --paper: var(--ds-surface);
  --muted: var(--ds-muted);
  --line: var(--ds-line);
  position: relative;
  background: var(--ds-surface);
  color: var(--ds-text);
  color-scheme: dark;
  padding-block: var(--ds-section-space);
}
[data-page="home"] .about-section {
  padding-top: clamp(16px, 3vw, 48px);
  /* A still, low-contrast remnant of the hero's violet reflection. */
  background: radial-gradient(ellipse at 90% 0%, rgba(85,24,93,.11), transparent 48%), var(--ds-surface);
}
:is([data-page="home"], [data-page="works"]) .section-heading {
  font: 400 .8125rem/1.5 var(--body);
  letter-spacing: .015em;
  text-transform: none;
  color: var(--ds-muted);
  border-color: var(--ds-line);
}
[data-page="home"] :is(.about-section, .experience-section) .section-heading > span {
  border-left: 0;
  padding-left: 0;
}
[data-page="home"] :is(.about-section > #about-title, .experience-section .section-statement, .education-block .education-title),
[data-page="works"] .works-intro h1 {
  font-family: var(--body);
  font-size: var(--ds-heading);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -.05em;
  text-transform: none;
  color: var(--ds-text);
  margin-bottom: 36px;
}
[data-page="home"] .about-overview {
  grid-template-columns: minmax(0,1.35fr) minmax(0,.75fr);
  gap: clamp(40px, 7vw, 112px);
  margin-top: clamp(36px, 5vw, 64px);
}
[data-page="home"] .about-intro { max-width: var(--ds-reading); }
[data-page="home"] .about-intro p,
[data-page="home"] .experience-highlights {
  color: var(--ds-text);
  font: 400 clamp(17px, 1.45vw, 20px)/1.75 var(--body);
  letter-spacing: -.01em;
  max-width: var(--ds-reading);
}
[data-page="home"] :is(.about-keyword, .experience-keyword) { color: inherit; font-weight: 600; }
[data-page="home"] .about-section .about-quote { border-left-color: var(--ds-purple); padding-left: 24px; }
[data-page="home"] .about-quote p { color: var(--ds-muted); }
[data-page="home"] .about-traits { gap: 12px; margin-top: 32px; }
[data-page="home"] .about-traits span { border-color: var(--ds-line); color: var(--ds-muted); padding: 8px 12px; }
[data-page="home"] .about-section .about-reference {
  background: transparent;
  border: 0;
  padding: 24px 0 0;
  align-self: start;
  color: var(--ds-text);
}
[data-page="home"] .about-section .about-reference .education-block h4 {
  color: var(--ds-text);
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.035em;
}
[data-page="home"] .about-reference :is(.small-heading, .education-entry-meta p, .education-gpa) { color: var(--ds-muted); }
[data-page="home"] .about-reference .education-programs p { color: var(--ds-text); }
[data-page="home"] .experience-layout { gap: clamp(36px, 6vw, 96px); margin-top: 0; }
[data-page="home"] .experience-item { border-color: var(--ds-line); margin-bottom: 48px; padding-bottom: 48px; }
[data-page="home"] .experience-item h3 {
  color: var(--ds-text);
  font: var(--ds-role-title-weight) var(--ds-role-title-size)/var(--ds-role-title-leading) var(--body);
  letter-spacing: var(--ds-role-title-tracking);
  text-transform: none;
}
[data-page="home"] :is(.experience-meta, .experience-skills) { color: var(--ds-muted); }
[data-page="home"] .experience-highlights li::marker { color: var(--ds-muted); }
[data-page="home"] .experience-company { color: var(--ds-text); }
:is([data-page="home"], [data-page="works"]) .site-footer {
  background: var(--ds-surface);
  color: var(--ds-text);
  border-top: 1px solid var(--ds-line);
}
:is([data-page="home"], [data-page="works"]) :is(.footer-email, .footer-links, .footer-links a) { color: var(--ds-text); }
:is([data-page="home"], [data-page="works"]) a:hover { text-decoration-color: var(--ds-yellow); }
[data-page="home"] :is(.about-section, .experience-section) :focus-visible { outline: 2px solid var(--ds-yellow); outline-offset: 5px; }
[data-page="home"] :is(.about-section, .experience-section) ::selection { background: var(--ds-yellow); color: var(--ds-surface); }
@media (max-width: 760px) {
  [data-page="home"] :is(.about-overview, .experience-layout) { grid-template-columns: minmax(0,1fr); gap: 40px; }
  [data-page="home"] .about-reference { max-width: var(--ds-reading); }
  [data-page="home"] :is(.about-section > #about-title, .experience-section .section-statement, .education-block .education-title) { margin-bottom: 24px; }
  [data-page="home"] .about-section { padding-bottom: 32px; }
  [data-page="home"] .experience-section { padding-top: 32px; }
  [data-page="home"] .experience-section { padding-bottom: 40px; }
  [data-page="home"] .experience-item:last-child { margin-bottom: 0; padding-bottom: 0; }
  [data-page="home"] .about-reference .education-entry-meta { margin: 16px 0 12px; }
  [data-page="home"] .about-reference .education-block h4 { margin: 0 0 16px; }
  [data-page="home"] .about-reference .education-programs p { margin: 0 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-page="home"] .role-home::after { transition: none; }
}

/* Override the earlier light-theme selectors at the same scope. */
[data-page="home"] .about-section .about-main .section-statement { color: var(--ds-text); }
[data-page="home"] .about-section .about-keyword { color: inherit; }

.hero-contact-links { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: baseline; }
.hero-contact-links a { padding-block: 4px; text-underline-offset: 5px; }
.hero-contact-links a:hover { text-decoration: underline; }
[data-page="home"] .home-selected-works {
  background: var(--ds-surface);
  color: var(--ds-text);
  padding-block: var(--ds-section-space);
  min-width: 0;
}
.home-selected-works .project-carousel { margin-top: clamp(32px, 5vw, 64px); min-width: 0; }
.home-selected-works .carousel-track { gap: 24px; padding: 0; scrollbar-width: none; cursor: grab; }
.home-selected-works .carousel-track::-webkit-scrollbar { display: none; }
.home-selected-works .carousel-card { flex: 0 0 100%; scroll-snap-stop: always; }
.home-selected-works .project-thumbnail { aspect-ratio: 16 / 10; height: auto; background: #17131c; border-color: var(--ds-line); cursor: inherit; }
.home-selected-works .project-thumbnail img { object-fit: contain; }
.home-selected-works .carousel-card-caption { justify-content: space-between; padding-block: 20px; color: var(--ds-text); }
.home-selected-works .carousel-card-caption h3 { margin: 0; font: 400 clamp(24px, 3vw, 36px)/1.2 var(--body); letter-spacing: -.035em; }
.home-selected-works .carousel-card-caption time { color: var(--ds-muted); font-size: .875rem; }
.home-selected-works .carousel-track:focus-visible { outline: 2px solid var(--ds-yellow); outline-offset: 6px; }
.home-selected-works .carousel-track.is-dragging { cursor: grabbing; }

/* About heading sits above both columns, centered within the section. */
[data-page="home"] .about-section > #about-title { text-align: center; margin-inline: auto; }

/* Bring consecutive experience records closer after removing their metadata. */
[data-page="home"] .experience-item:not(:last-child) { padding-bottom: 24px; margin-bottom: 24px; }
[data-page="home"] .experience-item:not(:last-child) > .experience-highlights { margin-bottom: 0; }

/* Names roll upward through one clipped line; hover reveals the underline. */
[data-page="home"] #about-title .about-name { position: relative; overflow: visible; }
[data-page="home"] #about-title .about-name-trigger {
  appearance: none;
  display: inline-grid;
  overflow: hidden;
  vertical-align: baseline;
  padding: 0;
  margin: 0;
  border: 0;
  /* A rounded clipping box would shave the underline caps at the bottom edge. */
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  cursor: pointer;
  user-select: none;
}
/* Reserve the widest alias so the centered greeting never changes width. */
[data-page="home"] #about-title .about-name-sizer {
  grid-area: 1 / 1;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
}
[data-page="home"] #about-title .about-name-face {
  display: inline-block;
  white-space: nowrap;
  grid-area: 1 / 1;
  justify-self: start;
  position: relative;
  text-decoration: none;
}
[data-page="home"] #about-title .about-name-face::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
}
[data-page="home"] #about-title .about-name-trigger:is(:hover, :focus-visible) .about-name-face::after { opacity: 1; }
[data-page="home"] #about-title .about-name-trigger:focus-visible { outline: 2px solid var(--ds-yellow); outline-offset: 6px; }


/* Experience uses a full-width paper surface between two dark sections. */
[data-page="home"] .experience-section {
  --ds-surface: #100d14;
  --ds-text: #efedf1;
  --ds-muted: #b4afbb;
  --ds-line: rgba(239,237,241,.17);
  --portfolio-surface: var(--ds-surface);
  --portfolio-text: var(--ds-text);
  --portfolio-muted: var(--ds-muted);
  --portfolio-line: var(--ds-line);
  --paper: var(--ds-surface);
  --muted: var(--ds-muted);
  --line: var(--ds-line);
  width: 100%;
  max-width: none;
  margin-inline: 0;
  border-radius: 0;
  padding-block: clamp(48px, 7vw, 96px);
  background: var(--ds-surface);
  color: var(--ds-text);
  color-scheme: dark;
}

[data-page="home"] .experience-layout { gap: 24px; }
[data-page="home"] .experience-layout > #experience-title { margin-bottom: 0; }
[data-page="home"] .experience-layout > #experience-title { text-align: center; }
[data-page="home"] .experience-item:last-child { margin-bottom: 0; padding-bottom: 0; }
[data-page="home"] .experience-item:last-child .experience-highlights { margin-bottom: 0; }
[data-page="home"] .experience-section { padding-bottom: clamp(40px, 6vw, 80px); }
[data-page="home"] :is(.education-block .education-title, #experience-title, .experience-item h3) { font-weight: 700; }
[data-page="home"] .about-overview { grid-template-columns: minmax(0, 1fr); gap: clamp(100px, 12vw, 160px); }
[data-page="home"] .about-intro { margin-inline: auto; text-align: center; }
[data-page="home"] .about-section .about-reference { justify-self: stretch; width: 100%; max-width: none; padding-top: 0; }
[data-page="home"] .education-block .education-title { text-align: center; }

/* Section titles share the viewport center; reading-width limits apply only to copy. */
[data-page="home"] .education-details { width: 100%; max-width: var(--ds-reading); }
[data-page="home"] .experience-layout { grid-template-columns: minmax(0, 1fr); }
[data-page="home"] .home-showcase-title {
  font: 400 var(--ds-heading)/1.06 var(--body);
  letter-spacing: -.05em;
  text-transform: none;
  color: var(--ds-text);
}
[data-page="home"] :is(.education-title, #experience-title, .home-showcase-title) {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  justify-self: stretch;
  text-align: center;
}
