/* ============================================================
   Manjit Shakya — Portfolio
   Design system: deep ink, off-white, refined emerald accent
   Space Grotesk (display/body) + JetBrains Mono (labels/tags)
   ============================================================ */

:root {
  /* Color — warm-neutral near-black */
  --bg:        oklch(0.165 0.006 250);
  --bg-2:      oklch(0.195 0.007 250);
  --surface:   oklch(0.214 0.008 250);
  --surface-2: oklch(0.245 0.009 250);
  --line:      oklch(1 0 0 / 0.09);
  --line-2:    oklch(1 0 0 / 0.16);

  --text:      oklch(0.955 0.004 250);
  --text-2:    oklch(0.78 0.008 250);
  --text-3:    oklch(0.6 0.01 250);
  --text-4:    oklch(0.46 0.01 250);

  /* Accent (tweakable) */
  --accent:    oklch(0.82 0.15 158);
  --accent-2:  oklch(0.82 0.15 158 / 0.14);
  --accent-3:  oklch(0.82 0.15 158 / 0.30);
  --accent-ink: oklch(0.2 0.04 158);

  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --r: 14px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

::selection { background: var(--accent-3); color: var(--text); }

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

/* Background grain / grid layer */
.bg-field {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 80% -10%, var(--accent-2), transparent 55%),
    linear-gradient(to bottom, var(--bg-2), var(--bg) 40%);
  opacity: 0.9;
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(100% 70% at 50% 0%, #000 10%, transparent 75%);
          mask-image: radial-gradient(100% 70% at 50% 0%, #000 10%, transparent 75%);
  opacity: 0.5;
}

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); position: relative; z-index: 1; }
section { position: relative; z-index: 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--accent); opacity: 0.6;
}

.section-head { margin-bottom: clamp(36px, 6vw, 64px); }
.section-head h2 {
  font-size: clamp(28px, 4.6vw, 46px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-top: 18px;
  max-width: 22ch;
  text-wrap: balance;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-4);
  letter-spacing: 0.1em;
}

.pad { padding-block: clamp(72px, 11vw, 140px); }
.divider { height: 1px; background: var(--line); width: 100%; }

/* ---------- Top nav ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: background 0.4s var(--ease), border-color 0.4s, padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled {
  background: oklch(0.165 0.006 250 / 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
  padding-block: 13px;
}
.brand {
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 9px; letter-spacing: 0.02em;
}
.brand .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-2); }
.navlinks { display: flex; gap: 4px; align-items: center; }
.navlinks a {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3);
  padding: 8px 13px; border-radius: 8px; transition: color 0.2s, background 0.2s;
  letter-spacing: 0.03em;
}
.navlinks a:hover { color: var(--text); background: var(--surface); }
.navlinks a.active { color: var(--accent); }
.nav-cta {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text) !important;
  border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 15px !important;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent-2) !important; }

.nav-retro {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--accent) !important;
  border: 1px solid var(--accent-3); border-radius: 9px; padding: 8px 13px !important;
  letter-spacing: 0.03em; transition: all 0.2s var(--ease);
}
.nav-retro:hover { background: var(--accent-2) !important; border-color: var(--accent); transform: translateY(-1px); }
@media (max-width: 600px) {
  .nav-retro { padding: 7px 10px !important; }
  .nav-retro .rm-label { display: none; }
}
@media (max-width: 760px) { .navlinks .hide-sm { display: none; } }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; padding-top: 90px; }
.hero-inner { width: 100%; }
.hero .status {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 100px; padding: 7px 14px;
  margin-bottom: 30px; background: oklch(1 0 0 / 0.02);
}
.hero .status .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  position: relative;
}
.hero .status .pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--accent); animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }

.hero h1 {
  font-size: clamp(46px, 11vw, 138px);
  font-weight: 600; line-height: 0.92; letter-spacing: -0.035em;
  margin-bottom: 6px;
}
.hero h1 .ln { display: block; overflow: hidden; }
.hero h1 .ln span { display: inline-block; }
.hero .role {
  font-family: var(--font-mono);
  font-size: clamp(14px, 2.4vw, 21px);
  color: var(--text-2); letter-spacing: 0.02em; margin-top: 22px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.hero .role .arrow { color: var(--accent); }
.hero .role .cursor {
  display: inline-block; width: 10px; height: 1.1em; background: var(--accent);
  margin-left: 2px; transform: translateY(2px);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero .lede {
  max-width: 56ch; color: var(--text-2); font-size: clamp(16px, 2vw, 19px);
  margin-top: 30px; line-height: 1.7;
}
.hero .lede strong { color: var(--text); font-weight: 500; }

.hero-actions { display: flex; gap: 14px; margin-top: 38px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13.5px; letter-spacing: 0.02em;
  padding: 13px 20px; border-radius: 11px; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s, color 0.2s;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { box-shadow: 0 12px 34px -10px var(--accent-3); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-2); }
.btn svg { width: 15px; height: 15px; }

.hero-meta {
  display: flex; gap: clamp(24px, 5vw, 60px); margin-top: clamp(50px, 8vw, 90px);
  flex-wrap: wrap; padding-top: 32px; border-top: 1px solid var(--line);
}
.hero-meta .stat .n {
  font-size: clamp(30px, 5vw, 46px); font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hero-meta .stat .n .suf { color: var(--accent); }
.hero-meta .stat .l {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); margin-top: 6px;
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: start; }
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; gap: 48px; } }
.about-lede { font-size: clamp(21px, 2.8vw, 30px); font-weight: 500; letter-spacing: -0.015em; line-height: 1.32; text-wrap: pretty; }
.about-lede .hl { color: var(--accent); }
.summary-list { display: flex; flex-direction: column; gap: 2px; }
.summary-list li {
  list-style: none; display: grid; grid-template-columns: 26px 1fr; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  color: var(--text-2); font-size: 15.5px; line-height: 1.55;
}
.summary-list li .k { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); padding-top: 3px; }
.summary-list li strong { color: var(--text); font-weight: 500; }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 38px; }
.filter-group-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-4); width: 100%; margin-bottom: -2px;
}
.chip {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.01em;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 100px; cursor: pointer;
  transition: all 0.2s var(--ease); display: inline-flex; align-items: center; gap: 7px;
}
.chip:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.chip .ct { opacity: 0.6; font-size: 11px; }
.chip.active .ct { opacity: 0.7; }

.proj-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
@media (max-width: 960px) { .proj-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .proj-grid { grid-template-columns: 1fr; } }

.pcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px 24px 22px; display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
  transition: border-color 0.35s var(--ease), transform 0.45s var(--ease), background 0.35s;
}
.pcard::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--r); pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--accent-2), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.pcard:hover { border-color: var(--line-2); transform: translateY(-4px); background: var(--surface-2); }
.pcard:hover::before { opacity: 1; }
.pcard.is-hidden { display: none; }
/* filter transition states */
.pcard.filtering { opacity: 0; transform: scale(0.96) translateY(8px); }

.pcard .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pcard .arch {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-3); border-radius: 6px; padding: 4px 8px;
  white-space: nowrap; flex-shrink: 0;
}
.pcard .arch.mono { color: var(--text-3); border-color: var(--line); }
.pcard h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
.pcard .co { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-4); letter-spacing: 0.03em; }
.pcard p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; flex-grow: 1; }
.pcard .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pcard .tags span {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  background: oklch(1 0 0 / 0.03); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px;
}
.pcard .tags .more { color: var(--text-4); border-style: dashed; }

.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--text-3);
  font-family: var(--font-mono); font-size: 14px;
}

/* ---------- Experience timeline ---------- */
.timeline { position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--line);
}
.tl-item {
  position: relative; padding: 0 0 38px 42px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item .node {
  position: absolute; left: 0; top: 6px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line-2); z-index: 1;
  display: grid; place-items: center; transition: border-color 0.4s, box-shadow 0.4s;
}
.tl-item .node::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--text-4); transition: background 0.4s; }
.tl-item.current .node { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-2); }
.tl-item.current .node::after { background: var(--accent); }
.tl-row { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; flex-wrap: wrap; }
.tl-item h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.tl-item .date { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tl-item .org { color: var(--text-2); font-size: 14.5px; margin-top: 4px; }
.tl-item .org .mode {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-4);
  margin-left: 8px; border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px;
}
.tl-item.current h3 .badge {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent); border-radius: 5px; padding: 3px 7px;
  margin-left: 10px; vertical-align: middle; font-weight: 600;
}

/* ---------- Skills ---------- */
.skill-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 880px) { .skill-cols { grid-template-columns: 1fr; } }
.skill-cat {
  border: 1px solid var(--line); border-radius: var(--r); padding: 22px; background: var(--surface);
}
.skill-cat .ct {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.skill-cat .ct .ix { color: var(--text-4); }
.skill-cat .pills { display: flex; flex-wrap: wrap; gap: 7px; }
.skill-cat .pills span {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2);
  background: oklch(1 0 0 / 0.03); border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, background 0.2s;
}
.skill-cat .pills span:hover { color: var(--text); border-color: var(--accent); background: var(--accent-2); transform: translateY(-2px); }

/* ---------- Mentoring + Education two-col ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; gap: 56px; } }
.mini-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 26px; }
.mini-head h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.mini-head .ix { font-family: var(--font-mono); font-size: 12px; color: var(--text-4); }
.stack-list { display: flex; flex-direction: column; }
.stack-item { padding: 16px 0; border-top: 1px solid var(--line); }
.stack-item:first-child { border-top: none; padding-top: 0; }
.stack-item .a { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.stack-item .a .t { font-size: 16px; font-weight: 600; }
.stack-item .a .meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.stack-item .b { color: var(--text-2); font-size: 14px; margin-top: 4px; }

/* ---------- Contact ---------- */
.contact { text-align: left; }
.contact h2 {
  font-size: clamp(38px, 8vw, 96px); font-weight: 600; letter-spacing: -0.035em; line-height: 0.95;
  text-wrap: balance;
}
.contact h2 .hl { color: var(--accent); }
.contact-sub { color: var(--text-2); font-size: clamp(16px, 2.2vw, 20px); max-width: 50ch; margin-top: 26px; line-height: 1.6; }
.contact-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 48px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
@media (max-width: 700px) { .contact-links { grid-template-columns: 1fr; } }
.clink {
  background: var(--bg); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; transition: background 0.25s, color 0.2s; position: relative;
}
.clink:hover { background: var(--surface); }
.clink > span:first-child { display: flex; flex-direction: column; }
.clink .lab { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-4); }
.clink .val { font-size: 16px; margin-top: 5px; transition: color 0.2s; }
.clink:hover .val { color: var(--accent); }
.clink .arr { color: var(--text-4); transition: transform 0.3s var(--ease), color 0.2s; }
.clink:hover .arr { transform: translate(3px, -3px); color: var(--accent); }

footer {
  padding: 40px var(--gutter); border-top: 1px solid var(--line); margin-top: clamp(60px,10vw,120px);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-4);
}
footer a:hover { color: var(--accent); }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Hero line entrance */
.hero h1 .ln span { transform: translateY(110%); transition: transform 1s var(--ease); }
.hero.loaded h1 .ln span { transform: translateY(0); }
.hero h1 .ln:nth-child(2) span { transition-delay: 0.08s; }
.fade-up { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.hero.loaded .fade-up { opacity: 1; transform: none; }
.hero.loaded .fade-up.s1 { transition-delay: 0.35s; }
.hero.loaded .fade-up.s2 { transition-delay: 0.45s; }
.hero.loaded .fade-up.s3 { transition-delay: 0.55s; }
.hero.loaded .fade-up.s4 { transition-delay: 0.7s; }

/* ---------- No-glow tweak ---------- */
body.no-glow .pcard::before,
body.no-glow .bg-field { display: none; }

/* ---------- Tweaks panel ---------- */
.twk {
  position: fixed; right: 18px; bottom: 18px; z-index: 2147483646;
  width: 250px; background: oklch(0.214 0.008 250 / 0.86);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 20px 50px -16px rgba(0,0,0,0.6);
  font-family: var(--font-mono); color: var(--text);
  opacity: 0; transform: translateY(12px) scale(0.98); pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.twk.open { opacity: 1; transform: none; pointer-events: auto; }
.twk-hd { display: flex; align-items: center; justify-content: space-between; padding: 13px 12px 13px 16px; border-bottom: 1px solid var(--line); }
.twk-hd b { font-size: 13px; font-weight: 500; letter-spacing: 0.04em; }
.twk-x { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 13px; width: 24px; height: 24px; border-radius: 7px; }
.twk-x:hover { background: var(--surface-2); color: var(--text); }
.twk-bd { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 9px; }
.twk-sec { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4); margin-top: 6px; }
.twk-sec:first-child { margin-top: 0; }
.twk-sw { display: flex; gap: 8px; }
.twk-chip { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); cursor: pointer; transition: transform 0.18s var(--ease), box-shadow 0.18s; }
.twk-chip:hover { transform: scale(1.08); }
.twk-chip.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor; }
.twk-seg { display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.twk-seg button { flex: 1; background: none; border: none; color: var(--text-3); font-family: var(--font-mono); font-size: 11px; padding: 7px 4px; border-radius: 6px; cursor: pointer; transition: all 0.18s; }
.twk-seg button:hover { color: var(--text); }
.twk-seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.twk-tog { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.twk-tog input { appearance: none; width: 38px; height: 22px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 100px; position: relative; cursor: pointer; transition: background 0.2s; }
.twk-tog input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3); transition: transform 0.2s var(--ease), background 0.2s; }
.twk-tog input:checked { background: var(--accent-2); border-color: var(--accent); }
.twk-tog input:checked::after { transform: translateX(16px); background: var(--accent); }

/* ---------- CV modal ---------- */
.cv-modal { position: fixed; inset: 0; z-index: 2000; display: none; }
.cv-modal.open { display: block; }
.cv-backdrop {
  position: absolute; inset: 0; background: oklch(0.1 0.005 250 / 0.7);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.cv-modal.open .cv-backdrop { opacity: 1; }
.cv-sheet {
  position: absolute; left: 50%; top: 50%;
  width: min(960px, 94vw); height: min(86vh, 1000px);
  transform: translate(-50%, -46%) scale(0.97); opacity: 0;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 40px 100px -24px rgba(0,0,0,0.7);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.cv-modal.open .cv-sheet { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.cv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 12px 11px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
  background: var(--bg-2);
}
.cv-bar-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cv-dots { display: flex; gap: 7px; }
.cv-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.cv-url { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-bar-r { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cv-ext { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 8px; transition: all 0.2s; white-space: nowrap; }
.cv-ext:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-2); }
.cv-close { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 14px; width: 30px; height: 30px; border-radius: 8px; transition: all 0.2s; flex-shrink: 0; }
.cv-close:hover { background: var(--surface-2); color: var(--text); }
.cv-frame-wrap { position: relative; flex: 1; background: #fff; }
.cv-frame { width: 100%; height: 100%; border: 0; display: block; opacity: 0; transition: opacity 0.5s var(--ease); }
.cv-frame.loaded { opacity: 1; }
.cv-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; font-family: var(--font-mono); font-size: 13px; color: var(--text-3); background: var(--surface);
  transition: opacity 0.4s; z-index: 1;
}
.cv-frame.loaded ~ .cv-loading,
.cv-frame-wrap:has(.cv-frame.loaded) .cv-loading { opacity: 0; pointer-events: none; }
.cv-spin { width: 26px; height: 26px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: cvspin 0.8s linear infinite; }
@keyframes cvspin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { .cv-sheet { width: 96vw; height: 90vh; } .cv-url { display: none; } }
