/* =============================================
   TOKENS — LIGHT (default)
   Frozen: do not change token values
============================================= */
:root {
  --bg-primary:            #FAF8F5;
  --bg-card:               #FAF8F5;
  --bg-card-hover:         #F2EDE6;
  --surface:               #F2EDE6;
  --accent-primary:        #B84E26;
  --accent-dark:           #963D1C;
  --accent-soft:           #D4B8A0;
  --accent-secondary:      #7060A8;
  --accent-fg:             #FFFFFF;
  --text-primary:          #1C1714;
  --text-secondary:        #6E6258;
  --text-muted:            #8A7D73;
  --border:                #E5DDD4;
  --font-display:          'Red Hat Display', system-ui, sans-serif;
  --font-heading:          'Red Hat Display', system-ui, sans-serif;
  --font-mono:             'DM Mono', 'Courier New', monospace;
  --font-body:             'Figtree', system-ui, sans-serif;
  --nav-bg:                rgba(250, 248, 245, 0.88);
  --hero-glow:             rgba(184, 78, 38, 0.07);
  --stat-hl-bg:            rgba(112, 96, 168, 0.06);
  --stat-hl-border:        rgba(112, 96, 168, 0.25);
  --badge-expert-bg:       rgba(184, 78, 38, 0.08);
  --badge-expert-border:   rgba(184, 78, 38, 0.22);
  --badge-expert-text:     #B84E26;
  --btn-shadow:            rgba(184, 78, 38, 0.22);
  --gradient-accent:       none;
  --nav-h:                 68px;
}

/* =============================================
   TOKENS — BLUE
   Inspired by blueGreen / Indaco aesthetic
   Periwinkle canvas · lime CTAs · Playfair serif
============================================= */
[data-theme="blue"] {
  --bg-primary:            #6565F0;
  --bg-card:               #5050D8;
  --bg-card-hover:         #3D3DC8;
  --surface:               #3D3DC8;
  --accent-primary:        #C5F200;
  --accent-dark:           #A8CE00;
  --accent-soft:           rgba(197, 242, 0, 0.25);
  --accent-secondary:      #C5F200;
  --accent-fg:             #0A0D1A;
  --text-primary:          #FFFFFF;
  --text-secondary:        #C5C5E0;
  --text-muted:            #9494C0;
  --border:                rgba(255, 255, 255, 0.14);
  --font-display:          'Red Hat Display', system-ui, sans-serif;
  --font-heading:          'Red Hat Display', system-ui, sans-serif;
  --font-mono:             'JetBrains Mono', 'Courier New', monospace;
  --font-body:             'Figtree', system-ui, sans-serif;
  --nav-bg:                rgba(101, 101, 240, 0.96);
  --hero-glow:             rgba(197, 242, 0, 0.06);
  --stat-hl-bg:            rgba(197, 242, 0, 0.10);
  --stat-hl-border:        rgba(197, 242, 0, 0.32);
  --badge-expert-bg:       rgba(197, 242, 0, 0.10);
  --badge-expert-border:   rgba(197, 242, 0, 0.35);
  --badge-expert-text:     #C5F200;
  --btn-shadow:            rgba(197, 242, 0, 0.28);
  --gradient-accent:       none;
}

/* =============================================
   TOKENS — DARK
   Near-black · coral-to-amber gradient accent
   Syne display · Inter body
============================================= */
[data-theme="dark"] {
  --bg-primary:            #0D0D0D;
  --bg-card:               #141414;
  --bg-card-hover:         #1C1C1C;
  --surface:               #141414;
  --accent-primary:        #FF6B6B;
  --accent-dark:           #E05555;
  --accent-soft:           rgba(255, 107, 107, 0.25);
  --accent-secondary:      #FF9F45;
  --accent-fg:             #0D0D0D;
  --text-primary:          #F5F5F5;
  --text-secondary:        #7D7D8C;
  --text-muted:            #4A4A58;
  --border:                rgba(255, 255, 255, 0.08);
  --font-display:          'Red Hat Display', system-ui, sans-serif;
  --font-heading:          'Red Hat Display', system-ui, sans-serif;
  --font-mono:             'DM Mono', 'Courier New', monospace;
  --font-body:             'Figtree', system-ui, sans-serif;
  --nav-bg:                rgba(13, 13, 13, 0.92);
  --hero-glow:             rgba(255, 107, 107, 0.07);
  --stat-hl-bg:            rgba(255, 107, 107, 0.06);
  --stat-hl-border:        rgba(255, 107, 107, 0.22);
  --badge-expert-bg:       rgba(255, 107, 107, 0.08);
  --badge-expert-border:   rgba(255, 107, 107, 0.25);
  --badge-expert-text:     #FF6B6B;
  --btn-shadow:            rgba(255, 107, 107, 0.25);
  --gradient-accent:       linear-gradient(135deg, #FF6B6B 0%, #FF9F45 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.35s ease, color 0.35s ease;
}

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

ul {
  list-style: none;
}

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

button {
  cursor: pointer;
}

/* =============================================
   TYPOGRAPHY — HEADINGS
============================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.025em;
}

/* =============================================
   UTILITIES
============================================= */
.label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-primary);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.section {
  padding: clamp(5rem, 10vh, 8rem) clamp(1.25rem, 5vw, 4rem);
}

.section-head {
  margin-bottom: clamp(3rem, 6vh, 4.5rem);
}

.section-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  margin-top: 0.35rem;
}

.accent {
  color: var(--accent-primary);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--accent-primary);
  color: var(--accent-fg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  border-radius: 4px;
  z-index: 1000;
  text-decoration: none;
  white-space: nowrap;
  transition: top 0s;
}

.skip-link:focus {
  top: 0.75rem;
}

/* Focus styles */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .hero-label,
  .hero-line1,
  .hero-line2,
  .hero-tagline,
  .hero-ctas {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* =============================================
   NAV
============================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  padding: 0 clamp(1.25rem, 5vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  z-index: 500;
  transition: border-color 0.3s ease, background 0.35s ease;
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.nav-logo:hover {
  opacity: 0.55;
}

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

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  position: relative;
  transition: color 0.2s ease;
}

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

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

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

/* Theme toggle pill */
.theme-btn {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.28rem 0.75rem;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.theme-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-primary);
  transition: all 0.25s ease;
  transform-origin: center;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  background: var(--bg-primary);
  padding: 3rem 1.5rem;
  z-index: 400;
  flex-direction: column;
  gap: 0;
  transition: background 0.35s ease;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}

.mobile-menu a:hover {
  color: var(--accent-primary);
}

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

/* =============================================
   BUTTONS
============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.7rem;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease,
              transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--accent-fg);
  border-color: var(--accent-primary);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px var(--btn-shadow);
}

/* Blue theme: lime button with dark text */
[data-theme="blue"] .btn-primary {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: var(--accent-fg);
}

[data-theme="blue"] .btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

/* Dark theme: gradient button */
[data-theme="dark"] .btn-primary {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #0D0D0D;
}

[data-theme="dark"] .btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--btn-shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

/* =============================================
   HERO
============================================= */
.hero {
  min-height: 80svh;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 2rem) clamp(1.25rem, 5vw, 4rem) clamp(2.5rem, 6vh, 4rem);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: -10%;
  width: 65%;
  height: 75%;
  background: radial-gradient(ellipse at top right, var(--hero-glow) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

/* Staggered page-load animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.hero-label {
  animation: fadeUp 0.5s ease forwards;
  animation-delay: 0.05s;
  opacity: 0;
}

.hero-label::after {
  content: '_';
  animation: blink 1.1s step-end infinite;
  color: var(--accent-primary);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 9vw, 9rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
}

.hero-line1,
.hero-line2 {
  display: block;
}

.hero-line1 {
  color: var(--text-primary);
  animation: fadeUp 0.65s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.hero-line2 {
  color: var(--accent-primary);
  animation: fadeUp 0.65s ease forwards;
  animation-delay: 0.35s;
  opacity: 0;
}

/* Dark theme: gradient text on line 2 */
[data-theme="dark"] .hero-line2 {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 40ch;
  margin-bottom: clamp(2rem, 4vh, 2.75rem);
  line-height: 1.6;
  letter-spacing: 0.01em;
  animation: fadeUp 0.65s ease forwards;
  animation-delay: 0.5s;
  opacity: 0;
}

.hero-ctas {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
  animation: fadeUp 0.65s ease forwards;
  animation-delay: 0.65s;
  opacity: 0;
}

/* =============================================
   STATS BAR
============================================= */
.stats {
  border-top: 1px solid var(--border);
}

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

.stat-card {
  padding: clamp(1.75rem, 3.5vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.25s ease;
}

/* Mobile 2-col: no right border on even, no bottom border on last row */
.stat-card:nth-child(2n) { border-right: none; }
.stat-card:nth-child(3),
.stat-card:nth-child(4)  { border-bottom: none; }

@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-card  { border-bottom: none; border-right: 1px solid var(--border); }
  .stat-card:nth-child(2n) { border-right: 1px solid var(--border); }
  .stat-card:last-child    { border-right: none; }
}

.stat-card-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1;
  color: var(--text-primary);
}

.stat-number a {
  color: inherit;
  transition: color 0.2s ease;
}

.stat-number a:hover {
  color: var(--accent-primary);
}

/* Highlighted stat card */
.stat-card.highlight {
  background: var(--stat-hl-bg);
  border-color: var(--stat-hl-border);
  position: relative;
  overflow: hidden;
}

.stat-card.highlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, var(--stat-hl-bg) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card.highlight .stat-number {
  color: var(--accent-secondary);
}

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

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(3rem, 6vw, 6rem);
    align-items: start;
  }

  .about-sticky {
    position: sticky;
    top: calc(var(--nav-h) + 2rem);
  }
}

.about-heading {
  font-size: clamp(2.6rem, 5.5vw, 4.5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
}

.about-heading .slash {
  font-family: var(--font-mono);
  font-size: 0.6em;
  color: var(--accent-primary);
  opacity: 0.7;
  margin-right: 0.15em;
}

.about-body p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.about-body p:last-of-type {
  margin-bottom: 0;
}

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

/* Skills grid */
.skills {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.skills-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-primary);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.skill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.skill-row:last-child {
  border-bottom: none;
}

.skills-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
  opacity: 0.5;
}

.skill-name {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: var(--font-body);
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 3px 9px 2px;
  border-radius: 3px;
  white-space: nowrap;
}

.badge-expert {
  background: var(--badge-expert-bg);
  color: var(--badge-expert-text);
  border: 1px solid var(--badge-expert-border);
}

.badge-learning {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* =============================================
   SELECTED WORK
============================================= */
.work {
  border-top: 1px solid var(--border);
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 28px rgba(0, 0, 0, 0.04);
}

@media (min-width: 700px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .case-card:first-child {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--border);
  }
}

.case-card {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0;
  cursor: default;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  border-bottom: 1px solid var(--border);
}

.case-card:last-child {
  border-bottom: none;
}

@media (min-width: 700px) {
  .case-card:nth-child(2) { border-right: 1px solid var(--border); border-bottom: none; }
  .case-card:nth-child(3) { border-bottom: none; }
}

.case-card:hover {
  background: var(--bg-card-hover);
}

/* Case image */
.case-img {
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  border-bottom: 1px solid var(--border);
}

.case-img-inner {
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border-radius: 6px;
  position: relative;
}

.case-card:not(:first-child) .case-img-inner {
  aspect-ratio: 16 / 9;
}

.case-img-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.55s ease, transform 0.55s ease;
}

.case-card:hover .case-img-inner img {
  filter: grayscale(0%);
  transform: scale(1.03);
}

/* Gradient overlay on image */
.case-img-inner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,0.25) 0%, transparent 100%);
  pointer-events: none;
}

.case-content {
  padding: clamp(1.75rem, 3.5vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  flex: 1;
}

.case-category {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.case-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.75vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.case-card:first-child .case-title {
  font-size: clamp(2rem, 4vw, 3rem);
}

.case-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 60ch;
}

.case-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.case-metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.case-metric-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--accent-primary);
}

.case-metric-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.case-quote {
  background: var(--surface);
  border-left: 2px solid var(--accent-soft);
  border-radius: 0 4px 4px 0;
  padding: 0.875rem 1rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.case-quote cite {
  display: block;
  margin-top: 0.4rem;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  padding: 4px 11px 3px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.case-card:hover .tag {
  border-color: var(--accent-soft);
  color: var(--accent-primary);
}

.case-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  transition: gap 0.2s ease, opacity 0.2s ease;
  margin-top: 0.25rem;
}

.case-cta:hover {
  gap: 0.6rem;
  opacity: 0.75;
}

/* =============================================
   CODE LAB
============================================= */
.code-lab {
  border-top: 1px solid var(--border);
}

.code-lab-intro {
  max-width: 60ch;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: clamp(2.5rem, 5vh, 3.5rem);
}

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

@media (min-width: 640px) {
  .lab-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .lab-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Browser window card */
.lab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.lab-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  background: var(--bg-card-hover);
}

.lab-chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.lab-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red    { background: #FF5F57; }
.dot-yellow { background: #FFBD2E; }
.dot-green  { background: #27C93F; }

.lab-url {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.lab-status {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  padding: 2px 7px 1px;
  border-radius: 3px;
  flex-shrink: 0;
}

.status-live {
  background: rgba(39, 201, 63, 0.12);
  color: #27C93F;
  border: 1px solid rgba(39, 201, 63, 0.28);
}

.status-progress {
  background: rgba(255, 189, 46, 0.12);
  color: #FFBD2E;
  border: 1px solid rgba(255, 189, 46, 0.28);
}

.status-exploring {
  background: rgba(90, 154, 216, 0.12);
  color: #5A9AD8;
  border: 1px solid rgba(90, 154, 216, 0.28);
}

.lab-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lab-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-primary);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.lab-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.lab-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.25rem;
}

.lab-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-top: 0.5rem;
  transition: gap 0.2s ease, opacity 0.2s ease;
}

.lab-cta:hover {
  gap: 0.55rem;
  opacity: 0.75;
}

.lab-footer {
  text-align: center;
  margin-top: clamp(2rem, 4vh, 3rem);
}

.lab-footer a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lab-footer a:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* =============================================
   CONTACT
============================================= */
.contact {
  border-top: 1px solid var(--border);
  text-align: left;
}

.contact-headline {
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
  font-family: var(--font-display);
  font-weight: 800;
}

.contact-headline .accent {
  color: var(--accent-primary);
}

/* Dark theme gradient on contact accent */
[data-theme="dark"] .contact-headline .accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.contact-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 38ch;
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

.contact-ctas {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
}

/* =============================================
   FOOTER
============================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem clamp(1.25rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.footer-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.footer-year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.75rem;
  justify-content: flex-end;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

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

@media (max-width: 639px) {
  .footer {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0.75rem;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem;
  }

  .footer-year {
    order: -1;
  }
}
