/* ===== SECTIONS.CSS ===== */
/* Section-specific layouts */

/* Sidebar base rules moved to sidebar.css — do not redeclare here */
/* #sidebar, .sidebar-profile, .nav-links, .sidebar-footer styles live in sidebar.css */

/* Adjust main content and footer for the sidebar */
/* Handled via CSS variable --sidebar-w in sidebar.css */

/* Mobile header — hidden on desktop (shown by sidebar.css on mobile) */
.mobile-header {
  display: none;
}

/* ---- Section Alt Background ---- */
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 80px;
}

/* ---- Medium Article Cards with Thumbnails ---- */
.medium-card .pub-card-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}
.medium-card .pub-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Thumbnail wrapper */
.pub-thumb-wrap {
  flex-shrink: 0;
  width: 110px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1.5px solid var(--line);
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}
.pub-thumb-wrap:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

/* The actual screenshot/thumbnail */
.pub-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center; /* show the article image part, not the text */
  display: block;
  transition:
    transform 220ms ease,
    filter 220ms ease;
}
.pub-thumb-wrap:hover .pub-thumb {
  transform: scale(1.06);
  filter: brightness(0.55);
}

/* Hover overlay label */
.pub-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}
.pub-thumb-wrap:hover .pub-thumb-overlay {
  opacity: 1;
}

/* ---- Article Floating Promo Card ---- */
#pub-article-popup {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 320px;
  z-index: 1050;
  background: var(--card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: none;
  flex-direction: column;
  padding: 16px;
  animation: slideUpFade 250ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
#pub-article-popup.active {
  display: flex !important;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pub-popup-box {
  position: relative;
  width: 100%;
  text-align: left;
}
.pub-popup-thumb {
  width: 100%;
  height: 130px;
  object-fit: cover;
  object-position: right center;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--violet), var(--cyan));
}
.pub-popup-title {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.35;
}
.pub-popup-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-family: var(--font-mono);
}
.pub-popup-actions {
  display: flex;
  gap: 8px;
}
.pub-popup-actions .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  justify-content: center;
}
#pub-popup-close {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
  transition: all 150ms ease;
  z-index: 10;
}
#pub-popup-close:hover {
  color: var(--text);
  background: var(--line);
  transform: scale(1.05);
}

@media (max-width: 640px) {
  .medium-card .pub-card-inner {
    flex-direction: column;
  }
  .pub-thumb-wrap {
    width: 100%;
    height: 120px;
  }
  .pub-thumb {
    object-position: center;
  }
}

/* ---- Hero ---- */
.hero {
  padding: 96px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  position: relative;
  max-width: 800px;
}
.hero h1 {
  font-size: var(--fs-display);
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--lh-tight);
  margin-bottom: 24px;
  padding-right: 120px;
}
.text-violet {
  color: var(--text);
}
#typed-role {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  color: var(--text);
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  min-height: 48px;
  min-width: 350px;
  display: block;
  margin-bottom: 24px;
  white-space: nowrap;
  overflow: hidden;
}
#typed-role::after {
  content: "▍";
  animation: blink 1s step-start infinite;
  color: var(--cyan);
}
.hero .lede {
  color: var(--text-dim);
  font-size: 20px;
  max-width: 650px;
  margin-bottom: 40px;
  line-height: var(--lh-base);
  font-weight: var(--fw-regular);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.hero-visual {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: floatY 5s ease-in-out infinite;
}
.qframe {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--violet);
  background: var(--card);
  box-shadow: 0 6px 20px rgba(111, 76, 255, 0.25);
}
.qframe img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hv-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.circuit-svg {
  position: absolute;
  top: -40px;
  right: -40px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
}
.qubit-dot {
  filter: drop-shadow(0 0 6px var(--cyan));
}

/* ---- About ---- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

/* Connect Layout moved to components.css */
/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--line);
  padding: 34px var(--container-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.f-left {
  font-size: 13px;
  color: var(--text-dim);
}
.f-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.footer-visitors {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.admin-trigger-visible {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 500;
  transition: all 0.2s;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.admin-trigger-visible:hover {
  background: rgba(0, 240, 255, 0.1);
}

/* ---- Skills Grid ---- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 40px 24px;
  margin-top: 48px;
}
.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.skill-circle {
  width: 90px;
  height: 90px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  transition: all 0.3s ease;
}
.skill-item:hover .skill-circle {
  transform: translateY(-6px);
  border-color: var(--cyan);
  box-shadow: 0 12px 24px rgba(0, 240, 255, 0.15);
}
.skill-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

/* ---- New Connect Layout (Map Background) ---- */
#panel-connect {
  padding-bottom: 0;
}
.contact-info-centered {
  text-align: center;
  font-size: 16px;
  margin-top: 24px;
}
.contact-info-centered p {
  margin-bottom: 8px;
}
.contact-form-wide {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  margin-top: 40px;
}
.cf-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cf-right {
  display: flex;
}
.cf-right textarea {
  flex-grow: 1;
  min-height: 100%;
}
.cf-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.social-circle-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.3s;
}
.social-circle-btn:hover {
  background: var(--violet);
  color: #fff;
  border-color: var(--violet);
  transform: translateY(-4px);
}

/* ===== ASYMMETRIC BENTO GRIDS ===== */
.cert-grid,
.project-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 32px;
  margin-top: 48px;
}
.cert-card,
.project-card {
  grid-column: span 12;
}
@media (min-width: 768px) {
  /* Bento pattern: Large-Small, Small-Large */
  .cert-card:nth-child(4n + 1),
  .project-card:nth-child(4n + 1) {
    grid-column: span 8;
  }
  .cert-card:nth-child(4n + 2),
  .project-card:nth-child(4n + 2) {
    grid-column: span 4;
  }
  .cert-card:nth-child(4n + 3),
  .project-card:nth-child(4n + 3) {
    grid-column: span 4;
  }
  .cert-card:nth-child(4n + 4),
  .project-card:nth-child(4n + 4) {
    grid-column: span 8;
  }
}
/* Sibling dimming for certificates grid */
.cert-grid:has(.cert-featured-card:hover) .cert-featured-card:not(:hover) {
  opacity: 0.6;
  filter: blur(1.5px);
  transform: scale(0.98);
}

.cert-card,
.project-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}
.cert-card:hover,
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(144, 98, 255, 0.15);
  border-color: rgba(144, 98, 255, 0.5);
}
.cert-card h3,
.project-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.4;
}
.cert-issuer,
.project-lang {
  font-size: 14px;
  color: var(--cyan);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cert-date,
.project-desc {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 16px;
  flex-grow: 1;
}
.project-desc {
  font-family: var(--font-sans);
  line-height: 1.5;
}
.cert-skills,
.project-stats {
  margin-top: auto;
  font-size: 13px;
  color: var(--text-body);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===== FEATURED CERTIFICATES ===== */
.cert-featured-card {
  grid-column: span 12;
  background: var(--card);
  border: 1px solid var(--violet);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s ease,
    opacity 0.4s,
    filter 0.4s;
  box-shadow: 0 4px 20px rgba(144, 98, 255, 0.1);
  cursor: pointer;
}
@media (min-width: 768px) {
  .cert-featured-card {
    grid-column: span 6;
  }
}
@media (min-width: 1024px) {
  .cert-featured-card {
    grid-column: span 4;
  }
}

/* ===== RESULTS CARDS ===== */
.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  cursor: zoom-in;
}
.result-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 229, 255, 0.1);
  border-color: var(--cyan);
}
.result-img-container {
  width: 100%;
  height: 250px;
  background: radial-gradient(circle at center, #1a1a2e 0%, #0d0d16 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  overflow: hidden;
}
.result-img-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.result-card:hover .result-img-container img {
  transform: scale(1.08);
}
.result-info {
  padding: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--line);
}
.result-info h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.cert-featured-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 40px rgba(144, 98, 255, 0.4);
  z-index: 100;
}
.cert-img-container {
  width: 100%;
  height: 280px;
  background: radial-gradient(circle at center, #1a1a2e 0%, #0d0d16 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
}
.cert-img-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 15px;
  transition:
    transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    filter 0.5s;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
}
.cert-featured-card:hover .cert-img-container img {
  transform: scale(1.2);
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.8));
}

/* Floating Badges */
.cert-badges {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 2;
}
.cert-badge {
  background: rgba(0, 229, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: var(--cyan);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.cert-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.cert-info h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.4;
}
.cert-info .cert-issuer {
  font-size: 14px;
  color: var(--cyan);
  font-weight: 600;
  margin-bottom: 4px;
}
.cert-info .cert-date {
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
