/* ============================================================
   UTKARSH SINGH — PORTFOLIO 2.0
   Design system · elegant / minimal / futuristic-technical
   Electric-blue accent · near-neutral base · light + dark
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Michroma&display=swap');

/* ---------- tokens ---------- */
:root {
  --display: 'Michroma', sans-serif;
  --sans: 'Chakra Petch', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Chakra Petch', ui-monospace, 'SFMono-Regular', monospace;

  /* accent — electric blue, constant hue across modes */
  --accent: oklch(0.56 0.18 264);
  --accent-2: oklch(0.66 0.15 248);
  --accent-ink: oklch(0.98 0.01 264);
  --accent-soft: oklch(0.56 0.18 264 / 0.12);
  --accent-line: oklch(0.56 0.18 264 / 0.32);
  --accent-glow: oklch(0.56 0.18 264 / 0.22);

  --shadow-1: 0 1px 2px rgba(8,10,18,.04), 0 8px 24px -16px rgba(8,10,18,.18);
  --shadow-2: 0 2px 6px rgba(8,10,18,.05), 0 30px 60px -32px rgba(8,10,18,.30);

  --maxw: 1200px;
  --slant: 3.2deg;            /* apple-style section slant */
  --ease: cubic-bezier(.22,.61,.36,1);
  --radius: 14px;
}

/* light (default) */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg:        oklch(0.975 0.004 255);
  --bg-2:      oklch(0.955 0.005 255);
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.99 0.003 255);
  --text:      oklch(0.20 0.02 262);
  --text-2:    oklch(0.44 0.02 262);
  --text-3:    oklch(0.62 0.015 262);
  --line:      oklch(0.20 0.02 262 / 0.12);
  --line-2:    oklch(0.20 0.02 262 / 0.06);
  --grid-line: oklch(0.20 0.02 262 / 0.04);
  --mesh:      oklch(0.55 0.06 262 / 0.55);
  --mesh-rgb:  118,130,164;
  --accent-rgb: 59,91,219;
  --halo-a:    oklch(0.56 0.18 264 / 0.10);
  --halo-b:    oklch(0.66 0.12 230 / 0.07);
  --nav-bg:    oklch(0.975 0.004 255 / 0.72);
}

/* dark */
[data-theme="dark"] {
  color-scheme: dark;
  --bg:        oklch(0.16 0.012 262);
  --bg-2:      oklch(0.19 0.014 262);
  --surface:   oklch(0.21 0.015 262);
  --surface-2: oklch(0.235 0.016 262);
  --text:      oklch(0.94 0.008 262);
  --text-2:    oklch(0.74 0.012 262);
  --text-3:    oklch(0.56 0.014 262);
  --line:      oklch(0.94 0.01 262 / 0.12);
  --line-2:    oklch(0.94 0.01 262 / 0.06);
  --grid-line: oklch(0.94 0.01 262 / 0.045);
  --mesh:      oklch(0.78 0.07 262 / 0.40);
  --mesh-rgb:  150,166,205;
  --accent-rgb: 110,140,245;
  --halo-a:    oklch(0.60 0.20 264 / 0.18);
  --halo-b:    oklch(0.68 0.13 220 / 0.12);
  --accent:    oklch(0.66 0.17 264);
  --accent-ink: oklch(0.15 0.02 264);
  --nav-bg:    oklch(0.155 0.012 262 / 0.72);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* page-wide ambient field (fixed, very subtle) */
body::before {
  content: "";
  position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 42% at 14% 6%, var(--halo-a), transparent 60%),
    radial-gradient(34% 38% at 88% 14%, var(--halo-b), transparent 62%);
  animation: haloDrift 26s ease-in-out infinite alternate;
}
/* fixed grid kept separate so it never moves with the living halos */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
}
@keyframes haloDrift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(4%, 3%, 0) scale(1.12); }
  100% { transform: translate3d(-3%, 5%, 0) scale(1.05); }
}
@media (prefers-reduced-motion: reduce){ body::before { animation: none; } }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px){ .wrap { padding: 0 20px; } }

.eyebrow {
  font-family: var(--display);
  font-size: 10px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--text-3);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow .pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.eyebrow .line { width: 34px; height: 1px; background: var(--accent-line); }

h1,h2,h3,h4 { font-weight: 600; line-height: 1.04; letter-spacing: -0.01em; margin: 0; }

.mono {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .12em;
  color: var(--text-3);
}

/* accent text */
.acc { color: var(--accent); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* ---------- buttons ---------- */
.btn {
  --bpad: 14px 22px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: var(--bpad);
  font-family: var(--sans); font-weight: 600;
  font-size: 13px; letter-spacing: .02em;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s var(--ease),
              background .25s var(--ease), box-shadow .25s var(--ease), color .2s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--shadow-1); }
.btn .ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.btn--primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 8px 24px -10px var(--accent-glow);
}
.btn--primary:hover { box-shadow: 0 14px 34px -10px var(--accent-glow); }
.btn--ghost { background: transparent; }
.btn--sm { --bpad: 9px 14px; font-size: 12px; border-radius: 8px; }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--text-2); background: var(--surface-2);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip .dot.live { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 0 var(--accent-glow);} 50%{ box-shadow: 0 0 0 6px transparent;} }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav__in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--accent-line); border-radius: 8px;
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--accent-soft), transparent);
}
.brand__mark span {
  font-family: var(--display); font-size: 13px; color: var(--accent);
}
.brand__name { font-family: var(--display); font-size: 12px; letter-spacing: .14em; }
.brand__name b { color: var(--text); font-weight: 400; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  color: var(--text-2); padding: 8px 13px; border-radius: 8px;
  position: relative; transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--text); background: var(--bg-2); }
.nav__links a.active { color: var(--accent); }
.nav__tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  color: var(--text-2); cursor: pointer; transition: .2s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; }
@media (max-width: 760px){ .nav__links a:not(.active){ display: none; } }

/* ---------- decorative parallax bg layer ---------- */
.bg-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-deco .ghost {
  position: absolute; font-family: var(--display);
  color: var(--text); opacity: .035; letter-spacing: .04em;
  font-size: clamp(120px, 22vw, 320px); line-height: .8; user-select: none;
  white-space: nowrap;
}
[data-theme="dark"] .bg-deco .ghost { opacity: .05; }
.bg-deco .orb {
  position: absolute; border-radius: 50%; filter: blur(50px);
  background: radial-gradient(circle at 50% 50%, var(--accent-glow), transparent 70%);
  animation: orbFloat 18s ease-in-out infinite alternate;
}
@keyframes orbFloat {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(3%, -5%, 0) scale(1.14); }
}
@media (prefers-reduced-motion: reduce){ .bg-deco .orb { animation: none; } }
.mesh-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
canvas.mesh-svg { pointer-events: none; }
.mesh-svg line { stroke: var(--mesh); stroke-width: .6; opacity: .5; }
.mesh-svg circle { fill: var(--mesh); }
.mesh-svg .node-hot { fill: var(--accent); }

/* ---------- section scaffolding ---------- */
.section { position: relative; padding: 120px 0; }
.section > .wrap, .now > .wrap { position: relative; z-index: 1; }
.section--tight { padding: 84px 0; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 52px; }
.section__head h2 {
  font-size: clamp(30px, 4.4vw, 50px); letter-spacing: -0.02em; margin-top: 16px;
}
.section__index {
  font-family: var(--display); font-size: 12px; letter-spacing: .2em;
  color: var(--text-3); text-align: right; line-height: 2;
}
.section__index b { display: block; color: var(--accent); font-weight: 400; }

/* slanted band — apple-style diagonal that guides the eye */
.slant-band { position: relative; }
.slant-band::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 200px;
  background: var(--bg-2);
  clip-path: polygon(0 var(--slant-h, 64px), 100% 0, 100% 100%, 0 100%);
  z-index: -1;
}

/* generic reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"]{ transition-delay: .08s; }
.reveal[data-delay="2"]{ transition-delay: .16s; }
.reveal[data-delay="3"]{ transition-delay: .24s; }
.reveal[data-delay="4"]{ transition-delay: .32s; }
@media (prefers-reduced-motion: reduce){ .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- cards / surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.card__corner { position: absolute; top: 14px; right: 16px; }

/* divider rule */
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- footer ---------- */
.foot { position: relative; border-top: 1px solid var(--line); background: var(--bg-2); padding: 72px 0 40px; overflow: hidden; }
.foot__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 48px; }
.foot h5 { font-family: var(--display); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--text-3); margin: 0 0 18px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.foot li a { font-size: 14px; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; transition: color .2s, gap .2s; }
.foot li a:hover { color: var(--accent); gap: 12px; }
.foot__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.foot__bottom .mono { font-size: 11px; }
@media (max-width: 820px){ .foot__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .foot__grid { grid-template-columns: 1fr; gap: 32px; } }

/* utility */
.stack { display: grid; gap: var(--g, 16px); }
.row { display: flex; align-items: center; gap: var(--g, 12px); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.grow { flex: 1; }
.wrap-flex { flex-wrap: wrap; }
