/* ============================================================
   Tristan Herpich - Portfolio (Relaunch3)
   Combined relaunch + Relaunch2: bright navy-and-gold theme by
   default, with a switchable dark mode (relaunch palette) via the
   lamp toggle in the header. Choice persists in localStorage.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: rgba(11, 58, 107, 0.12);
  --border-strong: rgba(11, 58, 107, 0.28);
  --text: #16283c;
  --text-muted: #54677d;
  --accent: #0b3a6b;
  --accent-2: #15579c;
  --accent-soft: rgba(11, 58, 107, 0.07);
  --gold: #a67c1c;
  --gold-soft: rgba(166, 124, 28, 0.1);
  --shadow: 0 16px 40px -24px rgba(22, 40, 60, 0.28);
  --shadow-sm: 0 6px 18px -10px rgba(22, 40, 60, 0.18);
  --radius: 10px;
  --radius-sm: 6px;
  --max-width: 1120px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.25, 0.6, 0.3, 1);
}

/* ---------- Dark theme (relaunch palette, toggle via header lamp) ---------- */
[data-theme="dark"] {
  --bg: #0a0f1e;
  --bg-alt: #0e1527;
  --surface: #121a2e;
  --surface-2: #16203a;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);
  --text: #e8edf7;
  --text-muted: #9aa7bd;
  --accent: #4f8ef7;
  --accent-2: #7c6cf6;
  --accent-soft: rgba(79, 142, 247, 0.14);
  --gold: #d4a94e;
  --gold-soft: rgba(212, 169, 78, 0.12);
  --shadow: 0 20px 45px -18px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 6px 18px -10px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  color: var(--accent-2);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text);
}

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

.container-narrow {
  max-width: 860px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 6px 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Section scaffolding ---------- */
.section {
  padding: 104px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin-bottom: 52px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  margin-top: 8px;
  padding-bottom: 16px;
  position: relative;
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 54px;
  height: 3px;
  border-radius: 2px;
  background: var(--gold);
}

.eyebrow {
  display: inline-block;
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Reveal-on-scroll (smooth professional fade) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(255, 255, 255, 0.98);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--text);
}

.brand-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  border: 1px solid rgba(166, 124, 28, 0.55);
  border-radius: 7px;
  padding: 4px;
}

.main-nav {
  display: flex;
  gap: 6px;
}

.main-nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.main-nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Theme toggle (lamp) & header actions ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
              background 0.25s var(--ease);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Bright mode shows the moon (click for dark); dark mode shows the sun. */
.theme-icon-sun { display: none; }

[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  box-shadow: 0 10px 22px -14px rgba(11, 58, 107, 0.55);
}

.btn-primary:hover {
  color: #fff;
  background: var(--accent-2);
  border-color: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -14px rgba(11, 58, 107, 0.6);
}

.btn-ghost {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Hero ---------- */
.hero {
  padding: 110px 0 96px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 440px at 10% -10%, rgba(11, 58, 107, 0.07), transparent 62%),
    radial-gradient(640px 420px at 94% 12%, rgba(166, 124, 28, 0.06), transparent 60%);
  border-bottom: 1px solid var(--border);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 64px;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 800;
  margin: 10px 0 18px;
  color: var(--text);
}

.hero-sub {
  color: var(--text-muted);
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  max-width: 540px;
  margin: 0 0 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 44px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.hero-stats strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

.hero-stats span {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.portrait-frame {
  position: relative;
  width: min(100%, 320px);
  margin: 0 auto;
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: -14px;
  border: 2px solid var(--gold);
  border-radius: 22px;
  opacity: 0.5;
  z-index: 0;
}

.portrait-frame img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  object-fit: cover;
  object-position: 50% 15%;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  z-index: 1;
}

/* Pin the portrait to the top of the hero row */
.hero-visual {
  align-self: start;
}

/* Hero entrance animation (page load) */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-copy > *,
.hero-visual {
  animation: riseIn 0.8s var(--ease) both;
}

.hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
.hero-copy > *:nth-child(2) { animation-delay: 0.12s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.19s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.26s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.33s; }
.hero-visual                  { animation-delay: 0.22s; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 56px;
  align-items: start;
}

.about-facts {
  min-width: 0;
}

.about-text p {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin: 0 0 18px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.fact-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.fact-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.fact-list li:last-child {
  border-bottom: none;
}

.fact-list span {
  color: var(--text-muted);
  flex: 0 0 auto;
  white-space: nowrap;
}

.fact-list strong {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.core-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.pill {
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(11, 58, 107, 0.22);
  border-radius: 999px;
  cursor: help;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(11, 58, 107, 0.12);
}/* ---------- CV Timeline ---------- */
.timeline {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding-left: 30px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), rgba(166, 124, 28, 0.35), transparent);
  opacity: 0.65;
  border-radius: 2px;
}

.timeline-group-title {
  margin: 40px 0 18px;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.timeline-group-title:first-child {
  margin-top: 0;
}

.tl-spacer {
  height: 10px;
}

.tl-item {
  position: relative;
  padding: 0 0 34px 26px;
}

.tl-item:last-child {
  padding-bottom: 6px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tl-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.tl-pic {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.tl-head-meta {
  min-width: 0;
}

.tl-head-meta .tl-period {
  margin-bottom: 4px;
}

.tl-head-meta .tl-title {
  margin-bottom: 0;
}

.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
              box-shadow 0.3s var(--ease);
}

.tl-card:hover {
  transform: translateY(-3px);
  border-color: rgba(11, 58, 107, 0.4);
  box-shadow: var(--shadow);
}

.tl-period {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.tl-title {
  font-size: 1.06rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tl-desc {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin: 0 0 12px;
}

.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tl-tag {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 10px;
  cursor: help;
}

.tl-tag:hover {
  color: var(--accent);
  border-color: var(--border-strong);
}

/* Floating tooltip (timeline tags & skill pills) */
.tooltip {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  background: #0e2a4d;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  max-width: min(72vw, 320px);
  box-shadow: 0 12px 30px -12px rgba(14, 42, 77, 0.6);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s var(--ease), visibility 0.18s;
  z-index: 9999;
}

.tooltip.show {
  opacity: 1;
  visibility: visible;
}

/* ---------- Projects Slider ---------- */
.slider {
  max-width: 900px;
  margin: 0 auto;
}

.slider-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #0d1b2a;
  box-shadow: var(--shadow);
}

.slider-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0d1b2a;
  overflow: hidden;
}

.slide-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}

.slide-frame.active {
  opacity: 1;
  visibility: visible;
}

.slide-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0d1b2a;
}

.slide-frame .slide-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1b2a;
  color: #c9d4e4;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}

.slide-frame.loaded .slide-loader {
  opacity: 0;
  visibility: hidden;
}

.slide-loader::after {
  content: "";
  width: 26px;
  height: 26px;
  margin-left: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(11, 58, 107, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  font-size: 1.05rem;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 8px 20px -12px rgba(22, 40, 60, 0.4);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.slider-arrow:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.slider-prev { left: 18px; }
.slider-next { right: 18px; }

.slider-counter {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 5;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(13, 27, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.slider-meta {
  margin-top: 30px;
  text-align: left;
}

.slider-meta .meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.meta-badge {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(11, 58, 107, 0.2);
  padding: 4px 12px;
  border-radius: 999px;
}

.meta-badge.meta-year {
  color: var(--text-muted);
  background: rgba(84, 103, 125, 0.08);
  border-color: var(--border);
}

.slider-meta h3 {
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  margin-bottom: 12px;
}

.slider-meta p {
  color: var(--text-muted);
  margin: 0 0 14px;
  max-width: 760px;
}

.slider-meta .role-note {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 10px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
}

.slider-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.slider-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 26px;
}

.slider-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(84, 103, 125, 0.25);
  cursor: pointer;
  transition: width 0.3s var(--ease), background 0.3s var(--ease);
}

.slider-dot.active {
  width: 28px;
  background: var(--accent);
}/* ---------- Skills ---------- */
/* Dimension graph (radar) - small, centered, above the skill groups */
.skills-radar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 34px;
}

.skills-radar-wrap canvas {
  width: 300px;
  max-width: 100%;
  height: auto;
}

.skills-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}

.skills-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
              box-shadow 0.3s var(--ease);
}

.skills-group:hover {
  border-color: rgba(11, 58, 107, 0.35);
  box-shadow: var(--shadow-sm);
}

.skills-group h3 {
  font-size: 1.05rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skills-group h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.skills-group.wide {
  grid-column: 1 / -1;
}

.skill-bar {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  cursor: help;
}

.skill-bar:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.skill-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.skill-bar-top .name {
  color: var(--text);
  font-weight: 500;
}

.skill-bar-top .val {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Recruiter-friendly tier badges */
.skill-bar-top .val.tier-expert {
  color: var(--accent);
  background: rgba(11, 58, 107, 0.2);
  border-color: var(--gold);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(166, 124, 28, 0.18);
}

.skill-bar-top .val.tier-proficient {
  color: var(--accent);
  background: rgba(11, 58, 107, 0.14);
  border-color: rgba(11, 58, 107, 0.5);
}

.skill-bar-top .val.tier-intermediate {
  color: #8a6416;
  background: var(--gold-soft);
  border-color: rgba(166, 124, 28, 0.35);
}

.skill-bar-top .val.tier-basic {
  color: var(--text-muted);
  background: rgba(84, 103, 125, 0.08);
  border-color: rgba(84, 103, 125, 0.3);
}

/* ---------- Q&A Accordion ---------- */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.acc-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}

.acc-item.open {
  border-color: rgba(11, 58, 107, 0.45);
}

.acc-summary {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.acc-summary:hover {
  color: var(--accent);
}

.acc-icon {
  flex-shrink: 0;
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(11, 58, 107, 0.4);
  transition: transform 0.35s var(--ease), background 0.3s var(--ease);
}

.acc-icon::before,
.acc-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  border-radius: 2px;
}

.acc-icon::before {
  width: 10px;
  height: 2px;
}

.acc-icon::after {
  width: 2px;
  height: 10px;
  transition: opacity 0.3s var(--ease);
}

.acc-item.open .acc-icon {
  transform: rotate(180deg);
  background: var(--accent);
}

.acc-item.open .acc-icon::before,
.acc-item.open .acc-icon::after {
  background: #fff;
}

.acc-item.open .acc-icon::after {
  opacity: 0;
}

.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease);
}

.acc-body-inner {
  padding: 0 24px 22px;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.acc-body-inner p {
  margin: 0;
}

/* ---------- Contact ---------- */
.contact-card {
  text-align: center;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 56px 40px;
  box-shadow: var(--shadow);
}

.contact-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 22px;
  object-fit: contain;
  opacity: 0.95;
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  border: 1px solid rgba(166, 124, 28, 0.55);
  border-radius: 14px;
  padding: 8px;
}

.contact-lead {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 520px;
  margin: 0 auto 30px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* GitHub mark: solid black on light theme, solid white on dark theme. */
.btn-github .btn-icon {
  color: #111111;
}
[data-theme="dark"] .btn-github .btn-icon {
  color: #ffffff;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-tag {
  color: rgba(84, 103, 125, 0.75);
}

/* ============================================================
   Dark theme component overrides
   ============================================================ */
[data-theme="dark"] .site-header {
  background: rgba(10, 15, 30, 0.92);
}

[data-theme="dark"] .site-header.scrolled {
  background: rgba(10, 15, 30, 0.98);
}

[data-theme="dark"] .btn-ghost {
  background: var(--surface);
}

[data-theme="dark"] .hero::before {
  background:
    radial-gradient(760px 440px at 10% -10%, rgba(79, 142, 247, 0.12), transparent 62%),
    radial-gradient(640px 420px at 94% 12%, rgba(212, 169, 78, 0.08), transparent 60%);
}

[data-theme="dark"] .pill {
  border-color: rgba(79, 142, 247, 0.32);
}

[data-theme="dark"] .pill:hover {
  background: rgba(79, 142, 247, 0.16);
}

[data-theme="dark"] .tl-card:hover {
  border-color: rgba(79, 142, 247, 0.45);
}

[data-theme="dark"] .slider-arrow {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(18, 26, 46, 0.94);
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .meta-badge {
  border-color: rgba(79, 142, 247, 0.3);
}

[data-theme="dark"] .meta-badge.meta-year {
  background: rgba(154, 167, 189, 0.08);
}

[data-theme="dark"] .slider-dot {
  background: rgba(154, 167, 189, 0.3);
}

[data-theme="dark"] .skills-group:hover {
  border-color: rgba(79, 142, 247, 0.4);
}

[data-theme="dark"] .skill-bar-top .val.tier-expert {
  color: #9dbcf5;
  background: rgba(79, 142, 247, 0.18);
  border-color: #d4a94e;
  box-shadow: 0 0 0 3px rgba(212, 169, 78, 0.15);
}

[data-theme="dark"] .skill-bar-top .val.tier-proficient {
  color: #9dbcf5;
  background: rgba(79, 142, 247, 0.14);
  border-color: rgba(79, 142, 247, 0.45);
}

[data-theme="dark"] .skill-bar-top .val.tier-intermediate {
  color: #d4a94e;
  border-color: rgba(212, 169, 78, 0.4);
}

[data-theme="dark"] .skill-bar-top .val.tier-basic {
  background: rgba(154, 167, 189, 0.08);
  border-color: rgba(154, 167, 189, 0.3);
}

[data-theme="dark"] .acc-item.open {
  border-color: rgba(79, 142, 247, 0.5);
}

[data-theme="dark"] .acc-icon {
  border-color: rgba(79, 142, 247, 0.45);
}

[data-theme="dark"] .footer-tag {
  color: rgba(154, 167, 189, 0.75);
}

@media (max-width: 720px) {
  [data-theme="dark"] .main-nav {
    background: rgba(10, 15, 30, 0.98);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.55);
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .portrait-frame {
    width: min(100%, 300px);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

@media (max-width: 720px) {
  .section {
    padding: 72px 0;
  }

  .hero {
    padding: 76px 0 68px;
  }

  .main-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 18px 28px 26px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 40px -24px rgba(22, 40, 60, 0.3);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .main-nav a {
    padding: 12px 8px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    color: var(--text);
  }

  .nav-toggle {
    display: flex;
  }

  .hero-stats {
    gap: 26px;
  }

  .timeline {
    padding-left: 24px;
  }

  .tl-head {
    gap: 12px;
  }

  .tl-pic {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
    border-radius: 10px;
  }

  .contact-card {
    padding: 40px 24px;
  }
}

@media (max-width: 460px) {
  .hero-stats {
    flex-wrap: wrap;
    gap: 18px 26px;
  }

  .slider-prev { left: 10px; }
  .slider-next { right: 10px; }
}

/* ============================================================
Reduced motion - respect user preference
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
/* ============================================================ EOF */