/* ==========================================================================
   Nyi Lin Naing – dark theme, neural-network hero and responsive fixes.
   Loaded last so it overrides the original light styles without deleting them.
   ========================================================================== */
:root {
  --nyi-bg: #05070f;
  --nyi-surface: #0f1526;
  --nyi-surface-2: #161e33;
  --nyi-line: #222b44;
  --nyi-line-2: #34405f;
  --nyi-text: #e8ecf5;
  --nyi-text-2: #c4cce0;
  --nyi-muted: #96a1ba;
  --nyi-blue: #8fb0ff;
  --nyi-blue-strong: #5b8cff;
  --nyi-amber: #fead25;
  --nyi-teal: #2dd4bf;

  /* original variables, re-pointed to the dark palette */
  --color-bg: var(--nyi-bg);
  --color-bg-light: var(--nyi-surface);
  --color-text-main: var(--nyi-text);
  --color-text-muted: var(--nyi-muted);
  --color-primary: var(--nyi-blue);
  --color-secondary: var(--nyi-blue-strong);
  --color-accent: var(--nyi-teal);
  --color-glass: rgba(15, 21, 38, 0.78);
  --color-glass-border: rgba(143, 176, 255, 0.16);
  --color-glass-highlight: rgba(143, 176, 255, 0.06);
  --gradient-glow: radial-gradient(circle at center, rgba(91, 140, 255, 0.14) 0%, rgba(5, 7, 15, 0) 70%);
  color-scheme: dark;
}

html,
body.nyi-dark,
body.nyi-dark.light-mode {
  background: var(--nyi-bg) !important;
  color: var(--nyi-text) !important;
}

/* ---------- Hero: neural network instead of the cloud sky ---------- */
body.nyi-dark .hero-section {
  background: radial-gradient(ellipse at 50% 45%, #13204a 0%, #070b18 55%, var(--nyi-bg) 100%) !important;
}
body.nyi-dark .hero-mesh { background: transparent !important; }
body.nyi-dark .hero-mesh-canvas,
body.nyi-dark .hero-cloud-drift { display: none !important; }
body.nyi-dark .nyi-network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Section backgrounds ---------- */
body.nyi-dark :is(.about-section, .testimonials-section, .education-section, .projects-section, .contact-section, .approach-section) {
  background: transparent !important;
}

/* ---------- Cards and surfaces ---------- */
body.nyi-dark :is(.bento-card, .bento-tech-card, .contact-bento-a, .contact-bento-b, .contact-bento-c,
  .approach-panel, .sticky-video-wrapper, .glass-cert-front, .glass-cert-back, .player-music-queue,
  .edu-story-visual-frame, .footer-status-bar, .whatsapp-card-middle, .edu-tl-card, .experience-card) {
  background: var(--nyi-surface) !important;
  background-image: none !important;
  border-color: var(--nyi-line) !important;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8) !important;
  color: var(--nyi-text) !important;
}
body.nyi-dark :is(.contact-notification, .glass-cert-file, .edu-story-window-bar, .approach-media, .music-record,
  .photo-card-icon, .tech-network-hub, .exp-hover-arrow, .edu-tl-chip, .exp-date, .approach-tag, .btn-sm.project-btn-slide) {
  background: var(--nyi-surface-2) !important;
  background-image: none !important;
  border-color: var(--nyi-line-2) !important;
  color: var(--nyi-text-2) !important;
}
body.nyi-dark .edu-tl-chip--green { color: var(--nyi-teal) !important; }
body.nyi-dark .project-folder-card { background: transparent !important; }
body.nyi-dark .project-folder-surface path { fill: var(--nyi-surface) !important; stroke: var(--nyi-line) !important; }
body.nyi-dark .footer-overlay { background: linear-gradient(180deg, rgba(5, 7, 15, 0.55), var(--nyi-bg)) !important; }
body.nyi-dark .apple-switch__track { background: var(--nyi-surface-2) !important; }

/* ---------- Text ---------- */
body.nyi-dark :is(h1, h2, h3, h4, h5, .bento-main-title, .bento-tech-title, .project-title, .exp-company,
  .notification-channel, .player-final-title, .glass-cert-file-name, .glass-cert-label, .approach-strip-title,
  .approach-number, .edu-story-step-title, .testimonials-selector-name, .project-folder-number, .live-clock,
  .footer-particle-label, .approach-copy-word, .approach-copy-letter, strong) {
  color: var(--nyi-text) !important;
}
body.nyi-dark :is(p, small, li, .exp-desc, .exp-link, .footer-social-link, .status-left, .status-center, .status-right,
  .testimonials-label, .apple-switch__label, .glass-cert-file-meta, .notification-copy p) {
  color: var(--nyi-text-2) !important;
}
body.nyi-dark .exp-link, body.nyi-dark .footer-social-link:hover { color: var(--nyi-blue) !important; }
body.nyi-dark .about-highlight { color: var(--nyi-text) !important; background-color: rgba(91, 140, 255, 0.18) !important; }
body.nyi-dark .about-highlight--fullstack { background-color: transparent !important; }
body.nyi-dark .flow-download-text { color: inherit !important; }

/* ---------- Titles that used a dark text-fill ---------- */
html body.nyi-dark .bento-main-title,
html body.nyi-dark #education .subsection-title--neutral,
html body.nyi-dark #education .subsection-title--neutral .text-gradient,
html body.nyi-dark .section-title,
html body.nyi-dark .about-title,
html body.nyi-dark .edu-tl-achieve strong,
html body.nyi-dark .link-text {
  color: var(--nyi-text) !important;
  -webkit-text-fill-color: var(--nyi-text) !important;
}
html body.nyi-dark .text-gradient,
html body.nyi-dark.light-mode .subsection-title-large .text-gradient {
  background: linear-gradient(135deg, var(--nyi-text) 0%, var(--nyi-blue) 60%, var(--nyi-teal) 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* ---------- Notification cards (about + contact) ---------- */
html body.nyi-dark :is(#about #bentoContactCard, #contact #contactBentoCard) .notification-intro::before {
  background: radial-gradient(ellipse at 30% 65%, rgba(15, 21, 38, 0.98), rgba(15, 21, 38, 0.88) 55%, transparent 78%) !important;
}
html body.nyi-dark :is(#about #bentoContactCard, #contact #contactBentoCard) .notification-stream::after {
  background: linear-gradient(to bottom, rgba(15, 21, 38, 0), rgba(15, 21, 38, 0.88) 68%, var(--nyi-surface)) !important;
}
html body.nyi-dark :is(#about #bentoContactCard, #contact #contactBentoCard) .notification-intro h3 { color: var(--nyi-text) !important; }
html body.nyi-dark :is(#about #bentoContactCard, #contact #contactBentoCard) .notification-intro p { color: var(--nyi-muted) !important; }

/* ---------- Tech stack card ---------- */
html body.nyi-dark .bento-tech-card {
  background: var(--nyi-surface) !important;
  border-color: var(--nyi-line) !important;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8) !important;
}
html body.nyi-dark #techStackNetwork .tech-network::after {
  background: linear-gradient(to top, var(--nyi-surface), rgba(15, 21, 38, 0.88) 9%, rgba(15, 21, 38, 0.4) 26%, transparent 58%) !important;
}
html body.nyi-dark #techStackNetwork .tech-network-hub { background: var(--nyi-surface-2) !important; border-color: var(--nyi-line-2) !important; color: var(--nyi-blue) !important; }
html body.nyi-dark #techStackNetwork .tech-network-hub::before { background: rgba(91, 140, 255, 0.06) !important; border-color: var(--nyi-line) !important; }
html body.nyi-dark #about .bento-tech-card {
  --tool-bubble: var(--nyi-surface-2);
  --tool-bubble-border: var(--nyi-line-2);
  --tool-shadow: rgba(0, 0, 0, 0.45);
  --tool-inner-glint: rgba(255, 255, 255, 0.06);
}
html body.nyi-dark #about .bento-tech-card :is(.ios-dock-item, .ios-dock-item:hover, .ios-dock-tooltip span) {
  background: var(--nyi-surface-2) !important;
  color: var(--nyi-text) !important;
}
html body.nyi-dark .tech-network-subheading, html body.nyi-dark .bento-tech-title { color: var(--nyi-text) !important; }
html body.nyi-dark .tech-network-subheading { color: var(--nyi-muted) !important; }

/* ---------- Hero readability over the network ---------- */
body.nyi-dark .nyi-network-canvas { opacity: 0.7; }

/* ---------- Experience ---------- */
html body.nyi-dark #education .exp-hover-copy .exp-date { background: var(--nyi-surface-2) !important; color: var(--nyi-muted) !important; }
html body.nyi-dark #education .exp-hover-arrow { background: var(--nyi-surface-2) !important; color: var(--nyi-text) !important; }
html body.nyi-dark #education .exp-hover-title { color: var(--nyi-text) !important; }

/* ---------- Certificate folders ---------- */
html body.nyi-dark .glass-cert-file { background: var(--nyi-surface-2) !important; }
html body.nyi-dark :is(.glass-cert-file-name, .glass-cert-file-meta) {
  background: rgba(15, 21, 38, 0.92) !important;
  border-color: var(--nyi-line-2) !important;
  color: var(--nyi-text-2) !important;
}
html body.nyi-dark .glass-cert-dialog-image { background: var(--nyi-surface-2) !important; }
html body.nyi-dark .glass-cert-dialog-close { background: var(--nyi-surface-2) !important; color: var(--nyi-text) !important; }

/* ---------- Hero music card -> podcast card ---------- */
html body.nyi-dark .hero-music-player .music-card { background: rgba(15, 21, 38, 0.72) !important; border-color: var(--nyi-line-2) !important; }
html body.nyi-dark .hero-music-player :is(.music-title, .music-artist, .music-btn) { color: var(--nyi-text) !important; }
html body.nyi-dark .hero-music-player .music-artist { color: var(--nyi-muted) !important; }
html body.nyi-dark .hero-music-player .music-record { background: radial-gradient(circle at 30% 30%, #2a3554, #10162a) !important; }
html body.nyi-dark.light-mode #music-tooltip.tooltip-black,
html body.nyi-dark.light-mode #image-tooltip {
  background: var(--nyi-surface-2) !important; color: var(--nyi-text) !important; border-color: var(--nyi-line-2) !important;
}
html body.nyi-dark.light-mode #music-tooltip.tooltip-black::after { border-top-color: var(--nyi-surface-2) !important; }
html body.nyi-dark.light-mode :is(.bento-main-card, .bento-photo-card, .bento-player-card) { background: var(--nyi-surface) !important; }
html body.nyi-dark.light-mode .bento-player-card.is-playing { background: #2f4fb8 !important; }
html body.nyi-dark .bento-player-inner-final::before { background: #2f4fb8 !important; }
html body.nyi-dark :is(.player-final-artist, .player-final-time, .control-btn-final) { color: var(--nyi-text-2) !important; }
html body.nyi-dark #about #techStackNetwork {
  background: var(--nyi-surface) !important;
  border-color: var(--nyi-line) !important;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.8) !important;
}
html body.nyi-dark #techStackNetwork .tech-node-orb { background: var(--nyi-surface-2) !important; border-color: var(--nyi-line-2) !important; }
html body.nyi-dark #techStackNetwork .tech-node-label { background: var(--nyi-surface-2) !important; border-color: var(--nyi-line-2) !important; color: var(--nyi-text) !important; }
html body.nyi-dark #techStackNetwork .tech-node { color: var(--nyi-text) !important; }
html body.nyi-dark #techStackNetwork :is(.tech-network-ring) { border-color: rgba(143, 176, 255, 0.12) !important; }

/* ---------- Project folders: every theme gets dark text tokens ---------- */
html body.nyi-dark #projects .project-folder-card,
html body.nyi-dark #projects .project-folder-card[data-folder-theme] {
  --folder-panel: var(--nyi-surface);
  --project-surface: var(--nyi-surface);
  --project-text: var(--nyi-text);
  --project-muted: var(--nyi-text-2);
  --project-chip: rgba(143, 176, 255, 0.1);
  --project-divider: rgba(143, 176, 255, 0.2);
  --project-border: var(--nyi-line);
}
html body.nyi-dark #projects .project-folder-card :is(.project-title, .project-folder-number) { color: var(--nyi-text) !important; }
html body.nyi-dark #projects .project-folder-card .project-desc { color: var(--nyi-text-2) !important; }
html body.nyi-dark #projects .project-folder-card .project-meta { color: var(--nyi-blue) !important; }
html body.nyi-dark #projects .project-gallery-flow.flow-download,
html body.nyi-dark #projects .project-folder-card[data-folder-theme] .project-gallery-flow { color: var(--nyi-text) !important; background: var(--nyi-surface-2) !important; }

/* ---------- Contact cards ---------- */
html body.nyi-dark #contact .contact-bento-whatsapp .whatsapp-card-heading,
html body.nyi-dark .whatsapp-card-heading { color: var(--nyi-text) !important; }
html body.nyi-dark .whatsapp-card-subtitle, html body.nyi-dark .whatsapp-card-to { color: var(--nyi-muted) !important; }
html body.nyi-dark :is(.whatsapp-card-name, .telegram-card-name) { color: var(--nyi-text) !important; }
html body.nyi-dark :is(.whatsapp-card-number, .telegram-card-handle) { color: var(--nyi-muted) !important; }
html body.nyi-dark .whatsapp-email-btn { color: var(--nyi-text) !important; border-color: var(--nyi-line-2) !important; }
html body.nyi-dark #projects .project-btn-slide { width: auto !important; min-width: 96px; padding-right: 44px !important; }

/* ==========================================================================
   Responsive fixes
   ========================================================================== */
@media (max-width: 768px) {
  /* podcast player sat under the menu button: move it below the top bar */
  html body.nyi-dark .hero-music-player { top: 76px !important; }
  body.nyi-dark .nyi-network-canvas { opacity: 0.45; }
}
@media (max-width: 480px) {
  html body.nyi-dark .hero-music-player { top: 70px !important; }
}
