/* ── TOKENS ───────────────────────────────── */
:root {
  --deep:      #3d3556;
  --mid:       #7d6494;
  --soft:      #c89dc8;
  --blush:     #f5b8c8;
  --cream:     #fdf4f7;
  --ink:       #2e2640;
  --muted:     #9e8faa;
  --line:      rgba(125,100,148,.18);
  --win-r:     14px;
  --shadow:    0 20px 60px rgba(42,30,60,.2), 0 2px 8px rgba(42,30,60,.08);
  --font:      'Nunito', sans-serif;
  --body:      'Nunito Sans', sans-serif;
  /* theme-aware */
  --bg-body:   linear-gradient(160deg,#eddff5 0%,#f5e2ee 45%,#fce8ef 100%);
  --dot-color: rgba(125,100,148,.12);
  --win-bg:    rgba(255,255,255,.97);
  --win-border:rgba(255,255,255,.8);
  --hub-wave-bg: white;
  --card-bg:   #fdf4f7;
  --cert-bg:   white;
  --footer-c:  rgba(61,53,86,.38);
  --clock-c:   rgba(61,53,86,.42);
}

/* ── DARK MODE ────────────────────────────── */
[data-theme="dark"] {
  --deep:      #c89dc8;
  --mid:       #d4afd4;
  --soft:      #a07aaa;
  --blush:     #e8a0b8;
  --cream:     #1e1828;
  --ink:       #f0e8f5;
  --muted:     #9a8aaa;
  --line:      rgba(200,157,200,.15);
  --shadow:    0 20px 60px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.3);
  --bg-body:   linear-gradient(160deg,#1a1424 0%,#1e1530 45%,#221830 100%);
  --dot-color: rgba(200,157,200,.07);
  --win-bg:    rgba(32,24,44,.97);
  --win-border:rgba(255,255,255,.08);
  --hub-wave-bg: #201828;
  --card-bg:   #261e36;
  --cert-bg:   #261e36;
  --footer-c:  rgba(200,157,200,.35);
  --clock-c:   rgba(200,157,200,.4);
}

/* ── THEME TOGGLE & MUTE TOGGLE ──────────── */
#theme-toggle,
#mute-toggle {
  position: fixed;
  top: 20px;
  z-index: 600;
  border: transparent;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  transition: transform .2s ease;
}
#theme-toggle { left: 20px; }
#mute-toggle  { left: 80px; }
#theme-toggle:hover,
#mute-toggle:hover { transform: scale(1.20); }

/* ── RESET & BASE ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  font-family: var(--body);
  min-height: 100vh;
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 20px 16px 60px;
  transition: background .4s ease;
}

/* polka-dot wallpaper */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}

/* ── FOOTER ───────────────────────────────── */
footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  padding: 10px;
  font-family: var(--font);
  font-size: .7rem;
  font-weight: 700;
  color: var(--footer-c);
  letter-spacing: .08em;
  z-index: 1;
  pointer-events: none;
}

/* ── CLOCK ────────────────────────────────── */
#clock {
  position: fixed;
  top: 14px; right: 18px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--clock-c);
  letter-spacing: .05em;
  z-index: 2;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   HUB WINDOW  (the centered home card)
══════════════════════════════════════════ */
#hub {
  position: relative;
  z-index: 10;
  width: min(540px, 96vw);
  background: var(--win-bg);
  border-radius: var(--win-r);
  box-shadow: var(--shadow);
  border: 1px solid var(--win-border);
  overflow: hidden;
  animation: popIn .4s cubic-bezier(.34,1.4,.64,1) forwards;
  transition: background .4s, border-color .4s, box-shadow .4s;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.9) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* title bar */
.hub-bar {
  background: var(--deep);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.hub-dots { display: flex; gap: 6px; }
.hub-dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #f5a0b0; }
.dot-y { background: #f5c87a; }
.dot-g { background: #8fcf8f; }
.hub-bar-title {
  flex: 1; text-align: center;
  font-family: var(--font);
  font-size: .75rem; font-weight: 700;
  color: rgba(255,255,255,.55);
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* hub body */
.hub-body {
  padding: 44px 32px 40px;
  text-align: center;
}

.hub-greeting {
  font-family: var(--font);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 8px;
}
.hub-greeting em {
  font-style: italic;
  color: var(--mid);
}

.hub-sub {
  font-size: .88rem;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 56px;
}

/* nav icons row */
.hub-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 700;
  color: var(--mid);
  letter-spacing: .06em;
  text-transform: lowercase;
  transition: all .2s ease;
  padding: 4px;
}
.nav-btn:hover { color: var(--deep); transform: translateY(-4px); }
.nav-btn:hover .nav-icon { background: var(--soft); border-color: var(--soft); }

.nav-icon {
  width: 58px; height: 58px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  transition: all .2s ease;
  box-shadow: 0 2px 8px rgba(125,100,148,.1);
}

/* wave divider inside hub */
.hub-wave {
  width: 100%;
  height: 50px;
  background: linear-gradient(180deg, rgba(200,157,200,.13) 0%, rgba(245,184,200,.18) 100%);
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}
.hub-wave::before {
  content: '';
  position: absolute;
  top: -5px; left: -1%; right: -1%;
  height: 20px;
  background: var(--hub-wave-bg);
  border-radius: 0 0 50% 50%;
  transition: background .4s;
}

/* ══════════════════════════════════════════
   POPUP WINDOWS
══════════════════════════════════════════ */
.win {
  position: fixed;
  background: var(--win-bg);
  border-radius: var(--win-r);
  box-shadow: var(--shadow);
  border: 1px solid var(--win-border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
  min-width: 300px;
  max-width: min(520px, 95vw);
  max-height: calc(100vh - 60px);
  transition: background .4s, border-color .4s;
}
.win.open {
  display: flex;
  animation: winPop .25s cubic-bezier(.34,1.3,.64,1) forwards;
}
.win.closing { animation: winClose .18s ease forwards; }
@keyframes winPop {
  from { opacity: 0; transform: scale(.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes winClose {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(.9) translateY(10px); }
}

/* title bar */
.win-bar {
  background: var(--deep);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
  gap: 8px;
}
.win-bar:active { cursor: grabbing; }
.win-dots { display: flex; gap: 6px; }
.win-title {
  flex: 1; text-align: center;
  font-family: var(--font);
  font-size: .90rem; font-weight: 700;
  color: rgba(255,255,255,.55);
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ✕ close button */
.win-close {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.7);
  font-size: .90rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .18s ease;
  flex-shrink: 0;
  font-family: var(--font);
  line-height: 1;
}
.win-close:hover { background: rgba(245,160,176,.5); color: white; border-color: transparent; }

.win-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--soft) transparent;
}
.win-body::-webkit-scrollbar { width: 5px; }
.win-body::-webkit-scrollbar-thumb { background: var(--soft); border-radius: 99px; }

/* ── SECTION LABEL ────────────────────────── */
.sec-label {
  font-size: .90rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 700;
  margin-bottom: 7px;
  margin-top: 16px;
  font-family: var(--font);
}

/* ── ABOUT ────────────────────────────────── */
.about-top {
  display: flex; gap: 16px; align-items: flex-start;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.avatar-wrap {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--soft), var(--blush));
  padding: 3px; flex-shrink: 0;
}
.avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #ecdaf5, #fce5ed);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 1.4rem; font-weight: 800; color: var(--mid);
}
.avatar-wrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.about-name { font-family: var(--font); font-size: 1.5rem; font-weight: 800; color: var(--deep); }
.about-role { font-size: .90rem; color: var(--soft); font-weight: 700; margin: 3px 0 5px; letter-spacing: .04em; }
.about-loc  { font-size: .95rem; color: var(--muted); }
.about-bio  { font-size: .95rem; line-height: 1.78; color: var(--ink); margin-bottom: 4px; }
.about-bio a { color: var(--mid); text-decoration: none; border-bottom: 1px dotted var(--soft); }
.about-bio a:hover { color: var(--deep); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip {
  padding: 4px 11px; border-radius: 999px;
  font-size: .80rem; font-weight: 700;
  background: rgba(200,157,200,.13); color: var(--mid);
  border: 1px solid rgba(200,157,200,.25);
  transition: all .2s; cursor: default; font-family: var(--font);
}
.chip:hover { background: var(--soft); color: white; border-color: var(--soft); }

.edu-box {
  background: linear-gradient(135deg,rgba(200,157,200,.1),rgba(245,184,200,.07));
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
}
.edu-deg { font-size: .95rem; font-weight: 700; color: var(--deep); font-family: var(--font); }
.edu-sch { font-size: .80rem; color: var(--muted); margin-top: 2px; }

.dot-list { list-style: none; }
.dot-list li {
  font-size: .90rem; color: var(--ink);
  padding: 3px 0; display: flex; align-items: baseline; gap: 7px; line-height: 1.5;
}
.dot-list li::before { content:'✦'; color: var(--blush); font-size: .9rem; flex-shrink: 0; }

/* ── PROJECTS ─────────────────────────────── */
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.proj-card {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--card-bg);
  text-decoration: none; color: inherit; display: block;
  transition: transform .2s, box-shadow .2s;
}
.proj-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(61,53,86,.12); }
.proj-thumb {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, rgba(200,157,200,.2), rgba(245,184,200,.16));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; overflow: hidden;
}
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-body { padding: 9px 11px 12px; }
.proj-tag { font-size: .70rem; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); font-weight: 700; margin-bottom: 2px; font-family: var(--font); }
.proj-title { font-family: var(--font); font-size: .95rem; font-weight: 800; color: var(--deep); margin-bottom: 3px; }
.proj-desc { font-size: .80rem; color: var(--muted); line-height: 1.5; }
.proj-link { display: inline-block; margin-top: 6px; font-size: .70rem; color: var(--mid); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font); }

/* ── CERTIFICATES ─────────────────────────── */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cert-card {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cert-bg);
  cursor: pointer;
  position: relative;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  align-items: stretch;
  width: 100%;
}
.cert-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(61,53,86,.12); }

/* left thumbnail strip */
.cert-thumb-strip {
  width: 80px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(200,157,200,.25), rgba(245,184,200,.2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  position: relative;
  overflow: hidden;
}
.cert-thumb-strip img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cert-thumb-strip .cert-overlay {
  position: absolute; inset: 0;
  background: rgba(61,53,86,.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.cert-card:hover .cert-overlay { opacity: 1; }
.cert-overlay span {
  color: white; font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; font-weight: 700; font-family: var(--font);
  text-align: center; padding: 0 4px;
}

/* right text area */
.cert-foot {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.cert-name {
  font-size: .88rem; font-weight: 700;
  color: var(--deep); font-family: var(--font);
  line-height: 1.35;
}
.cert-host {
  font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--soft);
  font-weight: 700; font-family: var(--font);
}
.cert-theme { font-size: .75rem; color: var(--muted); line-height: 1.45; }

/* ── CONTACT ──────────────────────────────── */
.contact-intro { text-align: center; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.contact-intro h2 { font-family: var(--font); font-size: 1rem; font-weight: 800; color: var(--deep); }
.contact-intro p { font-size: .80rem; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.clinks { display: flex; flex-direction: column; gap: 8px; }
.clink {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  background: rgba(200,157,200,.08); border: 1px solid var(--line);
  text-decoration: none; color: inherit; transition: all .2s;
}
.clink:hover { background: rgba(200,157,200,.18); border-color: var(--soft); transform: translateX(5px); }
.clink-icon {
  width: 40px; height: 40px; border-radius: 9px;
  background: linear-gradient(135deg, var(--soft), var(--blush));
  display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0;
}
.clink-type { font-size: .70rem; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); font-weight: 700; margin-bottom: 1px; font-family: var(--font); }
.clink-val  { font-size: .90rem; color: var(--deep); font-weight: 600; }

/* ── LIGHTBOX ─────────────────────────────── */
#lb {
  position: fixed; inset: 0;
  background: rgba(30,20,45,.86); backdrop-filter: blur(14px);
  z-index: 999;
  display: none; align-items: center; justify-content: center; padding: 24px;
  cursor: pointer;
}
#lb.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
#lb img {
  max-width: min(800px, 92vw); max-height: 88vh;
  border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.45); cursor: default;
}
#lb-x {
  position: absolute; top: 18px; right: 18px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  color: white; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s; font-family: var(--font);
}
#lb-x:hover { background: rgba(245,160,176,.5); }

/* ── MOBILE ───────────────────────────────── */
@media (max-width: 600px) {
  .hub-greeting { font-size: 1.9rem; }
  .hub-nav { gap: 16px; }
  .nav-icon { width: 50px; height: 50px; font-size: 1.4rem; }
  .proj-grid { grid-template-columns: 1fr; }
  .win { max-width: 95vw; }
  .cert-thumb-strip { width: 60px; font-size: 1.4rem; }
  .cert-name { font-size: .82rem; }
  .cert-theme { display: none; }
}
