/* =========================================================
   Nethuselah Bunag — Portfolio
   Design system: warm off-white canvas, near-black ink,
   confident blue accent. Space Grotesk (display) + Inter
   (body + labels/utility). Max 2 font families.
   ========================================================= */

:root{
  /* Color */
  --canvas: #FAFAF8;
  --canvas-alt: #F1EFEA;
  --surface: #FFFFFF;
  --ink: #14171C;
  --body: #4B5160;
  --muted: #5B6472;
  --hairline: #E4E2DC;
  --hairline-strong: #C9C6BE;
  --accent: #3452FF;
  --accent-ink: #FFFFFF;
  --accent-soft: #E9ECFF;
  --status: #1FAE7A;
  --dark: #14171C;
  --dark-soft: #1C2027;
  --on-dark: #F5F4F0;
  --on-dark-muted: #9BA0AC;

  /* Type */
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "Inter", system-ui, -apple-system, sans-serif;

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

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20,23,28,.06);
  --shadow-md: 0 8px 24px rgba(20,23,28,.08);
  --shadow-lg: 0 24px 64px rgba(20,23,28,.14);

  --max: 1180px;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *, *::before, *::after{ animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

body{
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

ul{ margin: 0; padding: 0; list-style: none; }

h1,h2,h3{ font-family: var(--font-display); color: var(--ink); margin: 0; letter-spacing: -0.02em; }

p{ margin: 0; }

::selection{ background: var(--ink); color: var(--canvas); }

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link{
  position: absolute; left: -9999px; top: auto;
  background: var(--ink); color: var(--on-dark);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm);
  z-index: 999;
}

.skip-link:focus{ left: var(--sp-4); top: var(--sp-4); }

.mono-label{
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow{
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-4);
}

.status-dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--status);
  box-shadow: 0 0 0 3px rgba(31,174,122,.18);
  flex: none;
}

/* =========================
   Buttons
   ========================= */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 14px 24px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
  white-space: nowrap;
}

.btn-sm{ padding: 10px 18px; font-size: 14px; }

.btn-primary{
  background: var(--ink);
  color: var(--canvas);
}

.btn-primary:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-ghost{
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.btn-ghost:hover{ border-color: var(--ink); transform: translateY(-2px); }

/* =========================
   Nav
   ========================= */

.nav{
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,248,.82);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner{
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.nav-mark{
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}

.nav-logo{
  width: auto;
  height: 32px;
  display: block;
  flex: none;
  filter: drop-shadow(0 1px 2px rgba(20,23,28,.18));
}

.nav-mark-text{ font-size: 15px; }

@media (max-width: 860px){ .nav-mark-text{ display:none; } }

.nav-links{
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  font-size: 14px;
  font-weight: 500;
}

.nav-links a{ color: var(--body); transition: color .15s ease; position: relative; }

.nav-links a:not(.nav-cta):hover{ color: var(--ink); }

.nav-cta{
  background: var(--ink);
  color: var(--canvas) !important;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  transition: transform .15s ease, box-shadow .15s ease;
}

.nav-cta:hover{ transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  padding: 0;
}

.nav-toggle span{
  display: block; height: 2px; width: 22px;
  background: var(--ink); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.nav-mobile{
  display: none;
  flex-direction: column;
  padding: var(--sp-2) var(--sp-5) var(--sp-5);
  border-top: 1px solid var(--hairline);
}

.nav-mobile a{
  padding: var(--sp-3) 0;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
}

.nav-mobile.open{ display: flex; }

@media (max-width: 860px){
  .nav-links{ display: none; }
  .nav-toggle{ display: flex; }
}

/* =========================
   Layout helpers
   ========================= */

.section{ padding: var(--sp-10) var(--sp-5); scroll-margin-top: 84px; }

.section-alt{ background: var(--canvas-alt); }

.section-inner{ max-width: var(--max); margin: 0 auto; }

.section-head{ max-width: 640px; margin-bottom: var(--sp-8); }

.section-head h2{
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

.section-lede{ margin-top: var(--sp-3); color: var(--body); font-size: 17px; }

@media (max-width: 640px){
  .section{ padding: var(--sp-8) var(--sp-4); }
  .section-head{ margin-bottom: var(--sp-6); }
}

/* =========================
   Hero
   ========================= */

.hero{ padding: var(--sp-8) var(--sp-5) var(--sp-9); scroll-margin-top: 0; }

.hero-inner{
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-7);
}

.hero-copy{
  min-width: 0;
  opacity: 0;
  animation: hero-rise .5s cubic-bezier(.16,.8,.24,1) forwards;
}

.hero-copy .badge{
  display: inline-flex;
  margin-top: var(--sp-5);
}

.badge.badge-outline{
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--body);
}

/* --photo-w = portrait width. The photo and the glow both use it, so they stay in proportion. */
.hero-photo-wrap{
  --photo-w: 380px;
  position: relative;
  isolation: isolate;
  opacity: 0;
  animation: hero-rise .5s cubic-bezier(.16,.8,.24,1) .12s forwards;
  display: flex;
  justify-content: flex-start;
  flex-shrink: 0;
}

@keyframes hero-rise{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

.hero-name{
  font-size: clamp(40px, 6.4vw, 76px);
  line-height: .98;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-role{
  margin-top: var(--sp-4);
  font-family: var(--font-mono);
  font-size: clamp(15px, 2vw, 18px);
  color: var(--accent);
  font-weight: 500;
}

.hero-role-sep{ color: var(--hairline-strong); margin: 0 4px; }

.hero-intro{
  margin-top: var(--sp-5);
  font-size: 18px;
  color: var(--body);
  max-width: 46ch;
}

.hero-actions{
  margin-top: var(--sp-7);
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.hero-links{
  margin-top: var(--sp-7);
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.hero-link{
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--body);
  transition: color .15s ease;
}

.hero-link .icon-github, .hero-link .icon-email{ width: 18px; height: 18px; display: block; flex: none; object-fit: contain; }

.hero-link .icon-linkedin{ width: 18px; height: 18px; display: block; flex: none; object-fit: contain; }

.hero-link:hover{ color: var(--ink); }

/* Portrait: no border, no card corners, natural proportions (height: auto), soft real shadow */
.hero-photo{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--photo-w);
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(20, 23, 28, .10)) drop-shadow(0 18px 28px rgba(20, 23, 28, .14));
}

/* Soft three-color glow behind the portrait: no panel, no hard edges.
   Each blob fades to transparent exactly at the box edge. */
.hero-photo-glow{
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: calc(var(--photo-w) * 1.12);
  height: calc(var(--photo-w) * 1.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
  background:
    radial-gradient(38% 30% at 38% 34%, #C7D2FE 0%, rgba(199, 210, 254, 0) 100%),
    radial-gradient(36% 32% at 64% 36%, #E9D5FF 0%, rgba(233, 213, 255, 0) 100%),
    radial-gradient(50% 28% at 50% 72%, #FFE4D6 0%, rgba(255, 228, 214, 0) 100%);
}

@media (max-width: 940px){
  .hero{ padding-top: 36px; }
  .hero-inner{ flex-direction: column; align-items: stretch; gap: var(--sp-6); }
  .hero-photo-wrap{ order: -1; justify-content: center; --photo-w: clamp(220px, 55vw, 250px); }
}

/* =========================
   About
   ========================= */

.about-grid{
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--sp-9);
}

.about-grid .section-head{ margin-bottom: 0; }

.about-body p{ margin-bottom: var(--sp-4); font-size: 17px; }

.about-meta{
  margin-top: var(--sp-6);
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.about-meta-item{ display: flex; flex-direction: column; gap: 4px; }

.about-meta-item span:last-child{ font-weight: 600; color: var(--ink); }

@media (max-width: 860px){
  .about-grid{ grid-template-columns: 1fr; gap: var(--sp-5); }
}

/* =========================
   Skills
   ========================= */

.skills-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--sp-4);
}

.skill-card{
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: border-color .18s ease, transform .18s ease;
}

.skill-card:hover{ border-color: var(--hairline-strong); transform: translateY(-3px); }

.skill-card h3{
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.skill-card h3 .mono-label{ margin: 0; }

.tag-list{ display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.tag-list li{
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  background: var(--canvas-alt);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  color: var(--ink);
}

.section-alt .tag-list li{ background: var(--surface); }

/* =========================
   Projects
   ========================= */

.project-list{
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.project-card{
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: var(--sp-8);
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.project-visual{
  background: var(--canvas-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-7);
}

.project-visual-image{
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-md);
}

.project-visual-window{
  width: 100%;
  max-width: 340px;
  background: var(--dark);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  box-shadow: var(--shadow-md);
}

.terminal-bar{ display: flex; gap: 6px; margin-bottom: var(--sp-3); }

.terminal-bar span{ width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.18); }

.project-visual-body .mono-label{ color: var(--on-dark-muted); margin-bottom: var(--sp-3); display: block; }

.project-visual-lines{ display: grid; gap: 10px; }

.project-visual-lines span{
  display: block; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(52,82,255,.55), rgba(31,174,122,.4));
}

.project-info{ padding: var(--sp-7) var(--sp-7) var(--sp-7) 0; }

.project-info h3{ font-size: 26px; margin: var(--sp-2) 0 var(--sp-4); }

.project-info > p{ font-size: 16px; margin-bottom: var(--sp-6); }

.project-features ul{ display: grid; gap: var(--sp-2); margin-top: var(--sp-3); }

.project-features li{
  font-size: 15px; color: var(--body);
  padding-left: var(--sp-5); position: relative;
}

.project-features li::before{
  content: ""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

.project-features{ margin-bottom: var(--sp-6); }

.project-stack{ margin-bottom: var(--sp-6); }

.project-stack .tag-list{ margin-top: var(--sp-3); }

.projects-note{
  margin-top: var(--sp-6);
  font-size: 14px;
  color: var(--muted);
}

.projects-note a{ color: var(--accent); font-weight: 600; }

.projects-note a:hover{ text-decoration: underline; }

@media (max-width: 860px){
  .project-card{ grid-template-columns: 1fr; }
  .project-info{ padding: var(--sp-6); }
  .project-visual{ padding: var(--sp-6); }
}

/* =========================
   Projects - flip cards
   ========================= */
.flip-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: var(--sp-6);
}

/* Outer card: gives the 3D depth */
.flip-card{
  position: relative;
  perspective: 1400px;
}

/* Inner element: this is what rotates. It fills the whole card.
   Front and back share ONE grid cell, so both faces have the same size
   and the taller one sets the card height (no fixed height, nothing cut off). */
.flip-inner{
  position: relative;
  display: grid;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.4, .2, .2, 1);
}

.flip-card.is-flipped .flip-inner{ transform: rotateY(180deg); }

/* Both faces: full card area, own padding, hidden when facing away */
.flip-face{
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-back{ transform: rotateY(180deg); }

/* ----- Front face ----- */
.flip-front{ text-align: center; }

/* Whole screenshot visible: natural aspect ratio, no crop, no zoom, no stretch */
.flip-image{
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  margin-bottom: var(--sp-5);
}

.flip-front h3{
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  margin-bottom: var(--sp-3);
}
.flip-front p{ font-size: 15px; margin-bottom: var(--sp-5); }

/* "Learn More →" is a plain text link: no background, border, padding or pill shape.
   The underline is always there but transparent, so it fades in on hover. */
.learn-more{
  margin-top: auto;
  align-self: center;
  padding: 0;
  background: none;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s ease;
}

.learn-more:hover{ text-decoration-color: currentColor; }

/* ----- Back face -----
   Content flows from the top with small, controlled spacing (same density as the front).
   Any extra card height stays empty at the BOTTOM instead of being spread between items. */
.flip-back{ justify-content: flex-start; }

/* Small "← Back" button at the upper-left of the back face.
   fit-content = only as wide as its text, never full width. */
.back-button{
  align-self: flex-start;
  flex: none;
  width: fit-content;
  margin: 0 0 16px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  background: var(--canvas-alt);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease;
}

.back-button:hover{ background: var(--hairline); border-color: var(--hairline-strong); }

.flip-back h3{
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  text-align: center;
}

.flip-back > p{ margin: 0 0 16px; font-size: 15px; }

.flip-back .project-features{ margin: 0 0 16px; }
.flip-back .project-features ul{ margin-top: 0; }

.flip-back .project-stack{ margin: 0 0 18px; }

/* Action button(s) sit right under the tags (not pushed to the bottom) */
.flip-actions{ display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: 0; }

@media (max-width: 540px){
  .flip-face{ padding: var(--sp-5); }
}

/* =========================
   Learning
   ========================= */

.learning-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--sp-4);
}

.learning-card{
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}

.learning-card h3{
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  margin: var(--sp-2) 0 var(--sp-3);
}

.learning-card p{ font-size: 15px; }

/* =========================
   Certificates
   ========================= */

.cert-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--sp-5);
}

.cert-card{
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.cert-thumb{
  position: relative;
  display: block;
  background: var(--canvas-alt);
  border-bottom: 1px solid var(--hairline);
}

.cert-thumb img{
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top center;
  transition: transform .3s ease;
}

.cert-thumb:hover img{ transform: scale(1.03); }

.cert-thumb-hint{
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  background: rgba(20,23,28,.82);
  color: var(--on-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}

.cert-thumb:hover .cert-thumb-hint,
.cert-thumb:focus-visible .cert-thumb-hint{ opacity: 1; transform: translateY(0); }

.cert-card-body{ padding: var(--sp-6); }

.cert-card-top{
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  color: var(--accent);
}

.cert-card-top .icon-certificate{ width: 26px; height: 26px; flex: none; display: block; object-fit: contain; }

.cert-card h3{
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  margin-bottom: var(--sp-2);
}

.cert-theme{ font-size: 15px; font-style: italic; color: var(--body); margin-bottom: var(--sp-5); }

.cert-meta{ display: flex; gap: var(--sp-7); flex-wrap: wrap; }

.cert-meta dt{ font-family: var(--font-mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

.cert-meta dd{ margin: 2px 0 0; font-weight: 600; color: var(--ink); font-size: 14px; }

.cert-note{ margin-top: var(--sp-5); font-size: 14px; color: var(--muted); }

/* Certificate thumbnail is now a <button>: reset the browser's button look */
button.cert-thumb{
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: zoom-in;
}

/* =========================
   Certificates - lightbox
   ========================= */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 16, .88);
  overscroll-behavior: contain;
}

.lightbox-image{
  flex: none;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  max-height: 90dvh;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}

.lightbox-close{
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  transition: background-color .18s ease;
}

.lightbox-close:hover{ background: rgba(255, 255, 255, .24); }

/* Fade the dark background and scale the certificate slightly */
.lightbox-enter-active,
.lightbox-leave-active{ transition: opacity .25s ease; }

.lightbox-enter-active .lightbox-image,
.lightbox-leave-active .lightbox-image{ transition: transform .25s ease; }

.lightbox-enter-from,
.lightbox-leave-to{ opacity: 0; }

.lightbox-enter-from .lightbox-image,
.lightbox-leave-to .lightbox-image{ transform: scale(.96); }

/* =========================
   Education
   ========================= */

.edu-card{
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.edu-card h3{
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  margin-bottom: var(--sp-2);
}

.edu-card p{ color: var(--body); font-size: 15px; }

.badge{
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

/* =========================
   Contact
   ========================= */

.contact{ background: var(--dark); }

.contact .eyebrow{ color: var(--on-dark-muted); }

.contact h2{
  color: var(--on-dark);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

.contact .section-lede{ color: var(--on-dark-muted); }

.contact-inner{ max-width: 720px; }

.contact-grid{
  margin-top: var(--sp-7);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--sp-3);
}

.contact-card{
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--dark-soft);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-lg);
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

.contact-card:hover{ transform: translateY(-3px); border-color: rgba(255,255,255,.2); background: #232833; }

.contact-card .icon-email, .contact-card .icon-github, .contact-card .icon-facebook{ width: 22px; height: 22px; flex: none; display: block; object-fit: contain; }

.contact-card .icon-linkedin{ width: 22px; height: 22px; display: block; flex: none; object-fit: contain; }

.contact-card div{ display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.contact-card .mono-label{ color: var(--on-dark-muted); }

.contact-card div span:last-child{ color: var(--on-dark); font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }

/* =========================
   Footer
   ========================= */

.footer{ background: var(--dark); border-top: 1px solid rgba(255,255,255,.08); padding: var(--sp-6) var(--sp-5); }

@media (max-width: 1100px){
  .footer{ padding-right: 76px; }
}

.footer-inner{ max-width: var(--max); margin: 0 auto; color: var(--on-dark-muted); font-size: 14px; display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }

.footer-inner p:first-child{ color: var(--on-dark); font-weight: 600; }

.footer-meta{ font-family: var(--font-mono); font-size: 12.5px; }

/* =========================
   Back to top
   ========================= */

.to-top{
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-6);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--canvas);
  border: 1px solid rgba(255,255,255,.16);
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 90;
  box-shadow: var(--shadow-md);
}

.to-top .icon-arrow-up{ width: 18px; height: 18px; display: block; object-fit: contain; }

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

/* =========================
   Reveal-on-scroll (restrained)
   ========================= */

.reveal{ opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }

.reveal.in{ opacity: 1; transform: translateY(0); }