/* ============================================================
   HEX MENU — Complete styles
   Covers: START button, Why-intro, Hex menu, Section panels,
           Panel content, Cert lightbox
   ============================================================ */

/* ─── Shared hex clip-path utility ─────────────────────────── */
.hex-clip {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* ============================================================
   START / ENTER BUTTON — clean text button, no hex shape
   ============================================================ */
#start-btn {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  opacity: 0;
  pointer-events: none;

  /* Plain rectangular button */
  clip-path: none;
  width: auto;
  height: auto;
  padding: 0.7rem 2.4rem;

  background: transparent;
  border: 1px solid rgba(240, 184, 76, 0.5);
  border-radius: 3px;
  cursor: pointer;
  outline: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Ambient amber glow behind the button */
  box-shadow: 0 0 18px rgba(240, 184, 76, 0.08),
              0 0 40px rgba(240, 184, 76, 0.04);

  transition: background  0.28s ease,
              border-color 0.28s ease,
              box-shadow   0.28s ease,
              transform    0.28s ease;
}

/* Remove the old dark-fill layer — not needed */
#start-btn::after {
  display: none;
}

/* Idle breathing glow on the border */
@keyframes startPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(240,184,76,0.08), 0 0 36px rgba(240,184,76,0.04); border-color: rgba(240,184,76,0.4); }
  50%       { box-shadow: 0 0 28px rgba(240,184,76,0.20), 0 0 56px rgba(240,184,76,0.10); border-color: rgba(240,184,76,0.75); }
}

#start-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  animation: startPulse 2.6s ease-in-out infinite;
}

.start-btn-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* compensate letter-spacing on last char */
  color: var(--accent);
  text-transform: uppercase;
  transition: color 0.28s ease;
  position: relative;
  z-index: 1;
}

/* Hover: fill amber, text flips to dark */
#start-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 32px rgba(240, 184, 76, 0.35);
  transform: translateX(-50%) scale(1.04);
  animation: none;
}

#start-btn:hover .start-btn-text {
  color: var(--bg);
}

/* ============================================================
   HEX MENU OVERLAY
   ============================================================ */
#hex-menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: visibility 0s linear 0.5s;
}

#hex-menu.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s linear 0s;
}

/* ─── Hex node base ─────────────────────────────────────────── */
/*
  Two-layer border technique:
  - Outer .hex-node clip-path = amber background → this IS the border
  - Inner ::after clip-path = dark fill, scaled to 93% → leaves amber ring visible
  clip-path clips real CSS borders, so this is the only reliable way.
*/
.hex-node {
  position: absolute;
  width: 130px;
  height: 150px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  /* Amber outer = the visible border */
  background: rgba(240, 184, 76, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  cursor: pointer;
  outline: none;
  transform-origin: center center;
  will-change: transform, opacity;
  transition: transform 0.3s ease;
}

/* Dark inner fill — scaled slightly so amber border peeks around the edges */
.hex-node::after {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(14, 13, 11, 0.96);
  transform: scale(0.93);
  transition: background 0.3s ease;
  z-index: 0;
  pointer-events: none;
}

/* ─── Centre hex ────────────────────────────────────────────── */
.hex-centre {
  width: 90px;
  height: 104px;
  cursor: default;
  background: rgba(240, 184, 76, 0.65);
  z-index: 2;
}

.hex-centre::after {
  background: rgba(14, 13, 11, 0.98);
  transform: scale(0.90);
}

.hex-bee-icon {
  width: 48px;
  height: 48px;
}

/* ─── Ring hexes positioning ────────────────────────────────── */
/* Honeycomb ring: 6 hexes evenly around centre */
/* Radius ~200px from centre */
#hex-about      { transform: translate(-173px, -100px); animation: hexFloat 3.8s ease-in-out infinite; animation-delay: 0s; }
#hex-skills     { transform: translate(0px,   -200px); animation: hexFloat 3.8s ease-in-out infinite; animation-delay: 0.3s; }
#hex-experience { transform: translate(173px,  -100px); animation: hexFloat 3.8s ease-in-out infinite; animation-delay: 0.6s; }
#hex-projects   { transform: translate(173px,   100px); animation: hexFloat 3.8s ease-in-out infinite; animation-delay: 0.9s; }
#hex-publications { transform: translate(0px,   200px); animation: hexFloat 3.8s ease-in-out infinite; animation-delay: 1.2s; }
#hex-contact    { transform: translate(-173px,  100px); animation: hexFloat 3.8s ease-in-out infinite; animation-delay: 1.5s; }

@keyframes hexFloat {
  0%, 100% { margin-top: 0px; }
  50%       { margin-top: -8px; }
}

/* ─── Hex content — must sit above the ::after dark fill ───── */
.hex-icon {
  font-size: 1.6rem;
  line-height: 1;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.hex-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  transition: color 0.3s ease, transform 0.3s ease;
  position: relative;
  z-index: 1;
}

/* No separate .hex-glow needed — hover fills via ::after */

/* ─── Hover: fill the whole hex amber ───────────────────────── */
.hex-ring:hover {
  z-index: 3;
}

/* On hover, the ::after dark fill goes fully amber */
.hex-ring:hover::after {
  background: var(--accent);
}

.hex-ring:hover .hex-icon {
  transform: scale(1.18) translateY(-2px);
  filter: brightness(0) invert(1); /* white icon on amber fill */
}

.hex-ring:hover .hex-label {
  color: var(--bg);
  transform: translateY(-2px);
}

/* ─── Shrink state (when a section opens) ───────────────────── */
.hex-node.hex-shrunk {
  pointer-events: none;
}

/* ============================================================
   SECTION PANEL
   ============================================================ */
#section-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(14, 13, 11, 0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  clip-path: circle(0% at 50% 50%);
  transition: visibility 0s linear 0.6s;
}

#section-panel.is-open {
  opacity: 1;
  visibility: visible;
  transition: visibility 0s linear 0s;
  /* clip-path animated via GSAP */
}

/* ─── Panel back button ─────────────────────────────────────── */
#panel-back-btn {
  position: fixed;
  top: 1.5rem;
  left: 1.75rem;
  z-index: 21;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(20, 19, 16, 0.85);
  border: 1px solid rgba(240, 184, 76, 0.25);
  color: var(--text-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  backdrop-filter: blur(8px);
}

#panel-back-btn:hover {
  color: var(--accent);
  border-color: rgba(240, 184, 76, 0.6);
  background: rgba(30, 28, 24, 0.95);
}

#panel-back-btn.is-visible {
  opacity: 1;
}

/* ─── Panel content area ────────────────────────────────────── */
#panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 5rem 2.5rem 3rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  opacity: 0;
}

#panel-content.is-visible {
  opacity: 1;
}

/* Custom scrollbar in panel */
#panel-content::-webkit-scrollbar { width: 4px; }
#panel-content::-webkit-scrollbar-track { background: transparent; }
#panel-content::-webkit-scrollbar-thumb { background: rgba(240, 184, 76, 0.3); border-radius: 2px; }

/* ============================================================
   PANEL SECTION — Shared styles
   ============================================================ */
.panel-section {
  animation: panelContentIn 0.5s ease forwards;
}

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

.panel-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
  line-height: 1.1;
}

.panel-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin-top: 0.6rem;
  margin-bottom: 2rem;
  opacity: 0.6;
}

.panel-sub {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.panel-divider {
  width: 100%;
  height: 1px;
  background: rgba(240, 184, 76, 0.12);
  margin: 1.5rem 0;
}

/* ─── About panel ───────────────────────────────────────────── */
.panel-about-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.panel-bio {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text);
  max-width: 580px;
}

.panel-photo-wrap {
  display: flex;
  justify-content: flex-start;
}

.panel-portrait {
  width: 180px;
  filter: grayscale(15%);
  opacity: 0.9;
}

.panel-cert-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.panel-cert-btn {
  background: none;
  border: 1px solid rgba(240, 184, 76, 0.2);
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  width: 120px;
  height: 80px;
  transition: border-color 0.2s, transform 0.2s;
  padding: 0;
}

.panel-cert-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-cert-btn:hover {
  border-color: var(--accent);
  transform: scale(1.04);
}

/* ─── Skills panel ──────────────────────────────────────────── */
.panel-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
}

.skill-category {
  background: rgba(35, 32, 25, 0.5);
  border: 1px solid rgba(240, 184, 76, 0.1);
  border-radius: 6px;
  padding: 1.25rem;
}

.skill-badges-panel {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(240, 184, 76, 0.1);
  border: 1px solid rgba(240, 184, 76, 0.22);
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s;
}

.badge:hover {
  background: rgba(240, 184, 76, 0.18);
  border-color: rgba(240, 184, 76, 0.5);
}

/* ─── Experience panel ──────────────────────────────────────── */
.panel-exp-group {
  margin-bottom: 2.5rem;
}

.panel-exp-card {
  background: rgba(35, 32, 25, 0.5);
  border: 1px solid rgba(240, 184, 76, 0.12);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, background 0.2s;
}

.panel-exp-card:hover {
  border-color: rgba(240, 184, 76, 0.3);
  background: rgba(35, 32, 25, 0.75);
}

.panel-exp-featured {
  border-color: rgba(240, 184, 76, 0.25);
  position: relative;
  overflow: hidden;
}

.panel-exp-featured::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.panel-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.panel-exp-role {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.panel-exp-company {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 400;
  margin-top: 0.2rem;
}

.panel-exp-period {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.panel-exp-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.panel-exp-bullets li {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.6;
  padding-left: 1rem;
  position: relative;
}

.panel-exp-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  opacity: 0.5;
}

.panel-internship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* ─── Projects panel ────────────────────────────────────────── */
.panel-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* .panel-project-card styles defined in panels-glass.css */

/* ─── Publications panel ────────────────────────────────────── */
.panel-pub-card {
  background: rgba(35, 32, 25, 0.5);
  border: 1px solid rgba(240, 184, 76, 0.2);
  border-radius: 6px;
  padding: 2rem;
  max-width: 580px;
  position: relative;
}

.panel-pub-badge {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--bg);
  background: var(--accent);
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
  margin-bottom: 1rem;
}

.panel-pub-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.panel-pub-journal {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.panel-pub-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.panel-pub-link {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.4rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  background: var(--accent);
  color: var(--bg);
  border-radius: 3px;
  transition: background 0.2s;
}

.panel-pub-link:hover {
  background: var(--accent-muted);
}

/* ─── Contact panel ─────────────────────────────────────────── */
.panel-contact-intro {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.panel-contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 1rem 1.25rem;
  background: rgba(35, 32, 25, 0.5);
  border: 1px solid rgba(240, 184, 76, 0.12);
  border-radius: 6px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  max-width: 420px;
}

.panel-contact-item:hover {
  color: var(--accent);
  border-color: rgba(240, 184, 76, 0.4);
  background: rgba(35, 32, 25, 0.8);
}

.panel-contact-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  color: var(--accent);
  display: flex;
  align-items: center;
}

/* ============================================================
   CERT LIGHTBOX
   ============================================================ */
#cert-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 9, 8, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(6px);
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

#cert-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.lightbox-dialog {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-dialog img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
}

#lightbox-close {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  background: none;
  border: 1px solid rgba(240, 184, 76, 0.25);
  padding: 0.45rem 1rem;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s;
}

#lightbox-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .hex-node {
    width: 100px;
    height: 115px;
  }

  #hex-about      { transform: translate(-130px, -75px); }
  #hex-skills     { transform: translate(0px,   -150px); }
  #hex-experience { transform: translate(130px,  -75px); }
  #hex-projects   { transform: translate(130px,   75px); }
  #hex-publications { transform: translate(0px,   150px); }
  #hex-contact    { transform: translate(-130px,  75px); }

  .hex-label { font-size: 0.55rem; }
  .hex-icon  { font-size: 1.3rem; }

  #panel-content {
    padding: 4rem 1.25rem 2rem;
  }

  .panel-internship-grid,
  .panel-projects-grid {
    grid-template-columns: 1fr;
  }
}
