/* about.css — About page styles */
.about-hero {
  padding: var(--space-20) 0 var(--space-12);
  text-align: center;
}

.about-hero__avatar {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-full);
  border: 3px solid var(--accent-primary);
  margin: 0 auto var(--space-6);
  object-fit: cover;
  box-shadow: var(--shadow-glow);
}

.about-hero__name {
  font-size: var(--text-4xl);
  font-weight: var(--weight-extrabold);
  margin-bottom: var(--space-2);
}

.about-hero__role {
  font-size: var(--text-xl);
  color: var(--accent-primary);
  font-family: var(--font-mono);
  margin-bottom: var(--space-6);
}

.about-hero__bio {
  max-width: 700px;
  margin: 0 auto;
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Strengths table */
.strengths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.strength-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.strength-item__icon {
  font-size: var(--text-2xl);
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-accent);
}

.strength-item__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-1);
  color: var(--accent-primary);
}

.strength-item__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Lectures table */
.lectures-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.lectures-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--border-medium);
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lectures-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: top;
}

.lectures-table tr:hover td {
  background: var(--bg-glass);
}

.lectures-table .grade {
  color: var(--accent-primary);
  font-weight: var(--weight-semibold);
  font-family: var(--font-mono);
}

/* Code animation */
.about-code {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.about-code__header {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.about-code__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.about-code__dot:nth-child(1) {
  background: #ff5f57;
}

.about-code__dot:nth-child(2) {
  background: #febc2e;
}

.about-code__dot:nth-child(3) {
  background: #28c840;
}

.about-code__display {
  min-height: 60px;
  white-space: pre-wrap;
}

.about-code .cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent-primary);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

.about-code .kw {
  color: #c678dd;
}

.about-code .fn {
  color: #61afef;
}

.about-code .str {
  color: #98c379;
}

.about-code .cm {
  color: #5c6370;
  font-style: italic;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Home IoT 3D Section */
.iot-overlay {
  z-index: 2;
}

#iot-title-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  transition: all 1.5s cubic-bezier(0.25, 1, 0.5, 1);
  width: 90%;
  max-width: 800px;
}

#iot-title-box .section-title,
#iot-title-box .section-desc {
  margin-left: auto;
  margin-right: auto;
  transition: margin 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

#iot-title-box.corner {
  top: var(--space-8);
  left: var(--space-8);
  transform: translate(0, 0);
  text-align: left;
}

#iot-title-box.corner .section-title,
#iot-title-box.corner .section-desc {
  margin-left: 0;
  margin-right: auto;
}

/* 3D Control Hint Styles */
#iot-control-hint {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-hint-desktop,
.control-hint-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.sep {
  opacity: 0.3;
  margin: 0 4px;
}

.key {
  color: var(--accent-primary);
  font-weight: 700;
  background: rgba(0, 229, 160, 0.05);
  padding: 1px 4px;
  border-radius: 3px;
}

.control-hint-desktop,
.control-hint-mobile { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
}

.control-hint-desktop {
  white-space: nowrap;
}

@media (max-width: 768px) {
  #iot-control-hint {
    bottom: var(--space-4) !important;
    right: var(--space-4) !important;
    max-width: calc(100% - var(--space-8));
    border-radius: var(--radius-lg) !important;
  }
  
  .control-hint-mobile {
    flex-wrap: wrap;
    justify-content: flex-end;
    white-space: normal;
    line-height: 1.6;
    text-align: right;
  }
}


/* Gallery Link Badge Styles */
.gallery-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(0, 229, 160, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-full);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 229, 160, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-badge:hover {
  background: var(--accent-primary);
  color: var(--black);
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 229, 160, 0.4);
}

.gallery-badge .icon {
  font-size: 1.2em;
}

.gallery-badge .arrow {
  opacity: 0.7;
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .gallery-badge {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
  #iot-gallery-link {
    top: var(--space-4) !important;
    right: var(--space-4) !important;
  }
}

/* Combined responsive logic above */


/* Hobbies Bento Grid */
.hobbies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 240px;
  gap: var(--space-4);
}

.hobby-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--border-subtle);
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  /* Fix for rounded corners overflow during transform */
  mask-image: radial-gradient(white, black);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.hobby-card--wide { grid-column: span 2; }
.hobby-card--tall { grid-row: span 2; }

.hobby-card__bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 0;
  overflow: hidden;
}

.hobby-card__video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320%; /* Aggressive width to cover the tall bento aspect ratio */
  height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: brightness(0.45) saturate(0.8);
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.hobby-card:hover .hobby-card__video-bg {
  transform: translate(-50%, -50%) scale(1.05);
}

.hobby-card__slideshow {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
}

.hobby-card__slide {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  animation: hobbyFade 25s infinite;
}

.hobby-card__slide--dimmed {
  filter: brightness(0.4) contrast(1.1);
}

.hobby-card__slide:first-child {
  opacity: 1; /* Ensure first slide is visible while others are loading/animating */
}

.hobby-card:hover .hobby-card__slide {
  transform: scale(1.1);
}

@keyframes hobbyFade {
  0% { opacity: 0; transform: scale(1); }
  4% { opacity: 1; }
  20% { opacity: 1; }
  24% { opacity: 0; transform: scale(1.1); }
  100% { opacity: 0; }
}

/* Staggered delays for 5 slides (Default) */
.hobby-card__slide:nth-child(1) { animation-delay: 0s; }
.hobby-card__slide:nth-child(2) { animation-delay: 5s; }
.hobby-card__slide:nth-child(3) { animation-delay: 10s; }
.hobby-card__slide:nth-child(4) { animation-delay: 15s; }
.hobby-card__slide:nth-child(5) { animation-delay: 20s; }

/* Dedicated 2-slide logic to avoid empty gaps */
.hobby-card__slideshow--2 .hobby-card__slide {
  animation: hobbyFade2 12s infinite;
}

.hobby-card__slideshow--2 .hobby-card__slide:nth-child(1) { animation-delay: 0s; }
.hobby-card__slideshow--2 .hobby-card__slide:nth-child(2) { animation-delay: 6s; }

@keyframes hobbyFade2 {
  0% { opacity: 0; transform: scale(1); }
  8% { opacity: 1; }
  50% { opacity: 1; }
  58% { opacity: 0; transform: scale(1.05); }
  100% { opacity: 0; }
}

.hobby-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.95) 10%, rgba(10, 10, 15, 0.4) 50%, transparent 100%);
  z-index: 1;
}

.hobby-card__content {
  position: relative;
  z-index: 2;
  padding: var(--space-6);
  transform: translateY(10px);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.hobby-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-5px);
}

.hobby-card:hover .hobby-card__bg {
  transform: scale(1.1);
}

.hobby-card:hover .hobby-card__content {
  transform: translateY(0);
}

.hobby-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.hobby-card__icon {
  font-size: 1.5rem;
}

.hobby-card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
  color: #fff;
}

.hobby-card__desc {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-bottom: var(--space-4);
  opacity: 0.8;
}

.hobby-card__actions {
  display: flex;
  gap: var(--space-2);
}

.btn--glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: var(--space-1-5) var(--space-3);
  font-size: 0.75rem;
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

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

@media(max-width:1024px) {
  .hobbies-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width:768px) {
  .hobbies-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(240px, auto);
  }
  .hobby-card--wide, .hobby-card--tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media(max-width:768px) {
  .about-hero__name {
    font-size: var(--text-3xl);
  }

  .about-hero__avatar {
    width: 110px;
    height: 110px;
  }

  .lectures-table {
    font-size: var(--text-xs);
  }

  .lectures-table th,
  .lectures-table td {
    padding: var(--space-2) var(--space-3);
  }
}

/* Video Modal & Trigger positioning */
#iot-video-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: var(--space-3) !important;
}

#iot-video-btn:hover {
  transform: translateY(-2px);
}

.video-trigger__icon {
  width: 24px;
  height: 24px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  font-size: 10px;
  position: relative;
  padding-left: 1px;
  margin-right: 8px;
}

.video-trigger__icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 1px solid var(--accent-primary);
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@media (max-width: 768px) {
  #iot-video-btn {
    top: 60px !important;
    right: 16px !important;
    padding: 6px 10px !important;
  }
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.video-modal.active {
  opacity: 1;
}

.video-modal__container {
  width: 90%;
  max-width: 1000px;
  aspect-ratio: 16/9;
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: visible; /* For close button */
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.video-modal__close {
  position: absolute;
  top: -45px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.video-modal__close:hover { opacity: 1; }

.video-trigger:hover {
  background: rgba(0, 229, 160, 0.15);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 229, 160, 0.2);
}

.video-trigger__icon {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  font-size: 14px;
  position: relative;
  padding-left: 2px; /* Visual center for play icon */
}

.video-trigger__icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--accent-primary);
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

.video-trigger__text {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.video-modal.active {
  opacity: 1;
}

.video-modal__container {
  width: 90%;
  max-width: 1000px;
  aspect-ratio: 16/9;
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: visible; /* For close button */
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.video-modal__close {
  position: absolute;
  top: -45px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.video-modal__close:hover { opacity: 1; }

@media (max-width: 768px) {
  .video-trigger {
    top: 60px;
    right: 16px;
    padding: 6px 12px;
  }
  .video-trigger__text {
    font-size: var(--text-xs);
  }
  .video-trigger__icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}