/* ══════════════════════════════════════
   COOL SLATE MASCULINE THEME
   Clean, calm, sharp — no feminine tones
   + Dark mode, timeline, social links
   (Fixed dark mode white‑out bugs)
══════════════════════════════════════ */
:root {
  --bg: #f4f7fa;
  --bg2: #edf2f7;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 20px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.02);
  --max-w: 620px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --radius: 18px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode variables */
body.dark {
  --bg: #0f172a;
  --bg2: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-light: #1e3a5f;
  --border: #334155;
  --card-bg: #1e293b;
  --card-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* FIX 1: body uses CSS variable instead of hardcoded gradient */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.4,0,0.2,1),
              transform 0.65s cubic-bezier(0.4,0,0.2,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Container */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
.hero { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }

/* 🌓 Dark Mode Toggle */
.dark-toggle {
  position: fixed;
  top: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text);
  z-index: 9998;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.dark-toggle:hover {
  transform: scale(1.1);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Hero (no box) ── */
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
  padding-bottom: 80px;
}

/* Profile picture – silver ring */
.pfp-wrap {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 32px;
  border: 2px solid #94a3b8;
  box-shadow: 0 0 0 4px var(--bg), 0 10px 25px rgba(0,0,0,0.08);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.pfp-wrap:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 14px 35px rgba(37,99,235,0.15);
}
.pfp { width: 100%; height: 100%; object-fit: cover; }

/* FIX 3: white-space normal to prevent clipping on tablets */
.name {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 400;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
  white-space: normal;
  line-height: 1.15;
}
.name::after {
  content: '';
  display: block;
  width: 70px;
  height: 2px;
  background: #cbd5e1;
  margin: 12px auto 0;
  border-radius: 2px;
}

.tagline {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.3px;
  margin-top: 8px;
  margin-bottom: 36px;
}

/* ── Song Card (horizontal, taller, narrower) ── */
.song-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 15px 16px;
  max-width: 370px;
  width: 100%;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.song-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.song-art {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
}

.song-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.song-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.song-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.song-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-artist {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.song-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}
.song-play:hover {
  background: var(--accent);
}
/* Dark mode override for play button */
body.dark .song-play {
  background: var(--accent);
  color: #fff;
}
body.dark .song-play:hover {
  background: #2563eb;
}

.song-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.song-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.1s linear;
}
.song-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}
.song-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: var(--text); cursor: pointer; border: none;
}

.song-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--muted);
}

/* ── Sections ── */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  margin-bottom: 38px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-icon {
  font-size: 1.6rem;
  color: var(--accent);
  opacity: 0.7;
}
.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -12px;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(37,99,235,0.2) 100%);
  border-radius: 2px;
}

/* About */
.about-text {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.9;
  max-width: 520px;
}

/* ── Gallery ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.photo-item {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  background: #e2e8f0;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.photo-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 32px rgba(0,0,0,0.1);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.photo-item:hover img { transform: scale(1.07); }

.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.photo-item:hover .photo-overlay { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.96);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(8px);
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lb-content {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
#lbImg {
  max-width: 85vw;
  max-height: 75vh;
  border-radius: 14px;
  object-fit: contain;
  transform: scale(0.94);
  transition: transform 0.4s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.lightbox.open #lbImg { transform: scale(1); }
.lb-caption {
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 400;
  max-width: 400px;
}
.lb-close, .lb-prev, .lb-next {
  position: fixed;
  color: #94a3b8;
  font-size: 1.3rem;
  padding: 14px;
  transition: color var(--transition), transform var(--transition);
  z-index: 10001;
}
.lb-close { top: 24px; right: 24px; }
.lb-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: #fff; }

/* ── Education Timeline ── */
.timeline {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid var(--border);
  margin-top: 20px;
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -39px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--card-bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.timeline-card:hover {
  transform: translateX(6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  margin-bottom: 4px;
  color: var(--text);
}

.timeline-institution {
  font-size: 0.9rem;
  color: var(--muted);
  display: block;
  margin-bottom: 12px;
}

.timeline-meta {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text);
}
.timeline-meta i {
  color: var(--accent);
  margin-right: 4px;
}

/* ── My Works ── */
.works-list { display: flex; flex-direction: column; gap: 4px; }
.work-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
  border-radius: 12px;
  position: relative;
}
.work-item:first-child { border-top: 1px solid var(--border); }
.work-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  transform: scaleY(0);
  transition: transform 0.3s ease;
}
.work-item:hover {
  background: rgba(37,99,235,0.02);
  padding-left: 16px;
  transform: translateX(6px);
}
.work-item:hover::before { transform: scaleY(1); }

.work-item-info { display: flex; flex-direction: column; gap: 6px; }
.work-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text);
}
.work-detail {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.6;
}
.work-arrow {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color var(--transition), transform var(--transition);
}
.work-item:hover .work-arrow { color: var(--accent); transform: translate(2px, -2px); }

/* ── Connect / Social Links ── */
.social-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 24px 0 12px;
}

.social-link {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--text);
  box-shadow: var(--card-shadow);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.social-link:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-4px);
  border-color: var(--accent);
}

/* FIX 2: Toast — fixed position so it always shows correctly */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
  pointer-events: all;
}

/* Quote */
.section-quote {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.quote-block { text-align: center; padding: 24px 0; }
.quote-mark {
  font-family: var(--font-display);
  font-size: 6rem;
  line-height: 0.4;
  color: #cbd5e1;
  margin-bottom: 20px;
  user-select: none;
}
.quote-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--text);
  max-width: 420px;
  margin: 0 auto 16px;
}
.quote-author { font-size: 0.85rem; color: var(--muted); }

/* Message Form */
.message-form-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--card-shadow);
}

.msg-textarea {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text);
  resize: none;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
body.dark .msg-textarea {
  background: var(--card-bg);
  color: var(--text);
}
.msg-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.msg-textarea::placeholder { color: #94a3b8; }
body.dark .msg-textarea::placeholder { color: var(--muted); }

.msg-btn {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: #fff;
  padding: 12px 30px;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(30,41,59,0.2);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.msg-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37,99,235,0.3);
}
body.dark .msg-btn {
  background: var(--accent);
  color: #fff;
}
body.dark .msg-btn:hover {
  background: #2563eb;
}

.btn-icon { transition: transform var(--transition); }
.msg-btn:hover .btn-icon { transform: translateX(2px); }

/* Popup */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(6px);
  padding: 24px;
}
.popup-overlay.open { opacity: 1; pointer-events: all; }
.popup {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 44px 36px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 30px 70px rgba(0,0,0,0.2);
}
.popup-overlay.open .popup { transform: scale(1); }
.popup-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin: 0 auto 22px;
}
.popup-title { font-family: var(--font-display); font-size: 1.6rem; font-style: italic; margin-bottom: 12px; }
.popup-text { color: var(--muted); margin-bottom: 28px; }
.popup-close {
  background: var(--text);
  color: #fff;
  padding: 10px 28px;
  border-radius: 40px;
  font-size: 0.85rem;
  transition: background var(--transition);
}
body.dark .popup-close {
  background: var(--accent);
  color: #fff;
}
.popup-close:hover { background: var(--accent); }
body.dark .popup-close:hover { background: #2563eb; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 36px 20px;
  text-align: center;
}
.footer-text { font-size: 0.8rem; color: var(--muted); }

/* Back to Top */
.back-top {
  position: fixed;
  bottom: 32px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 8px 22px rgba(30,41,59,0.25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s, background 0.3s;
  z-index: 9999;
}
.back-top.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.back-top:hover { background: var(--accent); }
body.dark .back-top {
  background: var(--accent);
  color: #fff;
}
body.dark .back-top:hover {
  background: #2563eb;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .name { font-size: 2.5rem; line-height: 1.2; }
  .section-title { font-size: 1.9rem; }
  .photo-grid { gap: 10px; }
  .song-card { max-width: 320px; padding: 15px 16px; }
  .timeline { padding-left: 20px; }
}

@media (max-width: 480px) {
  .name { font-size: 2rem; }
  .hero-inner { padding-top: 60px; padding-bottom: 60px; }
}