/* ═══════════════════════════════════════════════
   PORTFOLIO v3 — Style
   Font: Syne + Outfit + JetBrains Mono
═══════════════════════════════════════════════ */

:root {
  --ink:        #0e0e0d;
  --ink-2:      #3a3a37;
  --ink-3:      #7a7a74;
  --ink-4:      #b0b0a8;
  --paper:      #f8f7f4;
  --paper-2:    #f1f0ec;
  --paper-3:    #e8e7e2;
  --line:       #e2e1dc;
  --line-2:     #d0cfc9;
  --white:      #ffffff;
  --accent:     #2563eb;
  --accent-dim: rgba(37,99,235,.10);
  --green:      #16a34a;
  --amber:      #d97706;
  --font-display: 'Syne', sans-serif;
  --font-body:    'Outfit', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --nav-h:  64px;
  --max-w:  1280px;
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);
  --r-sm: 6px; --r: 12px; --r-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--paper); color: var(--ink);
  line-height: 1.6; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

/* ── CURSOR ── */
#cursor-dot {
  position: fixed; pointer-events: none; z-index: 9999;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink); transform: translate(-50%,-50%);
  top: 0; left: 0; opacity: 0;
  transition: opacity .3s, width .22s var(--ease), height .22s var(--ease),
              background .18s, border .18s, border-radius .22s;
  mix-blend-mode: multiply; will-change: left, top;
}
#cursor-ring {
  position: fixed; pointer-events: none; z-index: 9998;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid rgba(14,14,13,.2);
  transform: translate(-50%,-50%);
  top: 0; left: 0; opacity: 0;
  transition: opacity .3s, width .35s var(--ease), height .35s var(--ease), border-color .2s;
  will-change: left, top;
}
#cursor-trail-canvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 9990;
}

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  transition: background .35s, border-color .35s, box-shadow .35s;
}
.nav.scrolled {
  background: rgba(248,247,244,.94);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 20px rgba(0,0,0,.04);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 32px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  letter-spacing: -.03em; transition: opacity .2s;
}
.nav-logo:hover { opacity: .65; }
.logo-dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-link {
  font-size: 13.5px; font-weight: 500; color: var(--ink-3);
  transition: color .2s; position: relative; letter-spacing: .01em;
}
.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1.5px; background: var(--accent);
  transition: width .28s var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--ink); }
.nav-cta {
  font-size: 13px; font-weight: 600; padding: 8px 18px;
  border-radius: var(--r-sm); background: var(--ink); color: var(--white);
  transition: all .2s;
}
.nav-cta:hover { background: var(--ink-2); transform: translateY(-1px); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 6px; width: 36px; }
.nav-toggle span { display: block; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease), opacity .2s; transform-origin: center; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── HERO ── */
.hero {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + 56px) 32px 96px;
  max-width: var(--max-w); margin: 0 auto; position: relative; overflow: hidden;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 28px;
  opacity: 0; animation: fadeUp .6s var(--ease) .1s forwards;
}
.hero-eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 8.5vw, 108px);
  font-weight: 700; line-height: 1.0; letter-spacing: -.04em; margin-bottom: 28px;
  opacity: 0; animation: fadeUp .7s var(--ease) .2s forwards;
}
.hero-h1 em { font-style: italic; font-weight: 300; color: var(--ink-3); }
.hero-desc {
  font-size: clamp(15px, 1.8vw, 18px); color: var(--ink-3);
  line-height: 1.8; max-width: 500px; font-weight: 350; margin-bottom: 40px;
  opacity: 0; animation: fadeUp .7s var(--ease) .32s forwards;
}
.hero-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 72px;
  opacity: 0; animation: fadeUp .7s var(--ease) .44s forwards;
}
.hero-stats {
  display: flex; border-top: 1px solid var(--line); padding-top: 32px;
  opacity: 0; animation: fadeUp .7s var(--ease) .56s forwards;
}
.hero-stat { padding-right: 36px; margin-right: 36px; border-right: 1px solid var(--line); }
.hero-stat:last-child { border-right: none; margin-right: 0; padding-right: 0; }
.stat-num { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -.04em; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; font-family: var(--font-mono); }
.hero-scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; animation: fadeIn .6s ease 1.2s forwards;
}
.scroll-track { width: 1px; height: 52px; background: var(--line); position: relative; overflow: hidden; }
.scroll-thumb { position: absolute; top: -100%; left: 0; width: 100%; height: 50%; background: var(--ink-3); animation: scrollAnim 2.2s var(--ease) infinite 1.5s; }
@keyframes scrollAnim { 0%{top:-50%} 100%{top:120%} }
.scroll-label { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: .12em; text-transform: uppercase; writing-mode: vertical-rl; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
  transition: all .22s var(--ease); white-space: nowrap;
}
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--ink-2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-outline:hover { border-color: var(--ink); background: var(--ink); color: var(--white); transform: translateY(-2px); }
.btn-ghost { background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--paper-3); border-color: var(--line-2); }
.btn-sm { padding: 8px 16px; font-size: 12.5px; border-radius: var(--r-sm); gap: 6px; }
.btn-full { width: 100%; justify-content: center; }

/* ── LAYOUT ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 32px; }
.section { padding: 112px 0; }
.section-alt { background: var(--paper-2); }
.section-eyebrow {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.section-eyebrow::before { content:''; width:28px; height:1px; background:var(--ink-3); }
.section-title {
  font-family: var(--font-display); font-size: clamp(34px, 5vw, 60px);
  font-weight: 700; letter-spacing: -.04em; line-height: 1.06; margin-bottom: 56px;
}
.section-title em { font-style: italic; font-weight: 300; color: var(--ink-3); }

/* ── ABOUT ── */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 72px; align-items: start; }
.about-photo-wrap { position: sticky; top: calc(var(--nav-h) + 24px); }
.about-photo { border-radius: var(--r-lg); overflow: visible; background: var(--paper-3); border: 1px solid var(--line); aspect-ratio: 3/4; position: relative; }
.about-photo img { border-radius: inherit; width: 100%; height: 100%; object-fit: cover; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--ink-4); }
.about-badge {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(248,247,244,.94); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 18px; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px;
}
.about-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: blink 2s infinite; }
.about-content { padding-top: 8px; }
.about-content .section-title { margin-bottom: 20px; }
.body-text { font-size: 15.5px; color: var(--ink-2); line-height: 1.85; font-weight: 350; margin-bottom: 16px; }
.body-text strong { color: var(--ink); font-weight: 600; }
.body-text em { font-style: italic; color: var(--ink-3); }
.about-info { margin-top: 36px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.info-row { display: flex; align-items: center; padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-key { width: 110px; flex-shrink: 0; font-weight: 600; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-mono); }
.info-val { color: var(--ink); }

/* ── GITHUB CONTRIBUTIONS ── */
.section-gh {
  border-top: 1px solid var(--line);
  padding: 80px 0;
}
.gh-contrib-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  padding: 32px;
  max-width: 900px;
}
.gh-contrib-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.gh-contrib-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
}
.gh-contrib-meta svg {
  color: var(--ink-3);
}
.gh-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  transition: color .2s;
}
.gh-profile-link:hover {
  color: var(--accent);
}
.gh-heatmap-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  margin-bottom: 8px;
}
.gh-heatmap {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  gap: 4px;
  min-width: max-content;
}
.gh-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background-color: var(--paper-3);
  outline: 1px solid rgba(27,31,35,0.06);
  outline-offset: -1px;
}
.gh-l0 { background-color: var(--paper-3); }
.gh-l1 { background-color: #9be9a8; }
.gh-l2 { background-color: #40c463; }
.gh-l3 { background-color: #30a14e; }
.gh-l4 { background-color: #216e39; }

.gh-contrib-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 12px;
}
.gh-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-3);
}
.gh-legend-label {
  margin: 0 4px;
}

/* ── SKILLS ── */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.skill-item { padding: 22px 28px; border-bottom: 1px solid var(--line); transition: background .2s; }
.skill-item:hover { background: var(--paper-2); }
.skill-item:nth-child(odd) { border-right: 1px solid var(--line); }
.skill-item:nth-last-child(-n+2) { border-bottom: none; }
.skill-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.skill-name { font-size: 14px; font-weight: 600; }
.skill-pct { font-family: var(--font-mono); font-size: 12px; color: var(--accent); font-weight: 500; }
.skill-track { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.skill-fill { height: 100%; background: var(--ink); border-radius: 2px; width: 0; transition: width 1.1s var(--ease); }

/* ── TAGS & BADGES ── */
.tag {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 100px;
  font-size: 11.5px; font-weight: 500; letter-spacing: .01em;
  background: var(--paper-3); border: 1px solid var(--line);
  color: var(--ink-2); font-family: var(--font-mono); transition: all .2s; white-space: nowrap;
}
.section-alt .tag { background: var(--paper-2); }
.tag-primary { background: var(--accent-dim); border-color: rgba(37,99,235,.22); color: var(--accent); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; font-family: var(--font-mono); letter-spacing: .03em; flex-shrink: 0;
}
.badge::before { content:''; display:block; width:5px; height:5px; border-radius:50%; flex-shrink:0; }
.badge-done { background:#dcfce7; color:#15803d; } .badge-done::before { background:#16a34a; }
.badge-wip  { background:#fef3c7; color:#b45309; } .badge-wip::before  { background:#d97706; }

/* ═══════════════════════════════════════════════
   FEATURED PROJECTS (homepage)
═══════════════════════════════════════════════ */
.projects-intro { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 0; }
.link-view-all {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-3); transition: all .2s; padding-bottom: 56px;
}
.link-view-all svg { transition: transform .2s; }
.link-view-all:hover { color: var(--accent); }
.link-view-all:hover svg { transform: translateX(3px); }

.featured-list { display: flex; flex-direction: column; }
.featured-item {
  display: grid; grid-template-columns: 1fr 360px;
  gap: 56px; border-top: 1px solid var(--line);
  padding: 64px 0; align-items: center;
}
.featured-item:first-child { margin-top: 48px; }
.featured-item:last-child { border-bottom: 1px solid var(--line); }

/* Visual: desktop full-width, mobile floating overlay */
.fi-visual {
  position: relative;
  padding-bottom: 0; /* phone overflow handled by margin-bottom on featured-item */
}

/* Desktop screenshot — full width */
.fi-desktop {
  width: 100%;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--paper-2);
  aspect-ratio: 16/9; position: relative;
}
.fi-desktop img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); display: block; }
.featured-item:hover .fi-desktop img { transform: scale(1.03); }

/* Mobile screenshot — floating in front of desktop, bottom-right */
.fi-mobile {
  position: absolute;
  bottom: 12px; right: 12px; /* anchored INSIDE the desktop screenshot */
  width: 20%;
  min-width: 72px; max-width: 120px;
  border-radius: 14px; overflow: hidden;
  border: 3px solid rgba(255,255,255,.9);
  background: var(--ink);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
  aspect-ratio: 9/19.5;
  z-index: 3;
  transform: rotate(2deg);
  transition: transform .4s var(--ease);
}
.featured-item:hover .fi-mobile { transform: rotate(0deg) scale(1.04); }
.fi-mobile img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Info */
.fi-info { display: flex; flex-direction: column; justify-content: center; }
.fi-num { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); letter-spacing: .1em; margin-bottom: 12px; }
.fi-title { font-family: var(--font-display); font-size: clamp(22px, 2.8vw, 32px); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 6px; }
.fi-subtitle { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: 14px; }
.fi-desc { font-size: 14px; color: var(--ink-2); line-height: 1.75; font-weight: 350; margin-bottom: 20px; }
.fi-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.fi-status { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.fi-progress-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 100px; }
.fi-progress-track { flex: 1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.fi-progress-fill { height: 100%; background: var(--ink-3); border-radius: 2px; }
.fi-progress-pct { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.fi-actions { display: flex; gap: 10px; }

/* ═══════════════════════════════════════════════
   ALL PROJECTS PAGE
═══════════════════════════════════════════════ */
.page-hero { padding: calc(var(--nav-h) + 64px) 0 48px; border-bottom: 1px solid var(--line); }
.page-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); margin-bottom: 24px; transition: all .2s; }
.page-back svg { transition: transform .2s; }
.page-back:hover { color: var(--accent); }
.page-back:hover svg { transform: translateX(-3px); }
.page-h1 { font-family: var(--font-display); font-size: clamp(40px, 6vw, 72px); font-weight: 700; letter-spacing: -.04em; line-height: 1.05; margin-bottom: 14px; }
.page-h1 em { font-style: italic; font-weight: 300; color: var(--ink-3); }
.page-sub { font-size: 16px; color: var(--ink-3); font-weight: 350; max-width: 500px; }

.filter-bar {
  padding: 24px 0; border-bottom: 1px solid var(--line);
  position: sticky; top: var(--nav-h); z-index: 50;
  background: rgba(248,247,244,.96); backdrop-filter: blur(16px);
}
.filter-inner { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-label { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); letter-spacing: .08em; text-transform: uppercase; margin-right: 6px; }
.filter-btn { padding: 6px 16px; border-radius: 100px; font-size: 12.5px; font-weight: 500; border: 1.5px solid var(--line); color: var(--ink-3); background: transparent; transition: all .2s; font-family: var(--font-body); }
.filter-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.filter-btn.active { background: var(--ink); color: var(--white); border-color: var(--ink); }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 48px 0 80px; }
.project-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--white);
  overflow: hidden; /* clean card corners */
  transition: transform .3s var(--ease), box-shadow .3s, border-color .2s;
  display: flex; flex-direction: column;
  /* pointer-events always on — physics only applies to images inside */
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 24px 64px rgba(0,0,0,.09); border-color: var(--line-2); }
.project-card.hidden { display: none; }

/* ── Card visual: desktop full, mobile floating overlay ── */
.card-visual {
  position: relative; flex-shrink: 0;
  background: var(--paper-2);
  /* No extra padding — phone thumb is contained inside desktop screenshot area */
  overflow: hidden; /* clip phone to card visual area */
}

/* Desktop screenshot */
.card-desktop-thumb {
  width: 100%; aspect-ratio: 16/9; overflow: hidden;
  background: var(--paper-2);
  /* border-radius handled by parent .project-card overflow:hidden */
}
.card-desktop-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s var(--ease);
}
.project-card:hover .card-desktop-thumb img { transform: scale(1.05); }

/* Mobile screenshot — floating overlay bottom-right */
.card-mobile-thumb {
  position: absolute;
  bottom: 10px; right: 10px; /* INSIDE the card-desktop-thumb area */
  width: 26%;
  min-width: 52px; max-width: 90px;
  border-radius: 10px; overflow: hidden;
  border: 2.5px solid rgba(255,255,255,.9);
  background: var(--ink);
  box-shadow: 0 6px 20px rgba(0,0,0,.32), 0 2px 6px rgba(0,0,0,.18);
  aspect-ratio: 9/19.5;
  z-index: 3;
  transform: rotate(2deg);
  transition: transform .35s var(--ease);
  pointer-events: none; /* phone overlay should not block card clicks */
}
.project-card:hover .card-mobile-thumb { transform: rotate(0deg) scale(1.04); }
.card-mobile-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: top; display: block;
}
/* Desktop-only card: extra bottom padding not needed */
.card-visual.no-mobile { padding-bottom: 0; }

.card-body { padding: 22px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 5px; }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.card-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 500; margin-bottom: 8px; }
.card-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; font-weight: 350; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 12px; flex: 1; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.card-tags .tag { font-size: 10.5px; padding: 3px 8px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; }

/* ═══════════════════════════════════════════════
   DETAIL PAGE — completely fixed layout
═══════════════════════════════════════════════ */
.detail-wrap { padding: calc(var(--nav-h) + 48px) 0 96px; }
.detail-back-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; gap: 16px; flex-wrap: wrap; }
.detail-top-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* Header */
.detail-header { padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.detail-title-row { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 60px); font-weight: 700; letter-spacing: -.04em; line-height: 1.08; }
.detail-subtitle { font-size: 15px; color: var(--ink-3); font-weight: 500; margin-bottom: 20px; }
.detail-progress-row { display: flex; align-items: center; gap: 12px; max-width: 300px; }
.detail-progress-label { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.detail-progress-track { flex: 1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.detail-progress-fill { height: 100%; background: var(--ink); border-radius: 2px; width: 0; transition: width 1.1s var(--ease); }
.detail-progress-pct { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* ── Detail visual: desktop full-width, mobile floating overlay ── */
.detail-visual-section {
  margin-bottom: 40px;
}
/* Wrapper — position context for overlay */
.detail-screens {
  position: relative;
  display: block;
  /* Padding-bottom makes room for floating phone overflow */
  padding-bottom: 28px;
}
.detail-screens.no-mobile { padding-bottom: 0; }
/* Desktop screenshot */
.detail-desktop-wrap {
  width: 100%;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--paper-2);
}
.detail-desktop-wrap img {
  width: 100%; display: block;
  max-height: 520px; object-fit: cover;
}
/* Mobile phone — floating in front, anchored bottom-right */
.detail-mobile-frame {
  position: absolute;
  bottom: -24px; right: 24px;
  width: 18%;
  min-width: 100px; max-width: 160px;
  border-radius: 20px; overflow: hidden;
  border: 3.5px solid var(--paper);
  background: var(--ink);
  box-shadow: 0 20px 56px rgba(0,0,0,.28), 0 4px 12px rgba(0,0,0,.12);
  z-index: 3;
  transform: rotate(2deg);
  transition: transform .4s var(--ease);
}
.detail-screens:hover .detail-mobile-frame { transform: rotate(0deg) translateY(-6px); }
.detail-mobile-frame img {
  width: 100%; display: block;
  aspect-ratio: 9/19.5; object-fit: cover;
}
/* Label under entire visual */
.detail-mobile-caption {
  margin-top: 36px; /* account for phone overflow */
  font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
}
.detail-mobile-caption::before,
.detail-mobile-caption::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
/* Desktop-only: no phone, no extra margin */
.detail-screens.no-mobile { }
.detail-screens.no-mobile .detail-desktop-wrap { max-width: 100%; }
.detail-screens.no-mobile .detail-mobile-caption { margin-top: 0; }

/* Tags */
.detail-tags-section {
  margin-bottom: 36px; padding: 22px;
  background: var(--paper-2); border-radius: var(--r); border: 1px solid var(--line);
}
.detail-tags-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
}
.detail-tags-list { display: flex; gap: 7px; flex-wrap: wrap; }

/* README */
.readme-section { margin-bottom: 48px; }
.readme-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 24px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px;
}
.readme-content { font-size: 15px; color: var(--ink-2); line-height: 1.85; font-weight: 350; max-width: 820px; }
.readme-content h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); margin: 0 0 16px; }
.readme-content h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin: 40px 0 12px; padding-top: 28px; border-top: 1px solid var(--line); }
.readme-content h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.readme-content h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 24px 0 8px; }
.readme-content p { margin-bottom: 14px; }
.readme-content p:last-child { margin-bottom: 0; }
.readme-content strong { color: var(--ink); font-weight: 600; }
.readme-content em { font-style: italic; color: var(--ink-3); }
.readme-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.readme-content code { font-family: var(--font-mono); font-size: 12.5px; background: var(--paper-3); padding: 2px 6px; border-radius: 4px; color: var(--ink); border: 1px solid var(--line); }
.readme-content pre { background: var(--ink); border-radius: var(--r); padding: 22px 24px; overflow-x: auto; margin: 20px 0; }
.readme-content pre code { background: none; border: none; color: #c8c8c0; font-size: 13px; line-height: 1.7; padding: 0; }
.readme-content ul { padding-left: 20px; list-style: disc; margin: 0 0 14px; }
.readme-content ol { padding-left: 20px; list-style: decimal; margin: 0 0 14px; }
.readme-content li { margin-bottom: 5px; }
.readme-content hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.readme-content blockquote { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--ink-3); margin: 16px 0; font-style: italic; }
.md-table-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--r); border: 1px solid var(--line); }
.md-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.md-table-wrap th, .md-table-wrap td { padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.md-table-wrap th { font-weight: 600; color: var(--ink); background: var(--paper-2); font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.md-table-wrap td { color: var(--ink-2); }
.md-table-wrap tr:last-child td { border-bottom: none; }

.detail-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.detail-loading { min-height: 400px; display: flex; align-items: center; justify-content: center; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.detail-error { text-align: center; padding: 80px 24px; }
.detail-error p { color: var(--ink-3); margin-bottom: 24px; }

/* ── CONTACT ── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.contact-links { margin-top: 36px; display: flex; flex-direction: column; }
.contact-link { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2); transition: all .2s; }
.contact-link:first-child { border-top: 1px solid var(--line); }
.contact-link:hover { color: var(--accent); padding-left: 4px; }
.contact-link-icon { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--paper-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink-3); flex-shrink: 0; transition: all .2s; }
.contact-link:hover .contact-link-icon { background: var(--accent-dim); border-color: rgba(37,99,235,.3); color: var(--accent); }
.contact-link-label { font-size: 11px; color: var(--ink-4); display: block; margin-bottom: 2px; font-family: var(--font-mono); }
.contact-link-value { display: block; font-weight: 500; }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--ink-2); letter-spacing: .04em; text-transform: uppercase; font-family: var(--font-mono); }
.form-control { width: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--ink); font-size: 14.5px; font-weight: 350; transition: border-color .2s, box-shadow .2s; resize: vertical; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-control::placeholder { color: var(--ink-4); }

/* ── FOOTER ── */
.footer { border-top: 1px solid var(--line); padding: 36px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-copy { font-size: 13px; color: var(--ink-3); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--ink-3); transition: color .2s; }
.footer-links a:hover { color: var(--ink); }

/* ── REVEAL ANIMATIONS ── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.reveal-left  { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }
.reveal.visible { opacity: 1; transform: translate(0,0); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── CURSOR HINT ── */
.cursor-hint {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(14,14,13,.85); backdrop-filter: blur(12px);
  color: rgba(255,255,255,.85); font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .06em;
  padding: 8px 20px; border-radius: 100px; z-index: 300;
  white-space: nowrap; opacity: 0; animation: fadeIn .5s ease 2.5s forwards;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET 1100px
═══════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .featured-item { grid-template-columns: 1fr; gap: 36px; }
  /* fi-mobile overlay: slightly smaller on tablet */
  .fi-mobile { width: 20%; bottom: -16px; right: -8px; }
  .about-grid { grid-template-columns: 220px 1fr; gap: 48px; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  /* detail mobile phone: smaller */
  .detail-mobile-frame { width: 15%; min-width: 88px; bottom: -18px; right: 16px; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE 768px
═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --nav-h: 56px; }
  .container { padding: 0 20px; }
  .section { padding: 72px 0; }
  .hero { padding: calc(var(--nav-h) + 32px) 20px 64px; }
  .nav-inner { padding: 0 20px; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: rgba(248,247,244,.98); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: flex-start;
    padding: 20px; gap: 0;
    transform: translateY(-110%); opacity: 0;
    transition: transform .35s var(--ease), opacity .25s;
    pointer-events: none;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .nav-link { padding: 14px 0; font-size: 16px; width: 100%; border-bottom: 1px solid var(--line); }
  .nav-link::after { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }

  /* Hero */
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .hero-stat { border-right: none; padding-right: 0; margin-right: 0; width: calc(50% - 10px); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { justify-content: center; }

  /* About */
  .about-grid { grid-template-columns: 1fr; }
  .about-photo-wrap { position: static; }
  .about-photo { max-width: 160px; aspect-ratio: 1; border-radius: var(--r); }

  /* Skills */
  .skills-grid { grid-template-columns: 1fr; }
  .skill-item:nth-child(odd) { border-right: none; }
  .skill-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .skill-item:last-child { border-bottom: none; }

  /* ─ Featured: overlay stays, adjust sizes ─ */
  .featured-item { gap: 24px; padding: 40px 0; }
  .fi-mobile {
    width: 26%;
    bottom: -14px; right: -6px;
    border-radius: 10px; border-width: 2.5px;
  }
  /* fi-visual padding-bottom handles phone overflow */

  /* ─ Card: overlay stays, adjust ─ */
  .card-mobile-thumb {
    width: 30%;
    bottom: -10px; right: 12px;
    border-radius: 8px; border-width: 2px;
  }
  /* card-mobile-thumb is inside desktop area, no padding needed */

  /* ─ Detail visual: keep overlay, scale down phone ─ */
  .detail-mobile-frame {
    width: 24%;
    min-width: 80px; max-width: 120px;
    bottom: -16px; right: 12px;
    border-radius: 16px; border-width: 2.5px;
  }
  .detail-mobile-caption { margin-top: 28px; font-size: 10px; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }
  .projects-intro { flex-direction: column; align-items: flex-start; }
  .link-view-all { padding-bottom: 24px; }

  /* Detail page */
  .detail-wrap { padding: calc(var(--nav-h) + 24px) 0 64px; }
  .detail-back-row { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Contact & Form */
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }

  /* Hide cursor on touch */
  #cursor-dot, #cursor-ring, #cursor-trail-canvas { display: none; }
  .cursor-hint { display: none; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE 480px
═══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .projects-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero-stat { width: 100%; }
  /* Featured phone overlay */
  .fi-mobile {
    width: 28%;
    bottom: -12px; right: -4px;
  }
  /* Card phone overlay */
  .card-mobile-thumb {
    width: 32%;
    bottom: -8px; right: 10px;
  }
  /* Detail phone overlay */
  .detail-mobile-frame {
    width: 26%;
    min-width: 72px;
    bottom: -12px; right: 10px;
    border-radius: 12px;
  }
}

/* ═══════════════════════════════════════════════
   TECH BADGES (from tech-icons.js)
═══════════════════════════════════════════════ */
.tech-badge {
  cursor: default;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
}
.tech-badge svg {
  display: block;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
}

/* Override fi-tags and card-tags spacing for icon badges */
.fi-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* ── PHYSICS OVERRIDES ── */
/* Cards have overflow:hidden — physics tilt is on IMAGE, not card */
/* profile photo: visible overflow for drag above nav */
.about-photo-wrap { overflow: visible !important; position: relative; z-index: 1; }
/* Dragged profile photo must appear above nav (z:200) */
.about-photo img[style*="99999"] { isolation: isolate; }

/* Draggable cursor indicator */
img[style*="grab"] { cursor: grab; }
img[style*="grabbing"] { cursor: grabbing; }

/* Ripple won't inherit pointer-events */
body > div[style*="position: fixed"][style*="border-radius: 50%"] {
  pointer-events: none !important;
}

/* Magnetic button - reset transform origin to center */
.btn, .nav-cta, .filter-btn, .nav-link, .nav-logo {
  transform-origin: center center;
}

/* Floating hero stats */
.hero-stat { will-change: transform; }

/* Physics hint toast */
.physics-hint {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  background: rgba(14,14,13,.88);
  backdrop-filter: blur(12px);
  color: rgba(255,255,255,.9);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .06em;
  padding: 10px 22px; border-radius: 100px;
  z-index: 9000; white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  pointer-events: none;
  transition: opacity .4s;
}

/* 3D card tilt — ensure no clip */
.project-card, .featured-item {
  transform-style: preserve-3d;
}

/* Chaos mode indicator */
@keyframes chaosWobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}
.chaos-active { animation: chaosWobble .3s ease-in-out infinite; }
