:root {
  color-scheme: dark;
  --bg: #05050c;
  --bg-2: #0d0730;
  --panel: rgba(15, 20, 49, 0.72);
  --panel-strong: rgba(20, 25, 65, 0.9);
  --line: rgba(135, 154, 255, 0.26);
  --line-strong: rgba(111, 124, 255, 0.58);
  --text: #f7f8ff;
  --muted: #b8bdd5;
  --soft: #7f86a8;
  --blue: #15a7ff;
  --violet: #7080ff;
  --cyan: #40e1ff;
  --green: #53f0bc;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 5%, rgba(112, 128, 255, 0.28), transparent 34rem),
    radial-gradient(circle at 78% 15%, rgba(21, 167, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 75% 80%, rgba(87, 22, 175, 0.48), transparent 34rem),
    linear-gradient(135deg, #030305 0%, #050615 42%, #16002e 100%);
  user-select: none;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

img,
video {
  max-width: 100%;
  display: block;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

.cursor-glow {
  position: fixed;
  width: 12rem;
  height: 12rem;
  border-radius: 999px;
  pointer-events: none;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(64, 225, 255, 0.07), transparent 70%);
  filter: blur(14px);
  z-index: 0;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1360px, calc(100% - 104px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: calc(100vw - 32px);
  gap: 9px;
  padding: 7px;
  margin: 10px auto 0;
  border: 1px solid rgba(135, 154, 255, 0.34);
  border-radius: 22px;
  background: rgba(5, 6, 20, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  transition: transform 240ms ease, opacity 240ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.site-header:hover,
.site-header:focus-within {
  transform: scale(1.01);
  border-color: var(--line-strong);
  box-shadow: 0 24px 80px rgba(21, 167, 255, 0.2);
}

.site-header.is-hidden {
  transform: translateY(-140%);
  opacity: 0;
  pointer-events: none;
}

.brand,
.header-action,
.desktop-nav a,
.primary-button,
.ghost-button,
.pdf-pill {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand {
  gap: 10px;
  padding: 6px;
  font-weight: 800;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  box-shadow: 0 0 28px rgba(21, 167, 255, 0.35);
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.desktop-nav a,
.header-action,
.ghost-button,
.pdf-pill {
  gap: 8px;
  padding: 0 12px 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.94rem;
  transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.nav-icon {
  width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(112, 128, 255, 0.38), rgba(21, 167, 255, 0.24));
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.nav-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.desktop-nav a:hover,
.desktop-nav a.is-traveling,
.header-action:hover,
.ghost-button:hover,
.pdf-pill:hover {
  transform: scale(1.045);
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(112, 128, 255, 0.16);
}

.section,
.hero {
  padding: 96px 0 0;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  align-items: center;
  gap: 40px;
  min-height: calc(100vh - 100px);
}

.eyebrow,
.project-label {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(112, 128, 255, 0.12);
  color: #dce2ff;
  font-size: 0.86rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin: 24px 0;
  font-size: clamp(3rem, 7.1vw, 5.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.profile-hero h1 {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

h1 span {
  display: block;
}

.hero-lead {
  max-width: 900px;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.75;
  text-align: justify;
  text-align-last: left;
}

.summary-label {
  margin: 0 0 10px;
  color: var(--cyan);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.contact-label {
  margin: 24px 0 10px;
}

.hero-actions,
.tag-row,
.quick-stats,
.pdf-certs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 32px;
}

.primary-button {
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  font-weight: 800;
  box-shadow: 0 18px 44px rgba(21, 167, 255, 0.28);
}

.quick-stats {
  margin-top: 36px;
}

.stat-card,
.skill-card,
.timeline-item,
.contact-card,
.hero-console,
.project-feature,
.project-card,
.certificate-card,
.media-card,
.shot {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hover-pop {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.hover-pop:hover,
.hover-pop:focus-visible {
  transform: scale(1.025);
  border-color: var(--line-strong);
  box-shadow: 0 28px 92px rgba(21, 167, 255, 0.23);
}

.stat-card {
  width: min(210px, 100%);
  min-height: 118px;
  padding: 20px;
  border-radius: 22px;
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.7rem;
}

.stat-card span,
.signal-list span,
.project-card p,
.skill-card p,
.timeline-item p,
.contact-section p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-console {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: 30px;
}

.hero-console::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(120deg, rgba(112, 128, 255, 0.22), transparent 36%, rgba(21, 167, 255, 0.14));
  pointer-events: none;
}

.console-top,
.identity-panel,
.signal-list {
  position: relative;
}

.console-top {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.console-top span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--blue);
}

.console-top span:nth-child(2) {
  background: var(--violet);
}

.console-top span:nth-child(3) {
  background: var(--green);
}

.identity-panel {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.2);
}

.identity-panel img {
  aspect-ratio: 1;
  object-fit: contain;
}

.identity-panel p {
  margin-bottom: 4px;
  color: var(--soft);
  font-weight: 700;
}

.identity-panel h2 {
  margin-bottom: 0;
  font-size: 1.7rem;
}

.signal-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.signal-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.signal-list strong {
  text-align: right;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.story-section .section-heading {
  max-width: none;
}

.project-section .section-heading {
  max-width: none;
}

.project-section .section-heading p,
.project-section .section-heading h2 {
  text-align: center;
}

.project-section .section-heading p {
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}

.pyramid-title {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.pyramid-title span {
  display: block;
}

.section-heading p {
  margin-bottom: 12px;
  color: var(--cyan);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.section-heading h2,
.contact-section h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.perpy-section .section-heading h2,
.ease-section .section-heading h2 {
  font-size: clamp(2rem, 4.3vw, 3.35rem);
}

.perpy-section .section-heading h2 {
  margin-top: 14px;
}

.project-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(300px, 1.14fr);
  gap: 24px;
  padding: 24px;
  border-radius: 28px;
}

.project-copy {
  align-self: center;
  padding: 12px;
}

.project-copy h3,
.project-card h3,
.skill-card h3,
.timeline-item h3 {
  margin: 14px 0 10px;
  font-size: 1.55rem;
}

.justified-title,
.project-card h3,
.reference-card p {
  text-align: justify;
  text-align-last: left;
}

.project-copy p {
  color: var(--muted);
  line-height: 1.8;
  text-align: justify;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(21, 167, 255, 0.1);
  color: #d8e6ff;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-row .tag-break {
  flex-basis: 100%;
  width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.media-card,
.shot,
.certificate-card {
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  color: var(--text);
}

.media-card {
  position: relative;
  min-height: 310px;
  border-radius: 24px;
}

.media-card img {
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
}

.media-card span,
.certificate-card span {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
  font-weight: 800;
}

.project-grid,
.skill-board,
.certificate-grid {
  display: grid;
  gap: 18px;
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.project-card,
.skill-card,
.timeline-item {
  padding: 22px;
  border-radius: 24px;
}

.project-card video,
.terminal-mini {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #060816;
  object-fit: cover;
}

.perpy-video-frame {
  width: min(300px, 100%);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #050713;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
}

.project-card .perpy-video-frame video {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #050713;
  object-fit: contain;
  object-position: center;
}

.project-card .perpy-video-frame video:fullscreen {
  object-fit: contain;
}

.terminal-mini {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 22px;
}

.terminal-mini span {
  color: var(--green);
  font-weight: 900;
  font-size: 1.5rem;
}

.terminal-mini code {
  color: var(--muted);
  white-space: normal;
}

.screenshot-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.shot {
  aspect-ratio: 16 / 10;
  border-radius: 18px;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skill-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item span {
  color: var(--cyan);
  font-weight: 900;
}

.certificate-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.certificate-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
}

.certificate-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdf-certs {
  margin-top: 18px;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: center;
  padding-bottom: 96px;
}

.contact-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 24px;
}

.hero-contact.contact-card {
  max-width: 560px;
  margin-top: 0;
  user-select: text;
}

.contact-card a,
.contact-card span {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  user-select: text;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.contact-card a:hover,
.contact-card span:hover {
  transform: scale(1.025);
  border-color: var(--line-strong);
  background: rgba(112, 128, 255, 0.14);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
}

.modal-panel {
  position: relative;
  width: min(1120px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 18px 62px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: rgba(8, 10, 27, 0.96);
  box-shadow: var(--shadow);
}

.modal-panel h2 {
  margin: 0 110px 14px 4px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.modal-nav {
  display: none;
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  z-index: 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.modal.has-gallery .modal-nav {
  display: grid;
}

.modal-nav-button {
  width: 46px;
  height: 46px;
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 167, 255, 0.12);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(12px);
}

.modal-close.hover-pop:hover,
.modal-close.hover-pop:focus-visible,
.modal-nav-button.hover-pop:hover,
.modal-nav-button.hover-pop:focus-visible {
  transform: scale(1.006);
  border-color: var(--line-strong);
  box-shadow: 0 12px 34px rgba(21, 167, 255, 0.13);
}

.modal-nav-next {
  justify-self: end;
}

.modal-nav-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-body img,
.modal-body video {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 16px;
  background: #02030a;
}

@media (max-width: 980px) {
  .section-grid,
  .project-feature,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .project-grid,
  .skill-board,
  .certificate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screenshot-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 22px, 1180px);
  }

  .site-header {
    border-radius: 18px;
  }

  .brand span:last-child {
    display: none;
  }

  h1 {
    font-size: clamp(2.6rem, 18vw, 4.1rem);
  }

  .section,
  .hero {
    padding-top: 72px;
  }

  .quick-stats,
  .project-grid,
  .skill-board,
  .certificate-grid,
  .screenshot-strip {
    grid-template-columns: 1fr;
  }

  .quick-stats {
    display: grid;
  }

  .stat-card {
    width: 100%;
  }

  .identity-panel {
    grid-template-columns: 72px 1fr;
  }

  .signal-list div {
    display: grid;
    gap: 4px;
  }

  .signal-list strong {
    text-align: left;
  }
}

.profile-hero h1 {
  max-width: 780px;
}

.profile-hero {
  align-items: start;
  min-height: calc(100vh - 180px);
}

.portrait-stack {
  display: grid;
  gap: 16px;
  margin-top: 0;
  padding: 14px;
  border-radius: 30px;
}

.portrait-main,
.photo-tile,
.publication-preview,
.ease-login-preview,
.gallery-card {
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0;
  overflow: hidden;
}

.portrait-main {
  border-radius: 26px;
  width: min(390px, 100%);
  justify-self: end;
  aspect-ratio: 1;
}

.portrait-main img,
.photo-tile img,
.publication-preview img,
.ease-login-preview img,
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ease-login-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  background: #f4f6fb;
}

.ease-login-preview img {
  object-fit: contain;
}

.portrait-grid {
  width: min(430px, 100%);
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.photo-tile {
  border-radius: 20px;
  aspect-ratio: 1;
}

.story-section {
  padding-top: 40px;
}

.story-section,
#skills,
#certificates,
.references-section {
  margin-top: 88px;
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 0%, rgba(64, 225, 255, 0.09), transparent 28rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.022));
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.story-section:hover,
#skills:hover,
#certificates:hover,
.references-section:hover {
  transform: scale(1.006);
  border-color: var(--line-strong);
  box-shadow: 0 28px 92px rgba(21, 167, 255, 0.16);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.story-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.story-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.story-card img:hover {
  transform: scale(1.025);
  border-color: var(--line-strong);
  box-shadow: 0 20px 64px rgba(21, 167, 255, 0.18);
}

.story-card img.valedictorian-photo {
  object-position: center 18%;
}

.story-card h3 {
  margin: 16px 0 8px;
}

.story-card p {
  color: var(--muted);
  line-height: 1.7;
}

.story-card a,
.section-link,
.mini-link {
  width: fit-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 167, 255, 0.1);
  color: #dfe9ff;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-row a {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.link-row a:hover,
.link-row a:focus-visible {
  transform: scale(1.075);
  border-color: var(--line-strong);
  background: rgba(112, 128, 255, 0.18);
  box-shadow: 0 16px 48px rgba(21, 167, 255, 0.18);
}

.story-card > a:hover,
.story-card > a:focus-visible {
  transform: scale(1.075);
  border-color: var(--line-strong);
  background: rgba(112, 128, 255, 0.18);
  box-shadow: 0 16px 48px rgba(21, 167, 255, 0.18);
}

.perpy-section .project-card:first-child > div:last-child {
  margin-top: 18px;
}

.contact-section {
  grid-template-columns: 1fr;
  text-align: center;
}

.contact-section p {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.project-section {
  margin-top: 88px;
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 0%, rgba(64, 225, 255, 0.11), transparent 28rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.022));
  box-shadow: var(--shadow);
}

.perpy-section {
  background:
    radial-gradient(circle at 80% 10%, rgba(83, 240, 188, 0.14), transparent 28rem),
    linear-gradient(145deg, rgba(16, 31, 46, 0.72), rgba(9, 8, 24, 0.8));
}

.ease-section {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 210, 88, 0.11), transparent 26rem),
    linear-gradient(145deg, rgba(35, 28, 20, 0.62), rgba(6, 8, 22, 0.84));
}

.project-grid-wide {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.publication-card {
  display: grid;
  gap: 18px;
}

.publication-preview {
  width: 100%;
  border-radius: 20px;
  aspect-ratio: 4 / 3;
}

.publication-preview img {
  object-fit: contain;
  background: #f4f6fb;
}

.ordered-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.gallery-card {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 18px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

.gallery-card span {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
}

.mode-toolbar strong,
.mode-toolbar span {
  display: block;
}

.mode-toolbar span {
  margin-top: 4px;
  color: var(--muted);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-weight: 900;
}

.toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.cert-grid-expanded {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.certificate-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}

.certificate-shell .certificate-card {
  width: 100%;
  border: 0;
  border-radius: 0;
  aspect-ratio: 4 / 3;
  background: #f3f6fb;
}

.certificate-shell .certificate-card img {
  object-fit: contain;
}

.certificate-meta {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.certificate-meta strong {
  line-height: 1.35;
  text-align: justify;
  text-align-last: left;
}

.certificate-meta span {
  color: var(--cyan);
  font-weight: 800;
}

.references-section .section-heading {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.references-section .section-heading h2 {
  text-align: center;
}

.references-section .section-heading p {
  text-align: left;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.reference-card {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.reference-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.reference-card p {
  margin: 0;
  color: var(--muted);
}

.reference-card span {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 167, 255, 0.09);
  color: #dfe9ff;
  user-select: text;
}

.mini-link {
  min-height: 34px;
  font-size: 0.78rem;
}

.section-link {
  margin-top: 18px;
}

.story-card p,
.project-card p,
.contact-section p,
.skill-card p,
.reference-card p {
  text-align: justify;
}

.project-section {
  position: relative;
}

.project-top-link {
  position: absolute;
  top: 34px;
  right: 34px;
  margin-top: 0;
}

.portrait-stack .contact-label {
  justify-self: stretch;
  margin: 10px 0 0;
}

.portrait-stack .hero-contact.contact-card {
  width: min(360px, 28vw);
  justify-self: end;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
}

.portrait-stack .contact-card span {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.perpy-section .publication-preview {
  width: min(300px, 100%);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
}

.perpy-section .publication-preview img,
.ease-section .publication-preview img,
.ease-section .ease-login-preview img {
  object-fit: cover;
  object-position: top center;
  background: #f4f6fb;
}

.cert-grid-expanded .certificate-shell.is-extra {
  display: none;
}

.cert-grid-expanded.is-expanded .certificate-shell.is-extra {
  display: block;
}

.profile-hero.section-grid {
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 28px;
  min-height: calc(100vh - 220px);
  padding-top: 52px;
}

.portrait-stack {
  width: fit-content;
  justify-self: end;
  padding: 10px;
  margin-top: 0;
}

.portrait-main {
  width: min(360px, 30vw);
}

.story-section .section-heading h2,
#skills .section-heading h2,
#certificates .section-heading h2,
.contact-section h2 {
  text-align: center;
}

.story-section .section-heading,
#skills .section-heading,
#certificates .section-heading,
.contact-section > div:first-child {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.ordered-gallery .gallery-card.is-extra {
  display: none;
}

.ordered-gallery.is-expanded .gallery-card.is-extra {
  display: block;
}

.show-more-button {
  grid-column: 1 / -1;
  width: fit-content;
  min-height: 44px;
  justify-self: center;
  margin-top: 4px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 167, 255, 0.12);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.back-to-top {
  width: fit-content;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px auto 0;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 167, 255, 0.12);
  color: var(--text);
  font-weight: 900;
}

.back-to-top.is-returning {
  transform: translateY(-8px) scale(1.025);
  border-color: var(--line-strong);
  box-shadow: 0 20px 64px rgba(21, 167, 255, 0.2);
}

.contact-section p {
  text-align: center;
}

.ease-section .project-card:first-child > div:last-child {
  margin-top: 18px;
}

.ease-section .publication-preview img {
  object-position: center 31%;
}

.ease-section .ease-login-preview img {
  object-position: center 36%;
}

.perpy-gallery .gallery-card img {
  object-fit: contain;
  object-position: center 8%;
  background: #050713;
}

.project-copy .tag-row,
.project-card .tag-row {
  justify-content: space-between;
  width: 100%;
}

.panelcrusher-section .project-copy .tag-row {
  justify-content: center;
}

.ease-section .project-card .tag-row {
  justify-content: center;
}

.project-section {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-section:hover {
  transform: scale(1.006);
  border-color: var(--line-strong);
  box-shadow: 0 28px 92px rgba(21, 167, 255, 0.16);
}

.perpy-video-frame {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.perpy-video-frame:hover {
  transform: scale(1.025);
  border-color: var(--line-strong);
  box-shadow: 0 22px 70px rgba(21, 167, 255, 0.18);
}

@media (max-width: 980px) {
  .story-grid,
  .cert-grid-expanded,
  .ordered-gallery,
  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-grid-wide {
    grid-template-columns: 1fr;
  }

  .project-section {
    padding: 28px;
  }
}

@media (max-width: 620px) {
  .story-grid,
  .cert-grid-expanded,
  .ordered-gallery,
  .reference-grid {
    grid-template-columns: 1fr;
  }

  .project-section {
    padding: 20px;
    border-radius: 24px;
  }

  .mode-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Responsive hardening for phones, tablets, and narrow browser windows. */
.section,
.hero,
.project-section,
.story-section,
#skills,
#certificates,
.references-section,
.project-feature,
.project-card,
.story-card,
.skill-card,
.reference-card,
.certificate-shell,
.contact-card,
.mode-toolbar {
  min-width: 0;
}

h1,
h2,
h3,
p,
a,
span,
strong {
  overflow-wrap: anywhere;
}

.desktop-nav {
  max-width: 100%;
}

@media (max-width: 980px) {
  .page-shell {
    width: min(100% - 48px, 1360px);
  }

  .site-header {
    width: min(100%, calc(100vw - 24px));
    overflow: hidden;
  }

  .desktop-nav {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  .desktop-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .profile-hero.section-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .hero-copy,
  .portrait-stack {
    width: min(100%, 760px);
    justify-self: center;
  }

  .portrait-stack .hero-contact.contact-card,
  .portrait-main {
    width: min(100%, 420px);
    justify-self: center;
  }

  .project-top-link {
    position: static;
    margin-top: 18px;
  }

  .project-feature {
    grid-template-columns: 1fr;
  }

  .tag-row {
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 28px, 1360px);
  }

  .section,
  .hero {
    padding-top: 64px;
  }

  .story-section,
  #skills,
  #certificates,
  .references-section,
  .project-section {
    margin-top: 48px;
    padding: 20px;
    border-radius: 24px;
  }

  .section-heading h2,
  .contact-section h2,
  .perpy-section .section-heading h2,
  .ease-section .section-heading h2 {
    font-size: clamp(1.75rem, 10vw, 2.7rem);
    line-height: 1.08;
  }

  h1 {
    font-size: clamp(2.65rem, 17vw, 4.2rem);
  }

  .project-copy h3,
  .project-card h3,
  .skill-card h3,
  .timeline-item h3 {
    font-size: clamp(1.15rem, 6vw, 1.45rem);
    line-height: 1.18;
  }

  .hero-lead,
  .project-copy p,
  .project-card p,
  .story-card p,
  .skill-card p,
  .reference-card p,
  .contact-section p {
    font-size: 0.96rem;
    line-height: 1.65;
  }

  .project-grid,
  .skill-board,
  .certificate-grid,
  .story-grid,
  .reference-grid,
  .ordered-gallery {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 10px;
  }

  .modal-panel {
    padding: 14px 46px;
    border-radius: 18px;
  }

  .modal-close {
    position: static;
    width: fit-content;
    margin: 0 0 10px auto;
  }

  .modal-panel h2 {
    margin: 0 0 12px;
    font-size: 1.2rem;
  }

  .modal-nav {
    left: 6px;
    right: 6px;
  }

  .modal-nav-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }
}
