/* =========================================================================
   Control Plane — portfolio stylesheet
   Muhammad Ameer Hamza · DevOps Engineer (AWS)
   ========================================================================= */

:root {
  /* dark theme (default) */
  --bg: #0B0E13;
  --surface: #121821;    /* cards: clearly lifted from bg */
  --surface-2: #19212C;  /* diagram panel / nodes */
  --line: #273140;       /* visible hairlines */
  --node-line: #34414F;  /* diagram node borders */
  --text: #EEF2F6;
  --muted: #A0ACBA;
  --accent: #4FD1A5;
  --accent-2: #7AA7FF;
  --warn: #F5B454;
  --glow: rgba(79, 209, 165, .16);
  /* ink = accent tuned for small text; matches accent on dark, darkens on light */
  --accent-ink: var(--accent);
  --warn-ink: var(--warn);
  /* diagram edge colours */
  --edge-deploy: var(--accent-2);
  --edge-traffic: var(--accent);
  --edge-config: var(--muted);
  --edge-alert: var(--warn);

  /* type */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* scale */
  --maxw: 1120px;
  --radius: 14px;
  --s1: 8px;  --s2: 16px;  --s3: 24px;  --s4: 32px;
  --s5: 48px; --s6: 64px;  --s7: 96px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

/* light theme — explicit toggle */
:root[data-theme="light"] {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #F0F2F5;
  --line: #E3E7EC;
  --node-line: #CBD3DC;
  --text: #0E1116;
  --muted: #5B6573;
  --accent: #0E9F74;
  --accent-2: #2F6FEB;
  --warn: #B4740B;
  --glow: rgba(14, 159, 116, .12);
  --accent-ink: #097552;
  --warn-ink: #8A5A08;
  --edge-deploy: #2F6FEB;
  --edge-traffic: #097552;
  --edge-config: #5B6573;
  --edge-alert: #8A5A08;
  color-scheme: light;
}

/* light theme — system preference, unless user forced dark */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F6F7F9;
    --surface: #FFFFFF;
    --surface-2: #F0F2F5;
    --line: #E3E7EC;
    --node-line: #CBD3DC;
    --text: #0E1116;
    --muted: #5B6573;
    --accent: #0E9F74;
    --accent-2: #2F6FEB;
    --warn: #B4740B;
    --glow: rgba(14, 159, 116, .12);
    --accent-ink: #097552;
    --warn-ink: #8A5A08;
    --edge-deploy: #2F6FEB;
    --edge-traffic: #097552;
    --edge-config: #5B6573;
    --edge-alert: #8A5A08;
    color-scheme: light;
  }
}

/* -------------------------------------------------------------------------
   base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 var(--s2);
}

p { margin: 0 0 var(--s2); }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

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

ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  background: var(--accent);
  color: #04120C;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.skip-link:focus { left: 8px; }

/* layout helpers */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s3); }
.section { padding: var(--s7) 0; position: relative; }
@media (max-width: 640px) { .section { padding: var(--s6) 0; } }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 var(--s2);
  display: block;
}
.section-title { font-size: clamp(28px, 4vw, 40px); margin-bottom: var(--s2); }
.section-intro { color: var(--muted); max-width: 60ch; margin-bottom: var(--s5); }

/* -------------------------------------------------------------------------
   buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #04120C;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn .ico { width: 16px; height: 16px; }

/* -------------------------------------------------------------------------
   nav
   ------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .dot { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: var(--s3); }
.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color .2s var(--ease);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-actions { display: flex; align-items: center; gap: var(--s2); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .ico { width: 18px; height: 18px; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .ico-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .ico-moon { display: none; }
}

.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-cta { display: none; }
  .nav-links {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: var(--s2) var(--s3) var(--s3);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
  }
  .nav-links.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-toggle {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }
  .nav-toggle .ico { width: 20px; height: 20px; }
}

/* -------------------------------------------------------------------------
   background grid
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(48px, 9vw, 104px) 0 var(--s6);
  overflow: hidden;
}
/* soft radial accent glow so the page doesn't open on flat black */
.hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -12%;
  left: -6%;
  width: 62%;
  height: 90%;
  background:
    radial-gradient(45% 55% at 30% 40%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%),
    radial-gradient(40% 50% at 60% 55%, color-mix(in srgb, var(--accent-2) 6%, transparent), transparent 72%);
  pointer-events: none;
}
.grid-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--muted) 40%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .07;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 92%);
  pointer-events: none;
}

/* -------------------------------------------------------------------------
   hero
   ------------------------------------------------------------------------- */
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: var(--s5);
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: var(--s4); } }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: var(--s3);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--glow);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-size: clamp(38px, 6vw, 66px);
  margin-bottom: var(--s3);
  max-width: 16ch;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-sub {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 18px);
  max-width: 56ch;
  margin-bottom: var(--s4);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* terminal card */
.terminal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.6);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.terminal-bar .tdot { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.terminal-bar .tlabel {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}
.terminal-body {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.85;
  padding: var(--s3) var(--s3) var(--s4);
  min-height: 232px;
}
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line .prompt { color: var(--accent-2); }
.term-line .ok { color: var(--accent-ink); }
.term-line .cmd { color: var(--text); }
.cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* -------------------------------------------------------------------------
   impact strip
   ------------------------------------------------------------------------- */
.impact {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.impact .wrap { padding-top: var(--s5); padding-bottom: var(--s5); }
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s3);
}
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, 1fr); gap: var(--s3) var(--s2); } }
.stat { padding: var(--s1) var(--s2); border-left: 2px solid var(--line); }
.stat .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4.4vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.stat .num .suffix { color: var(--accent); }
.stat .cap {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.45;
}

/* -------------------------------------------------------------------------
   cards / projects
   ------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 0 40px -20px var(--glow); transform: translateY(-1px); }

.projects-grid { display: grid; gap: var(--s4); }

.project { overflow: hidden; }
.project-top { padding: var(--s4) var(--s4) var(--s3); }
.project h3 { font-size: clamp(20px, 2.4vw, 24px); margin-bottom: 8px; }
.project .context { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; max-width: 70ch; }

.featured-flag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent-ink); margin-bottom: 10px;
}
.featured-flag::before { content: "★"; }

/* diagram panel */
.diagram-panel {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--s3) var(--s3) var(--s2);
  position: relative;
}
.diagram-panel > * { position: relative; z-index: 1; }

/* lower body — tags only */
.project-lower { padding: var(--s3) var(--s4); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
}

/* featured card — gradient ring + soft glow behind diagram */
.project.featured { border-color: transparent; }
.project.featured::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(130deg,
    color-mix(in srgb, var(--accent) 55%, transparent),
    color-mix(in srgb, var(--accent-2) 55%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.project.featured .diagram-panel::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(55% 75% at 50% 42%, var(--glow), transparent 70%);
  pointer-events: none;
}

/* ---- diagram lane system ---- */
.diagram-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.diagram { width: 100%; height: auto; display: block; }
@media (max-width: 640px) { .diagram { min-width: 580px; } }  /* scroll, don't shrink text */

.diagram text { font-family: var(--font-mono); }
.diagram .lane-band { fill: color-mix(in srgb, var(--muted) 6%, transparent); }
.diagram .lane-label { fill: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .12em; }

.diagram .node { fill: var(--surface-2); stroke: var(--node-line); stroke-width: 1.5; }
.diagram .node-core { fill: color-mix(in srgb, var(--accent) 15%, var(--surface-2)); stroke: color-mix(in srgb, var(--accent) 60%, var(--node-line)); stroke-width: 1.5; }
.diagram .n-title { fill: var(--text); font-size: 11px; font-weight: 500; }
.diagram .n-sub { fill: var(--muted); font-size: 9px; }
.diagram .e-label { fill: var(--muted); font-size: 9px; }
.diagram .e-label.alert { fill: var(--warn-ink); }

/* edges */
.diagram .edge { fill: none; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.diagram .e-deploy  { stroke: var(--edge-deploy); }
.diagram .e-traffic { stroke: var(--edge-traffic); }
.diagram .e-config  { stroke: var(--edge-config); stroke-dasharray: 5 4; }
.diagram .e-alert   { stroke: var(--edge-alert); stroke-dasharray: 5 4; }
.diagram marker path { fill: context-stroke; }

/* hover flow — only the hovered path */
@keyframes dash { to { stroke-dashoffset: -18; } }
@media (prefers-reduced-motion: no-preference) {
  .diagram .edge:hover { stroke-dasharray: 6 4; animation: dash .8s linear infinite; }
}

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.legend .lg { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.legend .sw { width: 20px; border-top: 2px solid; display: inline-block; }
.legend .sw.deploy  { border-color: var(--edge-deploy); }
.legend .sw.traffic { border-color: var(--edge-traffic); }
.legend .sw.config  { border-color: var(--edge-config); border-top-style: dashed; }
.legend .sw.alert   { border-color: var(--edge-alert); border-top-style: dashed; }

/* -------------------------------------------------------------------------
   lab builds
   ------------------------------------------------------------------------- */
.lab-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--warn-ink);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line));
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  border-radius: 8px;
  padding: 5px 11px;
  display: inline-block;
  margin-bottom: var(--s4);
}
.lab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
@media (max-width: 720px) { .lab-grid { grid-template-columns: 1fr; } }
.lab { padding: var(--s3); }
.lab h3 { font-size: 17px; margin-bottom: 8px; display: flex; align-items: center; gap: 9px; }
.lab h3 .ico { width: 18px; height: 18px; color: var(--accent); }
.lab p { color: var(--muted); font-size: 14px; margin-bottom: var(--s2); }
.lab .repo-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.lab .repo-link .ico { width: 14px; height: 14px; }

/* -------------------------------------------------------------------------
   experience timeline
   ------------------------------------------------------------------------- */
.timeline { display: grid; gap: 0; border-left: 1px solid var(--line); margin-left: 6px; }
.job { position: relative; padding: 0 0 var(--s5) var(--s4); }
.job:last-of-type { padding-bottom: var(--s3); }
.job::before {
  content: "";
  position: absolute;
  left: -6px; top: 4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.job .job-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-ink);
  margin-bottom: 6px;
}
.job h3 { font-size: 18px; margin-bottom: 4px; }
.job .company { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.job p { color: var(--text); font-size: 14.5px; margin: 0; max-width: 68ch; }

.edu-line {
  margin-top: var(--s3);
  padding: var(--s2) var(--s3);
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.edu-line .ico { width: 16px; height: 16px; color: var(--accent); }

/* -------------------------------------------------------------------------
   stack — delivery pipeline rail
   ------------------------------------------------------------------------- */
.rail {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
/* horizontal rail line through the node centres (desktop) */
.rail::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 10%;
  right: 10%;
  height: 2px;
  background-image: repeating-linear-gradient(90deg, var(--accent) 0 7px, transparent 7px 14px);
  background-size: 14px 100%;
  opacity: .5;
  z-index: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .rail:hover::before { animation: railflow .7s linear infinite; }
}
@keyframes railflow { to { background-position: 14px 0; } }

.stage { position: relative; display: flex; flex-direction: column; padding: 0 12px; }
.stage-node { align-self: center; z-index: 1; height: 18px; display: grid; place-items: center; margin-bottom: 14px; }
.stage-node .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--accent);
}
.stage-head { margin-bottom: var(--s2); }
.node-label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .06em; color: var(--accent-ink); margin-bottom: 6px;
}
.stage-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; margin: 0 0 4px; }
.stage-cap { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.4; }

.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-row {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 4px;
  background: none; border: 0; border-top: 1px solid var(--line);
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  text-align: left; cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.tool-list li:last-child .tool-row { border-bottom: 1px solid var(--line); }
.tool-row .t-ico { width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); flex-shrink: 0; transition: color .15s var(--ease); }
.tool-row .t-ico svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.tool-row .dot-ico { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* colour lives on the span, not the <button>: some engines don't re-resolve
   an inherited custom property on a form control when the root theme flips */
.tool-row .t-name { flex: 1; min-width: 0; color: var(--text); }
.aws-tag {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tool-row:hover, .tool-row:focus-visible, .tool-row.active {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.tool-row:hover .t-ico, .tool-row:focus-visible .t-ico, .tool-row.active .t-ico { color: var(--accent); }
.tool-row:hover .aws-tag, .tool-row.active .aws-tag { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent-ink); }

/* languages & systems line */
.langs {
  margin: var(--s4) 0 0; padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 13px; color: var(--text);
}
.langs-label { color: var(--accent-ink); margin-right: 10px; letter-spacing: .06em; }

/* project highlight driven by stack rows */
.project.dimmed { opacity: .5; }
.project.hl { box-shadow: 0 0 0 2px var(--accent); }
.uses-chip {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.uses-chip[hidden] { display: none; }

/* screen-reader only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* mobile — vertical rail on the left */
@media (max-width: 1023px) {
  .rail { grid-template-columns: 1fr; gap: var(--s5); }
  .rail::before {
    top: 4px; bottom: 4px; left: 8px; right: auto; width: 2px; height: auto;
    background-image: repeating-linear-gradient(180deg, var(--accent) 0 7px, transparent 7px 14px);
    background-size: 100% 14px;
  }
  .rail:hover::before { animation: none; }
  @media (prefers-reduced-motion: no-preference) {
    .rail:hover::before { animation: railflowv .7s linear infinite; }
  }
  .stage {
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-areas: "node head" "gap tools";
    padding: 0;
    row-gap: var(--s2);
  }
  .stage-node { grid-area: node; align-self: start; justify-self: start; margin: 2px 0 0 0; }
  .stage-head { grid-area: head; margin-bottom: 0; }
  .tool-list { grid-area: tools; }
}
@keyframes railflowv { to { background-position: 0 14px; } }

/* -------------------------------------------------------------------------
   certifications
   ------------------------------------------------------------------------- */
.cert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
@media (max-width: 640px) { .cert-grid { grid-template-columns: 1fr; } }
.cert {
  padding: var(--s3);
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.cert:hover { text-decoration: none; }
.cert-badge {
  flex-shrink: 0;
  width: 54px; height: 54px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
}
.cert-badge .ico { width: 28px; height: 28px; color: var(--accent); }
.cert h3 { font-size: 16px; margin-bottom: 3px; }
.cert p { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: 0; }

/* -------------------------------------------------------------------------
   contact
   ------------------------------------------------------------------------- */
.contact-card {
  padding: var(--s5);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s4);
  align-items: center;
}
@media (max-width: 640px) { .contact-card { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: var(--s4); } }
.contact-photo {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  padding: 3px;
  background: var(--surface-2);
}
.contact-photo img { border-radius: 50%; width: 100%; height: 100%; object-fit: cover; }
.contact-body h2 { font-size: clamp(24px, 3.5vw, 32px); margin-bottom: 8px; }
.contact-body p { color: var(--muted); margin-bottom: var(--s3); }
.contact-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
@media (max-width: 640px) { .contact-actions { justify-content: center; } }

.copy-btn { position: relative; }
.copy-toast {
  position: absolute;
  top: -34px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #04120C;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.copy-btn.copied .copy-toast { opacity: 1; transform: translateX(-50%) translateY(-2px); }

/* -------------------------------------------------------------------------
   footer
   ------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: var(--s4) 0;
}
.footer p {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  text-align: center;
}

/* -------------------------------------------------------------------------
   reveal on scroll
   ------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .status-dot { animation: none; }
  .cursor { animation: none; }
}

/* sprite */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
