:root {
  --bg-main: #05060c;
  --bg-card: #0b1020;
  --bg-surface: #0f1629;
  --primary: #3ea9ff;
  --secondary: #b28bff;
  --accent: #ff9f43;
  --accent-2: #4be2c8;
  --accent-3: #ff6fb1;
  --text-main: #e8ecf5;
  --text-muted: #99a2ba;
  --border: #1f2942;
  --shadow: 0 14px 45px rgba(0, 0, 0, 0.45);
  --glow: 0 0 24px rgba(62, 169, 255, 0.25);
}

.theme-light {
  --bg-main: #f5f7fb;
  --bg-card: #ffffff;
  --bg-surface: #e9eef9;
  --primary: #2f88ff;
  --secondary: #6f7ea6;
  --accent: #ff8f36;
  --accent-2: #2dc8a8;
  --accent-3: #e95fa8;
  --text-main: #1f2433;
  --text-muted: #4b5670;
  --border: #d2daeb;
  --shadow: 0 12px 34px rgba(31, 36, 48, 0.12);
  --glow: 0 0 20px rgba(47, 136, 255, 0.25);
}

/* Tech theme: high-contrast, neon accents (blue/orange) */
.theme-tech {
  --bg-main: #06070a;
  --bg-card: #0b0e16;
  --bg-surface: #0f1320;
  --primary: #2aa8ff;      /* electric blue */
  --secondary: #8aa2c9;    /* cool slate */
  --accent: #ff8a1f;       /* vivid orange */
  --accent-2: #00e7b7;     /* neon teal */
  --accent-3: #ffd166;     /* soft amber */
  --text-main: #e9eef7;    /* off-white */
  --text-muted: #8fa0bd;   /* muted steel */
  --border: #1a2540;       /* deep navy */
  --shadow: 0 14px 45px rgba(0, 0, 0, 0.5);
  --glow: 0 0 26px rgba(42, 168, 255, 0.28);
}

.theme-ocean {
  --bg-main: #020a12;
  --bg-card: #061824;
  --bg-surface: #0a2030;
  --primary: #2ed3e8;
  --secondary: #5ac8ff;
  --accent: #22f5c8;
  --accent-2: #3dd5ff;
  --accent-3: #6effdb;
  --text-main: #d9f5ff;
  --text-muted: #88b8d4;
  --border: #14354a;
  --shadow: 0 14px 45px rgba(0, 20, 35, 0.5);
  --glow: 0 0 28px rgba(46, 211, 232, 0.28);
}

.theme-sunset {
  --bg-main: #180a0f;
  --bg-card: #261218;
  --bg-surface: #331620;
  --primary: #ff6b8a;
  --secondary: #ffab7c;
  --accent: #ff9d54;
  --accent-2: #ff5f9d;
  --accent-3: #ffc166;
  --text-main: #ffe8ec;
  --text-muted: #dfa8b8;
  --border: #442530;
  --shadow: 0 14px 45px rgba(50, 10, 20, 0.5);
  --glow: 0 0 28px rgba(255, 107, 138, 0.32);
}

.theme-forest {
  --bg-main: #070f0a;
  --bg-card: #0e1a13;
  --bg-surface: #13221a;
  --primary: #3ed68c;
  --secondary: #6ad3a8;
  --accent: #a8e870;
  --accent-2: #5ce0b8;
  --accent-3: #79e85a;
  --text-main: #dff7e6;
  --text-muted: #90bfa3;
  --border: #1d3228;
  --shadow: 0 14px 45px rgba(5, 25, 15, 0.5);
  --glow: 0 0 28px rgba(62, 214, 140, 0.3);
}

.theme-purple {
  --bg-main: #0d0616;
  --bg-card: #16102a;
  --bg-surface: #1d1435;
  --primary: #a375ff;
  --secondary: #d09fff;
  --accent: #ff78c8;
  --accent-2: #c88fff;
  --accent-3: #ffb4e4;
  --text-main: #f0e5ff;
  --text-muted: #b699d4;
  --border: #2d1f44;
  --shadow: 0 14px 45px rgba(20, 10, 35, 0.5);
  --glow: 0 0 28px rgba(163, 117, 255, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Chakra Petch", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(62, 169, 255, 0.08), transparent 32%),
    radial-gradient(circle at 78% 12%, rgba(178, 139, 255, 0.08), transparent 30%),
    radial-gradient(circle at 40% 70%, rgba(255, 159, 67, 0.08), transparent 32%),
    var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

.theme-light body,
body.theme-light {
  background:
    radial-gradient(circle at 18% 18%, rgba(47, 136, 255, 0.08), transparent 32%),
    radial-gradient(circle at 78% 12%, rgba(233, 95, 168, 0.08), transparent 30%),
    radial-gradient(circle at 40% 70%, rgba(255, 143, 54, 0.09), transparent 32%),
    var(--bg-main);
}

.theme-tech body,
body.theme-tech {
  background:
    radial-gradient(circle at 18% 18%, rgba(42, 168, 255, 0.12), transparent 32%),
    radial-gradient(circle at 78% 12%, rgba(255, 138, 31, 0.10), transparent 30%),
    radial-gradient(circle at 40% 70%, rgba(0, 231, 183, 0.10), transparent 32%),
    var(--bg-main);
}

.theme-ocean body,
body.theme-ocean {
  background:
    radial-gradient(circle at 18% 18%, rgba(46, 211, 232, 0.12), transparent 32%),
    radial-gradient(circle at 78% 12%, rgba(34, 245, 200, 0.12), transparent 30%),
    radial-gradient(circle at 40% 70%, rgba(90, 200, 255, 0.1), transparent 32%),
    var(--bg-main);
}

.theme-sunset body,
body.theme-sunset {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 107, 138, 0.14), transparent 32%),
    radial-gradient(circle at 78% 12%, rgba(255, 157, 84, 0.14), transparent 30%),
    radial-gradient(circle at 40% 70%, rgba(255, 193, 102, 0.12), transparent 32%),
    var(--bg-main);
}

.theme-forest body,
body.theme-forest {
  background:
    radial-gradient(circle at 18% 18%, rgba(62, 214, 140, 0.14), transparent 32%),
    radial-gradient(circle at 78% 12%, rgba(168, 232, 112, 0.14), transparent 30%),
    radial-gradient(circle at 40% 70%, rgba(92, 224, 184, 0.12), transparent 32%),
    var(--bg-main);
}

.theme-purple body,
body.theme-purple {
  background:
    radial-gradient(circle at 18% 18%, rgba(163, 117, 255, 0.14), transparent 32%),
    radial-gradient(circle at 78% 12%, rgba(255, 120, 200, 0.14), transparent 30%),
    radial-gradient(circle at 40% 70%, rgba(200, 143, 255, 0.12), transparent 32%),
    var(--bg-main);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: 0.3;
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #ffe3df; }

.nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 6vw;
  background: linear-gradient(135deg, rgba(12, 17, 31, 0.9), rgba(12, 19, 36, 0.88));
  backdrop-filter: blur(10px);
  z-index: 10;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--glow);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo span { color: var(--secondary); }

.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.nav-links li {
  display: flex;
  align-items: center;
}

.nav-links a {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  color: var(--text-main);
}

.nav-links a:hover { background: rgba(62, 169, 255, 0.12); color: #fdfdfd; box-shadow: 0 0 0 1px rgba(62, 169, 255, 0.25); }
.admin-link { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; }

.nav-links button {
  height: 38px;
  padding: 0 16px;
}

.hero {
  position: relative;
  padding: 60px 6vw 40px;
}

.hero-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  z-index: 1;
}

.hero-text h1 {
  font-size: clamp(32px, 5vw, 56px);
  margin: 8px 0;
}

.subtitle { color: var(--secondary); margin: 6px 0 12px; }
.intro { max-width: 640px; color: var(--text-muted); }

.hero-actions { display: flex; gap: 12px; margin: 18px 0; }

.hero-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: 14px; }

.hero-visual { position: relative; min-height: 240px; display: grid; justify-items: center; }

.avatar {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 12px 40px rgba(36, 112, 160, 0.25);
  animation: float 6s ease-in-out infinite;
}

.award-photo {
  width: 280px;
  height: 280px;
  border-radius: 8px;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 0 30px rgba(36, 112, 160, 0.4), 0 12px 40px rgba(0, 0, 0, 0.35);
  display: block;
  margin: 12px auto;
  transition: transform 0.3s ease;
}

.award-photo:hover {
  transform: scale(1.05);
}

.award-card-with-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px !important;
}

.award-card-with-photo h3 {
  margin: 12px 0 6px;
}

.card-stack { position: absolute; bottom: 0; right: 10%; display: flex; gap: 10px; }
.mini-card {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 12px;
  backdrop-filter: blur(6px);
}

.section { padding: 40px 6vw; position: relative; z-index: 1; }
.section-heading h2 { margin: 4px 0 12px; }
.eyebrow { letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; color: var(--secondary); }

.card {
  background: linear-gradient(150deg, rgba(14, 19, 36, 0.95), rgba(12, 18, 32, 0.92));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.theme-light .card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 255, 0.96));
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}


.theme-light .nav {
  background: rgba(255, 255, 255, 0.9);
}
@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.timeline { display: grid; gap: 12px; }
.timeline-item {
  border-left: 3px solid var(--primary);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: linear-gradient(135deg, rgba(62, 169, 255, 0.18), rgba(75, 226, 200, 0.18)); color: var(--text-main); font-size: 12px; border: 1px solid rgba(62, 169, 255, 0.25); }
.theme-light .badge { background: linear-gradient(135deg, rgba(47, 136, 255, 0.16), rgba(45, 200, 168, 0.16)); border-color: rgba(47, 136, 255, 0.22); }

.skill-card ul { padding-left: 18px; color: var(--text-muted); margin: 8px 0 0; }
.skill-item { display: flex; align-items: center; gap: 8px; }
.level-meter { display: inline-grid; grid-template-columns: repeat(5, 10px); gap: 4px; align-items: center; }
.level-cell { width: 10px; height: 10px; border-radius: 2px; background: rgba(255,255,255,0.08); border: 1px solid var(--border); }
.level-cell.filled { background: var(--primary); border-color: rgba(255,255,255,0.15); }

.project { position: relative; overflow: hidden; }
.project h3 { margin: 4px 0; }
.project .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.project .tags span { background: linear-gradient(135deg, rgba(255, 111, 177, 0.18), rgba(62, 169, 255, 0.18)); padding: 4px 8px; border-radius: 8px; font-size: 12px; border: 1px solid rgba(255, 111, 177, 0.18); }

.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: center;
}

.contact .card { display: flex; flex-direction: column; gap: 10px; }

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  background: linear-gradient(150deg, rgba(14, 19, 36, 0.95), rgba(12, 18, 32, 0.92));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
  z-index: 101;
}

.theme-light .modal-content {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 255, 0.96));
}

.modal-content h2 {
  margin: 0 0 24px;
  font-size: 24px;
  color: var(--text-main);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-size: 24px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(62, 169, 255, 0.2);
  color: var(--accent);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 500;
  color: var(--text-main);
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
  outline: none;
}

.theme-light .form-group input,
.theme-light .form-group textarea {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--border);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: rgba(62, 169, 255, 0.06);
  box-shadow: 0 0 0 2px rgba(62, 169, 255, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.contact-form .btn {
  margin-top: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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



.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: #0b0d14;
  background: var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255, 159, 67, 0.28); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--accent-2)); color: var(--text-main); border-color: rgba(255, 255, 255, 0.08); box-shadow: var(--glow); }
.btn.ghost { background: rgba(255, 255, 255, 0.03); color: var(--text-main); border-color: var(--border); }

.theme-light .btn.ghost { color: var(--text-main); border-color: var(--border); }

.footer {
  padding: 20px 6vw 40px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.footer-built { margin-top: 6px; }
.footer-admin-link { display: inline-block; margin-top: 12px; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@media (max-width: 720px) {
  .nav-links { flex-wrap: wrap; }
  .hero-actions { flex-wrap: wrap; }
}
