/* =============================================================
   Jun Han Ong — Cybersecurity Portfolio
   Plain CSS. No frameworks. No preprocessors. No bloat.
   ============================================================= */

/* --- Reset & Base ------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0a0f1a;
  --bg-alt:       #0f1624;
  --bg-card:      #131c2e;
  --border:       #1e2d45;
  --text:         #e2e8f0;
  --text-muted:   #8899b4;
  --accent:       #38bdf8;
  --accent-dim:   #0ea5e9;
  --accent-glow:  rgba(56, 189, 248, 0.15);
  --green:        #34d399;
  --amber:        #fbbf24;
  --red:          #f87171;
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:    'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  --radius:       8px;
  --radius-lg:    14px;
  --max-width:    1000px;
  --nav-height:   64px;
}

[data-theme="light"] {
  --bg:           #f8fafc;
  --bg-alt:       #f1f5f9;
  --bg-card:      #ffffff;
  --border:       #e2e8f0;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --accent:       #0284c7;
  --accent-dim:   #0369a1;
  --accent-glow:  rgba(2, 132, 199, 0.08);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

/* --- Navigation --------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}
.nav-logo:hover { text-decoration: none; opacity: 0.8; }

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* --- Hero --------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 120px 24px 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, var(--accent-glow) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(52, 211, 153, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 700px;
  text-align: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero-last { color: var(--accent); }

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 14px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* --- Buttons ------------------------------------------------ */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius);
  transition: all 0.2s;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  text-decoration: none;
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 6px 16px;
}

/* --- Sections ----------------------------------------------- */
.section {
  padding: 100px 24px;
}

.section-alt {
  background: var(--bg-alt);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-top: 8px;
  border-radius: 2px;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 48px;
  font-size: 1.05rem;
}

/* --- About -------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
  align-items: start;
}

.about-text p {
  margin-bottom: 16px;
  color: var(--text-muted);
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat {
  text-align: center;
  padding: 20px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Projects ----------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.project-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.08);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.15);
}

.project-links { margin-top: auto; }

.project-status {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Skills ------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

.skill-group h3 {
  font-size: 1.05rem;
  margin-bottom: 16px;
  color: var(--accent);
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skill-list li {
  display: grid;
  grid-template-columns: 1fr 120px 80px;
  align-items: center;
  gap: 12px;
}

.skill-name {
  font-size: 0.88rem;
  color: var(--text);
}

.skill-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.skill-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.skill-level {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  font-style: italic;
}

/* --- Timeline ----------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

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

.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -32px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--border);
}

.timeline-marker.current {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timeline-content h3 {
  font-size: 1.1rem;
  margin: 4px 0 6px;
}

.timeline-content p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* --- Contact ------------------------------------------------ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
  color: var(--text);
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.contact-icon { font-size: 2rem; }
.contact-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.contact-value { font-family: var(--font-mono); font-size: 0.88rem; color: var(--accent); }

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

.footer-small {
  margin-top: 8px;
  font-size: 0.78rem;
  opacity: 0.6;
}

/* --- Responsive --------------------------------------------- */
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-stats {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .stat {
    flex: 1;
    min-width: 100px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skill-list li {
    grid-template-columns: 1fr 80px 60px;
    gap: 8px;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none; /* Could add hamburger, keeping it simple for now */
  }
}
