:root {
  --bg: #0b1020;
  --bg-soft: #11182c;
  --panel: #151f36;
  --panel-2: #1a2744;
  --text: #edf3ff;
  --muted: #a8b6cf;
  --accent: #66d0c8;
  --accent-2: #8eb7ff;
  --accent-3: #d8b36c;
  --line: rgba(255, 255, 255, 0.09);
  --line-hover: rgba(142, 183, 255, 0.3);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --card-grad-start: rgba(21, 31, 54, 0.95);
  --card-grad-end: rgba(15, 23, 42, 0.95);
  --nav-bg: rgba(11, 16, 32, 0.88);
  --surface-subtle: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --modal-backdrop: rgba(5, 9, 20, 0.72);
}

html.light {
  --bg: #f4f7fb;
  --bg-soft: #eaf0f8;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0d9488;
  --accent-2: #2563eb;
  --accent-3: #b45309;
  --line: rgba(15, 23, 42, 0.11);
  --line-hover: rgba(37, 99, 235, 0.35);
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.07);
  --card-grad-start: rgba(255, 255, 255, 0.98);
  --card-grad-end: rgba(248, 250, 252, 0.98);
  --nav-bg: rgba(255, 255, 255, 0.92);
  --surface-subtle: rgba(15, 23, 42, 0.025);
  --surface-hover: rgba(15, 23, 42, 0.055);
  --modal-backdrop: rgba(15, 23, 42, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(102, 208, 200, 0.13), transparent 36%),
    radial-gradient(circle at 88% 4%, rgba(142, 183, 255, 0.11), transparent 34%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Primary Cards & Sub-Panels */
.cv-card {
  border: 1px solid var(--line);
  background: linear-gradient(165deg, var(--card-grad-start), var(--card-grad-end));
  box-shadow: var(--shadow);
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.cv-card:hover {
  border-color: var(--line-hover);
}

.sub-panel {
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sub-panel:hover {
  border-color: var(--line-hover);
}

.sub-panel-interactive {
  cursor: pointer;
}

.sub-panel-interactive:hover {
  transform: translateY(-2px);
  background: var(--surface-hover);
}

/* Accent Color Helpers */
.accent-teal { color: var(--accent); }
.accent-blue { color: var(--accent-2); }
.accent-gold { color: var(--accent-3); }
.accent-muted { color: var(--muted); }

.badge-teal {
  background: rgba(102, 208, 200, 0.14);
  color: var(--accent);
  border: 1px solid rgba(102, 208, 200, 0.3);
}

.badge-blue {
  background: rgba(142, 183, 255, 0.14);
  color: var(--accent-2);
  border: 1px solid rgba(142, 183, 255, 0.3);
}

.badge-gold {
  background: rgba(216, 179, 108, 0.14);
  color: var(--accent-3);
  border: 1px solid rgba(216, 179, 108, 0.3);
}

.badge-muted {
  background: var(--surface-hover);
  color: var(--muted);
  border: 1px solid var(--line);
}

html.light .badge-teal {
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.28);
}

html.light .badge-blue {
  background: rgba(37, 99, 235, 0.09);
  border-color: rgba(37, 99, 235, 0.25);
}

html.light .badge-gold {
  background: rgba(180, 83, 9, 0.09);
  border-color: rgba(180, 83, 9, 0.25);
}

/* Bullet Lists */
.fleet-list {
  list-style: disc;
  padding-left: 1.35rem;
}

.fleet-list li {
  margin: 0.45rem 0;
  color: var(--text);
  opacity: 0.94;
}

.fleet-list li::marker {
  color: var(--accent);
}

/* Smooth Collapsible Accordion */
.accordion-content {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 1;
}

.accordion-content.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
  margin-top: 0 !important;
}

.accordion-inner {
  overflow: hidden;
}

.chevron-icon {
  transition: transform 0.28s ease;
}

.chevron-icon.rotated {
  transform: rotate(-90deg);
}

/* View Switching */
.view-panel {
  display: none;
  opacity: 0;
}

.view-panel.active-view {
  display: block;
  opacity: 1;
  animation: fadeInView 0.24s ease-out forwards;
}

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

/* Search Jump Highlight Pulse */
@keyframes targetFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(102, 208, 200, 0.65);
    border-color: var(--accent);
  }
  65% {
    box-shadow: 0 0 0 8px rgba(102, 208, 200, 0);
    border-color: var(--accent);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(102, 208, 200, 0);
  }
}

.flash-highlight {
  animation: targetFlash 1.5s ease-out;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(102, 208, 200, 0.14);
}

/* Achievement / Education 150px Left Emblem Box */
.achievement-image-box {
  width: 144px;
  height: 144px;
  flex: 0 0 144px;
}

/* Career Timeline Accent Line */
.timeline-wrapper {
  position: relative;
}

@media (min-width: 640px) {
  .timeline-wrapper {
    padding-left: 1.5rem;
  }
  .timeline-wrapper::before {
    content: '';
    position: absolute;
    left: 0.4rem;
    top: 1rem;
    bottom: 1rem;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3), transparent);
    opacity: 0.35;
    border-radius: 999px;
  }
  .timeline-item {
    position: relative;
  }
  .timeline-item::before {
    content: '';
    position: absolute;
    left: -1.42rem;
    top: 1.65rem;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--bg);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 3px var(--bg);
  }
}

/* Quick Jump Rail Active Link */
.rail-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-radius: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.rail-link:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--line);
}

/* Inputs & Search */
.site-input {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.site-input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.site-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 208, 200, 0.15);
}

/* Command Palette Modal */
.search-modal-backdrop {
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
}

/* Instagram Embed Shell */
.ig-embed-shell {
  display: flex;
  justify-content: center;
  width: 100%;
}

.ig-embed-shell iframe,
.ig-embed-shell blockquote.instagram-media {
  margin: 0 auto !important;
  max-width: 540px !important;
  width: 100% !important;
  min-width: 260px !important;
  border-radius: 14px !important;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid var(--line) !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

html.light .ig-embed-shell blockquote.instagram-media {
  background: #ffffff !important;
}

/* Keep inactive carousel slides off-screen rather than display:none so Instagram iframes compute height properly */
.ig-carousel-viewport {
  position: relative;
  width: 100%;
}

.ig-slide-card {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.ig-slide-card.ig-slide-hidden {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 100% !important;
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ig-panel-card {
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.ig-panel-active-turn {
  box-shadow: 0 0 0 1px rgba(102, 208, 200, 0.42), 0 12px 30px rgba(0, 0, 0, 0.25);
}

/* Print / Save PDF Styles */
@media print {
  :root,
  html.dark,
  html.light {
    --bg: #ffffff !important;
    --bg-soft: #ffffff !important;
    --panel: #ffffff !important;
    --panel-2: #f8fafc !important;
    --text: #0f172a !important;
    --muted: #475569 !important;
    --accent: #0f766e !important;
    --accent-2: #1d4ed8 !important;
    --accent-3: #b45309 !important;
    --line: #cbd5e1 !important;
    --surface-subtle: #ffffff !important;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 10pt;
  }

  .no-print {
    display: none !important;
  }

  .view-panel {
    display: block !important;
    opacity: 1 !important;
    margin-bottom: 24px !important;
  }

  .accordion-content.collapsed {
    grid-template-rows: 1fr !important;
    opacity: 1 !important;
    margin-top: 0.75rem !important;
  }

  .cv-card,
  .sub-panel {
    box-shadow: none !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    break-inside: avoid;
  }

  .timeline-wrapper {
    padding-left: 0 !important;
  }

  .timeline-wrapper::before,
  .timeline-item::before {
    display: none !important;
  }
}
