/* ==========================================================================
   Humayun Saghir · Portfolio
   Dark, monochrome design. Colors are tokens on :root.
   ========================================================================== */

:root {
  --bg: #0b0b0c;
  --bg-2: #111113;
  --surface: #151517;
  --surface-2: #1b1b1e;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ededee;
  --muted: #9a9aa1;
  --faint: #6b6b72;
  --white: #f6f6f4;

  --easy: #2fc0a6;
  --medium: #f0b232;
  --hard: #ef5a5a;
  --sticky: #e9c46a;
  --sticky-ink: #2b2410;

  --heat-0: #1a1a1d;
  --heat-1: #0e4429;
  --heat-2: #006d32;
  --heat-3: #26a641;
  --heat-4: #39d353;

  --radius: 22px;
  --radius-sm: 14px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);

  --font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Archivo", "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--white); color: var(--bg); }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; border-radius: 8px; }

.ic { width: 18px; height: 18px; flex: none; }
.ic.sm { width: 14px; height: 14px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--white); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600;
}
.skip:focus { top: 16px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Nav ---------- */
.nav-wrap {
  position: fixed; top: 16px; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; padding: 0 16px; pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 2px;
  padding: 6px;
  background: rgba(22, 22, 24, 0.72);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  max-width: 100%;
}
.nav-logo {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(145deg, #2a2a2e, #121214);
  border: 1px solid var(--line-2);
  font-weight: 700; font-size: 12px; letter-spacing: 0.04em; margin-right: 4px;
}
.nav-link {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: 4px; padding: 8px 15px; border-radius: 999px;
  background: var(--white); color: #111; font-size: 14px; font-weight: 600;
  transition: transform .2s;
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-cta .ic { width: 16px; height: 16px; }

/* ---------- Pills & buttons ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2);
  font-size: 14.5px; font-weight: 500; color: var(--text);
  transition: background-color .2s, transform .2s, border-color .2s;
}
.pill:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.pill-white { background: var(--white); color: #111; border-color: var(--white); font-weight: 600; }
.pill-white:hover { background: #fff; border-color: #fff; }
.pill.outline { background: transparent; margin-top: 28px; }

.round-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--white); color: #111; border: 0;
  transition: transform .2s, background-color .2s;
}
.round-btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); }
.round-btn.ghost:hover { background: var(--surface-2); }
.round-btn:disabled { opacity: .35; cursor: default; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 150px 0 40px; overflow: hidden; }
.pixels {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: .9;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 85%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 85%);
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.45fr 1fr; gap: 48px; align-items: end;
}
.hello { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.hello span { color: var(--faint); }
h1 {
  font-size: clamp(46px, 7.6vw, 96px);
  font-weight: 500; letter-spacing: -0.045em; line-height: 0.98;
}
.lede { margin-top: 22px; font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.meta {
  display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 30px;
  font-size: 13px; color: var(--faint);
}
.meta li { position: relative; }
.meta li + li::before {
  content: ""; position: absolute; left: -15px; top: 50%;
  width: 3px; height: 3px; border-radius: 50%; background: var(--faint);
}

.resume-card {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px 16px;
  padding: 26px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--line);
  transition: border-color .25s, transform .25s;
}
.resume-card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.resume-card:hover .round-btn { transform: rotate(-8deg) scale(1.05); }
.sketch {
  grid-column: 1 / -1; justify-self: center;
  width: min(230px, 70%); height: auto; color: #8e8e95;
  transform: rotate(-6deg); margin-bottom: 8px;
  transition: transform .4s ease;
}
.resume-card:hover .sketch { transform: rotate(-2deg) translateY(-4px); }
.resume-text strong { display: block; font-weight: 600; font-size: 16px; }
.resume-text span { font-size: 13px; color: var(--muted); }

.quick-stats {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 64px 0 0; border-top: 1px solid var(--line);
}
.quick-stats div { padding: 22px 0 0; }
.quick-stats div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.quick-stats dt { font-size: 12.5px; color: var(--faint); }
.quick-stats dd { margin: 4px 0 0; font-size: clamp(28px, 3.4vw, 40px); font-weight: 500; letter-spacing: -0.03em; }

/* ---------- Sections ---------- */
.section { position: relative; padding: clamp(80px, 11vw, 140px) 0 0; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 12px;
}
.section-title { font-size: clamp(34px, 4.6vw, 56px); letter-spacing: -0.035em; margin-bottom: 48px; max-width: 18ch; }

/* ---------- Projects ---------- */
.project {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center;
  padding: 56px 0; border-top: 1px solid var(--line);
}
.project.flip .shots { order: 2; }
.shots {
  position: relative; aspect-ratio: 16 / 11.5;
  perspective: 1600px;
}
.shot {
  position: absolute; margin: 0; overflow: hidden;
  border-radius: 16px; border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.shot.back  { width: 62%; aspect-ratio: 16 / 10; right: 0; top: 0; opacity: .55; transform: rotate(4deg); }
.shot.mid   { width: 62%; aspect-ratio: 16 / 10; left: 0; top: 8%; opacity: .75; transform: rotate(-4deg); }
.shot.front { width: 78%; aspect-ratio: 16 / 10; left: 11%; bottom: 0; padding-top: 26px; background: #1c1c1f; }
.shot.front .dots { position: absolute; top: 9px; left: 12px; display: flex; gap: 6px; }
.shot.front .dots i { width: 8px; height: 8px; border-radius: 50%; background: #3a3a3f; }
.project:hover .shot.back  { transform: rotate(7deg) translate(14px, -8px); }
.project:hover .shot.mid   { transform: rotate(-7deg) translate(-14px, -4px); }
.project:hover .shot.front { transform: translateY(-6px); }

.tags { font-size: 12.5px; color: var(--faint); margin-bottom: 14px; }
.tags b { color: var(--line-2); margin: 0 6px; font-weight: 400; }
.project h3 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -0.03em; line-height: 1.15; }
.metric { margin: 14px 0 16px; color: var(--text); font-weight: 500; font-size: 15px; }
.project-body > p:not(.tags):not(.metric) { color: var(--muted); font-size: 15.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chips li {
  padding: 6px 12px; border-radius: 999px; font-size: 13px; color: #cfcfd4;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 24px; }
.links a {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 500;
  border-bottom: 1px solid transparent; transition: border-color .2s, gap .2s;
}
.links a:hover { border-color: var(--text); gap: 9px; }

/* ---------- Field notes carousel (Instagram-slide style cards) ---------- */
.notes-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.notes-head .section-title { margin-bottom: 32px; }
.carousel-ctrl { display: flex; gap: 8px; margin-bottom: 36px; }
.track {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))) 24px;
  scroll-padding: 0 max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline-offset: -2px; }

.slide {
  --pad: clamp(16px, 4.2%, 22px);
  position: relative; flex: none; scroll-snap-align: start;
  width: min(440px, 84vw); aspect-ratio: 9 / 10.4;
  display: flex; flex-direction: column; gap: 14px;
  padding: calc(var(--pad) + 26px) var(--pad) var(--pad);
  border-radius: var(--radius); overflow: hidden; isolation: isolate;
  background: #121214; border: 1px solid var(--line);
  container-type: inline-size;
}
.slide-bg { position: absolute; inset: 0; z-index: -1; }
.slide-bg.photo { background-size: cover; background-position: center; filter: blur(2px) saturate(1.1); transform: scale(1.06); }
.slide-bg.photo::after, .slide-bg.code::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.82) 0%, rgba(8, 8, 10, 0.68) 45%, rgba(8, 8, 10, 0.9) 100%);
}
.slide-bg.code { background: radial-gradient(120% 80% at 80% 0%, #1f2a44 0%, #0e0f14 60%); }
.slide-bg.code pre {
  margin: 0; padding: 18px; font-family: var(--font-mono); font-size: 11px; line-height: 1.7;
  color: #7f9cd9; opacity: .75; white-space: pre; overflow: hidden; height: 100%;
}
.count {
  position: absolute; top: 14px; right: 14px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(0, 0, 0, 0.45); color: #fff; backdrop-filter: blur(6px);
}
.slide-title {
  font-family: var(--font-display); font-stretch: 72%; font-weight: 900;
  text-transform: uppercase; color: #fff;
  font-size: clamp(26px, 8.4cqi, 38px); line-height: 0.92; letter-spacing: -0.02em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}
.slide-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.slide-row.bottom { margin-top: auto; align-items: end; }
.slide-text {
  font-size: clamp(12px, 3.35cqi, 14.5px); line-height: 1.42; font-weight: 600; color: #fff;
  text-align: justify; hyphens: auto; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.thumb, .panel { margin: 0; }
.thumb img {
  width: 100%; aspect-ratio: 16 / 11; object-fit: cover; object-position: top;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}
.thumb.small img { aspect-ratio: 16 / 10; }
.thumb figcaption, .panel figcaption {
  margin-top: 6px; text-align: center; font-weight: 700; font-size: clamp(11px, 3cqi, 13px); color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.panel > :first-child {
  background: rgba(14, 14, 17, 0.88); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px; padding: 10px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}
.bar-cmp { display: grid; gap: 4px; font-size: 10.5px; color: var(--muted); }
.bar-cmp b {
  position: relative; display: block; height: 22px; margin-bottom: 4px;
  font-size: 11px; font-weight: 700; color: #fff; line-height: 22px; padding-left: 8px;
}
.bar-cmp b::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); min-width: 4px; z-index: -1;
  border-radius: 4px; background: #6b2e2e;
}
.bar-cmp b { isolation: isolate; }
.bar-cmp b.fast::before { background: var(--easy); }
.panel.term pre {
  margin: 0; font-family: var(--font-mono); font-size: clamp(9.5px, 2.5cqi, 11px); line-height: 1.6; color: #d7e3ff; white-space: pre;
  overflow: hidden;
}
.panel.term pre span { color: var(--easy); }
.lc-list { display: grid; gap: 4px; font-size: clamp(10px, 2.6cqi, 11.5px); counter-reset: n; }
.lc-list li { display: flex; justify-content: space-between; gap: 8px; color: #d9d9de; counter-increment: n; }
.lc-list li span::before { content: counter(n) ". "; color: var(--faint); }
.lc-list b { color: var(--easy); font-weight: 600; }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 6px; }
.node {
  position: relative; padding: 6px 9px; font-size: clamp(9.5px, 2.5cqi, 11px); font-weight: 600; color: #1b1b1f;
  border-radius: 4px; background: #dfe3ff;
}
.node + .node::before {
  content: "→"; position: absolute; left: -7px; top: 50%; transform: translate(-50%, -50%);
  color: #fff; font-size: 10px;
}
.node + .node { margin-left: 8px; }
.node.oval { border-radius: 999px; background: #c9f2cf; }
.node.pink { background: #f6c8d8; }
.node.lilac { background: #d9cbff; }

.stickies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stickies span {
  display: grid; place-items: center; text-align: center; min-height: 46px; padding: 6px 4px;
  background: var(--sticky); color: var(--sticky-ink); font-weight: 700; font-size: clamp(9.5px, 2.5cqi, 11px); line-height: 1.2;
  border-radius: 3px;
  box-shadow: 3px 3px 0 #c9a34a, 6px 6px 0 #a7843a;
}
.stickies em { display: block; font-style: normal; font-size: 1.35em; }

.patterns { display: grid; gap: 7px; }
.patterns small { display: block; font-size: 10px; color: #cfcfd6; margin-bottom: 3px; font-weight: 600; }
.cells { display: flex; gap: 3px; }
.cells i { width: 16px; height: 16px; border: 1px solid #5fd3ff; border-radius: 2px; background: rgba(95, 211, 255, 0.08); }
.cells i.hl { background: #5fd3ff; }

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.carousel-dots button {
  width: 7px; height: 7px; padding: 0; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, 0.25); transition: width .3s, background-color .3s;
}
.carousel-dots button[aria-selected="true"] { width: 22px; border-radius: 999px; background: var(--white); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.about-grid .section-title { margin-bottom: 28px; max-width: 16ch; }
.about-copy { display: grid; gap: 16px; color: var(--muted); font-size: 16.5px; max-width: 58ch; }
.timeline { position: relative; display: grid; gap: 34px; padding-left: 28px; margin-top: 8px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.timeline li { position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -28px; top: 6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--white);
}
.when { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
.timeline h3 { margin-top: 6px; font-size: 20px; letter-spacing: -0.02em; }
.where { color: var(--text); opacity: .8; font-size: 14px; margin: 4px 0 8px; }
.timeline li > p:last-child { color: var(--muted); font-size: 15px; }

/* ---------- Tiles & skills ---------- */
.tile {
  position: relative; padding: 26px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
}
.tile h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.bento .wide { grid-column: span 2; }
.bento .full { grid-column: 1 / -1; }
.bento .chips { margin-top: 16px; }

/* ---------- Showcase (LeetCode, GitHub) ---------- */
.mega {
  font-size: clamp(64px, 13vw, 168px); font-weight: 600; letter-spacing: -0.06em; line-height: 0.9;
}
.mega .dot { color: var(--faint); }
.mega-sub { margin-top: 22px; font-size: clamp(22px, 3vw, 34px); letter-spacing: -0.03em; line-height: 1.2; max-width: 22ch; }
.mega-desc { margin-top: 18px; color: var(--muted); max-width: 60ch; font-size: 16px; }
.mega-desc a { color: var(--text); border-bottom: 1px solid var(--line-2); }
.mega-desc a:hover { border-color: var(--text); }

.lc-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin-top: 48px; }
.ring-tile { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track-c { stroke: rgba(255, 255, 255, 0.07); }
.ring .seg { stroke-linecap: butt; stroke-dasharray: 0 327; transition: stroke-dasharray 1.2s cubic-bezier(.2, .7, .2, 1), stroke-dashoffset 1.2s cubic-bezier(.2, .7, .2, 1); }
.ring .easy { stroke: var(--easy); }
.ring .medium { stroke: var(--medium); }
.ring .hard { stroke: var(--hard); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-size: 36px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.ring-label span { font-size: 12px; color: var(--muted); }
.diff { display: grid; gap: 14px; }
.diff li { display: grid; grid-template-columns: 1fr auto; gap: 6px; font-size: 13.5px; }
.diff li > span:first-child { font-weight: 600; }
.diff .easy > span:first-child { color: var(--easy); }
.diff .medium > span:first-child { color: var(--medium); }
.diff .hard > span:first-child { color: var(--hard); }
.diff b { font-weight: 500; color: var(--muted); }
.diff b em { font-style: normal; color: var(--text); font-weight: 600; }
.diff b i { font-style: normal; }
.meter { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 1.2s cubic-bezier(.2, .7, .2, 1); }
.easy .meter i { background: var(--easy); }
.medium .meter i { background: var(--medium); }
.hard .meter i { background: var(--hard); }

.hbars { display: grid; gap: 11px; margin-top: 18px; }
.hbars li { display: grid; grid-template-columns: 1fr auto; gap: 5px; font-size: 13.5px; }
.hbars li b { font-weight: 600; }
.hbars li span { color: var(--muted); }
.hbars .bar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.hbars .bar i { display: block; height: 100%; width: var(--w, 0); background: var(--white); border-radius: inherit; transition: width 1.1s cubic-bezier(.2, .7, .2, 1); }
.tile-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 14px; font-weight: 500; }
.tile-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Languages and Tools (GitHub profile style) */
.card-heading { font-size: 22px !important; font-weight: 600 !important; letter-spacing: -0.02em !important; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card-heading.sub { font-size: 15px !important; margin-top: 30px; padding-bottom: 0; border-bottom: 0; color: var(--muted) !important; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 22px 12px; margin-top: 26px; }
.tools li { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; }
.tools img { width: 60px; height: 60px; border-radius: 14px; transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.tools li:hover img { transform: translateY(-4px) scale(1.05); }
.tools span { font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.tools-card .chips { margin-top: 14px; }

/* GitHub streak + languages */
.gh-cards { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; margin-top: 48px; }
.streak-card { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; padding: 34px 18px; }
.streak-col { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 10px; }
.streak-col + .streak-col { border-left: 1px solid var(--line-2); }
.streak-col > strong, .flame-ring strong { font-size: clamp(30px, 3.4vw, 42px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: #7aa7ff; }
.streak-label { font-size: 14px; font-weight: 500; color: #7aa7ff; margin-top: 6px; }
.streak-range { font-size: 12.5px; color: var(--easy); }
.current .streak-label { color: #c39bf5; font-weight: 600; }
.flame-ring {
  position: relative; display: grid; place-items: center;
  width: 104px; height: 104px; border-radius: 50%; border: 4px solid #7aa7ff;
}
.flame-ring strong { color: #c39bf5; }
.flame { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; color: #7aa7ff; background: var(--bg-2); border-radius: 50%; padding: 2px; }
.langs-card .lang-bar { display: flex; gap: 2px; height: 10px; margin: 22px 0 20px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.lang-bar i { display: block; height: 100%; }
.lang-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.lang-legend li { display: flex; align-items: center; gap: 9px; font-size: 14px; color: #cfcfd4; }
.lang-legend li::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--lc, #888); flex: none; }
.lang-legend b { font-weight: 500; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

.heat-tile { margin-top: 14px; }
.heat-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.legend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--faint); }
.legend i, .heatmap i { width: 11px; height: 11px; border-radius: 3px; display: block; }
.l0 { background: var(--heat-0); } .l1 { background: var(--heat-1); } .l2 { background: var(--heat-2); } .l3 { background: var(--heat-3); } .l4 { background: var(--heat-4); }
.heat-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-auto-columns: minmax(10px, 1fr); gap: 3px; width: 100%; min-width: 700px; }
.heatmap i { width: 100%; height: auto; aspect-ratio: 1; border-radius: 3px; }

.repo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.repo { display: flex; flex-direction: column; gap: 10px; transition: border-color .25s, transform .25s; }
.repo:hover { border-color: var(--line-2); transform: translateY(-3px); }
.repo-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.repo h3 { font-size: 16px; overflow-wrap: anywhere; }
.repo p { color: var(--muted); font-size: 14px; flex: 1; }
.repo .lang { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--faint); }
.repo .lang::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--lc, #888); }

/* ---------- Writing ---------- */
.articles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.article { display: flex; flex-direction: column; gap: 12px; min-height: 230px; transition: border-color .25s, transform .25s; }
.article:hover { border-color: var(--line-2); transform: translateY(-3px); }
.art-meta { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
.article h3 { font-size: clamp(21px, 2.2vw, 26px); letter-spacing: -0.025em; }
.article p { color: var(--muted); font-size: 15px; }
.read { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }

/* ---------- Contact & footer ---------- */
.contact { padding-bottom: clamp(80px, 10vw, 120px); overflow: hidden; }
.contact .pixels {
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 100%, #000 20%, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 80% at 50% 100%, #000 20%, transparent 80%);
}
.contact .wrap { position: relative; }
.footer { border-top: 1px solid var(--line); padding: 26px 0; font-size: 13px; color: var(--faint); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.footer a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .resume-card { max-width: 420px; }
  .lc-grid { grid-template-columns: 1fr 1fr; }
  .ring-tile { grid-column: 1 / -1; }
  .repo-grid { grid-template-columns: 1fr 1fr; }
  .gh-cards { grid-template-columns: 1fr; }
  .hide-md { display: none; }
}
@media (max-width: 820px) {
  .project, .about-grid { grid-template-columns: 1fr; }
  .project.flip .shots { order: 0; }
  .bento { grid-template-columns: 1fr 1fr; }
  .bento .full { grid-column: 1 / -1; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
  .quick-stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .quick-stats div:nth-child(n+3) { padding-top: 18px; }
}
@media (max-width: 600px) {
  .hero { padding-top: 120px; }
  .hide-sm { display: none; }
  .nav-link { padding: 8px 11px; }
  .bento, .lc-grid, .repo-grid, .articles { grid-template-columns: 1fr; }
  .bento .wide, .bento .full { grid-column: auto; }
  .ring-tile { grid-template-columns: 1fr; justify-items: center; }
  .ring-tile .diff { width: 100%; }
  .notes-head { align-items: start; flex-direction: column; }
  .carousel-ctrl { display: none; }
  .streak-card { padding: 28px 6px; }
  .streak-col { padding: 0 4px; }
  .flame-ring { width: 82px; height: 82px; border-width: 3px; }
  .streak-label { font-size: 12.5px; }
  .streak-range { font-size: 11px; }
  .tools { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 18px 8px; }
  .tools img { width: 50px; height: 50px; border-radius: 12px; }
  .card-heading { font-size: 19px !important; }
  .project { padding: 40px 0; }
  .tile { padding: 22px; }
}
@media (max-width: 380px) {
  .nav-cta { padding: 8px 12px; }
  .nav-cta .ic { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
