/* ==========================================================================
   MINIMALIST EDITORIAL DESIGN SYSTEM FOR GEOVANNI M. VERGARA
   Display: Outfit | Body: Plus Jakarta Sans
   ========================================================================== */

:root {
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Light Theme */
  --bg-page: #faf9f6;
  --card-bg: #ffffff;
  --ink: #141619;
  --ink-secondary: #33383f;
  --muted: #667085;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --soft: #f2f2ee;
  --soft-hover: #eae9e4;
  --dot-mesh: rgba(0, 0, 0, 0.04);

  /* Accents */
  --accent: #2563eb;
  --accent-light: rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.2);

  /* Geometry & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 30px -6px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 20px 42px -10px rgba(0, 0, 0, 0.1);
  --ease: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --max: 1160px;
}

html[data-theme="dark"] {
  --bg-page: #0c0d10;
  --card-bg: #131418;
  --ink: #f8fafc;
  --ink-secondary: #cbd5e1;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --soft: #1a1c22;
  --soft-hover: #22252c;
  --dot-mesh: rgba(255, 255, 255, 0.03);

  --accent: #60a5fa;
  --accent-light: rgba(96, 165, 250, 0.12);
  --accent-glow: rgba(96, 165, 250, 0.25);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -6px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 42px -10px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   RESETS & GLOBAL DEFAULTS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg-page);
  background-image: radial-gradient(var(--dot-mesh) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 240ms ease, color 240ms ease;
}

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

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.shell {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -100px;
  left: 24px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--card-bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 180ms ease;
}
.skip-link:focus {
  top: 16px;
}

.section {
  padding: 110px 0;
  border-top: 1px solid var(--line);
}

/* Typography Defaults */
h1, h2, h3, .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.eyebrow, .section-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-label {
  display: inline-block;
  margin-bottom: 16px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 44px;
  flex-wrap: wrap;
  gap: 20px;
}

.section-heading p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* ==========================================================================
   SITE HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 246, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  transition: background-color 240ms ease, border-color 240ms ease;
}

html[data-theme="dark"] .site-header {
  background: rgba(12, 13, 16, 0.88);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.wordmark {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.site-nav a {
  padding: 8px 16px;
  border-radius: var(--pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 180ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  background: var(--soft);
}

.nav-cta {
  border-radius: var(--pill);
  padding: 9px 20px;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--card-bg);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: all var(--ease);
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--card-bg);
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: all 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  transform: scale(1.05);
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }

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

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 12px;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  scroll-margin-top: 100px;
  min-height: calc(88vh - 72px);
  padding: 80px 0 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 880px;
}

.hero-eyebrow-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.hero-eyebrow-wrap .eyebrow {
  color: var(--accent);
  margin: 0;
}

.eyebrow-divider {
  color: var(--line-strong);
}

.eyebrow-year {
  color: var(--muted);
  font-weight: 500;
}

.hero h1 {
  font-size: clamp(3.2rem, 7.5vw, 6.2rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.0;
  margin: 18px 0 0;
  color: var(--ink);
}

.hero h1 span {
  color: var(--accent);
}

.hero-summary {
  max-width: 660px;
  margin: 26px 0 0;
  font-size: clamp(1.08rem, 1.8vw, 1.25rem);
  line-height: 1.68;
  color: var(--muted);
  font-weight: 400;
}

/* Availability Pill */
.availability-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  margin: 26px 0 0;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
  width: fit-content;
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: liveDotPulse 2.2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  flex-shrink: 0;
}

@keyframes liveDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.availability-label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}

/* Hero Action Buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}

.button {
  font-family: var(--font-body);
  min-height: 48px;
  border-radius: var(--pill);
  padding: 12px 28px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--ease);
}

.button-primary {
  background: var(--ink);
  color: var(--card-bg);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.94;
}

.button-secondary {
  background: var(--card-bg);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--soft);
}

/* Hero Micro Stats */
.hero-stats-row {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.stat-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-text {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 500;
}

.stat-slash {
  color: var(--line-strong);
  font-size: 0.9rem;
}

/* Social Links */
.social-list {
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 26px 0 0;
  list-style: none;
  flex-wrap: wrap;
}

.social-list a {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--card-bg);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
  transition: all 180ms ease;
}

.social-list a:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* ==========================================================================
   ABOUT & CAPABILITIES
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 6vw, 80px);
  padding: 20px 0 60px;
}

.about-grid h2 {
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 0;
}

.about-grid p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.72;
  margin: 0 0 20px;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.capability-grid article {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 28px;
  box-shadow: var(--shadow-sm);
  transition: all var(--ease);
}

.capability-grid article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}

.cap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cap-num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
}

.cap-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--soft);
  padding: 3px 10px;
  border-radius: var(--pill);
}

.capability-grid h3 {
  font-size: 1.2rem;
  margin: 22px 0 10px;
}

.capability-grid p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.62;
  margin: 0;
}

/* ==========================================================================
   TECH STACK CHIPS
   ========================================================================== */
.tech-stack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 44px;
}

.tech-stack article {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--ease);
}

.tech-stack article:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.tech-stack img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: transform 200ms ease;
}

.tech-stack article:hover img {
  transform: scale(1.1);
}

.tech-stack strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.tech-stack span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}

.tech-stack small {
  display: none;
}

/* ==========================================================================
   SELECTED WORK (PROJECT CARDS)
   ========================================================================== */
.selected-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.project {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all var(--ease);
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.project-badge {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: var(--pill);
}

.project-category {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project h2 {
  font-size: 1.4rem;
  margin: 0;
}

.project-lead {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.62;
  margin: 12px 0 20px;
}

.case-study {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.case-item dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.case-item dd {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 22px 0 0;
}

.tag-row span {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: var(--pill);
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
}

.project-actions {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 180ms ease, color 180ms ease;
}

.project-link:hover {
  color: var(--ink);
  transform: translateX(3px);
}

.project-status {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--soft);
  padding: 3px 8px;
  border-radius: var(--pill);
}

/* Additional Work */
.additional-work {
  margin-top: 90px;
  padding-top: 46px;
  border-top: 1px solid var(--line);
}

.work-index {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.work-group h3 {
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 14px;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.work-group>a, .work-unavailable {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 15px 10px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  transition: all 160ms ease;
}

.work-group>a:hover {
  background: var(--soft);
  transform: translateX(4px);
}

.work-group small {
  font-size: 0.76rem;
  color: var(--muted);
}

.work-group b {
  font-size: 0.84rem;
  font-weight: 600;
}

.work-unavailable {
  color: var(--muted);
}

/* ==========================================================================
   EXPERIENCE SECTION (TIMELINE STEPPER)
   ========================================================================== */
.resume-grid.single-column {
  max-width: 840px;
  padding-top: 16px;
}

.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 36px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 8px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}

.timeline li {
  position: relative;
  padding: 0 0 46px 0;
}

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

.timeline li::before {
  content: '';
  position: absolute;
  top: 6px;
  left: -36px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 5px var(--bg-page);
  transition: all 200ms ease;
}

.timeline li:hover::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-light);
  transform: scale(1.15);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.timeline-head h3 {
  font-size: 1.3rem;
  margin: 0;
}

.timeline-period {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.timeline-org {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
}

.org-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 12px;
  border-radius: var(--pill);
}

.org-type {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--soft);
  padding: 2px 8px;
  border-radius: var(--pill);
}

.timeline-desc {
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--muted);
  margin: 0;
}

/* ==========================================================================
   CONTACT SECTION (LUXURY FLOATING CARD)
   ========================================================================== */
.contact-section {
  padding: 70px 0 110px;
  border-top: none;
}

.contact-inner {
  background: linear-gradient(145deg, #15171c 0%, #0d0e11 100%);
  color: #ffffff;
  padding: clamp(50px, 6.5vw, 80px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 70px -16px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 50px;
  align-items: center;
}

.contact-inner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -25%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.28) 0%, transparent 68%);
  pointer-events: none;
}

.contact-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 20px;
}

.contact-badge .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
}

.contact-inner h2 {
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.06;
  color: #ffffff;
  margin: 0;
}

.contact-inner p {
  color: #94a3b8;
  font-size: 1.05rem;
  line-height: 1.68;
  margin: 18px 0 0;
  max-width: 540px;
}

.contact-action-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.contact-inner .button-light {
  background: #ffffff;
  color: #0e1013;
  border: none;
  border-radius: var(--pill);
  padding: 16px 36px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
  transition: all var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.contact-inner .button-light:hover {
  background: #ffffff;
  color: #0e1013;
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(255, 255, 255, 0.35);
}

.contact-subtext {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

/* ==========================================================================
   FOOTER & BACK TO TOP
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.site-footer>.shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

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

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 200ms ease;
  z-index: 40;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top:hover {
  background: var(--ink);
  color: var(--card-bg);
  transform: translateY(-2px);
}

/* Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 450ms cubic-bezier(0.16, 1, 0.3, 1), transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
  .selected-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contact-inner { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 800px) {
  .menu-toggle { display: block; margin-left: auto; }
  .nav-cta { display: none; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 72px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: flex; }
  .site-nav a { width: 100%; padding: 10px 14px; }

  .hero { min-height: auto; padding: 60px 0 40px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .capability-grid { grid-template-columns: 1fr; }
  .selected-grid { grid-template-columns: 1fr; }
  .work-index { grid-template-columns: 1fr; gap: 36px; }
  .theme-toggle { order: 2; }
  .menu-toggle { order: 1; }
  .hero-stats-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .stat-slash { display: none; }
}

@media (max-width: 540px) {
  .tech-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-group>a, .work-unavailable { grid-template-columns: 1fr auto; }
  .work-group small { grid-column: 1; }
  .work-group b { grid-column: 2; grid-row: 1; }
  .site-footer>.shell { flex-direction: column; align-items: flex-start; }
}
