/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  /* Dark modern palette */
  --bg: #0c0c0e;
  --surface: #141416;
  --surface-2: #1c1c20;
  --border: rgba(255, 255, 255, 0.07);
  --accent: #818cf8;
  --accent-dark: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.25);

  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Resume light palette */
  --resume-bg: #f8fafc;
  --resume-sidebar: #111113;
  --resume-border: #e2e8f0;

  /* Compat aliases */
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-dark: #0c0c0e;
  --color-accent: #818cf8;

  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);

  --radius: 10px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition: 0.2s ease;
}

/* ============================================================
   Reset
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
  font-family: "Poppins", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   Scroll Progress Bar
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent), #a5b4fc);
  z-index: 10000;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent-glow), 0 0 4px var(--accent);
}

/* ============================================================
   Scroll Container
   ============================================================ */
.scroll-container {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  height: 100vh;
  width: 100%;
}

section {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  scroll-snap-align: start;
  width: 100%;
}

/* ============================================================
   Scroll Reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ============================================================
   INTRO SECTION
   ============================================================ */
.intro-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Animated dot grid overlay */
.intro-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  animation: gridDrift 25s linear infinite;
  z-index: 0;
}

@keyframes gridDrift {
  0%   { transform: translateY(0); }
  100% { transform: translateY(60px); }
}

/* Pulsing center glow */
.intro-container::after {
  content: "";
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 65%);
  pointer-events: none;
  animation: pulseGlow 5s ease-in-out infinite;
  z-index: 0;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.2); }
}

.intro-container > * {
  position: relative;
  z-index: 1;
}

.type {
  color: #fff;
  font-family: "DotGothic16", sans-serif;
  font-size: 40px;
  opacity: 0;
  transform: translateY(-50px);
  user-select: none;
  cursor: pointer;
}

.type.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 1.5s ease;
}

.type-1 {
  color: #fff;
  font-family: "VT323", monospace;
  font-size: 40px;
  margin-bottom: 9.5px;
  display: none;
  user-select: none;
  cursor: pointer;
  transition: opacity 0.5s ease;
}

.text {
  color: #fff;
  font-family: "VT323", monospace;
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
  opacity: 0;
  transform: translateX(-20px);
  user-select: none;
}

.text::after {
  content: "|";
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  opacity: 0;
}

.text.show {
  transform: translateX(0);
  transition: opacity 0.5s ease, transform 1s ease;
  opacity: 1;
}

.text.show::after {
  opacity: 1;
}

.text.typing-done::after {
  animation: none;
  opacity: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.scrollDown {
  background: transparent;
  border: none;
  cursor: pointer;
  margin-top: 20px;
  opacity: 0;
  transform: translateY(5px);
}

.scrollDown svg {
  transition: transform var(--transition);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.scrollDown:hover svg {
  transform: translateY(5px);
}

.scrollDown.showButton {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.intro {
  opacity: 1;
  transition: opacity 0.8s ease;
}

.intro.fade-out {
  opacity: 0;
}

/* ============================================================
   ABOUT / MAIN SECTION
   ============================================================ */
.main-container {
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Primary ambient orb */
.main-container::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.09) 0%, transparent 65%);
  pointer-events: none;
}

/* Floating accent orb */
.main-container::after {
  content: "";
  position: absolute;
  top: 15%;
  right: 8%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.13) 0%, transparent 65%);
  pointer-events: none;
  animation: floatOrb 7s ease-in-out infinite;
  border-radius: 50%;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.8; }
  50%       { transform: translateY(-24px) scale(1.08); opacity: 1; }
}

.profile-container {
  display: flex;
  align-items: center;
  gap: 48px;
  background: rgba(20, 20, 22, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(99, 102, 241, 0.06);
  max-width: 860px;
  width: 90%;
  z-index: 1;
  position: relative;
  overflow: hidden;
}

/* Gradient shimmer line on top edge */
.profile-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(99, 102, 241, 0.6) 50%, transparent 100%);
  pointer-events: none;
}

.profile-photo {
  user-select: none;
  pointer-events: none;
  flex-shrink: 0;
}

@keyframes photoGlow {
  0%, 100% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.2), var(--shadow-md); }
  50%       { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0.12), 0 0 32px rgba(99, 102, 241, 0.35); }
}

.profile-photo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--accent-dark);
  animation: photoGlow 3.5s ease-in-out infinite;
  display: block;
}

.about-text {
  color: var(--text);
  font-family: "Poppins", sans-serif;
  user-select: none;
}

.about-label {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.about-text h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f1f5f9 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-text > p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 22px;
  max-width: 420px;
}

/* ============================================================
   Social Icons
   ============================================================ */
.social-icons {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--transition);
}

.social-icons a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.88rem;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all var(--transition);
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover::after { opacity: 1; }

.btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn.btn-outline:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.btn.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

/* ============================================================
   RESUME / FRAME SECTION
   ============================================================ */
.frame-section {
  background: var(--bg);
  display: none;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 24px;
}

.frame-section .resume-container {
  background: var(--resume-bg);
  width: 100%;
  max-width: 1100px;
  height: calc(100vh - 48px);
  max-height: 820px;
  display: grid;
  grid-template-columns: 260px 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Sidebar */
.frame-section .sidebar {
  background: var(--resume-sidebar);
  color: #fff;
  padding: 2rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.frame-section .sidebar::-webkit-scrollbar { display: none; }

.sidebar-top,
.sidebar-mid {
  margin-bottom: 1.2rem;
}

.sidebar-actions {
  margin-top: auto;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.frame-section .sidebar h1 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
  color: #fff;
}

.frame-section .section-title {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: 1.2rem;
  margin-bottom: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.frame-section .sidebar p {
  font-size: 0.82rem;
  margin: 4px 0;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.frame-section .sidebar p i {
  color: var(--accent);
  font-size: 0.75rem;
  width: 14px;
  flex-shrink: 0;
}

/* Resume main area */
.frame-section .resume-main {
  padding: 2rem 2.4rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--resume-border) transparent;
  background: var(--resume-bg);
}

.frame-section .resume-main::-webkit-scrollbar { width: 4px; }
.frame-section .resume-main::-webkit-scrollbar-thumb {
  background: var(--resume-border);
  border-radius: 4px;
}

.frame-section .main-section {
  margin-bottom: 1.8rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.frame-section .main-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.frame-section .resume-main h2 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--resume-border);
}

.frame-section .resume-main h2 i { font-size: 0.85rem; }

.frame-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.frame-section ul li {
  font-size: 0.9rem;
  color: #374151;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.frame-section ul li:hover { background: #f1f5f9; }

.frame-section ul li .year {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Skill / Project tags */
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.skill-tag {
  display: inline-block;
  padding: 5px 14px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  cursor: default;
}

.skill-tag::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.4s ease;
}

.skill-tag:hover {
  background: #dde4ff;
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.skill-tag:hover::after { left: 150%; }

/* Reference card */
.reference-card {
  background: #f8fafc;
  border: 1px solid var(--resume-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.reference-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.reference-card .ref-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
}

.reference-card .ref-title {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 4px;
}

.reference-card p {
  font-size: 0.82rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reference-card p i {
  color: var(--accent-dark);
  font-size: 0.75rem;
  width: 14px;
}

/* Resume sidebar buttons */
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #cbd5e1;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: "Poppins", sans-serif;
  text-decoration: none;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.download-btn:hover {
  background: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

/* Resume sidebar Profile block */
.sidebar-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1.4rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

/* Accent glow line at very top of sidebar */
.sidebar-profile::before {
  content: "";
  position: absolute;
  top: -2rem;
  left: -1.6rem;
  right: -1.6rem;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

.sidebar-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent-dark);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18), 0 4px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-profile h1 {
  font-size: 0.82rem !important;
  font-weight: 700;
  color: #f1f5f9 !important;
  line-height: 1.3;
  margin-bottom: 4px !important;
  letter-spacing: 0.03em;
}

.sidebar-degree {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Tool Tags */
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.tool-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 500;
  transition: all var(--transition);
}

.tool-tag i {
  font-size: 0.68rem;
  color: var(--accent);
}

.tool-tag:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #f1f5f9;
}

/* Timeline List */
.timeline-list {
  list-style: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  position: relative;
  padding-left: 22px !important;
}

.timeline-list::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), #c7d2fe, transparent);
  opacity: 0.5;
}

.timeline-list li {
  position: relative;
  padding: 7px 10px 7px 14px !important;
  border-radius: var(--radius) !important;
}

.timeline-list li::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dark);
  border: 2px solid var(--resume-bg);
  box-shadow: 0 0 0 1.5px var(--accent-dark);
  z-index: 1;
}

.timeline-list li:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent), 0 0 8px rgba(99, 102, 241, 0.4);
}

/* ============================================================
   Allow text selection in resume content area
   ============================================================ */
.frame-section .resume-main,
.reference-card p {
  user-select: text;
  -webkit-user-select: text;
}

/* ============================================================
   GALLERY / WORKS SECTION
   ============================================================ */
.below {
  height: 100vh;
  overflow: hidden;
  padding: 0;
}

.below-container {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* Gallery sticky header */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 12px;
}

.below-navbar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-header-spacer {
  width: 34px;
  flex-shrink: 0;
}

.home-tab-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.home-tab-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.below-navbar ul {
  list-style: none;
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
}

.below-navbar li { display: inline; }

.below-navbar a {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.below-navbar a:hover { color: var(--text); }

.below-navbar a.active {
  background: var(--accent-dark);
  color: #fff;
}

/* Tab count badges */
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 17px;
  padding: 0 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-full);
  font-size: 0.62rem;
  font-weight: 700;
  margin-left: 4px;
  color: var(--text-muted);
  vertical-align: middle;
  transition: all var(--transition);
}

.below-navbar a.active .tab-count {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================================
   BENTO GALLERY GRID
   ============================================================ */
.works-gallery {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  grid-auto-flow: row dense;
  gap: 10px;
  padding: 14px 18px;
  overflow-y: auto;
  align-content: start;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
}

.works-gallery::-webkit-scrollbar { width: 4px; }
.works-gallery::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 4px;
}

.works-gallery.active { display: grid; }

/* ── Featured first item: 2 cols × 2 rows ── */
.works-gallery > .gallery-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

/* ── Videos: 2 cols wide (landscape) ── */
.works-gallery > .video-wrapper {
  grid-column: span 2;
}

/* ─── Gallery Item (image card) ─── */
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-2);
  aspect-ratio: unset;
  height: 100%;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.gallery-item .gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover .gallery-img {
  transform: scale(1.07);
}

/* Dark gradient + zoom icon overlay on hover */
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(6, 6, 18, 0.75) 0%,
    rgba(6, 6, 18, 0.1) 55%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.gallery-item:hover::after { opacity: 1; }

/* "Photo" pill label — top left on hover */
.gallery-item::before {
  content: attr(data-type);
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.92);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.64rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 3;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.gallery-item:hover::before {
  opacity: 1;
  transform: translateY(0);
}

/* Zoom icon — bottom right on hover */
.zoom-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  opacity: 0;
  transform: scale(0.7) translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 3;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gallery-item:hover .zoom-icon {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ─── Video Wrapper ─── */
.video-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  height: 100%;
  aspect-ratio: unset;
  /* fallback bg if video poster doesn't load */
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1040 60%, #0d0d18 100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease;
}

.video-wrapper:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.22);
}

/* Gallery video thumbnail (shown via poster attribute) */
.gallery-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Hide browser default video controls */
.gallery-video::-webkit-media-controls,
.gallery-video::-webkit-media-controls-enclosure,
.gallery-video::-webkit-media-controls-panel {
  display: none !important;
}

/* "Video" pill label — always visible */
.video-wrapper::before {
  content: "video";
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(99, 102, 241, 0.82);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.64rem;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  z-index: 3;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

/* Play button overlay */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
  transition: background var(--transition);
  z-index: 2;
}

.video-wrapper:hover .play-overlay {
  background: rgba(0, 0, 0, 0.42);
}

/* Play circle button */
.play-overlay i {
  font-size: 1rem;
  color: #fff;
  background: rgba(99, 102, 241, 0.88);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 10px rgba(99, 102, 241, 0.18),
    0 4px 24px rgba(0, 0, 0, 0.55);
  padding-left: 4px; /* optical centre for play arrow */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-wrapper:hover .play-overlay i {
  transform: scale(1.12);
  box-shadow:
    0 0 0 15px rgba(99, 102, 241, 0.12),
    0 4px 30px rgba(0, 0, 0, 0.65);
}

/* Tab switch stagger animation */
.works-gallery.switching .gallery-item,
.works-gallery.switching .video-wrapper {
  animation: itemFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes itemFadeIn {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   Fullscreen Image Viewer
   ============================================================ */
.fullscreen-view {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  flex-direction: column;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.fullscreen-view img {
  max-width: 88%;
  max-height: 84%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition: opacity 0.2s ease;
}

.fullscreen-view .close-btn {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 2rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  user-select: none;
  z-index: 10000;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.fullscreen-view .close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

/* Lightbox prev/next arrows */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: all 0.2s ease;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Image counter */
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  font-family: "Poppins", sans-serif;
  background: rgba(0, 0, 0, 0.45);
  padding: 4px 16px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
}

/* ============================================================
   Responsive — Tablet ≤ 1024px  (3-col bento)
   ============================================================ */
@media (max-width: 1024px) {
  .works-gallery {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 175px;
  }

  /* Keep first item as 2×2 */
  .works-gallery > .gallery-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
  }

  /* Videos still 2-wide */
  .works-gallery > .video-wrapper {
    grid-column: span 2;
  }
}

/* ============================================================
   Responsive — Tablet ≤ 900px
   ============================================================ */
@media (max-width: 900px) {
  .profile-container {
    gap: 32px;
    padding: 36px 32px;
  }

  .profile-photo img {
    width: 150px;
    height: 150px;
  }

  .about-text h1 { font-size: 1.9rem; }

  .frame-section .resume-container {
    grid-template-columns: 220px 1fr;
  }
}

/* ============================================================
   Responsive — Mobile ≤ 768px
   ============================================================ */
@media (max-width: 768px) {
  /* Intro */
  .intro-container {
    padding: 0 20px;
    text-align: center;
  }

  .type {
    font-size: clamp(1.2rem, 5.5vw, 2rem);
    text-align: center;
    padding: 0 12px;
    word-break: break-word;
  }

  .type-1 {
    font-size: clamp(1.2rem, 5.5vw, 2rem);
    text-align: center;
    padding: 0 12px;
  }

  .text {
    font-size: clamp(0.95rem, 4vw, 1.3rem);
    text-align: center;
    padding: 0 12px;
  }

  /* About */
  .profile-container {
    flex-direction: column;
    text-align: center;
    padding: 28px 20px;
    gap: 20px;
    width: 94%;
  }

  .profile-photo img {
    width: 130px;
    height: 130px;
  }

  .about-text > p { max-width: 100%; }

  .about-text h1 { font-size: 1.8rem; }

  .social-icons { justify-content: center; }
  .btn-group    { justify-content: center; }

  /* Resume */
  .frame-section {
    padding: 0;
    align-items: flex-start;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    scroll-snap-align: start;
  }

  .frame-section .resume-container {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }

  .frame-section .sidebar { padding: 1.6rem 1.2rem; }

  .sidebar-actions {
    flex-direction: row;
    padding-top: 1rem;
  }

  .back-btn,
  .download-btn {
    flex: 1;
    font-size: 0.82rem;
    padding: 10px 12px;
  }

  .frame-section .resume-main {
    padding: 1.6rem 1.2rem;
    overflow-y: visible;
  }

  /* Gallery */
  .gallery-header { padding: 10px 14px; }

  .below-navbar a {
    padding: 5px 12px;
    font-size: 0.8rem;
  }

  /* 2-col bento on mobile */
  .works-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
    gap: 8px;
    padding: 10px 12px;
  }

  /* First item: tall single column */
  .works-gallery > .gallery-item:first-child {
    grid-column: span 1;
    grid-row: span 2;
  }

  /* Videos still span full width on mobile */
  .works-gallery > .video-wrapper {
    grid-column: span 2;
  }

  /* Labels always visible on touch */
  .gallery-item::before,
  .gallery-item .zoom-icon {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
  }

  .gallery-item::after { opacity: 1 !important; }

  /* Lightbox arrows */
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
}

/* ============================================================
   Responsive — Small phones ≤ 480px
   ============================================================ */
@media (max-width: 480px) {
  .type, .type-1 { font-size: clamp(1rem, 5vw, 1.4rem); }
  .text          { font-size: clamp(0.85rem, 3.8vw, 1.1rem); }

  .profile-container { padding: 22px 16px; }

  .profile-photo img {
    width: 110px;
    height: 110px;
  }

  .about-text h1 { font-size: 1.5rem; }

  .btn {
    padding: 9px 18px;
    font-size: 0.84rem;
  }

  .works-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 120px;
    gap: 6px;
    padding: 8px 10px;
  }
}

/* ============================================================
   Responsive — Landscape Mobile (rotated phone, height ≤ 500px)
   ============================================================ */
@media (orientation: landscape) and (max-height: 500px) {

  .scroll-container { height: 100dvh; }
  section           { height: 100dvh; }

  /* Intro */
  .intro-container {
    padding: 0 32px;
    text-align: left;
  }

  .type, .type-1 {
    font-size: clamp(1rem, 4.5vh, 1.6rem);
    text-align: left;
    padding: 0;
  }

  .text {
    font-size: clamp(0.8rem, 2.8vh, 1rem);
    text-align: left;
    padding: 0;
    margin-top: 6px;
  }

  /* About */
  .main-container { overflow-y: auto; }

  .profile-container {
    flex-direction: row !important;
    text-align: left !important;
    gap: 20px;
    padding: 18px 22px;
    align-items: center;
    width: min(92%, 640px);
  }

  .profile-photo { flex-shrink: 0; }

  .profile-photo img {
    width: 86px !important;
    height: 86px !important;
  }

  .about-text h1    { font-size: 1.4rem !important; }
  .about-text > p   { font-size: 0.82rem; line-height: 1.55; }
  .social-icons     { justify-content: flex-start; }
  .btn-group        { justify-content: flex-start; margin-top: 10px; }

  .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  /* Resume */
  .frame-section {
    height: 100dvh;
    overflow: hidden;
    min-height: unset;
  }

  .frame-section .resume-container {
    grid-template-columns: 170px 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0;
    overflow: hidden;
  }

  .frame-section .sidebar {
    overflow-y: auto;
    padding: 1rem 0.9rem;
  }

  .sidebar-avatar {
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
  }

  .sidebar-profile h1  { font-size: 0.72rem !important; }

  .sidebar-actions {
    flex-direction: column;
    gap: 6px;
    padding-top: 0.6rem;
  }

  .back-btn,
  .download-btn {
    flex: none;
    font-size: 0.72rem;
    padding: 7px 10px;
  }

  .frame-section .resume-main {
    overflow-y: auto;
    padding: 0.9rem 1rem;
  }

  .main-section h2 {
    font-size: 0.78rem;
    padding-bottom: 6px;
    margin-bottom: 8px;
  }

  .timeline-list li {
    font-size: 0.78rem;
    padding: 3px 0;
  }

  .reference-card { padding: 10px 12px; }

  /* Gallery */
  .below          { height: 100dvh; }

  .below-container {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .gallery-header {
    padding: 7px 14px;
    flex-shrink: 0;
  }

  .works-gallery {
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-rows: 100px !important;
    gap: 6px !important;
    padding: 8px 12px !important;
    overflow-y: auto;
    flex: 1;
  }

  .works-gallery > .gallery-item:first-child {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
  }

  .works-gallery > .video-wrapper {
    grid-column: span 2 !important;
  }

  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }

  .lightbox-prev,
  .lightbox-next {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
}
