/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
:root { --ann-height: 0px; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(4rem + var(--ann-height));
  overflow-x: hidden;
}
body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: #0B0B16;
  color: #CBD5E1;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #0B0B16; }
::-webkit-scrollbar-thumb { background: linear-gradient(#7C3AED, #06B6D4); border-radius: 10px; }

/* ── Gradient text ── */
.g-text {
  background: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Gradient border card ── */
.g-border {
  border: 1px solid transparent;
  background: linear-gradient(#13131F, #13131F) padding-box,
              linear-gradient(135deg, rgba(124,58,237,.6), rgba(6,182,212,.6)) border-box;
}

/* ── Glassmorphism ── */
.glass {
  background: rgba(11, 11, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Hero animated gradient ── */
.hero-gradient {
  background: radial-gradient(ellipse 80% 80% at 50% -20%, rgba(124,58,237,.25) 0%, transparent 60%),
              radial-gradient(ellipse 60% 50% at 80% 60%, rgba(6,182,212,.12) 0%, transparent 60%),
              #0B0B16;
}

/* ── Grid pattern overlay ── */
.grid-pattern {
  background-image:
    linear-gradient(rgba(124,58,237,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Floating particles ── */
@keyframes floatUp {
  0%   { transform: translateY(0) scale(1); opacity: .5; }
  50%  { transform: translateY(-28px) scale(1.1); opacity: .8; }
  100% { transform: translateY(0) scale(1); opacity: .5; }
}
.particle { position: absolute; border-radius: 50%; animation: floatUp ease-in-out infinite; }

/* ── Glow shadows ── */
.glow-purple { box-shadow: 0 0 30px rgba(124,58,237,.4); }
.glow-cyan   { box-shadow: 0 0 30px rgba(6,182,212,.35); }

/* ── Section heading underline ── */
.section-heading::after {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #7C3AED, #06B6D4);
  margin: 14px auto 0;
}

/* ── Stat card gradient bg ── */
.stat-bg {
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(6,182,212,.08));
  border: 1px solid rgba(124,58,237,.25);
}

/* ── Skill badge (legacy) ── */
.skill-pill {
  transition: transform .25s ease, box-shadow .25s ease;
}
.skill-pill:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 18px rgba(124,58,237,.45);
}

/* ── Skill card (bento grid) ── */
@keyframes shimmerSweep {
  0%   { transform: translateX(-150%) skewX(-20deg); opacity: 1; }
  100% { transform: translateX(300%)  skewX(-20deg); opacity: 1; }
}
@keyframes chipIn {
  from { opacity: 0; transform: translateY(12px) scale(0.75); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes accentFlow {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
@keyframes iconPulse {
  0%, 100% { transform: scale(1)    rotate(0deg);   opacity: .05; }
  50%       { transform: scale(1.08) rotate(3deg);  opacity: .09; }
}
@keyframes glowRing {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.25); }
  100% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}

.skill-card {
  background: linear-gradient(#13131F, #13131F) padding-box,
              linear-gradient(135deg, rgba(124,58,237,.35), rgba(6,182,212,.35)) border-box;
  border: 1px solid transparent;
  transition: box-shadow .35s ease, background .35s ease;
  will-change: transform;
}
.skill-card:hover {
  background: linear-gradient(#15152A, #15152A) padding-box,
              linear-gradient(135deg, rgba(124,58,237,.7), rgba(6,182,212,.55)) border-box;
  box-shadow: 0 24px 56px rgba(0,0,0,.5), 0 0 0 1px rgba(124,58,237,.18);
}
/* Shimmer sweep on hover */
.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  transform: translateX(-150%) skewX(-20deg);
  pointer-events: none;
  z-index: 1;
}
.skill-card:hover::before {
  animation: shimmerSweep .65s ease forwards;
}
/* Animated accent bar */
.skill-accent-bar {
  background-size: 200% 200% !important;
  animation: accentFlow 2.5s ease infinite;
  opacity: .75;
  transition: opacity .3s ease, height .3s ease;
}
.skill-card:hover .skill-accent-bar { opacity: 1; height: 3px !important; }
/* Watermark icon animation */
.skill-watermark {
  animation: iconPulse 4s ease-in-out infinite;
}
/* Icon badge scale on card hover */
.skill-icon-badge {
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
}
.skill-card:hover .skill-icon-badge {
  transform: scale(1.18) rotate(-6deg);
}

/* ── Skill chip ── */
.skill-chip {
  opacity: 0;
  animation: chipIn .4s cubic-bezier(.34,1.56,.64,1) both;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  position: relative;
}
.skill-chip:hover {
  transform: translateY(-3px) scale(1.1);
  animation: glowRing .6s ease forwards, chipIn 0s .4s both; /* keep visible after entrance */
}

/* ── Project card ── */
.proj-card { transition: transform .35s ease, box-shadow .35s ease; }
.proj-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,.5);
}

/* ── Image zoom on hover ── */
.img-zoom { transition: transform .5s ease, opacity .5s ease; }
.proj-card:hover .img-zoom { transform: scale(1.07); opacity: 1; }

/* ── Timeline connector ── */
.tl-line {
  background: linear-gradient(to bottom, #7C3AED, #06B6D4, #7C3AED);
}

/* ── Nav underline hover ── */
.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #7C3AED, #06B6D4);
  transition: width .3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* ── Terminal window ── */
.terminal {
  background: #0D0D18;
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 16px;
  overflow: hidden;
}
.terminal-bar {
  background: #161626;
  border-bottom: 1px solid rgba(124,58,237,.2);
}

/* ── Typewriter ── */
@keyframes type { from { width: 0 } to { width: 100% } }
@keyframes blink { from, to { border-color: transparent } 50% { border-color: #7C3AED; } }
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid #7C3AED;
  animation: type 2.4s steps(30, end) forwards, blink .75s step-end infinite;
}

/* ── Scroll indicator ── */
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}
.scroll-dot { animation: scrollBounce 1.5s ease-in-out infinite; }

/* ── Alpine cloak ── */
[x-cloak] { display: none !important; }

/* ── Gradient button ── */
.g-btn {
  background: linear-gradient(135deg, #7C3AED, #06B6D4);
  transition: opacity .25s ease, transform .25s ease, box-shadow .25s ease;
}
.g-btn:hover {
  opacity: .9;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124,58,237,.4);
}

/* ── Contact card hover ── */
.contact-card {
  transition: transform .25s ease, box-shadow .25s ease;
}
.contact-card:hover {
  transform: translateX(6px);
  box-shadow: 0 0 24px rgba(124,58,237,.25);
}

/* ── Social icon ── */
.social-icon {
  transition: transform .25s ease, box-shadow .25s ease, color .25s ease;
}
.social-icon:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(124,58,237,.5);
  color: white;
}

/* ── Experience card hover ── */
.exp-card {
  transition: transform .3s ease, box-shadow .3s ease;
}
.exp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(124,58,237,.2);
}

/* ── Hero tech badges ── */
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.hero-badge {
  background: linear-gradient(135deg, rgba(124,58,237,.55), rgba(6,182,212,.45));
  border: 1px solid rgba(124,58,237,.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: badgeFloat 3.5s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(124,58,237,.25);
}

/* ── Filter pill active ── */
.filter-pill.is-active {
  background: linear-gradient(135deg, #7C3AED, #06B6D4) !important;
  color: white !important;
  border-color: transparent !important;
}

/* ── Cursor glow ── */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(124, 58, 237, 0.13) 0%,
    rgba(6, 182, 212, 0.07) 40%,
    transparent 70%
  );
  transition: opacity 0.3s ease;
  will-change: transform;
}

/* ══════════════════════════════════════════════════════════
   LIGHT MODE  —  applied when <body> has class "light"
   ══════════════════════════════════════════════════════════ */
html.light {
  background-color: #F3F4F8;
  color: #1E1B2E;
}
html.light body {
  background-color: #F3F4F8;
  color: #1E1B2E;
}

/* Scrollbar */
html.light ::-webkit-scrollbar-track { background: #F3F4F8; }

/* Hero / page background */
html.light .hero-gradient {
  background:
    radial-gradient(ellipse 80% 80% at 50% -20%, rgba(124,58,237,.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 60%, rgba(6,182,212,.07) 0%, transparent 60%),
    #F3F4F8;
}
html.light .grid-pattern {
  background-image:
    linear-gradient(rgba(124,58,237,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,.06) 1px, transparent 1px);
}

/* Nav glass */
html.light .glass {
  background: rgba(243, 244, 248, 0.92);
}
html.light #navbar {
  border-bottom-color: rgba(124,58,237,.18);
}

/* Text colours */
html.light .text-slate-400  { color: #4B5563 !important; }
html.light .text-slate-500  { color: #6B7280 !important; }
html.light .text-slate-600  { color: #6B7280 !important; }
html.light .text-slate-300  { color: #374151 !important; }
html.light .text-slate-200  { color: #1F2937 !important; }
html.light .text-white      { color: #111827 !important; }
html.light .nav-link        { color: #4B5563; }
html.light .nav-link:hover  { color: #111827; }
html.light .nav-link.active { color: #7C3AED; }

/* Cards & borders */
html.light .g-border {
  background:
    linear-gradient(#FFFFFF, #FFFFFF) padding-box,
    linear-gradient(135deg, rgba(124,58,237,.5), rgba(6,182,212,.5)) border-box;
}
html.light .stat-bg {
  background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(6,182,212,.05));
  border-color: rgba(124,58,237,.2);
}

/* Terminal */
html.light .terminal {
  background: #F9FAFB;
  border-color: rgba(124,58,237,.25);
}
html.light .terminal-bar {
  background: #EEF0F5;
  border-bottom-color: rgba(124,58,237,.15);
}

/* Experience / project cards */
html.light .exp-card:hover {
  box-shadow: 0 12px 36px rgba(124,58,237,.12);
}
html.light .proj-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,.12);
}

/* Input fields */
html.light input, html.light textarea {
  background: #FFFFFF !important;
  border-color: #D1D5DB !important;
  color: #111827 !important;
}
html.light input::placeholder,
html.light textarea::placeholder { color: #9CA3AF !important; }
html.light input:focus,
html.light textarea:focus {
  border-color: #7C3AED !important;
}

/* Filter pills */
html.light .filter-pill {
  border-color: #D1D5DB;
  color: #374151;
}
html.light .filter-pill:hover {
  border-color: #7C3AED;
  color: #7C3AED;
}

/* Footer */
html.light footer {
  border-top-color: rgba(124,58,237,.18);
}

/* Dark-mode toggle button */
#theme-toggle {
  transition: transform .25s ease, box-shadow .25s ease;
}

/* ══════════════════════════════════════════════════════════
   PROFESSIONAL / PERSONAL MODE TOGGLE
   ══════════════════════════════════════════════════════════ */

/* ── Floating pill toggle ── */
#mode-toggle {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 9999px;
  background: var(--glass-bg, rgba(11,11,22,.92));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-nav, rgba(255,255,255,.12));
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  gap: 0;
  user-select: none;
  transition: background .35s ease, border-color .35s ease;
  /* prevent overflowing viewport on narrow screens */
  max-width: calc(100vw - 2rem);
}
#mode-toggle .mode-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 22px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  border: none;
  cursor: pointer;
  transition: background .3s ease, color .3s ease, box-shadow .3s ease;
  color: var(--text-muted);
  background: transparent;
  white-space: nowrap;
}
#mode-toggle .mode-btn.mode-active {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  box-shadow: 0 4px 18px rgba(var(--c1-rgb),.45);
}
#mode-toggle .mode-btn i {
  font-size: 12px;
}

/* ── Mobile: compact toggle ── */
@media (max-width: 480px) {
  #mode-toggle {
    bottom: 1.25rem;
    padding: 3px;
    box-shadow: 0 6px 24px rgba(0,0,0,.45);
  }
  #mode-toggle .mode-btn {
    padding: 8px 14px;
    font-size: 12px;
    gap: 5px;
  }
  #mode-toggle .mode-btn i {
    font-size: 11px;
  }
}

/* ── Professional / personal view visibility ── */
#professional-view,
#personal-view {
  transition: opacity .35s ease;
}

/* ── Personal view reset (inherits body styles) ── */
.personal-view-root {
  min-height: 100vh;
}

/* ── Personal tag pills ── */
.personal-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(var(--c1-rgb),.1);
  border: 1px solid rgba(var(--c1-rgb),.25);
  color: var(--c1);
  transition: background .25s, border-color .25s;
}
.personal-tag:hover {
  background: rgba(var(--c1-rgb),.2);
  border-color: rgba(var(--c1-rgb),.5);
}

/* ── Game card ── */
.game-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              linear-gradient(135deg, rgba(var(--c1-rgb),.3), rgba(var(--c2-rgb),.2)) border-box;
  border: 1px solid transparent;
  transition: transform .35s ease, box-shadow .35s ease;
  cursor: default;
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0,0,0,.55);
}
.game-card-glow {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  transition: opacity .35s ease;
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--gc) 25%, transparent);
  pointer-events: none;
  z-index: 0;
}
.game-card:hover .game-card-glow { opacity: 1; }
.game-thumb {
  position: relative;
  z-index: 1;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-icon {
  font-size: 3rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.game-card:hover .game-icon { transform: scale(1.18) rotate(-5deg); }
.game-info {
  position: relative;
  z-index: 1;
  padding: 14px 16px 16px;
}
.game-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
}
.game-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(var(--c1-rgb),.1);
  border: 1px solid rgba(var(--c1-rgb),.2);
  color: var(--c1);
}

/* ── Sci-fi / Watch section ── */
.genre-banner {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 28px 24px;
  background: linear-gradient(135deg,rgba(var(--c2-rgb),.08),rgba(var(--c1-rgb),.08));
  border: 1px solid rgba(var(--c2-rgb),.2);
}
/* Star particles inside genre banner */
.genre-stars::before,
.genre-stars::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.6) 1px, transparent 1px),
    radial-gradient(circle, rgba(var(--c2-rgb),.4) 1px, transparent 1px);
  background-size: 40px 40px, 70px 70px;
  background-position: 0 0, 20px 20px;
  opacity: .18;
  pointer-events: none;
}
.genre-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.watch-card {
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              linear-gradient(135deg, rgba(var(--c1-rgb),.25), rgba(var(--c2-rgb),.15)) border-box;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 20px;
  transition: box-shadow .3s ease;
}
.watch-card:hover {
  box-shadow: 0 0 32px rgba(var(--c1-rgb),.18);
}
.watch-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(var(--c1-rgb),.15);
}
.watch-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.watch-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}
.watch-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.watch-year {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Personal view text color normalisation (overrides Tailwind hardcodes) ── */
.personal-view-root h4,
.personal-view-root h5 { color: var(--text); }
.personal-view-root .text-white { color: var(--text) !important; }
.personal-view-root .text-slate-400,
.personal-view-root .text-slate-500 { color: var(--text-muted) !important; }
.personal-view-root p.text-slate-400,
.personal-view-root p.text-slate-500 { color: var(--text-muted) !important; }
.routine-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.routine-timeline::before {
  content: '';
  position: absolute;
  left: 82px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(to bottom, var(--c1), var(--c2), var(--c1));
  opacity: .35;
}
.routine-item {
  display: grid;
  grid-template-columns: 76px 24px 1fr;
  align-items: flex-start;
  gap: 0 14px;
  padding-bottom: 28px;
  position: relative;
}
.routine-time {
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 3px;
  font-family: 'Space Mono', monospace;
  letter-spacing: -.5px;
}
.routine-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(var(--c1-rgb),.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: border-color .3s, box-shadow .3s;
}
.routine-item:hover .routine-dot {
  border-color: var(--c1);
  box-shadow: 0 0 12px rgba(var(--c1-rgb),.5);
}
.routine-card {
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              linear-gradient(135deg, rgba(var(--c1-rgb),.2), rgba(var(--c2-rgb),.1)) border-box;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  transition: box-shadow .3s ease, transform .3s ease;
}
.routine-item:hover .routine-card {
  box-shadow: 0 8px 28px rgba(var(--c1-rgb),.15);
  transform: translateX(4px);
}
.routine-card h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.routine-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}
#theme-toggle:hover {
  transform: rotate(20deg);
  box-shadow: 0 0 14px rgba(124,58,237,.4);
}

/* ── Project Modal ── */
#projectModal { transition: opacity .2s ease; }
#projectModal.hidden { display: none !important; }

.modal-panel {
  background: #13131F;
  animation: modalIn .22s ease forwards;
}
html.light .modal-panel {
  background: #FFFFFF;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Carousel */
#carouselTrack img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}
.carousel-arrow { transition: background .2s ease, transform .2s ease; }
.carousel-arrow:hover { transform: translateY(-50%) scale(1.1); }

/* Dot indicators */
.carousel-dot {
  width: 6px; height: 6px;
  border-radius: 9999px;
  background: rgba(255,255,255,.35);
  transition: background .2s ease, width .2s ease;
  cursor: pointer;
}
.carousel-dot.active {
  background: #7C3AED;
  width: 18px;
}

/* Cards clickable cursor */
.proj-card { cursor: pointer; }

/* ══════════════════════════════════════════════════════════
   PHOTOGRAPHY SECTION
   ══════════════════════════════════════════════════════════ */

/* ── Filter pills ── */
.photo-filter-pill {
  padding: 7px 18px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  border: 1px solid var(--border-nav);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.photo-filter-pill:hover {
  background: rgba(var(--c1-rgb),.08);
  color: var(--text);
  border-color: rgba(var(--c1-rgb),.4);
}
.photo-filter-pill.photo-filter-active {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(var(--c1-rgb),.35);
}

/* ── Masonry grid gallery ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 10px;
  gap: 12px;
  align-items: start;
}

.photo-item {
  display: block;
  border-radius: 16px;
  overflow: hidden;
}

/* ── Photo frame: aspect-ratio drives the height ── */
.photo-frame {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
}
.photo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.25,.46,.45,.94), filter .55s ease, opacity .3s ease;
  filter: brightness(.92) saturate(1.05);
  opacity: 0;
  will-change: transform, opacity;
}

/* Aspect ratios per type — frame sets its own height */
.photo-item.portrait  .photo-frame { aspect-ratio: 3/4; }
.photo-item.landscape .photo-frame { aspect-ratio: 4/3; }
.photo-item.landscape.wide .photo-frame { aspect-ratio: 16/9; }

/* Wide items span all columns (full-width hero row) */
.photo-item.landscape.wide { grid-column: 1 / -1; }
.photo-item.landscape.wide .photo-frame { height: 58vh; aspect-ratio: unset; }

/* Once JS sets data-loaded, fade in */
.photo-frame img.photo-loaded {
  opacity: 1;
}
.photo-frame:hover img.photo-loaded {
  transform: scale(1.06);
  filter: brightness(1) saturate(1.15);
}

/* ── Skeleton shimmer on unloaded frames ── */
@keyframes photoShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.photo-frame.photo-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    rgba(var(--c1-rgb), .04) 0%,
    rgba(var(--c1-rgb), .10) 40%,
    rgba(var(--c1-rgb), .04) 80%
  );
  background-size: 800px 100%;
  animation: photoShimmer 1.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
  transition: opacity .4s ease;
}
.photo-frame.photo-skeleton-done::after {
  opacity: 0;
  pointer-events: none;
}

/* ── Film grain overlay ── */
.photo-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 16px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
  opacity: .5;
}

/* ── Vignette on each card ── */
.photo-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.55) 100%);
  z-index: 1;
  pointer-events: none;
  transition: opacity .4s ease;
}
.photo-frame:hover::before { opacity: .7; }

/* ── Hover overlay ── */
.photo-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.18) 50%, transparent 100%);
  opacity: 0;
  transition: opacity .35s ease;
}
.photo-frame:hover .photo-overlay { opacity: 1; }

.photo-overlay-content { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; }

.photo-cat-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  margin-bottom: 4px;
}
.photo-overlay-content h5 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}
.photo-overlay-content p {
  font-size: 11px;
  color: rgba(255,255,255,.65);
  margin: 0;
}

/* Zoom icon button */
.photo-zoom-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.85);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, color .2s ease;
}
.photo-zoom-btn:hover {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  transform: scale(1.15);
}

/* Filtered-out items */
.photo-item.photo-hidden {
  display: none;
}

/* ── Gear strip tags ── */
.gear-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(var(--c1-rgb),.08);
  border: 1px solid rgba(var(--c1-rgb),.18);
  color: var(--text-muted);
  transition: background .2s, border-color .2s, color .2s;
}
.gear-tag:hover {
  background: rgba(var(--c1-rgb),.15);
  border-color: rgba(var(--c1-rgb),.35);
  color: var(--text);
}
.gear-tag i { font-size: 9px; color: var(--c1); }

/* ── Responsive grid breakpoints ── */
@media (max-width: 900px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .photo-grid { grid-template-columns: 1fr; }
  .photo-item { border-radius: 12px; }
  .photo-frame { border-radius: 12px; }
}

/* ══════════════════════════════════════════════════════════
   PHOTO LIGHTBOX
   ══════════════════════════════════════════════════════════ */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.photo-lightbox-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image wrapper — sizes itself to fit the image's natural ratio */
.lb-img-wrap {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img-wrap img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
  transition: opacity .3s ease;
  object-fit: contain;
}

/* Spinner */
.lb-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c1);
  font-size: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.lb-spinner.visible { opacity: 1; }

/* Close button */
.lb-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.5);
  color: rgba(255,255,255,.8);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.lb-close:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.4);
  color: #fff;
  transform: rotate(90deg) scale(1.1);
}

/* Prev / Next arrows */
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.75);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background .2s, border-color .2s, color .2s, transform .25s;
}
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-arrow:hover {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  border-color: transparent;
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}

/* Caption bar */
.lb-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
}
.lb-caption-inner { display: flex; flex-direction: column; gap: 3px; }
.lb-cat {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
}
.lb-caption h5 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.lb-caption p {
  font-size: 13px;
  color: rgba(255,255,255,.58);
  margin: 0;
  max-width: 480px;
}
.lb-counter {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Lightbox open/close animation */
@keyframes lbIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
.photo-lightbox.lb-open .lb-img-wrap img { animation: lbIn .25s ease; }
