/* LIGHT THEME */
:root {
  /* Base */
  --bg: #f7fbff;
  /* warm off-white background */
  --text: #1a1a1a;
  /* near-black text */
  --text-muted: #575965;
  /* soft slate gray for secondary text */

  /* Surfaces */
  --card-bg: #f3f3f3;
  --nav-bg: #dadada;

  /* Accents */
  --accent: #1a3d63;
  /* deep navy accent */
  --accent-light: #5b88b2;
  /* lighter steel-blue accent */
  --link: #1a3d63;
  --link-hover: #0a1931;

  /* Borders and dividers */
  --border: #ccc5b9;

  /* Background gradient tones */
  --bg1: #fbf9e4;
  --bg2: #b3cfe5;
}

/* DARK THEME */
[data-theme="dark"] {
  /* Base */
  --bg: #1d2746;
  --text: #d9dcf8;
  --text-muted: #a9b2e6;

  /* Surfaces */
  --card-bg: #242633;
  --nav-bg: #405283;

  /* Accents */
  --accent: #5b88b2;
  /* balanced blue highlight */
  --accent-light: #b3cfe5;
  /* softer highlight for hover or glow */
  --link: #b3cfe5;
  --link-hover: #4a7fa7;

  /* Borders and dividers */
  --border: #353a3e;

  /* Background gradient tones */
  --bg1: #121212;
  --bg2: #1a3d63;
}

/* BASE ELEMENTS */
body {
  font-family: 'Cabin', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.25s;
}

a:hover {
  color: var(--link-hover);
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 20;
  user-select: none;
}

/* icons */
.theme-toggle img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Light theme */
:root .theme-toggle img {
  filter: none;
}

/* Dark theme: invert icons to light */
[data-theme="dark"] .theme-toggle img {
  filter: invert(1) brightness(1.2);
}

/* icon dimming based on toggle state */
.theme-toggle input:checked~.icon-sun {
  opacity: 0.4;
}

.theme-toggle input:not(:checked)~.icon-moon {
  opacity: 0.4;
}

/* toggle track */
.theme-toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 35px;
  height: 20px;
  position: relative;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  outline: none;
  transition: background 0.3s ease;
}

/* slider knob */
.theme-toggle input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, background 0.3s ease;
}

.theme-toggle input:checked {
  background: var(--accent-light);
}

.theme-toggle input:checked::before {
  transform: translateX(15px);
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5 {
  font-family: 'Raleway', sans-serif;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-top: 1rem;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 0.35rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--accent-light);
  padding-bottom: 0.25rem;
  margin-top: 1.75rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-light);
}

h4 {
  font-size: 1.2rem;
  font-weight: 600;
  /* text-transform: uppercase; */
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

p, li {
  font-size: 1rem;
  line-height: 1.65;
  margin-top: 0;
  margin-bottom: 0.65rem;
}

ul li {
  margin-bottom: 0.5rem;
}


.text-muted {
  color: var(--text-muted);
}

.accent {
  color: var(--accent);
}

.intro-text,
.work-summary {
  text-align: left;
}

.work-summary ul {
  margin-left: 0;
  padding-left: 1rem;
}

/* WORK EXPERIENCE */
.work-experience h4 {
  margin-top: .7rem;
  /* margin-bottom: 0.3rem; */
}

.work-experience p {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.work-experience ul {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

.resume-dates {
  font-size: 0.9rem;
  font-style: italic;
}

section, .card, .work-summary {
  margin-bottom: 1.75rem;
}

/* RESPONSIVE */
@media (max-width: 576px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  p,
  li {
    font-size: 0.95rem;
  }

  .intro-text {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .work-experience {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* NAVIGATION */
nav {
  position: relative;
  top: auto;
  z-index: 50;
  background-color: var(--nav-bg);
  backdrop-filter: blur(8px);
}

/* Base: hidden on all screens */
.nav-hide {
  opacity: 0;
  transform: translateY(-6px);
  visibility: hidden;
  transition: opacity 300ms ease, transform 250ms ease, visibility 0ms linear 250ms;
  font-family: 'Raleway', sans-serif;
}

/* Sticky behavior only for desktops */
@media (min-width: 992px) {
  nav {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  /* Show name/title only when stuck */
  nav.stuck .nav-hide {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition-delay: 0ms;
  }
}

nav .nav-hide h4,
nav .nav-hide small {
  margin: 0;
  line-height: 1;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
}

nav.stuck {
  background-color: var(--nav-bg);
  backdrop-filter: saturate(1.05) blur(4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: box-shadow 180ms ease, backdrop-filter 180ms ease;
}

[data-theme="dark"] nav.stuck {
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.1);
}

.nav-sentinel {
  display: block;
  width: 2px;
  height: 2px;
  visibility: hidden;
}

/* HEX BACKGROUND */
#hexBackground {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  transition: background 0.5s ease;
}