/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Dark theme (default) */
:root, [data-theme="dark"] {
  --bg: #0b100e;
  --bg-elevated: #121a16;
  --bg-card: rgba(18,26,22,0.75);
  --bg-section-alt: #f4f1eb;
  --accent-primary: #5a9e6f;
  --accent-secondary: #3d7a52;
  --accent-warm: #b8956a;
  --accent-muted: #7a9e7e;
  --text-primary: #e2e8e4;
  --text-secondary: #8a9b8e;
  --text-inverse: #1a2418;
  --text-muted: #5c6e60;
  --gradient-line: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-warm), transparent);
  --gradient-line-alt: linear-gradient(90deg, transparent, var(--accent-secondary), var(--accent-primary), transparent);
  --nav-scroll-bg: rgba(11,16,14,0.92);
  --card-border: rgba(255,255,255,0.03);
  --card-hover-border: rgba(90,158,111,0.15);
  --card-hover-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 0 1px rgba(90,158,111,0.08), inset 0 1px 0 rgba(255,255,255,0.03);
  --tag-bg: rgba(90,158,111,0.08);
  --tag-color: rgba(122,158,126,0.8);
  --tag-border: rgba(90,158,111,0.1);
  --contact-hover-bg: rgba(90,158,111,0.12);
  --mobile-menu-bg: rgba(11,16,14,0.97);
  --radius: 16px;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f4f1eb;
  --bg-elevated: #eae6dd;
  --bg-card: rgba(255,255,255,0.85);
  --bg-section-alt: #faf9f6;
  --accent-primary: #3a6847;
  --accent-secondary: #2d5438;
  --accent-bright: #48a860;
  --accent-warm: #7a5c35;
  --accent-muted: #5a7d60;
  --text-primary: #111e14;
  --text-secondary: #3a4e3e;
  --text-inverse: #e2e8e4;
  --text-muted: #6a7e6e;
  --gradient-line: linear-gradient(90deg, transparent, var(--accent-bright), var(--accent-primary), var(--accent-warm), transparent);
  --gradient-line-alt: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-bright), transparent);
  --nav-scroll-bg: rgba(244,241,235,0.92);
  --card-border: rgba(0,0,0,0.08);
  --card-hover-border: rgba(72,168,96,0.3);
  --card-hover-shadow: 0 20px 40px rgba(0,0,0,0.08);
  --tag-bg: rgba(72,168,96,0.08);
  --tag-color: #3a6847;
  --tag-border: rgba(72,168,96,0.15);
  --contact-hover-bg: rgba(72,168,96,0.1);
  --mobile-menu-bg: rgba(244,241,235,0.97);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s, color 0.4s;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3.5rem;
  background: transparent;
  transition: background 0.5s, backdrop-filter 0.5s;
}

.nav-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0;
  text-transform: lowercase;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(1) contrast(1.1);
  opacity: 0.85;
  border: 1px solid var(--card-border);
  transition: opacity 0.3s, filter 0.3s;
}
.nav-logo:hover .nav-avatar {
  opacity: 1;
  filter: grayscale(0.5) contrast(1.1);
}

/* Avatar lightbox */
.avatar-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  cursor: pointer;
}
.avatar-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.avatar-lightbox img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1);
  border: 2px solid var(--card-border);
  transform: scale(0.5);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.avatar-lightbox.active img {
  transform: scale(1);
}

/* Gallery lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
  cursor: pointer;
  padding: 2rem;
}
.gallery-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}
.gallery-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  transform: scale(0.9);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.gallery-lightbox.active img {
  transform: scale(1);
}

.logo-text {
  color: var(--text-primary);
}
.logo-text span {
  font-weight: 500;
  color: var(--accent-primary);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gradient-line);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s;
}
.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--text-primary); border-radius: 1px; }

/* ===== HERO ===== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 64px;
  overflow-x: clip;
  background: var(--bg);
}

/* Ambient glows */
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 80%;
  height: 90%;
  background: radial-gradient(ellipse at center, rgba(90,158,111,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(184,149,106,0.04) 0%, transparent 65%);
  pointer-events: none;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* Trail marker text row */
.hero-text-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10vw;
  width: 100%;
  padding: 1rem 6vw 0;
  z-index: 10;
  position: relative;
  flex-shrink: 0;
}

.hero-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 0.5rem;
  transition: all 0.4s;
  flex: 1;
}

.marker-line {
  width: 1px;
  height: 40px;
  background: var(--text-secondary);
  opacity: 0.2;
  transition: all 0.4s;
  clip-path: inset(12px 0 0 0);
}

.marker-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  opacity: 1;
  transition: all 0.4s;
}

.hero-marker-right .marker-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.marker-sub {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.8;
  transition: all 0.4s;
}

/* Hero center name */
.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.hero-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  border: 2px solid rgba(90,158,111,0.15);
  opacity: 0.9;
}

.center-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 4rem;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  line-height: 1;
}

.center-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-primary);
  opacity: 0.7;
}

/* Marker hover */
.hero-marker:hover .marker-line {
  clip-path: inset(0);
  opacity: 0.5;
  background: var(--accent-primary);
}
.hero-marker:hover .marker-label {
  opacity: 1;
  color: var(--accent-primary);
}
.hero-marker:hover .marker-sub {
  opacity: 0.7;
}

/* Hero scroll arrow */
.hero-scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: var(--text-secondary);
  opacity: 0.4;
  text-decoration: none;
  transition: opacity 0.4s, color 0.4s;
  animation: scrollBounce 2.5s ease-in-out infinite;
}
.hero-scroll-arrow:hover {
  opacity: 1;
  color: var(--accent-primary);
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

.peak-range-label {
  font-family: 'Inter', sans-serif;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  fill: var(--text-secondary);
  opacity: 0.3;
  pointer-events: none;
}

/* Mountain silhouette */
.hero-mountain {
  margin-top: -35vh;
  margin-left: -25%;
  margin-right: 0;
  width: 125%;
  z-index: 1;
  pointer-events: auto;
  line-height: 0;
}

.mountain-silhouette {
  width: 100%;
  height: auto;
  opacity: 0.85;
}

/* ===== SECTION RIDGE DIVIDER ===== */
.section-ridge {
  line-height: 0;
  overflow: hidden;
  height: 24px;
  background: var(--bg);
}
.section-ridge svg {
  width: 100%;
  height: 24px;
  display: block;
}
.ridge-path {
  fill: var(--accent-primary);
  opacity: 0.08;
  transition: fill 0.4s;
}

/* Footer ridge */
.footer-ridge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  line-height: 0;
  transform: translateY(-100%);
}
.footer-ridge svg {
  width: 100%;
  height: 20px;
  display: block;
}
.footer-ridge .ridge-path {
  fill: var(--accent-primary);
  opacity: 0.06;
}

/* ===== SECTIONS ===== */
.section { padding: 10rem 2rem; position: relative; overflow: hidden; }
.section-dark { background: var(--bg); }

.section-light {
  background: var(--bg-section-alt);
  color: var(--text-primary);
}

/* Section background SVGs */
.section-bg-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  color: var(--accent-primary);
  opacity: 0.04;
}

/* Topo contour lines */
.section-bg-topo .section-bg-svg {
  top: 0;
  bottom: auto;
  height: 100%;
  opacity: 0.18;
}

/* Mary's Peak silhouette */
.section-bg-peak .section-bg-svg {
  height: 70%;
  opacity: 0.08;
}

/* Rolling hills */
.section-bg-hills .section-bg-svg {
  height: 50%;
  opacity: 0.08;
}

/* Section background labels */
.section-label {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.3;
  z-index: 2;
  pointer-events: none;
}

.container { max-width: 1040px; margin: 0 auto; }

.section-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.2rem;
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

/* Gradient underline on headings */
.section-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  margin: 1rem auto 0;
  background: var(--gradient-line);
  border-radius: 1px;
}

.section-light .section-heading::after {
  background: var(--gradient-line-alt);
}

.section-sub {
  text-align: center;
  font-size: 0.88rem;
  margin-bottom: 3.5rem;
  font-weight: 400;
}

.section-dark .section-sub { color: var(--text-secondary); }
.section-light .section-sub { color: var(--text-muted); }

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 2.5rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--accent-primary);
  opacity: 0.2;
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}

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

/* Dot on the line */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg);
  transform: translateX(-50%);
  left: calc(-2.5rem + 0.5px);
  z-index: 2;
}

/* Connector from dot to content */
.timeline-item::after {
  content: '';
  position: absolute;
  left: calc(-2.5rem + 5px);
  top: 0.6rem;
  width: calc(2.5rem - 5px);
  height: 1px;
  background: var(--accent-primary);
  opacity: 0.15;
}

.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.timeline-content:hover {
  border-color: var(--card-hover-border);
  box-shadow: var(--card-hover-shadow);
}

.timeline-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.timeline-content p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.timeline-content .tags {
  margin-top: 0.5rem;
}

/* ===== TERMINAL ===== */
.terminal {
  max-width: 750px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #0d1117;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 1rem;
  background: #161b22;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-title {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: #484f58;
  letter-spacing: 0.03em;
}
.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.8;
  overflow-x: hidden;
  word-break: break-word;
}
.terminal-line {
  color: #c9d1d9;
  margin-bottom: 0.2rem;
}
.term-prompt {
  color: #5a9e6f;
  font-weight: 700;
  margin-right: 0.5rem;
}
.term-dim {
  display: block;
  color: #484f58;
  font-size: 0.7rem;
}
.term-green {
  color: #5a9e6f;
}
.term-blink {
  animation: blink 1s step-end infinite;
  color: #5a9e6f;
}
@keyframes blink {
  50% { opacity: 0; }
}
.terminal-output {
  margin-bottom: 1rem;
}
.terminal-project {
  margin-bottom: 1.25rem;
}
.terminal-project .terminal-line {
  margin-bottom: 0.6rem;
}
.terminal-project-content {
  display: flex;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  transition: border-color 0.3s;
}
.terminal-project-content:hover {
  border-color: rgba(90,158,111,0.2);
}
.terminal-project-img {
  width: 140px;
  min-height: 90px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.terminal-project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
  transition: transform 0.4s, filter 0.3s;
}
.terminal-project-img:hover img {
  transform: scale(1.05);
  filter: brightness(1);
}
.terminal-project-info h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #c9d1d9;
  margin-bottom: 0.35rem;
}
.terminal-project-info p {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #8b949e;
  margin-bottom: 0.6rem;
}
.terminal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.term-lang {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: #8b949e;
}
.term-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.terminal-cursor {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .terminal-project-content {
    flex-direction: column;
  }
  .terminal-project-img {
    width: 100%;
    height: 140px;
  }
  .terminal-body {
    padding: 1rem;
    font-size: 0.7rem;
  }
}

/* Current role featured card */
.current-role {
  background: var(--bg-card);
  border: 1px solid var(--card-hover-border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  backdrop-filter: blur(12px);
  max-width: 700px;
  margin: 0 auto 2.5rem;
  position: relative;
  overflow: hidden;
}
.current-role::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-line);
}
.current-role-header {
  margin-bottom: 1.25rem;
}
.current-role-header .featured-badge {
  margin-bottom: 0.75rem;
}
.current-role-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.current-role-company {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.current-role-desc {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}
.role-highlights {
  list-style: none;
  margin-bottom: 1.25rem;
}
.role-highlights li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.role-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0.5;
}
.timeline-company {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

/* ===== CARDS ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  padding: 2rem 2rem 1.75rem;
  border-radius: var(--radius);
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
  position: relative;
  overflow: hidden;
}

.card:hover { transform: translateY(-4px); }

/* Dark cards */
.section-dark .card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
}

.section-dark .card:hover {
  border-color: var(--card-hover-border);
  box-shadow: var(--card-hover-shadow);
}

/* Gradient top line on hover */
.section-dark .card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient-line);
  opacity: 0;
  transition: opacity 0.4s;
}

.section-dark .card:hover::after { opacity: 1; }

/* Light cards */
.section-light .card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.section-light .card:hover {
  border-color: var(--card-hover-border);
  box-shadow: var(--card-hover-shadow);
}

.section-light .card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient-line-alt);
  opacity: 0;
  transition: opacity 0.4s;
}

.section-light .card:hover::after { opacity: 1; }

.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.85rem;
  line-height: 1.8;
  margin-bottom: 1.1rem;
}

.section-dark .card p { color: var(--text-secondary); }
.section-light .card p { color: var(--text-muted); }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tags span {
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.section-dark .tags span {
  background: var(--tag-bg);
  color: var(--tag-color);
  border: 1px solid var(--tag-border);
}

.section-light .tags span {
  background: var(--tag-bg);
  color: var(--accent-primary);
  border: 1px solid var(--tag-border);
}

/* Featured project card — promotional style */
.card-featured {
  padding: 0;
  grid-column: 1 / -1;
}
.featured-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  min-height: 320px;
}
.featured-screenshot {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius) 0 0 var(--radius);
  display: block;
}
.featured-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: brightness(0.8);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s;
}
.card-featured:hover .featured-screenshot img {
  transform: scale(1.03);
  filter: brightness(0.9);
}
.featured-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-badge {
  display: inline-block;
  width: fit-content;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  border-radius: 50px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}
.featured-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.featured-info h3 a {
  text-decoration: none;
  color: var(--text-primary);
  transition: color 0.3s;
}
.featured-info h3 a:hover {
  color: var(--accent-primary);
}
.featured-info p {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.featured-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.stack-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.3s;
}
.stack-icon:hover {
  transform: translateY(-3px);
  filter: brightness(1.2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.stack-icon svg {
  width: 18px;
  height: 18px;
}
.featured-link {
  display: inline-block;
  width: fit-content;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.3s;
}
.featured-link:hover {
  letter-spacing: 0.06em;
}

@media (max-width: 768px) {
  .featured-layout {
    grid-template-columns: 1fr;
  }
  .featured-screenshot {
    border-radius: var(--radius) var(--radius) 0 0;
    height: 200px;
  }
  .featured-info {
    padding: 1.5rem;
  }
}

/* Capstone featured visual */
.capstone-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2.5rem;
  background: linear-gradient(135deg, rgba(90,158,111,0.06), rgba(90,158,111,0.02));
  border-right: 1px solid var(--card-border);
  border-radius: var(--radius) 0 0 var(--radius);
}
.capstone-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
}
.capstone-logo svg {
  opacity: 0.7;
  margin-bottom: 0.25rem;
}
.capstone-school {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.capstone-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.capstone-stats {
  display: flex;
  gap: 2rem;
}
.capstone-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.stat-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--accent-primary);
  line-height: 1;
}
.stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.capstone-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.area-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid;
}
.area-cloud { color: #06B6D4; background: rgba(6,182,212,0.08); border-color: rgba(6,182,212,0.2); }
.area-data { color: #5a9e6f; background: rgba(90,158,111,0.08); border-color: rgba(90,158,111,0.2); }
.area-bigdata { color: #E86C00; background: rgba(232,108,0,0.08); border-color: rgba(232,108,0,0.2); }
.area-edge { color: #8B5CF6; background: rgba(139,92,246,0.08); border-color: rgba(139,92,246,0.2); }
.area-ai { color: #EC4899; background: rgba(236,72,153,0.08); border-color: rgba(236,72,153,0.2); }
.area-hw { color: #C51A4A; background: rgba(197,26,74,0.08); border-color: rgba(197,26,74,0.2); }

@media (max-width: 768px) {
  .capstone-visual {
    border-right: none;
    border-bottom: 1px solid var(--card-border);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 2rem 1.5rem;
  }
  .capstone-stats { gap: 1.5rem; }
}

/* Image cards */
.card-img { padding: 0; }

.card-thumb {
  height: 190px;
  overflow: hidden;
  background: var(--bg-card);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-img:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 1.5rem 1.75rem; }
.card-body h3 { margin-bottom: 0.5rem; }

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.about-skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.about-skills h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-primary);
  margin-bottom: 0.8rem;
}

.about-skills ul { list-style: none; }

.about-skills li {
  font-size: 0.88rem;
  padding: 0.35rem 0;
  color: var(--text-muted);
}

/* ===== CONTACT ===== */
.contact-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(8px);
  transition: all 0.4s;
}

.contact-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--contact-hover-bg);
  box-shadow: 0 0 30px rgba(90,158,111,0.12);
  transform: translateY(-2px);
}

.contact-btn svg { flex-shrink: 0; opacity: 0.7; }
.contact-btn:hover svg { opacity: 1; }

/* ===== MASONRY GALLERY ===== */
.masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 140px;
  grid-auto-flow: dense;
  gap: 0.75rem;
  margin-top: 3.5rem;
}

.masonry-item {
  position: relative;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  cursor: pointer;
}

.masonry-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: brightness(0.85) saturate(0.9);
  transition: transform 0.5s, filter 0.3s;
}

.masonry-item:hover img {
  transform: scale(1.05);
  filter: brightness(1) saturate(1);
}

.masonry-tall {
  grid-row: span 2;
}

.masonry-wide {
  grid-column: span 2;
}

.masonry-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.8rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s, transform 0.3s;
}

.masonry-item:hover .masonry-caption {
  opacity: 1;
  transform: translateY(0);
}

/* Oregon map in About */
.about-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.oregon-map {
  width: 100%;
  max-width: 280px;
  height: auto;
}
.oregon-outline {
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 0.4;
  opacity: 0.25;
}
.oregon-city {
  cursor: pointer;
}
.oregon-city circle {
  transition: r 0.3s, opacity 0.3s;
  opacity: 0.8;
}
.oregon-city text {
  opacity: 0.6;
  transition: opacity 0.3s;
}
.oregon-city:hover circle {
  r: 2;
  opacity: 1;
}
.oregon-city:hover text {
  opacity: 1;
}
.map-caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.4;
  margin-top: -5rem;
}

/* ===== FOOTER ===== */
.footer {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1.5rem;
  padding: 2.5rem 3.5rem;
  background: var(--bg);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: var(--gradient-line);
  opacity: 0.15;
}

.footer p { color: var(--text-secondary); opacity: 0.4; font-size: 0.78rem; letter-spacing: 0.02em; }

/* ===== SVG MOUNTAIN THEME COLORS ===== */
/* Dark theme gradient stops */
:root .mt-main-top, [data-theme="dark"] .mt-main-top { stop-color: #1a2a1e; stop-opacity: 0.85; }
:root .mt-main-mid, [data-theme="dark"] .mt-main-mid { stop-color: #111e14; stop-opacity: 0.92; }
:root .mt-main-bot, [data-theme="dark"] .mt-main-bot { stop-color: #0b100e; stop-opacity: 1; }
:root .mt-mid-top, [data-theme="dark"] .mt-mid-top { stop-color: #162218; stop-opacity: 0.65; }
:root .mt-mid-bot, [data-theme="dark"] .mt-mid-bot { stop-color: #0b100e; stop-opacity: 0.82; }
:root .mt-far-top, [data-theme="dark"] .mt-far-top { stop-color: #1a2a1e; stop-opacity: 0.6; }
:root .mt-far-bot, [data-theme="dark"] .mt-far-bot { stop-color: #0b100e; stop-opacity: 0.75; }
:root .mt-snow-top, [data-theme="dark"] .mt-snow-top { stop-color: #d0dcd4; stop-opacity: 0.22; }
:root .mt-snow-bot, [data-theme="dark"] .mt-snow-bot { stop-color: #d0dcd4; stop-opacity: 0; }
:root .mt-tree-top, [data-theme="dark"] .mt-tree-top { stop-color: #0a0f0c; }
:root .mt-tree-bot, [data-theme="dark"] .mt-tree-bot { stop-color: #0b100e; }
:root .mt-glow-inner, [data-theme="dark"] .mt-glow-inner { stop-color: #5a9e6f; stop-opacity: 0.04; }
:root .mt-glow-outer, [data-theme="dark"] .mt-glow-outer { stop-color: #5a9e6f; stop-opacity: 0; }

/* Light theme gradient stops — bottoms fade to match --bg #f4f1eb */
[data-theme="light"] .mt-main-top { stop-color: #4a6e4e; stop-opacity: 0.45; }
[data-theme="light"] .mt-main-mid { stop-color: #8aaa8a; stop-opacity: 0.25; }
[data-theme="light"] .mt-main-bot { stop-color: #f4f1eb; stop-opacity: 0; }
[data-theme="light"] .mt-mid-top { stop-color: #6a8e6e; stop-opacity: 0.35; }
[data-theme="light"] .mt-mid-bot { stop-color: #f4f1eb; stop-opacity: 0; }
[data-theme="light"] .mt-far-top { stop-color: #6a8e6e; stop-opacity: 0.45; }
[data-theme="light"] .mt-far-bot { stop-color: #f4f1eb; stop-opacity: 0; }
[data-theme="light"] .mt-snow-top { stop-color: #ffffff; stop-opacity: 0.7; }
[data-theme="light"] .mt-snow-bot { stop-color: #ffffff; stop-opacity: 0; }
[data-theme="light"] .mt-tree-top { stop-color: #3a5a3e; stop-opacity: 0.3; }
[data-theme="light"] .mt-tree-bot { stop-color: #f4f1eb; stop-opacity: 0; }
[data-theme="light"] .mt-glow-inner { stop-color: #4a7c59; stop-opacity: 0.04; }
[data-theme="light"] .mt-glow-outer { stop-color: #4a7c59; stop-opacity: 0; }

/* Peak interactive styles */
.peak-group { cursor: pointer; }
.peak-group .peak-shape,
.peak-group .peak-snow {
  transition: filter 0.4s, opacity 0.4s, transform 0.4s;
  transform-origin: bottom center;
}
.peak-group:hover .peak-shape {
  filter: brightness(1.6) saturate(1.3);
  transform: scaleY(1.04);
}
.peak-group:hover .peak-snow {
  opacity: 0.9 !important;
  filter: brightness(2);
}
.peak-label {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--text-secondary);
  opacity: 0.35;
  transition: all 0.4s;
}
.peak-elev {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  fill: var(--text-secondary);
  opacity: 0.2;
  letter-spacing: 0.05em;
  transition: all 0.4s;
}
.peak-tick {
  stroke: var(--text-secondary);
  opacity: 0.15;
  transition: all 0.4s;
}
.peak-group:hover .peak-label {
  font-size: 14px;
  fill: var(--accent-primary);
  opacity: 0.85;
  font-weight: 600;
}
.peak-group:hover .peak-elev {
  font-size: 11px;
  fill: var(--accent-primary);
  opacity: 0.55;
}
.peak-group:hover .peak-tick {
  stroke: var(--accent-primary);
  opacity: 0.5;
  stroke-width: 1.2;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .navbar { padding: 0 1.5rem; }
  .nav-links { display: none; }
  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--mobile-menu-bg);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    gap: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
  }
  .nav-toggle { display: flex; }
  .hero-mountain {
    margin-top: -15vh;
    margin-left: -35%;
    width: 135%;
  }
}

@media (max-width: 768px) {
  /* Hero */
  .hero {
    min-height: 100vh;
    padding-top: 64px;
  }

  .hero-text-row {
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    padding: 1.5rem 1.5rem 0;
  }

  .hero-marker {
    gap: 0.4rem;
    align-items: center;
    max-width: 100%;
  }
  .marker-line { display: none; }
  .marker-label { font-size: 1.6rem; }
  .hero-marker-right .marker-label { font-size: 1.1rem; }
  .marker-sub { font-size: 0.5rem; letter-spacing: 0.08em; white-space: nowrap; }

  .hero-center { order: -1; }
  .center-name { font-size: 2.2rem; }
  .hero-avatar { width: 60px; height: 60px; }

  .hero-mountain {
    margin-top: -10vh;
    margin-left: -50%;
    width: 150%;
  }

  #hero-canvas { display: none; }
  .hero-scroll-arrow { bottom: 1rem; }

  /* Sections */
  .section { padding: 6rem 1.5rem; }
  .cards { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-map { order: -1; }
  .oregon-map { max-width: 200px; }
  .masonry { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 120px; }
  .masonry-wide { grid-column: span 1; }
  .timeline { padding-left: 2rem; }
  .timeline-item::before { left: calc(-2rem + 0.5px); }
  .timeline-item::after { left: calc(-2rem + 5px); width: calc(2rem - 5px); }
  .contact-row { flex-direction: column; align-items: center; }
  .footer { flex-direction: column; gap: 0.75rem; text-align: center; padding: 2rem; }

  /* Current role */
  .current-role { padding: 1.5rem; }
  .current-role-header h3 { font-size: 1.05rem; }
  .role-highlights li { font-size: 0.8rem; }

  /* Featured stack icons */
  .featured-stack { gap: 0.4rem; }
  .stack-icon { width: 32px; height: 32px; }
  .stack-icon svg { width: 15px; height: 15px; }

  /* Featured info */
  .featured-info h3 { font-size: 1.15rem; }

  /* Area pills */
  .capstone-areas { gap: 0.3rem; }
  .area-pill { font-size: 0.6rem; padding: 0.25rem 0.6rem; }

  /* Terminal */
  .terminal { margin: 0; }
  .terminal-meta { gap: 0.6rem; }
  .term-lang { font-size: 0.6rem; }

  /* Section label */
  .section-label { font-size: 0.45rem; }


  /* Section backgrounds */
  .section-bg-svg text { display: none; }
}

@media (max-width: 480px) {
  .hero-text-row { gap: 1rem; }
  .center-name { font-size: 1.8rem; }
  .hero-avatar { width: 50px; height: 50px; }
  .marker-label { font-size: 1.3rem; }
  .hero-marker-right .marker-label { font-size: 0.9rem; }
  .marker-sub { font-size: 0.4rem; letter-spacing: 0.06em; }

  .masonry { grid-template-columns: 1fr; grid-auto-rows: 180px; }
  .masonry-tall { grid-row: span 1; }

  .terminal-body { padding: 0.75rem; font-size: 0.65rem; }
  .terminal-project-info h3 { font-size: 0.85rem; }
  .terminal-project-info p { font-size: 0.72rem; }
  .term-lang { font-size: 0.55rem; }
  .terminal-meta { gap: 0.4rem 0.6rem; }

  .current-role { padding: 1.25rem; }
  .stat-number { font-size: 1.6rem; }
  .capstone-stats { gap: 1rem; }

  .featured-screenshot { height: 160px; }
  .featured-info { padding: 1.25rem; }
  .featured-info h3 { font-size: 1rem; }
  .featured-info p { font-size: 0.78rem; }
  .featured-badge { font-size: 0.5rem; }

  .gallery-lightbox img { max-width: 95vw; max-height: 80vh; }
}

/* ===== LIGHT MODE BRIGHT ACCENTS ===== */
[data-theme="light"] .nav-links a:hover { color: var(--accent-bright); }
[data-theme="light"] .nav-links a.active { color: var(--accent-bright); }
[data-theme="light"] .center-title { color: var(--accent-bright); }
[data-theme="light"] .about-skills h4 { color: var(--accent-bright); }
[data-theme="light"] .hero-marker:hover .marker-label { color: var(--accent-bright); }
[data-theme="light"] .hero-marker:hover .marker-line { background: var(--accent-bright); }
[data-theme="light"] .back-to-top { background: var(--accent-bright); }
[data-theme="light"] .logo-text span { color: var(--accent-bright); }
[data-theme="light"] .oregon-city circle { fill: var(--accent-bright); }
[data-theme="light"] .oregon-city text { fill: var(--accent-bright); }

/* ===== ACTIVE NAV LINK ===== */
.nav-links a.active {
  color: var(--accent-primary);
}
.nav-links a.active::after {
  width: 100%;
}

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--gradient-line);
  z-index: 10001;
  transition: none;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s;
  z-index: 9999;
}
.back-to-top.visible {
  opacity: 0.7;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  opacity: 1;
}

/* ===== FOCUS STYLES ===== */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== REDUCED MOTION ===== */
@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;
  }
  .scroll-progress { display: none; }
}
