/* ==========================================
   Adytia Darmawan — 3D Portfolio Website
   ========================================== */

:root {
  --bg-deep: #0a0e1a;
  --bg-mid: #0f1729;
  --bg-soft: rgba(15, 23, 41, 0.7);
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-mid: rgba(255, 255, 255, 0.15);

  --text-primary: #f5f7fa;
  --text-secondary: #a8b3cf;
  --text-muted: #6b7894;

  --accent: #00d4ff;
  --accent-warm: #ffb74d;
  --accent-glow: rgba(0, 212, 255, 0.4);
  --accent-soft: rgba(0, 212, 255, 0.15);

  --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #0084ff 100%);
  --gradient-warm: linear-gradient(135deg, #ffb74d 0%, #ff6b6b 100%);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px var(--accent-glow);

  --section-padding: clamp(60px, 10vh, 120px) 0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ============= LOADING SCREEN ============= */
#loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-deep), var(--bg-mid));
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  max-width: 400px;
  padding: 32px;
}

.loader-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 32px;
  color: var(--accent);
  animation: rotate 4s linear infinite;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

@keyframes rotate {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

.loader-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.dots {
  display: inline-block;
  width: 20px;
  text-align: left;
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

.loader-bar {
  width: 100%;
  height: 3px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.loader-progress {
  height: 100%;
  width: 0%;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--accent-glow);
}

.loader-tip {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============= NAVIGATION ============= */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px clamp(20px, 5vw, 60px);
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 26, 0.6);
  border-bottom: 1px solid var(--border-soft);
  transition: padding 0.3s ease;
}

#navbar.scrolled {
  padding: 12px clamp(20px, 5vw, 60px);
  background: rgba(10, 14, 26, 0.85);
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-mark {
  color: var(--accent);
  margin-right: 2px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-links a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s;
}

/* ============= 3D CANVAS ============= */
#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ============= PERFORMANCE TOGGLE ============= */
.perf-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  background: var(--bg-soft);
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.7rem;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}

.perf-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============= LAYOUT ============= */
main {
  position: relative;
  z-index: 2;
}

.section {
  position: relative;
  padding: var(--section-padding);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 60px);
}

.section-header {
  margin-bottom: 48px;
  position: relative;
}

.section-num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  font-weight: 600;
  display: block;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-line {
  height: 2px;
  width: 60px;
  background: var(--gradient-primary);
  border-radius: 1px;
}

.section-sub {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ============= HERO ============= */
.section-hero {
  text-align: center;
  padding-top: 120px;
  position: relative;
  overflow: hidden;
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.hero-video-bg video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  filter: blur(2px) saturate(0.85) brightness(0.55);
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 0%, rgba(10, 14, 26, 0.85) 70%),
    linear-gradient(180deg, rgba(10, 14, 26, 0.7), rgba(10, 14, 26, 0.95));
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  padding: 8px 20px;
  border-radius: 100px;
  margin-bottom: 32px;
  text-transform: uppercase;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 32px;
}

.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: heroLineIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-title .line:nth-child(1) { animation-delay: 0.2s; }
.hero-title .line:nth-child(2) { animation-delay: 0.4s; }

.hero-title .accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes heroLineIn {
  to { opacity: 1; transform: translateY(0); }
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  opacity: 0;
  animation: heroLineIn 0.9s 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: heroLineIn 0.9s 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  font-family: var(--font-display);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--bg-deep);
  font-weight: 600;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-mid);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.hero-scroll-hint {
  margin-top: 80px;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: heroLineIn 0.9s 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.scroll-arrow {
  width: 1px;
  height: 40px;
  background: var(--text-muted);
  position: relative;
  overflow: hidden;
}

.scroll-arrow::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--accent);
  animation: scrollHint 2s ease-in-out infinite;
}

@keyframes scrollHint {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(200%); }
}

/* ============= ABOUT ============= */
.section-about {
  background: linear-gradient(180deg, transparent, rgba(10, 14, 26, 0.85) 30%, rgba(10, 14, 26, 0.85));
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-simple {
  max-width: 720px;
}

.about-text .lead {
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 24px;
  line-height: 1.7;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.stat {
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.about-timeline h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.timeline {
  list-style: none;
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border-mid);
}

.timeline li {
  position: relative;
  padding-bottom: 18px;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-year {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 4px;
}

.timeline-title {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
}

/* ============= RESEARCH ============= */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.research-card {
  position: relative;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
}

.research-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.research-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-mid);
  background: var(--bg-card-hover);
}

.research-card:hover::before {
  opacity: 1;
}

.research-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: inline-block;
  width: 56px;
  height: 56px;
  line-height: 56px;
  text-align: center;
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
}

.research-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.research-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-soft);
  border-radius: 100px;
  color: var(--text-muted);
  font-family: var(--font-display);
}

/* ============= PUBLICATIONS ============= */
.section-publications {
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.85), rgba(15, 23, 41, 0.95));
}

.pub-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.pub-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-mid);
}

.filter-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.pub-search {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  min-width: 280px;
  flex: 1;
  max-width: 400px;
  transition: all 0.3s;
}

.pub-search:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.pub-status {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pub-status.error {
  color: var(--accent-warm);
}

.pub-status.hidden {
  display: none;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-mid);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.pub-card {
  position: relative;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.pub-card:hover {
  transform: translateY(-4px) rotateX(2deg);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.1);
}

.pub-year-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
}

.pub-category {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-warm);
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 12px;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
  padding-right: 60px;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-style: italic;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.pub-actions {
  margin-top: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.pub-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 500;
  transition: opacity 0.3s;
}

.pub-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.pub-citations {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-display);
}

/* ============= PRODUCTS / HKI ============= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.product-card {
  position: relative;
  display: block;
  padding: 32px;
  background: linear-gradient(135deg, rgba(255, 183, 77, 0.08), var(--bg-card));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  text-decoration: none;
  color: inherit;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, var(--accent-warm), transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-warm);
  box-shadow: 0 20px 40px rgba(255, 183, 77, 0.12);
}

.product-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent-warm);
  color: var(--bg-deep);
  padding: 4px 12px;
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  z-index: 1;
}

.product-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  padding-right: 80px;
}

.product-type {
  font-size: 0.8rem;
  color: var(--accent-warm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 12px;
}

.product-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.product-link {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}

.product-card:hover .product-link {
  text-decoration: underline;
}

/* ============= AWARDS WALL ============= */
.section-awards {
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.85), rgba(15, 23, 41, 0.92));
}

.awards-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 16px 4px 32px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-soft) transparent;
}

.awards-track::-webkit-scrollbar { height: 6px; }
.awards-track::-webkit-scrollbar-track { background: transparent; }
.awards-track::-webkit-scrollbar-thumb { background: var(--accent-soft); border-radius: 3px; }

.award-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  padding: 24px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, background 0.3s;
  transition-delay: var(--delay, 0ms);
}

.award-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.award-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.award-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.12;
  pointer-events: none;
}

.award-gold::before { background: radial-gradient(circle, #fbbf24, transparent 70%); }
.award-silver::before { background: radial-gradient(circle, #cbd5e1, transparent 70%); }
.award-bronze::before { background: radial-gradient(circle, #d97706, transparent 70%); }

.award-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.award-gold .award-icon { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.award-silver .award-icon { background: rgba(203, 213, 225, 0.15); color: #cbd5e1; }
.award-bronze .award-icon { background: rgba(217, 119, 6, 0.15); color: #d97706; }

.award-year {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.award-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.award-org {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ============= FEATURED REEL ============= */
.section-reel {
  padding: 0;
  min-height: auto;
  background: var(--bg-deep);
}

.reel-wrapper {
  position: relative;
  width: 100%;
  height: clamp(540px, 84vh, 860px);
  overflow: hidden;
}

.reel-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: brightness(0.65);
}

.reel-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  background: linear-gradient(135deg, rgba(10, 14, 26, 0.5), rgba(10, 14, 26, 0.2));
}

.reel-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 6px 18px;
  border: 1px solid var(--accent);
  border-radius: 100px;
  margin-bottom: 24px;
  backdrop-filter: blur(4px);
}

.reel-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: white;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.reel-caption {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
}

/* ============= REVEAL ANIMATIONS ============= */
.section {
  opacity: 1;
}

/* Reveal animation - only applies when JS adds .reveal-ready class */
.reveal-ready .research-card,
.reveal-ready .product-card,
.reveal-ready .pub-card,
.reveal-ready .gallery-item,
.reveal-ready .eilero-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.reveal-ready .research-card.revealed,
.reveal-ready .product-card.revealed,
.reveal-ready .pub-card.revealed,
.reveal-ready .gallery-item.revealed,
.reveal-ready .eilero-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Default: visible (no JS / no observer) */
.research-card,
.product-card,
.pub-card,
.gallery-item,
.eilero-card {
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============= GALLERY ============= */
.section-gallery {
  background: linear-gradient(180deg, rgba(15, 23, 41, 0.95), rgba(10, 14, 26, 0.95));
}

.gallery-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  justify-content: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 220px;
  gap: 12px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item-featured {
  grid-row: span 2;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.15);
}

.gallery-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-media img,
.gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover .gallery-media img,
.gallery-item:hover .gallery-media video {
  transform: scale(1.06);
}

.gallery-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
  z-index: 2;
  pointer-events: none;
}

.gallery-item:hover .gallery-play-icon {
  background: var(--accent);
  color: var(--bg-deep);
  transform: translate(-50%, -50%) scale(1.1);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10, 14, 26, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  z-index: 1;
  pointer-events: none;
}

.gallery-year {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s;
}

.gallery-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s 0.05s;
  line-height: 1.3;
}

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

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 60px;
}

/* ============= LIGHTBOX ============= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
  animation: lbFadeIn 0.3s ease;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.95);
  backdrop-filter: blur(20px);
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
  max-height: 90vh;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
  background: var(--bg-soft);
  backdrop-filter: blur(8px);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  max-width: 720px;
  width: 100%;
}

.lightbox-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.lightbox-year {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 600;
}

.lightbox-counter {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: white;
}

.lightbox-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 2;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-mid);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}

.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-auto-rows: 180px;
  }
  .lightbox-prev, .lightbox-next {
    width: 40px;
    height: 40px;
  }
  .lightbox-close { top: 16px; right: 16px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ============= EILERO ============= */
.eilero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.eilero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.eilero-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.eilero-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-mid);
  overflow: hidden;
}

.eilero-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.eilero-info {
  padding: 20px;
}

.eilero-year {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.eilero-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 6px 0 8px;
}

.eilero-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============= CONTACT ============= */
.section-contact {
  background: linear-gradient(180deg, rgba(15, 23, 41, 0.95), var(--bg-deep));
  flex-direction: column;
  justify-content: center;
}

.contact-card {
  max-width: 560px;
  margin: 0 auto;
  perspective: 1000px;
}

.contact-card-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 48px;
  backdrop-filter: blur(20px);
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-soft);
}

.contact-card:hover .contact-card-inner {
  transform: rotateY(-4deg) rotateX(2deg);
}

.contact-header h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.contact-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.contact-info {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.contact-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateX(4px);
}

.contact-icon {
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 600;
}

.footer {
  margin-top: 80px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid var(--border-soft);
  }

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

  .nav-toggle {
    display: flex;
  }

  .pub-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .pub-search {
    max-width: 100%;
    width: 100%;
  }

  .contact-card-inner {
    padding: 32px 24px;
  }
}

@media (max-width: 600px) {
  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px;
  }

  .stat-num {
    font-size: 1.5rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============= DEPLOY STABILITY OVERRIDES ============= */
.section-awards {
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.86), rgba(15, 23, 41, 0.94));
}

.awards-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  overflow: visible;
  padding: 0;
  scroll-snap-type: none;
}

.award-card {
  min-width: 0;
  min-height: 190px;
  width: 100%;
}

.award-title,
.award-org {
  overflow-wrap: anywhere;
}

.section-gallery {
  background: linear-gradient(180deg, rgba(15, 23, 41, 0.94), rgba(10, 14, 26, 0.9));
}

.gallery-filters {
  margin-bottom: 24px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: auto !important;
  gap: 18px;
  align-items: stretch;
}

.gallery-item,
.gallery-item-featured {
  min-height: 0;
  grid-column: auto !important;
  grid-row: auto !important;
  aspect-ratio: 4 / 3;
}

.gallery-media {
  height: 100%;
}

.gallery-media img,
.gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 700px) {
  .awards-track,
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 56px 0;
  }

  #navbar {
    padding: 14px 18px;
  }

  #navbar.scrolled {
    padding: 10px 18px;
  }

  .nav-brand {
    font-size: 1rem;
  }

  .section {
    min-height: auto;
  }

  .section-hero {
    min-height: 100vh;
    padding-top: 96px;
  }

  .hero-title {
    font-size: clamp(2.65rem, 18vw, 4.2rem);
  }

  .hero-subtitle {
    font-size: 0.98rem;
  }

  .research-grid,
  .pub-grid,
  .products-grid,
  .eilero-grid {
    grid-template-columns: 1fr;
  }

  .pub-card,
  .product-card,
  .research-card {
    padding: 22px;
  }

  .pub-title,
  .product-title {
    padding-right: 0;
  }

  .pub-year-badge,
  .product-badge {
    position: static;
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 10px;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .award-card {
    min-height: 170px;
  }

  .gallery-grid {
    gap: 14px;
  }

  .gallery-item {
    aspect-ratio: 16 / 11;
  }

  .reel-wrapper {
    height: min(76vh, 620px);
  }

  .reel-title {
    font-size: clamp(2.2rem, 13vw, 3.6rem);
  }

  .reel-caption {
    font-size: 0.95rem;
  }

  .lightbox-stage {
    max-width: 94vw;
    max-height: 86vh;
  }

  .lightbox-info {
    padding: 16px;
  }
}
