/* =============================================================
   Gaurav Sharma — Portfolio
   Minimal · editorial · premium. Dark-first, light-aware.
   Pure CSS, no build step.
   ============================================================= */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
::selection { background: var(--accent); color: #04130d; }

/* ---------- Tokens ---------- */
:root {
  --bg:        #0a0b0d;
  --bg-2:      #0c0e11;
  --surface:   #111317;
  --surface-2: #16191e;
  --line:      #1c1f25;       /* hairline */
  --line-2:    #262a32;
  --text:      #f3f5f8;
  --text-dim:  #9ba1ac;
  --text-mute: #5d626c;
  --accent:    #38e0a6;
  --accent-dim:#1d7d5c;
  --accent-soft: rgba(56,224,166,.10);
  --maxw: 1180px;
  --pad: 28px;
  --nav-h: 76px;
  --r: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(.22,.7,.16,1);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
[data-theme="light"] {
  --bg:        #fbfbf9;
  --bg-2:      #f3f4f1;
  --surface:   #ffffff;
  --surface-2: #f5f6f4;
  --line:      #e7e8e4;
  --line-2:    #dcded9;
  --text:      #101316;
  --text-dim:  #4a505a;
  --text-mute: #868c95;
  --accent:    #10b981;
  --accent-dim:#0b7a5b;
  --accent-soft: rgba(16,185,129,.10);
}

/* ---------- Base ---------- */
html, body { min-height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}
/* one whisper-quiet ambient light, top-right */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(48vw 48vw at 88% -8%, var(--accent-soft), transparent 60%);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
p { color: var(--text-dim); }
strong { color: var(--text); font-weight: 600; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

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

/* eyebrow / kicker */
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--text-mute);
}
.kicker::before { content: ""; width: 22px; height: 1px; background: var(--accent); }
.kicker.dotted::before { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  padding: 13px 22px; border-radius: 100px; font-weight: 500; font-size: .92rem;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .25s var(--ease), background .25s, border-color .25s, color .25s;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #04130d; font-weight: 600; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-line { border-color: var(--line-2); color: var(--text); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-sm { padding: 9px 16px; font-size: .85rem; }
.btn-ghost { color: var(--text-dim); padding: 9px 4px; }
.btn-ghost:hover { color: var(--accent); }

/* link with animated arrow */
.lnk { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 500; }
.lnk .arr { transition: transform .25s var(--ease); color: var(--accent); }
.lnk:hover .arr { transform: translateX(5px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 100;
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s, height .3s;
}
.nav.scrolled { border-bottom-color: var(--line); height: 64px; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: -.01em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent); font-weight: 700; font-size: .82rem;
  font-family: var(--font-mono);
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  position: relative; padding: 8px 14px; font-size: .9rem; color: var(--text-dim);
  transition: color .2s;
}
.nav-links a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--text-dim); transition: .2s; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.menu-toggle { display: none; }

/* ---------- Section scaffold ---------- */
.section { padding: 120px 0; }
.section.tight { padding: 72px 0; }
.divider { height: 1px; background: var(--line); }
.head { max-width: 720px; margin-bottom: 60px; }
.head h2 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 18px 0 16px; font-weight: 600; }
.head p { font-size: 1.08rem; max-width: 620px; }
.idx { font-family: var(--font-mono); font-size: .78rem; color: var(--text-mute); letter-spacing: .1em; }

/* ---------- HERO ---------- */
.hero { position: relative; padding-top: calc(var(--nav-h) + 56px); padding-bottom: 72px; }
.hero-grid { display: grid; grid-template-columns: 1.5fr .85fr; gap: 64px; align-items: center; }
.hero .avail { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 30px; }
.hero .avail .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(56,224,166,.55); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(56,224,166,0); } 100% { box-shadow: 0 0 0 0 rgba(56,224,166,0); } }

.hero h1 {
  font-size: clamp(3.2rem, 11vw, 8rem);
  font-weight: 700; letter-spacing: -.045em; line-height: .92;
  margin-bottom: 26px;
}
.hero h1 .ln2 { display: block; color: var(--text-mute); }
[data-theme="light"] .hero h1 .ln2 { color: var(--line-2); }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-dim); max-width: 540px; margin-bottom: 16px; line-height: 1.5; }
.hero .lead b { color: var(--text); font-weight: 600; }
.hero .sub { font-size: .98rem; color: var(--text-mute); max-width: 520px; margin-bottom: 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 40px; }
.hero-socials { display: flex; gap: 8px; }
.hero-socials a { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--text-dim); transition: .2s; }
.hero-socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.hero-socials a svg { width: 18px; height: 18px; }

/* portrait — clean, single thin frame, no glow */
.portrait-wrap { position: relative; justify-self: center; width: 100%; max-width: 330px; }
.portrait {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center 20%;
  border-radius: var(--r-lg); border: 1px solid var(--line-2);
  filter: contrast(1.04) saturate(1.04);
  background: var(--surface);
}
.portrait-tag {
  position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 100px;
  padding: 11px 22px; box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.portrait-tag .v { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.portrait-tag .v small { display: block; font-family: var(--font-sans); font-weight: 400; font-size: .68rem; color: var(--text-mute); letter-spacing: .02em; }
.portrait-tag .sep { width: 1px; height: 26px; background: var(--line-2); }
[data-theme="light"] .portrait-tag { box-shadow: 0 12px 30px rgba(20,40,80,.10); }

/* ---------- Metrics strip ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); }
.metric { padding: 8px 28px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: none; padding-left: 0; }
.metric .n { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.03em; line-height: 1; }
.metric .l { color: var(--text-dim); font-size: .9rem; margin-top: 10px; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: 64px; align-items: start; }
.about-lead { font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-family: var(--font-display); font-weight: 500; letter-spacing: -.02em; line-height: 1.3; color: var(--text); }
.about-body p { font-size: 1.04rem; margin-bottom: 16px; }
.about-meta { margin-top: 26px; display: grid; gap: 0; }
.about-meta .row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.about-meta .row:last-child { border-bottom: 1px solid var(--line); }
.about-meta .k { color: var(--text-mute); font-family: var(--font-mono); font-size: .82rem; letter-spacing: .04em; }
.about-meta .vv { color: var(--text); text-align: right; font-weight: 500; }

/* ---------- Experience (editorial rows) ---------- */
.xp { border-top: 1px solid var(--line); }
.xp-row { display: grid; grid-template-columns: 96px 1fr; gap: 28px; padding: 34px 0; border-bottom: 1px solid var(--line); position: relative; transition: background .3s; }
.xp-row:hover { background: var(--surface); }
.xp-row .when { font-family: var(--font-mono); font-size: .8rem; color: var(--text-mute); padding-top: 5px; }
.xp-row .when .now { color: var(--accent); }
.xp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.xp-head .role { font-family: var(--font-display); font-weight: 600; font-size: 1.32rem; letter-spacing: -.02em; }
.xp-head .co { color: var(--accent); font-weight: 500; font-size: 1.05rem; }
.xp-head .loc { margin-left: auto; font-family: var(--font-mono); font-size: .76rem; color: var(--text-mute); }
.xp-row .desc { color: var(--text-dim); margin-top: 12px; font-size: 1rem; max-width: 760px; }
.xp-row .desc b { color: var(--text); }
.xp-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tg { font-family: var(--font-mono); font-size: .73rem; color: var(--text-mute); padding: 4px 11px; border: 1px solid var(--line); border-radius: 100px; transition: .2s; }
.xp-row:hover .tg { border-color: var(--line-2); color: var(--text-dim); }

/* compact list of older roles */
.xp-mini { display: grid; gap: 0; }
.xp-mini .m { display: grid; grid-template-columns: 96px 1fr auto; gap: 28px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline; transition: background .3s; }
.xp-mini .m:hover { background: var(--surface); }
.xp-mini .when { font-family: var(--font-mono); font-size: .8rem; color: var(--text-mute); }
.xp-mini .role { font-weight: 500; } .xp-mini .role .co { color: var(--accent); }
.xp-mini .loc { font-family: var(--font-mono); font-size: .76rem; color: var(--text-mute); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 64px; }
.skill-block { padding: 26px 0; border-top: 1px solid var(--line); }
.skill-block h3 { font-size: .82rem; font-family: var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-mute); font-weight: 500; margin-bottom: 18px; }
.skill-block .chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { font-size: .9rem; color: var(--text-dim); padding: 7px 13px; border: 1px solid var(--line); border-radius: 100px; transition: .2s; cursor: default; }
.chip:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* ---------- Work / app cards ---------- */
.group-label { display: flex; align-items: center; gap: 16px; margin: 0 0 28px; }
.group-label h3 { font-size: 1.5rem; font-weight: 600; }
.group-label .count { font-family: var(--font-mono); font-size: .8rem; color: var(--text-mute); }
.group-label .grow { flex: 1; height: 1px; background: var(--line); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(282px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; background: var(--surface);
  transition: transform .3s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-5px); border-color: var(--line-2); }
.card .top { aspect-ratio: 16/10; position: relative; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.card .top .glyph { font-size: 2.9rem; z-index: 2; transition: transform .35s var(--ease); }
.card:hover .top .glyph { transform: scale(1.14) rotate(-5deg); }
.card .top .mesh { position: absolute; inset: 0; opacity: .45; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; }
.card .body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card .body h4 { font-size: 1.12rem; font-weight: 600; margin-bottom: 7px; }
.card .body p { font-size: .9rem; line-height: 1.5; flex: 1; margin-bottom: 16px; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.card .acts { display: flex; gap: 9px; }
.card .acts .btn { flex: 1; }

/* ---------- Learning ---------- */
.learn { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.lc { border: 1px solid var(--line); border-radius: var(--r); padding: 26px; background: var(--surface); transition: transform .3s var(--ease), border-color .3s; }
.lc:hover { transform: translateY(-4px); border-color: var(--line-2); }
.lc h3 { display: flex; align-items: center; gap: 11px; font-size: 1.12rem; margin-bottom: 6px; font-weight: 600; }
.lc .emoji { font-size: 1.35rem; }
.lc > p { font-size: .9rem; margin-bottom: 18px; }
.res { display: grid; gap: 6px; }
.res a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; font-size: .9rem; color: var(--text-dim); border: 1px solid transparent; transition: .2s; }
.res a:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.res a .ico { color: var(--text-mute); flex: none; font-size: .85rem; width: 16px; text-align: center; }
.res a:hover .ico { color: var(--accent); }
.res a .arr { margin-left: auto; color: var(--accent); opacity: 0; transition: .2s; }
.res a:hover .arr { opacity: 1; }

.rm { border-top: 1px solid var(--line); }
.rm-row { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.rm-row .pn { font-family: var(--font-mono); font-size: .78rem; color: var(--accent); margin-bottom: 6px; letter-spacing: .08em; }
.rm-row .pt { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.rm-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Contact ---------- */
.contact { text-align: center; max-width: 760px; margin: 0 auto; }
.contact h2 { font-size: clamp(2.4rem, 7vw, 4.6rem); font-weight: 700; letter-spacing: -.04em; line-height: 1; margin-bottom: 26px; }
.contact h2 a { border-bottom: 2px solid var(--accent); transition: color .25s; }
.contact h2 a:hover { color: var(--accent); }
.contact p { font-size: 1.1rem; max-width: 520px; margin: 0 auto 34px; }
.contact-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer p { font-size: .86rem; color: var(--text-mute); }
.footer .fl { display: flex; gap: 22px; }
.footer .fl a { font-size: .86rem; color: var(--text-dim); transition: .2s; }
.footer .fl a:hover { color: var(--accent); }

/* ---------- Page hero (sub pages) ---------- */
.page-hero { padding-top: calc(var(--nav-h) + 60px); padding-bottom: 20px; }
.page-hero h1 { font-size: clamp(2.6rem, 8vw, 5rem); font-weight: 700; letter-spacing: -.04em; margin: 16px 0 18px; }
.page-hero p { font-size: 1.08rem; max-width: 640px; }
.crumb { display: flex; gap: 8px; font-family: var(--font-mono); font-size: .8rem; color: var(--text-mute); }
.crumb a:hover { color: var(--accent); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .07s; }
.reveal[data-delay="2"] { transition-delay: .14s; }
.reveal[data-delay="3"] { transition-delay: .21s; }
.reveal[data-delay="4"] { transition-delay: .28s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } html { scroll-behavior: auto; } .hero .avail .dot { animation: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .portrait-wrap { order: -1; max-width: 280px; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .skills { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 720px) {
  :root { --pad: 20px; }
  .section { padding: 84px 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 28px 0; }
  .metric { border-left: none; padding: 0; }
  .metric:nth-child(even) { border-left: 1px solid var(--line); padding-left: 24px; }
  .xp-row { grid-template-columns: 1fr; gap: 8px; }
  .xp-head .loc { margin-left: 0; width: 100%; }
  .xp-mini .m { grid-template-columns: 1fr; gap: 4px; }
  .rm-row { grid-template-columns: 1fr; gap: 12px; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 16px 20px 24px; transform: translateY(-130%); transition: transform .35s var(--ease); }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 13px 12px; font-size: 1.05rem; }
  .menu-toggle { display: grid; }
  .desktop-cta { display: none; }
}
