/* ─── CSS VARIABLES ─────────────────────────────────────────────── */
:root {
  --black: #000000;
  --gray: #575252;
  --orange: #e7901d;
  --gold: #e1be8f;
  --cream: #f5f5f5;
  --hover-gold: #ffcb86;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface2: #efefef;
  --text: #000000;
  --text2: #575252;
  --border: rgba(0, 0, 0, 0.12);
  --hex-color: rgba(231, 144, 29, 0.18);
  --hex-stroke: rgba(231, 144, 29, 0.32);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  --about-card-border: rgba(0, 0, 0, 0.16);
  --about-card-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
  --about-card-light-bg: #ffffff;
  --about-card-light-text: #111111;
  --about-card-accent-bg: #e7901d;
  --about-card-accent-text: #ffffff;
  --about-stack-border: color-mix(in srgb, var(--orange) 46%, transparent);
}
[data-theme="dark"] {
  --bg: #111111;
  --surface: #1c1c1c;
  --surface2: #252525;
  --text: #f5f5f5;
  --text2: #e1be8f;
  --border: rgba(255, 255, 255, 0.1);
  --hex-color: rgba(231, 144, 29, 0.12);
  --hex-stroke: rgba(231, 144, 29, 0.25);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  --about-card-border: rgba(255, 255, 255, 0.08);
  --about-card-shadow: 0 8px 18px rgba(0, 0, 0, 0.38);
  --about-card-light-bg: var(--surface);
  --about-card-light-text: var(--text);
  --about-card-accent-bg: color-mix(in srgb, var(--orange) 84%, #111111 16%);
  --about-card-accent-text: #fff3d9;
  --about-stack-border: color-mix(in srgb, var(--orange) 30%, transparent);
}

/* ─── RESET & BASE ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Share Tech Mono", monospace;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Share Tech Mono", monospace;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition:
    background 0.35s,
    color 0.35s;
}

/* ─── HEXAGON BACKGROUND ────────────────────────────────────────── */
.hex-bg {
  position: fixed;
  top: 0;
  bottom: 0;
  width: clamp(80px, 14vw, 200px);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hex-bg.left {
  left: 0;
}
.hex-bg.right {
  right: 0;
}
.hex-bg svg {
  width: 100%;
  height: 100%;
}

/* Pulse animation for hexagons */
@keyframes hexPulse {
  0%,
  100% {
    opacity: 0.18;
  }
  50% {
    opacity: 0.55;
  }
}
.hex-cell {
  animation: hexPulse var(--dur, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

/* ─── HONEYBEE (top-right, slow drift) ─────────────────────────── */
#bee-wrap {
  position: fixed;
  top: 90px;
  right: clamp(60px, 12vw, 180px);
  z-index: 10;
  pointer-events: none;
}
@keyframes beeDrift {
  0% {
    transform: translateX(0) translateY(0) rotate(-4deg);
  }
  40% {
    transform: translateX(22px) translateY(-8px) rotate(4deg);
  }
  70% {
    transform: translateX(-10px) translateY(4px) rotate(-2deg);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(-4deg);
  }
}
#bee-wrap svg {
  animation: beeDrift 7s ease-in-out infinite;
  width: clamp(64px, 8.6vw, 118px);
}

@media (max-width: 700px) {
  #bee-wrap svg {
    width: clamp(50px, 14vw, 68px);
  }
}

/* On small phones the -30px left offset risks clipping; neutralise it */
@media (max-width: 480px) {
  .hero-title-wrap {
    left: 0;
    max-width: 100%;
  }
}

/* ─── NAVBAR ────────────────────────────────────────────────────── */
#navbar-wrap {
  position: sticky;
  top: 14px;
  z-index: 100;
  display: flex;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 80px);
  pointer-events: none;
}
#navbar {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 8px 20px;
  box-shadow: var(--shadow);
  transition:
    background 0.35s,
    border-color 0.35s;
  width: 100%;
  min-width: 0;
  position: relative;
}
.nav-logo {
  font-family: "Share Tech Mono", monospace;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--orange);
  letter-spacing: -1px;
  flex-shrink: 0;
  user-select: none;
}
.nav-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 14px;
  flex-shrink: 0;
}
/* Desktop nav links */
.nav-links {
  display: none;
  gap: 6px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.nav-links a {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.75rem;
  color: var(--text2);
  text-decoration: none;
  padding: 5px 13px;
  border-radius: 999px;
  transition:
    background 0.2s,
    color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover {
  background: var(--orange);
  color: #fff;
}
/* Theme toggle */
#theme-btn {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text);
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
}
#theme-btn.flash,
#theme-btn:active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
@media (hover: hover) {
  #theme-btn:hover {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
  }
}

/* Mobile hamburger */
#nav-hamburger {
  display: flex;
  background: none;
  border: none;
  cursor: pointer;
  flex: 1;
  justify-content: center;
  align-items: center;
  color: var(--text);
  font-size: 1.2rem;
}
#nav-hamburger svg {
  display: none;
}
#nav-mobile-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  min-width: 0;
  transform: none;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 2px solid var(--border);
  border-radius: 22px;
  padding: 8px;
  flex-direction: column;
  gap: 0;
  backdrop-filter: blur(8px);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  z-index: 200;
  text-align: center;
}
#nav-mobile-menu.open {
  display: flex;
}
#nav-mobile-menu a {
  font-family: "Share Tech Mono", monospace;
  font-size: 1.1rem;
  color: var(--text2);
  text-decoration: none;
  padding: 10px 16px 14px;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  --mx: 50%;
  --my: 50%;
  transition:
    color 0.2s,
    transform 0.2s;
}
#nav-mobile-menu a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 78%;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(231, 144, 29, 0),
    rgba(231, 144, 29, 0.28) 24%,
    rgba(231, 144, 29, 0.95) 50%,
    rgba(231, 144, 29, 0.28) 76%,
    rgba(231, 144, 29, 0)
  );
  pointer-events: none;
}
#nav-mobile-menu a:hover {
  background-image: radial-gradient(
    circle 130px at var(--mx) var(--my),
    color-mix(in srgb, var(--orange) 52%, transparent) 0%,
    color-mix(in srgb, var(--orange) 22%, transparent) 42%,
    color-mix(in srgb, var(--orange) 8%, transparent) 62%,
    transparent 82%
  );
  background-repeat: no-repeat;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  #nav-mobile-menu {
    width: 100%;
    left: 0;
    right: 0;
  }
  #nav-mobile-menu a {
    width: 100%;
  }
}

/* ─── MAIN CONTENT WRAPPER ──────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 80px);
}

/* ─── SCROLL REVEAL ─────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(38px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── HERO SECTION ──────────────────────────────────────────────── */
#home {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 60px;
  padding-bottom: 18px;
  /* Contain the hero-title translateX entry animation on iOS */
  overflow: hidden;
}

/* Colliding title */
.hero-title-wrap {
  position: relative;
  left: -30px;
  display: block;
  width: fit-content;
  /* Guard: never let the offset push content past the left edge */
  max-width: calc(100% + 30px);
  min-height: clamp(92px, 15vw, 128px);
  margin: 10px auto 50px;
}
.hero-name {
  display: inline-block;
  background: #575252;
  color: #ffffff;
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  padding: clamp(10px, 2.2vw, 14px) clamp(16px, 4.5vw, 28px);
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 0;
  position: relative;
  z-index: 2;
  transform: translateX(-80px);
  opacity: 0;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.12);
  transition:
    transform 1s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.7s;
}
.hero-role {
  display: inline-block;
  background: #e7901d;
  color: #111111;
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  padding: clamp(10px, 2.2vw, 14px) clamp(16px, 4.5vw, 28px);
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 0;
  position: absolute;
  left: clamp(42px, 10vw, 92px);
  top: clamp(44px, 8.8vw, 68px);
  z-index: 1;
  transform: translateX(80px);
  opacity: 0;
  white-space: nowrap;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.12);
  transition:
    transform 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s,
    opacity 0.7s 0.15s;
}
.hero-title-wrap.collided .hero-name {
  transform: translateX(0);
  opacity: 1;
}
.hero-title-wrap.collided .hero-role {
  transform: translateX(0);
  opacity: 1;
}

.hero-bio {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 22px;
  max-width: 900px;
}
.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  color: var(--text2);
}
.hero-meta-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--orange);
}

/* ─── SECTION HEADERS ───────────────────────────────────────────── */
.section-title {
  font-family: "Share Tech Mono", monospace;
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--text);
  margin-bottom: 22px;
  padding-top: 30px;
}

/* Row that holds a section title + an optional badge (e.g. pagination) */
.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-title-row .section-title {
  margin-bottom: 0;
}

/* Projects pagination badge */
.projects-pagination {
  background: color-mix(in srgb, var(--orange) 14%, var(--surface));
  color: var(--orange);
  border: 2px solid var(--orange);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  margin-bottom: 2px;
}

/* ─── ABOUT ─────────────────────────────────────────────────────── */
#about {
  padding-bottom: 16px;
  position: relative;
  /*
   * CRITICAL iOS FIX: The about-cards translate ±126px (up to ±186px with
   * --about-shift scaling). On iOS Safari, off-screen transformed elements
   * expand the layout viewport, causing the page to zoom out.
   * overflow: hidden clips them to this section boundary — the slide-in
   * animation is still fully visible within the section.
   */
  overflow: hidden;
}
.about-stack {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 0;
  --about-progress: 0;
  --about-ease: 0;
}
.about-stack::before {
  content: "";
  position: absolute;
  inset: 4px -18px;
  border: 1px solid var(--about-stack-border);
  z-index: -1;
  pointer-events: none;
}
.about-card {
  border: 2px solid var(--about-card-border);
  font-size: clamp(0.92rem, 1.8vw, 1.02rem);
  line-height: 1.35;
  letter-spacing: 0.2px;
  padding: 14px 16px;
  opacity: 0;
  will-change: transform, opacity;
  /* Force GPU layer on iOS so property updates are composited, not reflowed */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: var(--about-card-shadow);
  transform-origin: center;
  --about-shift: calc(1 + var(--order) * 0.12);
  transition:
    transform 110ms linear,
    opacity 110ms linear;
}
.about-card + .about-card {
  margin-top: -2px;
}
.about-card-light {
  background: var(--about-card-light-bg);
  color: var(--about-card-light-text);
}
.about-card-accent {
  background: var(--about-card-accent-bg);
  color: var(--about-card-accent-text);
}

.about-card:nth-child(odd) {
  opacity: calc(0.2 + var(--about-progress) * 0.8);
  transform: translate3d(
      calc(
        (-126px * var(--about-shift)) *
          (1 - var(--about-ease))
      ),
      calc((-26px * var(--about-shift)) * (1 - var(--about-ease))),
      0
    )
    rotate(calc((-4.4deg * var(--about-shift)) * (1 - var(--about-ease))));
}

.about-card:nth-child(even) {
  opacity: calc(0.2 + var(--about-progress) * 0.8);
  transform: translate3d(
      calc((126px * var(--about-shift)) * (1 - var(--about-ease))),
      calc((26px * var(--about-shift)) * (1 - var(--about-ease))),
      0
    )
    rotate(calc((4.4deg * var(--about-shift)) * (1 - var(--about-ease))));
}

@media (max-width: 700px) {
  .about-stack {
    max-width: 100%;
  }
  .about-stack::before {
    inset: 6px -8px;
  }
  .about-card {
    padding: 12px 11px;
  }

  /* Reduce horizontal travel to ~18vw on mobile so the animation is
     proportional to screen width and less extreme */
  .about-card:nth-child(odd) {
    transform: translate3d(
        calc((-18vw * var(--about-shift)) * (1 - var(--about-ease))),
        calc((-16px * var(--about-shift)) * (1 - var(--about-ease))),
        0
      )
      rotate(calc((-3deg * var(--about-shift)) * (1 - var(--about-ease))));
  }
  .about-card:nth-child(even) {
    transform: translate3d(
        calc((18vw * var(--about-shift)) * (1 - var(--about-ease))),
        calc((16px * var(--about-shift)) * (1 - var(--about-ease))),
        0
      )
      rotate(calc((3deg * var(--about-shift)) * (1 - var(--about-ease))));
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── WHAT I CAN DO ─────────────────────────────────────────────── */
#what-i-can-do {
  padding-bottom: 16px;
  position: relative;
}
.capabilities-panel {
  position: relative;
  width: min(100%, 760px);
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.capabilities-panel::after {
  content: none;
}
.capabilities-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.capability-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  flex: 0 1 auto;
  padding: 11px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 84%, var(--orange) 16%);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.capability-card.reveal {
  opacity: 0;
  transform: translateX(-18px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--order) * 70ms);
}
.capability-card.reveal.visible {
  opacity: 1;
  transform: translateX(0);
}
.capability-card:hover {
  transform: translateX(2px);
}
.capability-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--orange);
  flex-shrink: 0;
}
.capability-icon svg {
  width: 20px;
  height: 20px;
}
.capability-text {
  font-size: clamp(0.92rem, 1.8vw, 1.02rem);
  line-height: 1.2;
}

@media (max-width: 700px) {
  .capabilities-panel {
    padding: 14px;
  }
  .capability-card {
    padding: 10px 12px;
  }
}

@media (min-width: 760px) {
  .capabilities-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .capability-card.reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── SKILLS ────────────────────────────────────────────────────── */
#skills {
  padding-bottom: 20px;
}
.skills-grid {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  position: relative;
}
.skill-item {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
}
.skill-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  transition: transform 0.2s;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}
.skill-item.active img {
  transform: scale(1.18);
}
.skill-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  font-family: "Share Tech Mono", monospace;
  z-index: 10;
}
.skill-item.active .skill-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── PROJECTS ──────────────────────────────────────────────────── */
#projects {
  padding-bottom: 20px;
}
.projects-carousel-wrap {
  position: relative;
  width: min(100%, 1120px);
  /* height is driven by card content — no fixed ceiling on desktop */
  margin: 0 auto;
  padding: 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}
.projects-carousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--orange) transparent;
}
.projects-carousel::-webkit-scrollbar {
  height: 5px;
}
.projects-carousel::-webkit-scrollbar-thumb {
  background: var(--orange);
  border-radius: 999px;
}
.project-card {
  width: clamp(290px, 74vw, 340px);
  flex: 0 0 auto;
  scroll-snap-align: start;
  align-self: flex-start;
  /* no vertical scroll needed — wrap expands to fit content */
}
.project-card::-webkit-scrollbar {
  width: 4px;
}
.project-card::-webkit-scrollbar-thumb {
  background: var(--orange);
  border-radius: 999px;
}
.project-frame {
  background: var(--surface);
  border: 2px solid var(--border);
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.project-frame:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(231, 144, 29, 0.18);
}
.project-frame-title {
  background: #e7901d;
  color: #1c1c1c;
  text-align: center;
  font-size: 0.92rem;
  padding: 10px 12px 9px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  letter-spacing: 0.2px;
}
.project-frame-media {
  padding: 12px;
}

/* Landscape projects — images stacked vertically at natural ratio */
.project-frame-media.gallery-landscape {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-frame-media.gallery-landscape .project-gallery-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border: 2px solid rgba(0, 0, 0, 0.08);
  background: #f1f1f1;
}

/* Mobile/portrait projects — horizontal scrollable strip */
.project-frame-media.gallery-mobile {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--orange) transparent;
}
.project-frame-media.gallery-mobile::-webkit-scrollbar {
  height: 4px;
}
.project-frame-media.gallery-mobile::-webkit-scrollbar-thumb {
  background: var(--orange);
  border-radius: 999px;
}
.project-frame-media.gallery-mobile .project-gallery-img {
  flex: 0 0 auto;
  display: block;
  /* portrait phone screen ratio */
  width: auto;
  height: 260px;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  border: 2px solid rgba(0, 0, 0, 0.08);
  background: #f1f1f1;
  scroll-snap-align: start;
}
.project-frame-details {
  padding: 0 12px 14px;
}
.project-meta-label {
  font-size: 0.7rem;
  color: var(--orange);
  font-weight: 700;
  margin-bottom: 4px;
  margin-top: 10px;
}
.project-tech-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 6px;
}
.project-tech-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}
.project-tech-item img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.project-tech-item span {
  font-size: 0.68rem;
  color: var(--text2);
}
.project-role,
.project-summary {
  line-height: 1.5;
}
.project-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.project-links .project-link-btn {
  flex: 1;
  justify-content: center;
}
.project-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.project-link-btn:hover {
  transform: translateY(-2px);
}
.project-link-github {
  background: var(--surface2);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.project-link-github:hover {
  background: #24292e;
  color: #fff;
  border-color: #24292e;
}
.project-link-demo {
  background: var(--orange);
  color: #fff;
  border: 1.5px solid var(--orange);
}
.project-link-demo:hover {
  background: #c97a15;
  border-color: #c97a15;
}

@media (max-width: 800px) {
  .projects-carousel-wrap {
    min-height: 480px;
  }

  .project-card {
    /* Narrower than the carousel inner width so the next card peeks through */
    width: clamp(290px, 72vw, 300px);
  }

  /* Slightly smaller portrait images on narrow screens */
  .project-frame-media.gallery-mobile .project-gallery-img {
    height: 210px;
  }
}

/* ─── CERTIFICATIONS ────────────────────────────────────────────── */
#certifications {
  padding-bottom: 20px;
}
.certs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.certs-view-all-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}
.certs-view-all-link {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.82rem;
  color: var(--orange);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 1px solid currentColor;
}
.certs-view-all-link:hover {
  color: var(--hover-gold);
}
.cert-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.2s;
}
.cert-card:hover {
  box-shadow: 0 4px 18px rgba(231, 144, 29, 0.2);
}
.cert-info {
  flex: 1;
}
.cert-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}
.cert-issued, .cert-issuer {
  font-size: 0.85rem;
  color: var(--text2);
}
.cert-view-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--orange);
  text-decoration: none;
  font-size: 0.88rem;
  border-bottom: 1px solid currentColor;
  line-height: 1.2;
}
.cert-view-link:hover {
  color: var(--hover-gold);
}
.cert-logo {
  width: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cert-logo img {
  max-width: 100%;
  max-height: 40px;
  object-fit: contain;
}

/* ─── CERTIFICATIONS PAGE ──────────────────────────────────────── */
.certifications-page {
  padding-bottom: 20px;
  background-color: white;
}
.certifications-page-shell {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.certifications-page-topbar {
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  background: var(--orange);
}
.certifications-back-link {
  color: #fff;
  text-decoration: none;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
}
.certifications-page-body {
  padding: 18px 22px 24px;
}
.certifications-page-title {
  text-align: center;
  padding-top: 0;
  margin-bottom: 18px;
}
.cert-category + .cert-category {
  margin-top: 18px;
}
.cert-category-title {
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}
.cert-feature-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: white;
}
.cert-feature-copy {
  flex: 1;
  min-width: 0;
}
.cert-feature-name {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.28;
  margin-bottom: 4px;
}
.cert-feature-issued {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.74rem;
  color: var(--text2);
  margin-bottom: 8px;
}
.cert-feature-link {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.76rem;
  color: var(--orange);
  text-decoration: none;
  display: inline-block;
}
.cert-feature-link:hover {
  color: var(--hover-gold);
}
.cert-feature-logo {
  width: 82px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cert-feature-logo img {
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
}
.cert-feature-logo--badge {
  width: 72px;
  height: 72px;
}
.cert-feature-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: #fff;
  font-family: "Share Tech Mono", monospace;
  font-size: 1.2rem;
  font-weight: 800;
  border: 2px solid rgba(0, 0, 0, 0.12);
}

@media (max-width: 640px) {
  .certifications-page-shell {
    border-radius: 16px;
  }

  .certifications-page-topbar {
    height: 66px;
    padding: 0 18px;
  }

  .certifications-page-body {
    padding: 16px 16px 20px;
  }

  .cert-feature-card {
    padding: 12px 14px;
  }

  .cert-feature-logo {
    width: 68px;
  }

  .cert-feature-badge {
    width: 56px;
    height: 56px;
    font-size: 1rem;
  }
}

body.cert-archive {
  background: #dcdcdc;
}

body.cert-archive main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
}

body.cert-archive .certifications-page {
  padding-bottom: 0;
  min-height: 100vh;
}

body.cert-archive .certifications-page-shell {
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

body.cert-archive .certifications-page-topbar {
  border-radius: 0;
}

body.cert-archive .certifications-page-body {
  padding: 16px 30px 26px;
}

@media (max-width: 640px) {
  body.cert-archive main {
    max-width: 100%;
  }

  body.cert-archive .certifications-page-body {
    padding: 14px 20px 20px;
  }
}

/* CSC badge placeholder */
.cert-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Share Tech Mono", monospace;
  font-weight: 800;
  font-size: 0.6rem;
  text-align: center;
  color: #fff;
  background: var(--orange);
  line-height: 1.2;
  padding: 4px;
}

/* ─── CONTACT ───────────────────────────────────────────────────── */
#contact {
  padding-bottom: 20px;
}
.contact-wrap {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 600px) {
  .contact-wrap {
    grid-template-columns: 1fr;
  }
}

.contact-left h3 {
  font-family: "Share Tech Mono", monospace;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--orange);
  margin-bottom: 14px;
  text-align: center;
}
.contact-subtitle {
  font-size: 0.82rem;
  color: var(--text2);
  margin-bottom: 14px;
}
.contact-type-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.contact-type-btn {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 9px 16px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
  text-align: left;
}
.contact-type-btn:hover,
.contact-type-btn.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.contact-cta {
  font-size: 0.8rem;
  color: var(--text2);
  font-style: italic;
  margin-top: 10px;
  text-align: center;
}

.contact-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-form-label {
  font-size: 0.75rem;
  color: var(--text2);
  margin-bottom: 4px;
  display: block;
}
.contact-input,
.contact-textarea {
  width: 100%;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 9px 13px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.78rem;
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
  resize: none;
}
.contact-input:focus,
.contact-textarea:focus {
  border-color: var(--orange);
}
.contact-textarea {
  min-height: 120px;
}
.contact-send-btn {
  align-self: flex-end;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
}
.contact-send-btn:hover {
  background: #c97a15;
  transform: translateY(-2px);
}
.contact-send-btn:disabled {
  cursor: wait;
  opacity: 0.75;
  transform: none;
}
.contact-status {
  font-size: 0.72rem;
  min-height: 1em;
  line-height: 1.4;
  color: var(--text2);
  margin-top: -2px;
}
.contact-status.success {
  color: #1f7a3e;
}
.contact-status.error {
  color: #b42318;
}

.contact-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  padding: 12px 16px;
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: "Share Tech Mono", monospace;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.contact-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.contact-toast.success {
  background: #e7901d;
}

.contact-toast.error {
  background: #b42318;
}

/* ─── LINKS ─────────────────────────────────────────────────────── */
#links {
  padding-bottom: 20px;
}
.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.link-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.link-btn:hover {
  background: var(--hover-gold);
  color: var(--black);
  border-color: var(--orange);
}
.link-btn svg {
  width: 20px;
  height: 20px;
}
.link-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
.gmail-div {
  background: var(--surface);
  border: 2px solid var(--border);
}

.resume-wrap {
  margin-top: 24px;
}
.resume-wrap p {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.resume-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 38px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
  text-decoration: none;
  display: inline-block;
}

#li-badge-light {
  margin-bottom: 10px;
}

.resume-btn:hover {
  background: #c97a15;
  transform: translateY(-2px);
}

/* ─── FOOTER ─────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.72rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  position: relative;
  z-index: 1;
  background-color: #e7901d;
}
#trademark-btn {
  color: var(--text);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
}

/* ─── TRADEMARK MODAL ───────────────────────────────────────────── */
#trademark-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#trademark-modal.open {
  display: flex;
}
.modal-box {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  max-width: 480px;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-box h4 {
  font-family: "Share Tech Mono", monospace;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--orange);
}
.modal-box p {
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.7;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text);
}

/* ─── CERTIFICATE PREVIEW MODAL ─────────────────────────────────── */
#cert-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.78);
  align-items: center;
  justify-content: center;
  padding: 14px;
}
#cert-modal.open {
  display: flex;
}
.cert-modal-box {
  position: relative;
  width: min(1120px, 100%);
  max-height: calc(100vh - 28px);
  border-radius: 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cert-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
}
.cert-modal-head {
  padding-right: 34px;
}
.cert-modal-head h4 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 4px;
}
.cert-modal-head p {
  font-size: 0.76rem;
  color: var(--text2);
  margin: 0;
  line-height: 1.35;
}
.cert-modal-image-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--surface2) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
#cert-modal-image {
  max-width: 100%;
  max-height: calc(100vh - 170px);
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

@media (max-width: 640px) {
  #cert-modal {
    padding: 6px;
  }

  .cert-modal-box {
    max-height: calc(100vh - 12px);
    padding: 12px;
    border-radius: 12px;
  }

  .cert-modal-head h4 {
    font-size: 0.86rem;
  }

  .cert-modal-head p {
    font-size: 0.7rem;
  }

  #cert-modal-image {
    max-height: calc(100vh - 150px);
  }
}

/* ─── UTILITY ───────────────────────────────────────────────────── */
section {
  position: relative;
  z-index: 1;
}
