
:root {
  --font: 'JetBrains Mono', monospace;
  --radius: 16px;
  --max-width: 1100px;
  --transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== DARK THEME ===== */
:root[data-theme="dark"] {
  --bg: #0a0806;
  --bg-2: #110e0b;
  --surface: #15110e;
  --surface-2: #1c1713;
  --border: rgba(215, 155, 91, 0.12);
  --border-hover: rgba(215, 155, 91, 0.3);
  --text: #f0e6d8;
  --text-dim: #9a8b7a;
  --text-muted: #8a7d6e;
  --accent: #d4944a;
  --accent-bright: #e8ad6a;
  --accent-glow: rgba(212, 148, 74, 0.15);
  --accent-soft: rgba(212, 148, 74, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
  --terminal-bg: #0f0c09;
  --terminal-bar: #1a1512;
  --scrollbar-track: #110e0b;
  --scrollbar-thumb: #2a2320;
}

/* ===== LIGHT THEME ===== */
:root[data-theme="light"] {
  --bg: #faf8f5;
  --bg-2: #f4f0eb;
  --surface: #ffffff;
  --surface-2: #f9f6f2;
  --border: rgba(160, 110, 50, 0.15);
  --border-hover: rgba(160, 110, 50, 0.35);
  --text: #1a1510;
  --text-dim: #5a5045;
  --text-muted: #6b5f52;
  --accent: #b86a2e;
  --accent-bright: #d4883e;
  --accent-glow: rgba(184, 106, 46, 0.1);
  --accent-soft: rgba(184, 106, 46, 0.05);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.1);
  --terminal-bg: #fefcf9;
  --terminal-bar: #f0ebe5;
  --scrollbar-track: #f0ebe5;
  --scrollbar-thumb: #c9bfb5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #0a0806;
  padding: 0.75rem 1.5rem;
  z-index: 999;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 0 0 8px 0;
  transition: left 0.2s ease;
}

.skip-link:focus {
  left: 0;
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* P0: Scroll offset for sticky header */
section[id] {
  scroll-margin-top: 70px;
}

body {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

/* ===== DOT GRID BACKGROUND ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  z-index: 100;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--accent-glow);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Focus indicators for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 245, 0.85);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

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

.brand-prompt {
  color: var(--accent);
  margin-right: 0.3rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-bright);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
  font-size: 1rem;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

#themeIconText {
  font-weight: 700;
  line-height: 1;
}

/* Hamburger button */
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
}

.hamburger:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hamburger span {
  display: block;
  width: 14px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: all 0.2s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
}

/* Mobile nav */
.mobile-nav {
  display: none;
  padding: 0 0 1rem 0;
  border-top: 1px solid var(--border);
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav a {
  display: block;
  padding: 0.6rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: lowercase;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s ease;
}

.mobile-nav a:last-child {
  border-bottom: none;
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--accent-bright);
}

/* ===== HERO ===== */
.hero {
  padding: 3rem 0 2rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "name-row  terminal"
    "actions   terminal";
  column-gap: 2.5rem;
  row-gap: 1.25rem;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
}

/* Hero Name Row */
.hero-name-row {
  grid-area: name-row;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Hero Title */
.hero-title {
  text-align: left;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* Terminal Window */
.terminal-window {
  width: 100%;
  max-width: 500px;
  grid-area: terminal;
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 40px var(--accent-soft);
  transition: all 0.4s ease;
  position: relative;
}

.terminal-window:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), 0 0 60px var(--accent-glow);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--terminal-bar);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
}

.terminal-dot:first-child {
  background: #ff5f57;
  opacity: 0.8;
}

.terminal-dot:nth-child(2) {
  background: #ffbd2e;
  opacity: 0.8;
}

.terminal-dot:nth-child(3) {
  background: #28c840;
  opacity: 0.8;
}

.terminal-title {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 0.8rem 1.4rem 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.terminal-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.prompt {
  color: var(--accent);
  font-weight: 700;
  user-select: none;
}

.cmd {
  color: var(--text-dim);
}

.terminal-output {
  color: var(--text);
  padding-left: 1.6rem;
  padding-bottom: 0.3rem;
  opacity: 0.9;
}

.blinking-cursor::after {
  content: '_';
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

/* Typing animation — faster */
.terminal-body .terminal-line,
.terminal-body .terminal-output {
  opacity: 0;
  animation: type-in 0.35s ease forwards;
}

.terminal-body .terminal-line:nth-child(1) { animation-delay: 0.1s; }
.terminal-body .terminal-output:nth-child(2) { animation-delay: 0.25s; }
.terminal-body .terminal-line:nth-child(3) { animation-delay: 0.4s; }
.terminal-body .terminal-output:nth-child(4) { animation-delay: 0.55s; }
.terminal-body .terminal-line:nth-child(5) { animation-delay: 0.7s; }
.terminal-body .terminal-output:nth-child(6) { animation-delay: 0.85s; }

/* Skip animation class */
.terminal-window.skipped .terminal-line,
.terminal-window.skipped .terminal-output {
  opacity: 1;
  transform: none;
  animation: none;
}

@keyframes type-in {
  0% {
    opacity: 0;
    transform: translateX(-6px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Skip animation button */
.skip-anim {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.terminal-window:hover .skip-anim {
  opacity: 1;
}

.skip-anim:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Hero Avatar */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
}

.avatar-frame {
  position: relative;
  width: 88px;
  height: 88px;
}

.hero-avatar {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.avatar-frame::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), transparent, var(--accent));
  opacity: 0.3;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.hero-avatar:hover {
  border-color: var(--accent);
  transform: scale(1.02);
}

.avatar-frame:hover::before {
  opacity: 0.5;
}

/* Hero Actions */
.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  grid-area: actions;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.82rem;
  font-family: var(--font);
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  cursor: pointer;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: #0a0806;
  border-color: transparent;
}

.button-primary:hover {
  box-shadow: 0 4px 20px var(--accent-glow), 0 0 30px var(--accent-glow);
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.button-secondary:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.button-icon {
  color: inherit;
  opacity: 0.7;
  font-weight: 400;
}

/* ===== STATS ===== */
.stats {
  padding: 1.5rem 0;
  background: var(--surface);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0;
  text-align: center;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

/* ===== SECTIONS ===== */
.section {
  padding: 2rem 0;
}

.section-header {
  margin-bottom: 1.25rem;
}

.section-tag {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.section-title {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-top: 0.5rem;
  color: var(--text);
}

/* ===== ABOUT ===== */
.about {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-lead {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 1rem;
}

.about-body {
  max-width: 120ch;
}

.about-body p {
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* ===== PROJECTS ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.25s ease;
  grid-column: span 1;
}

.project-card[style*="--span: 2"] {
  grid-column: span 2;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow), 0 0 30px var(--accent-soft);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.project-index {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.project-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.project-card p {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 0.2rem;
}

.project-impact {
  font-size: 0.8rem;
  color: var(--accent-bright);
  font-style: italic;
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tag {
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}

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

.project-link {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}

.project-link:hover {
  color: var(--accent-bright);
  letter-spacing: 0.06em;
}

/* ===== IMPACT ===== */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.impact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.25s ease;
}

.impact-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 30px var(--accent-soft);
  transform: translateY(-2px);
}

.impact-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}

.impact-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ===== EXPERIENCE / TIMELINE ===== */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 1.75rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent) 0%, var(--border) 70%, transparent 100%);
}

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

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

.timeline-marker {
  position: absolute;
  left: -1.75rem;
  top: 1.6rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: translateX(-3px);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:first-child .timeline-marker {
  background: var(--accent-bright);
  box-shadow: 0 0 14px var(--accent-glow), 0 0 24px var(--accent-glow);
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  transition: all 0.25s ease;
}

.timeline-card:hover {
  border-color: var(--accent);
  transform: translateX(3px);
  box-shadow: var(--shadow), 0 0 28px var(--accent-soft);
}

.timeline-item:hover .timeline-marker {
  background: var(--accent-bright);
  box-shadow: 0 0 14px var(--accent-glow);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-role {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
}

.timeline-company {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-bright);
  letter-spacing: 0.02em;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.timeline-period {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.timeline-location {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.timeline-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
}

.timeline-points li {
  font-size: 0.83rem;
  color: var(--text-dim);
  line-height: 1.65;
  padding-left: 1.1rem;
  position: relative;
}

.timeline-points li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.65;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.timeline-item.compact .timeline-card {
  padding: 1rem 1.5rem;
}

.timeline-item.compact .timeline-header {
  margin-bottom: 0;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.skill-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  transition: all 0.25s ease;
}

.skill-block:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.skill-block-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.9rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
  background: transparent;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: var(--accent-soft);
}

/* ===== CONTACT ===== */
.contact {
  padding-bottom: 3rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.contact-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow), 0 0 40px var(--accent-soft);
}

.contact-card .section-tag {
  display: block;
  margin-bottom: 1rem;
}

.contact-card .section-title {
  margin-bottom: 1rem;
}

.contact-text {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  background: var(--surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.footer-brand .footer-prompt {
  display: block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.footer-brand .footer-text {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
  max-width: 32ch;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.78rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-bright);
}

.footer-bottom {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-bottom .footer-year {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 40;
  font-size: 1.1rem;
  font-weight: 700;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger reveal animations */
.reveal:nth-child(1) { transition-delay: 0.05s; }
.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.15s; }

/* ===== ACCESSIBILITY ===== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .terminal-body .terminal-line,
  .terminal-body .terminal-output {
    opacity: 1 !important;
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }

  .skip-anim {
    display: none;
  }

  .scroll-progress {
    display: none;
  }
}

/* Print styles */
@media print {
  @page {
    margin: 1.5cm;
    orphans: 3;
    widows: 3;
  }

  .site-header,
  .scroll-progress,
  .back-to-top,
  .skip-anim,
  .theme-toggle,
  .hamburger,
  .mobile-nav,
  body::before,
  .hero-actions,
  .terminal-window {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
    line-height: 1.4;
  }

  a {
    color: #1a1a1a;
    word-break: break-word;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  .section {
    page-break-inside: avoid;
  }

  .project-card,
  .impact-card,
  .skill-block {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
}

/* WebKit scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ===== RESPONSIVE ===== */

/* High contrast mode */
@media (prefers-contrast: more) {
  :root {
    --text-muted: #5a5045;
    --border: rgba(160, 110, 50, 0.35);
  }

  :root[data-theme="dark"] {
    --text-muted: #9a8b7a;
    --border: rgba(215, 155, 91, 0.3);
  }

  .tag, .skill-tag {
    border-width: 2px;
  }

  .project-card, .impact-card, .skill-block {
    border-width: 2px;
  }
}

@media (max-width: 1024px) {
  .impact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  .hero-name-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-title {
    text-align: center;
  }

  .terminal-window {
    max-width: none;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    align-items: center;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-nav.open {
    display: block;
  }

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

  .project-card[style*="--span: 2"] {
    grid-column: span 1;
  }

  .timeline {
    padding-left: 1.25rem;
  }

  .timeline-marker {
    left: -1.25rem;
    transform: translateX(-3px);
  }

  .timeline-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .timeline-meta {
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(1, 1fr);
  }

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

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .hero {
    padding: 1.5rem 0 1rem;
  }

  .section {
    padding: 1.75rem 0;
  }

  .contact-card {
    padding: 2rem 1.5rem;
  }

  .hero-actions {
    width: 100%;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    min-width: 44px;
    min-height: 44px;
  }
}
