/* ===================================================================
   MRTIMMYJ — style.css  v2.0
   Complete portfolio stylesheet — main site + project case studies.
   Dark, technical, backend-engineer aesthetic.
   Font: JetBrains Mono (mono personality) + Inter (body)
=================================================================== */

/* --- Reset & Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #12121a;
  --bg2:         #1a1a26;
  --bg3:         #22222e;
  --surface:     #1e1e2c;
  --surface2:    #262636;
  --border:      rgba(255,255,255,0.08);
  --border2:     rgba(255,255,255,0.14);

  --text:        #e8e8f0;
  --text-muted:  #8888a8;
  --text-faint:  #55556a;

  --cyan:        #00c8ff;
  --purple:      #9b5de5;
  --green:       #00e68a;
  --yellow:      #ffd60a;
  --red:         #ff4d6d;
  --orange:      #ff8c42;

  --accent:      var(--cyan);
  --accent2:     var(--purple);

  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   14px;

  --shadow:      0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.7);

  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --font-body:   'Inter', system-ui, sans-serif;

  --nav-h:       60px;
  --transition:  0.2s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===================================================================
   CANVAS BACKGROUND (index only)
=================================================================== */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

body:not(.page-projects):not(.page-about):not(.page-project) main,
body:not(.page-projects):not(.page-about):not(.page-project) .site-header,
body:not(.page-projects):not(.page-about):not(.page-project) .site-footer {
  position: relative;
  z-index: 1;
}

/* ===================================================================
   SKIP LINK
   Hidden until keyboard focus — not a visible mobile sliver.
   position: fixed so it's always at the viewport top when focused.
=================================================================== */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  padding: 12px 20px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  z-index: 99999;
  border-radius: 0 0 var(--radius) 0;
  /* Visually hidden, still in tab order */
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}
.skip-link:focus {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
  outline: 3px solid #000;
  outline-offset: 2px;
}

/* ===================================================================
   HEADER / NAV
=================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(18, 18, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-right: auto;
}
.nav-logo:hover { color: #fff; }

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  transition: color var(--transition);
  position: relative;
  padding-bottom: 3px;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Small screen nav — just tighten gaps, no hamburger */
@media (max-width: 480px) {
  .nav-links { gap: 16px; }
  .nav-link  { font-size: 0.78rem; letter-spacing: 0.02em; }
  .nav-logo  { font-size: 0.95rem; }
}

/* ===================================================================
   BUTTONS
=================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover {
  background: #30d8ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,200,255,0.3);
}
.btn-primary--sm { padding: 8px 16px; font-size: 0.78rem; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(0,200,255,0.06);
  transform: translateY(-2px);
}
.btn-ghost--sm { padding: 8px 16px; font-size: 0.78rem; }

/* ===================================================================
   SECTION HELPERS
=================================================================== */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 48px;
  position: relative;
  padding-bottom: 16px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===================================================================
   TAGS
=================================================================== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.tag--go    { background: rgba(0,200,255,0.12); color: var(--cyan);   border: 1px solid rgba(0,200,255,0.25); }
.tag--infra { background: rgba(155,93,229,0.12); color: #c084fc;      border: 1px solid rgba(155,93,229,0.25); }
.tag--db    { background: rgba(0,230,138,0.12); color: var(--green);  border: 1px solid rgba(0,230,138,0.25); }
.tag--ml    { background: rgba(255,140,66,0.12); color: var(--orange); border: 1px solid rgba(255,140,66,0.25); }
.tag--obs   { background: rgba(255,214,10,0.10); color: var(--yellow); border: 1px solid rgba(255,214,10,0.2); }

/* ===================================================================
   HERO SECTION (index)
=================================================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
}

.hero-inner {
  text-align: center;
  max-width: 700px;
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 6px 14px;
  border: 1px solid rgba(0,200,255,0.3);
  border-radius: 100px;
  background: rgba(0,200,255,0.06);
}

.hero-name {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  letter-spacing: 0.02em;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-stack {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.stack-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: color var(--transition), border-color var(--transition);
}
.stack-pill:hover { color: var(--text-muted); border-color: var(--border2); }

/* ===================================================================
   FEATURED PROJECTS (index)
=================================================================== */
.featured-section {
  padding: 100px 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
}
.section-header .section-title { margin-bottom: 0; padding-bottom: 0; text-align: left; }
.section-header .section-title::after { display: none; }
.view-all-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  transition: color var(--transition);
}
.view-all-link:hover { color: #fff; }

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}

.featured-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.featured-card:hover {
  transform: translateY(-4px);
  border-color: var(--border2);
  box-shadow: var(--shadow);
}
.featured-card--large {
  grid-column: 1 / 3;
}

.featured-card__img {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
/* .featured-card__img {
  height: 160px;
  flex-shrink: 0;
} */
.featured-card--large .featured-card__img {
  height: 200px;
}

.featured-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.featured-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }

.featured-card__title {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.featured-card__desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.featured-card__cta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-top: 4px;
  transition: color var(--transition);
}
.featured-card:hover .featured-card__cta { color: #fff; }

/* ===================================================================
   ABOUT STRIP (index)
=================================================================== */
.about-strip {
  padding: 100px 0;
  background: var(--bg);
}
.about-strip__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.about-strip__text h2 {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.3;
}
.about-strip__text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
  line-height: 1.7;
}
.about-strip__skills { display: flex; flex-direction: column; gap: 14px; }
.skill-row {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.skill-row:last-child { border-bottom: none; }
.skill-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 100px;
  flex-shrink: 0;
}
.skill-val { color: var(--text-muted); }

/* ===================================================================
   PAGE HERO (projects + about)
=================================================================== */
.page-hero {
  padding: calc(var(--nav-h) + 60px) 0 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.page-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.page-hero__title {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.page-hero__sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
}

/* ===================================================================
   PROJECTS PAGE
=================================================================== */
.projects-featured, .projects-all {
  padding: 80px 0;
}
.projects-featured { background: var(--bg2); border-bottom: 1px solid var(--border); }
.projects-all { background: var(--bg); }

.projects-section-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

/* Pinned cards */
.projects-pinned {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pin-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
}
.pin-card:hover {
  transform: translateY(-4px);
  border-color: var(--border2);
  box-shadow: var(--shadow);
}

.pin-card__accent {
  height: 3px;
  flex-shrink: 0;
}
.pin-card__accent--blue   { background: linear-gradient(90deg, var(--cyan), var(--purple)); }
.pin-card__accent--purple { background: linear-gradient(90deg, var(--purple), #ff6b9d); }
.pin-card__accent--teal   { background: linear-gradient(90deg, var(--green), var(--cyan)); }

.pin-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.pin-card__body h3 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}
.pin-card__body p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }
.pin-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* All projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.proj-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.proj-card:hover {
  transform: translateY(-4px);
  border-color: var(--border2);
  box-shadow: var(--shadow);
}
.proj-card__img { overflow: hidden; aspect-ratio: 16/9; background: var(--bg3); }
.proj-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.proj-card:hover .proj-card__img img { transform: scale(1.04); }

.proj-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.proj-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.proj-card__title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}
.proj-card__desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; flex: 1; }

/* ===================================================================
   ABOUT PAGE
=================================================================== */
.about-hero-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.about-layout {
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.about-section-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Bio */
.about-bio p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 720px;
  margin-bottom: 16px;
}
.about-bio p:last-child { margin-bottom: 0; }

/* Skills table */
.skills-table { display: flex; flex-direction: column; gap: 0; }
.skills-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.skills-row:first-child { border-top: 1px solid var(--border); }
.skills-row__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.skills-row__pills { display: flex; gap: 8px; flex-wrap: wrap; }
.skill-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.skill-pill:hover {
  color: var(--text);
  border-color: var(--border2);
  background: var(--surface2);
}

/* Timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  top: 8px; left: 0;
  width: 2px; height: calc(100% - 8px);
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.tl-item {
  position: relative;
  padding-bottom: 48px;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -33px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.tl-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }

.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tl-company {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.tl-role { font-size: 0.88rem; color: var(--accent); }
.tl-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.tl-bullets { padding-left: 18px; list-style: disc; }
.tl-bullets li { font-size: 0.9rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 8px; }
.tl-bullets li:last-child { margin-bottom: 0; }

/* Education */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.edu-grid:last-child { margin-bottom: 0; }

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}
.edu-card:hover { border-color: var(--border2); }
.edu-card--primary { border-color: rgba(0,200,255,0.25); }

.edu-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.edu-card__header h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.edu-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  border: 1px solid rgba(0,200,255,0.3);
  padding: 2px 7px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}
.edu-degree { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.edu-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); margin-bottom: 12px; }
.edu-courses { font-size: 0.82rem; color: var(--text-faint); line-height: 1.5; }

/* ===================================================================
   CONTACT SECTION
=================================================================== */
.contact-section {
  padding: 100px 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  align-items: start;
}

.contact-info h3 {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}
.contact-info p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 28px; }

.social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--transition);
}
.social-links a:hover {
  background: rgba(0,200,255,0.1);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-faint); }
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,200,255,0.1);
}
.form-group textarea { min-height: 140px; resize: vertical; }

/* ===================================================================
   FOOTER
=================================================================== */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}
.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ===================================================================
   RESPONSIVE
=================================================================== */
@media (max-width: 900px) {
  .featured-grid { grid-template-columns: 1fr 1fr; }
  .featured-card--large { grid-column: 1 / 3; }
  .projects-pinned { grid-template-columns: 1fr 1fr; }
  .about-strip__inner { grid-template-columns: 1fr; gap: 48px; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 640px) {
  .featured-grid { grid-template-columns: 1fr; }
  .featured-card--large { grid-column: 1; }
  .projects-pinned { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-cta .btn-primary,
  .hero-cta .btn-ghost { width: 100%; max-width: 260px; justify-content: center; }
  .skills-row { grid-template-columns: 1fr; gap: 10px; }
  .tl-header { flex-direction: column; }
  .edu-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; gap: 8px; }
  .about-hero-links { flex-direction: column; }
  .about-hero-links .btn-primary,
  .about-hero-links .btn-ghost { justify-content: center; }
  .section-container { padding: 0 16px; }
  .featured-section,
  .about-strip,
  .projects-featured,
  .projects-all,
  .contact-section { padding-top: 60px; padding-bottom: 60px; }
  .about-layout { padding: 60px 16px; gap: 60px; }
  .hero-section { padding-bottom: 60px; }
}

@media (max-width: 400px) {
  .nav-logo { font-size: 0.95rem; }
  .page-hero__title { font-size: 1.7rem; }
  .hero-name { font-size: 2rem; }
}

/* ===================================================================
   SCROLL TO TOP BUTTON
=================================================================== */
#scrollToTopBtn {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: var(--surface) !important;
  color: var(--accent) !important;
  border: 1px solid var(--border2) !important;
  cursor: pointer !important;
  display: none !important;
  z-index: 200 !important;
  font-size: 16px !important;
  box-shadow: var(--shadow) !important;
  transition: opacity 0.3s ease, transform 0.2s ease, background 0.2s ease !important;
  align-items: center !important;
  justify-content: center !important;
}
#scrollToTopBtn:hover {
  background: rgba(0,200,255,0.1) !important;
  border-color: var(--accent) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 24px rgba(0,200,255,0.2) !important;
}
@media (max-width: 640px) {
  #scrollToTopBtn {
    width: 48px !important;
    height: 48px !important;
    bottom: 20px !important;
    right: 16px !important;
    font-size: 14px !important;
  }
}

/* ===================================================================
   PROJECT PAGE — case study layout
   Sticky sidebar TOC + content well + consistent section rhythm.
=================================================================== */

/* ---- Project hero ---- */
.proj-hero {
  padding: calc(var(--nav-h) + 56px) 0 64px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.proj-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 60% 40%, var(--hero-glow, rgba(0,200,255,0.07)) 0%, transparent 70%);
  pointer-events: none;
}

.proj-hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 56px;
  align-items: center;
}

.proj-hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.proj-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.proj-hero__date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}
.proj-hero__dot { color: var(--text-faint); font-size: 0.6rem; }

.proj-hero__title {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.proj-hero__desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 580px;
  margin-bottom: 32px;
}

.proj-hero__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.proj-hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Banner image card */
.proj-hero__banner {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 16/9;
}
.proj-hero__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.proj-hero__banner--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

/* ---- Case study layout ---- */
.case-study {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  align-items: start;
}

/* Sticky sidebar TOC */
.case-toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.case-toc__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.case-toc__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.case-toc__link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  padding: 7px 12px;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  transition: all var(--transition);
  display: block;
}
.case-toc__link:hover {
  color: var(--text-muted);
  border-left-color: var(--border2);
  background: rgba(255,255,255,0.03);
}
.case-toc__link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(0,200,255,0.05);
}

/* Main content well */
.case-content {
  min-width: 0; /* prevent grid blowout */
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* Section */
.cs-section { scroll-margin-top: calc(var(--nav-h) + 32px); }

.cs-section__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cs-section__title::before {
  content: attr(data-num);
  font-size: 0.65rem;
  color: var(--text-faint);
}

.cs-prose p {
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
  max-width: 680px;
}
.cs-prose p:last-child { margin-bottom: 0; }

/* Subsection cards (architecture breakdown etc) */
.cs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.cs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}
.cs-card:hover { border-color: var(--border2); }

.cs-card__icon {
  font-size: 1.4rem;
  margin-bottom: 12px;
  line-height: 1;
}
.cs-card__title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}
.cs-card__list {
  padding-left: 16px;
  list-style: disc;
}
.cs-card__list li {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 5px;
}
.cs-card__list li:last-child { margin-bottom: 0; }

/* Feature list */
.cs-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cs-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cs-feature__icon { font-size: 1.1rem; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.cs-feature__body { }
.cs-feature__title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
}
.cs-feature__desc { font-size: 0.83rem; color: var(--text-muted); line-height: 1.55; }

/* Workflow steps */
.cs-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: step;
}
.cs-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  counter-increment: step;
}
.cs-step:last-child { border-bottom: none; }
.cs-step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
  margin-top: 2px;
  flex-shrink: 0;
}
.cs-step__title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.cs-step__desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* Tech stack table */
.cs-stack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.cs-stack-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cs-stack-item__icon { font-size: 1.1rem; flex-shrink: 0; }
.cs-stack-item__info { }
.cs-stack-item__name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  display: block;
}
.cs-stack-item__role {
  font-size: 0.75rem;
  color: var(--text-faint);
  display: block;
}

/* Nav between projects */
.proj-nav {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 40px 0;
}
.proj-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.proj-nav__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 260px;
}
.proj-nav__dir {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.proj-nav__name {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition);
}
.proj-nav__link:hover .proj-nav__name { color: var(--accent); }
.proj-nav__link--next { text-align: right; }
.proj-nav__all {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  transition: color var(--transition);
}
.proj-nav__all:hover { color: var(--accent); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .proj-hero__inner { grid-template-columns: 1fr; }
  .proj-hero__banner { max-width: 480px; }
  .case-study { grid-template-columns: 1fr; gap: 40px; }
  .case-toc { position: static; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .case-toc__label { display: none; }
  .case-toc__list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .case-toc__link { border-left: none; border-bottom: 2px solid transparent; padding: 5px 10px; font-size: 0.72rem; }
  .case-toc__link.active { border-left-color: transparent; border-bottom-color: var(--accent); }
}

@media (max-width: 640px) {
  .proj-hero { padding-top: calc(var(--nav-h) + 40px); }
  .case-study { padding: 48px 16px; }
  .cs-cards { grid-template-columns: 1fr; }
  .cs-stack { grid-template-columns: 1fr 1fr; }
}
