/* ==========================================================================
   Dhruv Nailwal — Portfolio
   Shared stylesheet for all pages.

   Design language
   ----------------
   A premium, editorial dark theme that reads as intentionally crafted:
   deep warm-charcoal surfaces, soft neutral ink, and a single refined gold
   accent used with restraint. Strong typographic hierarchy (Space Grotesk
   for display, IBM Plex Sans for body, Plex Mono for data/labels), generous
   whitespace, hairline borders instead of glow, and flat editorial lists in
   supporting sections so the page never collapses into a sea of floating
   boxes.

   Core principle: not every element is a card. Primary content (projects,
   experience, achievements, jump links, values) uses subtle bordered
   surfaces; supporting lists (skills, education, facts, contact info) are
   flat rows separated by hairlines. This creates real visual hierarchy.

   Mobile-first: base styles target small screens; layout scales up via
   min-width queries. Breakpoints: 520, 600, 700, 768, 900, 1024.
   ========================================================================== */

:root {
  /* Surfaces — deep warm charcoal (neutral, not blue) */
  --bg: #0b0c0f;
  --bg-elev: #111317;             /* section alt background */
  --bg-soft: rgba(255, 255, 255, 0.03);
  --card: #131519;
  --card-hover: #16181d;
  --line: #23262d;                /* hairline */
  --line-strong: #2e323a;

  /* Accent — refined gold, used sparingly */
  --accent: #c8a24a;
  --accent-hover: #d6b45e;
  --accent-soft: #e8d296;
  --accent-ink: #171207;
  --accent-wash: rgba(200, 162, 74, 0.09);
  --line2: rgba(200, 162, 74, 0.32);

  /* Ink — soft neutrals */
  --ink: #eef0f3;
  --ink2: #9ba3af;
  --ink3: #5f6773;
  --ink4: #464c56;

  /* Semantic */
  --green: #66bb93;
  --red: #e0716f;
  --text: var(--ink);
  --text2: var(--ink2);
  --text3: var(--ink3);
  --border: var(--line);
  --border2: var(--line2);

  /* Brand icon colors */
  --github: #cdd3da;
  --linkedin: #5c9bd0;
  --leetcode: #d9bd6e;
  --hackerrank: #66bb93;
  --gfg: #66bb93;

  /* Type */
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* Touch targets / radii */
  --tap: 44px;
  --r-sm: 6px;
  --r-md: 10px;

  /* Layout */
  --container: 1120px;
  --section-pad: clamp(4rem, 8vw, 6.5rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100% }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
}
::selection { background: var(--accent-wash); color: var(--accent-soft) }
::-webkit-scrollbar { width: 4px }
::-webkit-scrollbar-track { background: var(--bg) }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px }
::-webkit-scrollbar-thumb:hover { background: var(--ink4) }
img { max-width: 100%; height: auto; display: block }
a { color: inherit }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }

/* ===== LOADER (home only) ===== */
#loader {
  position: fixed; inset: 0; background: var(--bg); z-index: 9999;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1.25rem;
  transition: opacity .5s;
}
#loader.hide { opacity: 0; pointer-events: none }
.loader-logo { font-family: var(--display); font-size: 1.4rem; font-weight: 600; color: var(--ink); letter-spacing: .02em }
.loader-logo .hl { color: var(--accent) }
.loader-bar { width: min(200px, 60vw); height: 2px; background: var(--line); border-radius: 1px; overflow: hidden }
.loader-fill { height: 100%; width: 0; background: var(--accent); animation: loadfill 1s cubic-bezier(.4, 0, .2, 1) forwards }
@keyframes loadfill { to { width: 100% } }

/* ===== SCROLL PROGRESS ===== */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 200; pointer-events: none }

/* ===== NAV ===== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 0 1.25rem;
  height: 66px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: background .3s ease, border-color .3s ease, height .3s ease;
  border-bottom: 1px solid transparent;
}
.nav-inner {
  width: 100%; max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
#navbar.scrolled {
  background: rgba(11, 12, 15, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  font-family: var(--display); font-weight: 600; font-size: 1.02rem;
  color: var(--ink); text-decoration: none; letter-spacing: .01em;
  white-space: nowrap;
}
.nav-logo .hl { color: var(--accent) }
.nav-links { display: none; align-items: center; gap: 2rem; list-style: none }
.nav-links a {
  color: var(--ink2); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: color .2s; position: relative;
  padding: .5rem 0;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px; background: var(--accent); transition: width .25s;
}
.nav-links a:hover { color: var(--ink) }
.nav-links a:hover::after { width: 100% }
.nav-links a.active { color: var(--ink) }
.nav-links a.active::after { width: 100% }
.nav-actions { display: flex; align-items: center; gap: .9rem }
.btn-nav {
  display: none;
  background: var(--accent); border: none; border-radius: var(--r-sm);
  padding: .5rem 1.15rem; min-height: 38px;
  cursor: pointer; color: var(--accent-ink); font-size: .86rem; font-weight: 600;
  font-family: var(--sans); text-decoration: none;
  transition: background .2s;
}
.btn-nav:hover { background: var(--accent-hover) }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  margin-right: -.4rem;
  background: none; border: 1px solid var(--line); cursor: pointer;
  color: var(--ink); font-size: 1.55rem; line-height: 1;
  border-radius: var(--r-sm);
  transition: color .2s, border-color .2s, transform .2s;
  font-family: var(--sans);
}
.nav-toggle:hover { color: var(--accent); border-color: var(--line-strong) }
.nav-toggle[aria-expanded="true"] { color: var(--accent) }

/* Full-screen mobile menu */
.nav-mobile {
  position: fixed; inset: 0; z-index: 900;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(.9rem, 3.5vh, 1.6rem);
  padding: 5.5rem 1.5rem 3rem;
  overflow-y: auto;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s;
}
.nav-mobile.open { opacity: 1; visibility: visible; transition: opacity .25s ease }
.nav-mobile a {
  font-family: var(--display); font-size: clamp(1.25rem, 5vw, 1.5rem);
  font-weight: 500; color: var(--ink2); text-decoration: none;
  padding: .4rem 1.25rem; transition: color .2s;
}
.nav-mobile a:hover, .nav-mobile a.active { color: var(--accent) }
body.menu-open { overflow: hidden }
body.menu-open #navbar { background: var(--bg); border-bottom-color: transparent }
body.menu-open .nav-toggle { color: var(--accent) }

@media (min-width: 768px) {
  #navbar { padding: 0 2rem; height: 72px }
  .nav-links { display: flex }
  .btn-nav { display: inline-flex; align-items: center }
  .nav-toggle { display: none }
  .nav-mobile { display: none }
}
@media (min-width: 768px) and (max-width: 949px) {
  .nav-links { gap: 1.4rem }
  .nav-links a { font-size: .87rem }
}

/* ===== PAGE SCAFFOLD ===== */
section { padding: var(--section-pad) 1.25rem; scroll-margin-top: 5rem }
.container { width: 100%; max-width: var(--container); margin: 0 auto }
.section-intro { margin-bottom: clamp(2.5rem, 6vw, 3.5rem); max-width: 620px }
.page-head { padding-top: calc(5.5rem + 24px) }
.section-label {
  display: block;
  font-family: var(--mono); font-size: .74rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .22em; color: var(--accent);
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--display); font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin-bottom: .9rem;
  line-height: 1.12;
}
.section-desc { color: var(--ink2); font-size: 1.02rem; line-height: 1.75 }
.section-subtitle { color: var(--ink2); font-size: 1rem; line-height: 1.75 }
.divider { height: 1px; background: var(--line); border: 0 }
.section-alt { background: var(--bg-elev) }

@media (min-width: 520px) { section { padding: calc(var(--section-pad) * .85) 1.75rem } }
@media (min-width: 768px) {
  section { padding: var(--section-pad) 2rem; scroll-margin-top: 5rem }
  .page-head { padding-top: calc(6.5rem + 24px) }
}

/* ===== SHARED SURFACES ===== */
/* Primary content surfaces — subtle bordered boxes. Not everything gets one. */
.box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
}
.box-hover { transition: border-color .2s, background .2s, transform .2s }
.box-hover:hover { border-color: var(--line-strong); background: var(--card-hover) }

/* Hairline list row used for flat, editorial supporting content */
.row-list { border-top: 1px solid var(--line) }
.row-item {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.05rem 0; border-bottom: 1px solid var(--line);
}

/* ===== HERO ===== */
#hero {
  min-height: 100svh; display: flex; align-items: center; justify-content: center;
  position: relative; padding: 6.5rem 1.25rem 3rem; overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, black, transparent);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, black, transparent);
}
.hero-inner {
  max-width: var(--container); width: 100%; position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3rem;
}
.hero-content { display: flex; flex-direction: column; gap: 1.25rem; align-items: center; text-align: center; width: 100% }
.hero-badge {
  display: inline-flex; align-items: center; gap: .6rem;
  border: 1px solid var(--line); border-radius: 100px; background: var(--bg-soft);
  padding: .4rem 1rem;
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); width: fit-content;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green) }
.hero-name {
  font-family: var(--display); font-size: clamp(2.7rem, 12vw, 5rem);
  font-weight: 600; line-height: 1.02; letter-spacing: -0.03em; color: var(--ink);
  text-wrap: balance;
}
.hero-name .accent { color: var(--accent) }
.hero-tagline {
  font-size: clamp(.92rem, 2.6vw, 1.05rem); color: var(--ink2);
  font-family: var(--mono); font-weight: 500; min-height: 1.8rem;
}
.hero-tagline::after {
  content: ''; display: inline-block; width: 8px; height: 1.05em; margin-left: 4px;
  vertical-align: middle; background: var(--accent); animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0 } }
.hero-desc { font-size: 1.02rem; color: var(--ink2); max-width: 560px; line-height: 1.8 }
.hero-btns { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; width: 100%; max-width: 330px }
.btn-primary, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .8rem 1.6rem; border-radius: var(--r-sm);
  font-size: .95rem; font-weight: 600; text-align: center;
  text-decoration: none; transition: transform .15s, background .2s, border-color .2s, color .2s;
  font-family: var(--sans); line-height: 1.2;
}
.btn-primary {
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-1px) }
.btn-primary:active { transform: translateY(0) }
.btn-outline {
  background: transparent; color: var(--ink); border: 1px solid var(--line-strong);
  font-weight: 500;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-soft) }
.btn i { font-size: .9em }
.btn-outline .go { color: var(--accent); font-size: .85em }

/* Stats */
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 1.4rem; width: 100%; max-width: 480px; margin-top: .4rem }
.hero-stat { display: flex; flex-direction: column; gap: .2rem; text-align: center }
.hero-stat-num { font-family: var(--display); font-size: clamp(1.6rem, 6vw, 2rem); font-weight: 600; color: var(--ink); letter-spacing: -0.02em }
.hero-stat-label { font-family: var(--mono); font-size: .62rem; color: var(--ink3); text-transform: uppercase; letter-spacing: .06em; line-height: 1.5 }

/* Hero portrait */
.hero-photo {
  position: relative; order: -1; width: min(250px, 76vw); margin: 0 auto;
}
.hero-photo .frame {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  background: var(--card);
}
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; display: block }
.hero-photo-caption {
  margin-top: .9rem; text-align: center;
  font-family: var(--mono); font-size: .68rem; color: var(--ink3);
  letter-spacing: .07em; text-transform: uppercase;
}

@media (min-width: 520px) {
  .hero-btns { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; width: auto; max-width: none }
  .hero-content { flex-direction: column }
}
@media (min-width: 768px) {
  #hero { padding: 8rem 2rem 4rem }
  .hero-stats { grid-template-columns: repeat(4, auto); justify-content: center; gap: 2.4rem; max-width: none }
  .hero-photo { width: min(300px, 80%) }
}
@media (min-width: 900px) {
  .hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(3rem, 6vw, 5rem); align-items: center }
  .hero-content { align-items: flex-start; text-align: left }
  .hero-badge { margin-left: 0 }
  .hero-photo { order: 0; width: min(340px, 100%); justify-self: center }
  .hero-stats { grid-template-columns: repeat(4, 1fr); justify-content: stretch; gap: 1rem; margin-top: 1rem }
  .hero-stat { text-align: left }
}

/* About-page portrait */
.about-photo { position: relative; width: min(260px, 76vw); margin: 0 auto; align-self: center }
.about-photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top;
  display: block; border-radius: var(--r-md); border: 1px solid var(--line);
}

/* ===== ABOUT ===== */
.about-layout { display: flex; flex-direction: column; gap: 2.5rem; align-items: center }
.about-text > p { color: var(--ink2); font-size: 1rem; line-height: 1.85; margin-bottom: 1.1rem }
.about-text > p:last-child { margin-bottom: 0 }
.about-highlights { display: flex; flex-direction: column; margin-top: 1.8rem; border-top: 1px solid var(--line) }
.about-hl {
  display: flex; align-items: center; gap: 1rem; padding: .95rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink2); font-size: .9rem; line-height: 1.5;
}
.about-hl-icon {
  width: 38px; height: 38px; border-radius: 8px; background: var(--bg-soft);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: .9rem; flex-shrink: 0;
}
.about-hl a { color: var(--accent); text-decoration: none }
.about-hl a:hover { text-decoration: underline }
.about-values { display: grid; grid-template-columns: 1fr; gap: .9rem; margin-top: 3rem }
.about-val { padding: 1.25rem 1.3rem }
.about-val:hover { border-color: var(--line-strong); transform: translateY(-2px) }
.about-val-title { font-family: var(--display); font-size: .98rem; font-weight: 600; color: var(--ink); margin-bottom: .35rem }
.about-val-title i { color: var(--accent); margin-right: .55rem; font-size: .9rem }
.about-val-text { font-size: .82rem; color: var(--ink3); line-height: 1.6 }
.currently-learning {
  background: var(--accent-wash); border: 1px dashed var(--line2); border-radius: var(--r-md);
  padding: 1.2rem 1.3rem; margin-top: 1.8rem;
}
.cl-title {
  font-family: var(--mono); font-size: .72rem; color: var(--accent-soft);
  font-weight: 500; text-transform: uppercase; letter-spacing: .14em; margin-bottom: .8rem;
}
.cl-tags { display: flex; flex-wrap: wrap; gap: .5rem }
.tag {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink2);
  padding: .3rem .85rem; border-radius: 100px; min-height: 32px;
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  transition: border-color .2s, color .2s;
}
.tag:hover { border-color: var(--line2); color: var(--accent-soft) }

@media (min-width: 600px) { .about-values { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (min-width: 900px) {
  .about-layout { display: grid; grid-template-columns: 300px 1fr; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: start }
  .about-photo { align-self: start; width: 100%; position: sticky; top: 6.5rem }
}

/* ===== HOME JUMP LINKS ===== */
.jump-grid { display: grid; grid-template-columns: 1fr; gap: 1rem }
.jump-card {
  display: block; padding: 1.6rem 1.5rem; text-decoration: none;
  display: flex; flex-direction: column; gap: .6rem;
}
.jump-card:hover { border-color: var(--line-strong); transform: translateY(-3px) }
.jump-card-kicker { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink3) }
.jump-card-title { font-family: var(--display); font-weight: 600; font-size: 1.12rem; color: var(--ink) }
.jump-card-desc { font-size: .86rem; color: var(--ink2); line-height: 1.7; flex: 1 }
.jump-card-go {
  font-size: .84rem; color: var(--ink3); padding-top: .4rem;
  display: inline-flex; align-items: center; gap: .4rem; transition: color .2s;
  font-weight: 500;
}
.jump-card:hover .jump-card-go { color: var(--accent) }
.jump-card-go .go { color: var(--accent); transition: transform .2s }
.jump-card:hover .jump-card-go .go { transform: translateX(4px) }

@media (min-width: 600px) { .jump-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (min-width: 1024px) { .jump-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) } }

/* ===== EDUCATION (flat timeline) ===== */
.edu-timeline { position: relative; border-top: 1px solid var(--line) }
.edu-item {
  display: grid; grid-template-columns: auto 1fr; gap: 1.2rem;
  padding: 1.6rem 0 1.6rem 0; border-bottom: 1px solid var(--line);
  align-items: start;
}
.edu-dot {
  width: 30px; height: 30px; border-radius: 50%; background: var(--bg);
  border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: .72rem; color: var(--accent); margin-top: .15rem;
}
.edu-meta { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; margin-bottom: .45rem }
.edu-school { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--ink) }
.edu-duration { font-family: var(--mono); font-size: .7rem; color: var(--ink3); background: var(--bg-soft); padding: .22rem .65rem; border-radius: 100px }
.edu-degree { font-size: .9rem; color: var(--ink2); margin-bottom: .5rem }
.edu-grade { font-size: .82rem; color: var(--ink2) }
.edu-cur { color: var(--accent) }
.edu-item.current .edu-school::after { content: ''; display:inline-block; width:6px;height:6px;border-radius:50%;background:var(--green);margin-left:.55rem;vertical-align:middle }
.edu-courses { margin-top: .85rem; display: flex; flex-wrap: wrap; gap: .4rem }
.edu-course {
  font-size: .72rem; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink2);
  padding: .24rem .65rem; border-radius: 5px; transition: border-color .2s, color .2s;
}
.edu-course:hover { border-color: var(--line2); color: var(--accent-soft) }

@media (min-width: 600px) {
  .edu-meta { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem }
}

/* ===== SKILLS ===== */
.skills-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem }
.skill-cat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 1.5rem 1.4rem;
  transition: border-color .2s, background .2s, transform .2s;
}
.skill-cat:hover { border-color: var(--line-strong); background: var(--card-hover); transform: translateY(-2px) }
.skill-cat-title {
  font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--ink);
  margin-bottom: 1.1rem; display: flex; align-items: center; gap: .7rem;
}
.skill-cat-icon {
  width: 32px; height: 32px; border-radius: 8px; background: var(--bg-soft);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: var(--accent); flex-shrink: 0;
}
.skill-items { display: flex; flex-direction: column; gap: .75rem }
.skill-item { display: flex; align-items: center; padding: 0; border: 0 }
.skill-name { font-size: .9rem; color: var(--ink2) }
.skill-badges { display: flex; flex-wrap: wrap; gap: .45rem }
.badge {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink2);
  padding: .3rem .75rem; border-radius: 100px;
  font-family: var(--mono); font-size: .7rem;
  transition: border-color .2s, color .2s;
}
.badge:hover { border-color: var(--line2); color: var(--accent-soft) }

@media (min-width: 560px) { .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (min-width: 900px) { .skills-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem } }

/* ===== CODING PROFILES ===== */
.profiles-grid { display: grid; grid-template-columns: 1fr; gap: 1rem }
.profile-card { padding: 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .9rem; text-decoration: none; color: inherit; min-width: 0 }
.profile-card:hover { border-color: var(--line-strong); transform: translateY(-3px) }
.profile-icon {
  width: 46px; height: 46px; border-radius: 9px; background: var(--bg-soft);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--ink2); font-size: 1.2rem;
}
.profile-head { display: flex; align-items: center; gap: .9rem }
.profile-name { font-family: var(--display); font-weight: 600; font-size: .98rem; color: var(--ink) }
.profile-user { font-size: .72rem; color: var(--ink3); font-family: var(--mono); overflow-wrap: anywhere; margin-top: .1rem }
.profile-desc { font-size: .8rem; color: var(--ink3); line-height: 1.6 }
.profile-btn {
  margin-top: auto; font-size: .8rem; color: var(--ink3);
  display: inline-flex; align-items: center; gap: .4rem; padding-top: .3rem; transition: color .2s;
  font-weight: 500; width: fit-content;
}
.profile-card:hover .profile-btn { color: var(--accent) }
.profile-btn .go { color: var(--accent); transition: transform .2s }
.profile-card:hover .profile-btn .go { transform: translateX(4px) }

.profile-icon.c-github { color: var(--github) }
.profile-icon.c-leetcode { color: var(--leetcode) }
.profile-icon.c-hackerrank { color: var(--hackerrank) }
.profile-icon.c-linkedin { color: var(--linkedin) }
.profile-icon.c-gfg { color: var(--gfg) }

@media (min-width: 560px) { .profiles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (min-width: 900px) { .profiles-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) } }

/* ===== PROJECTS ===== */
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem }
.project-card { overflow: hidden; display: flex; flex-direction: column; min-width: 0 }
.project-card:hover { border-color: var(--line-strong); transform: translateY(-3px) }
.project-img {
  height: 180px; background: var(--bg-elev); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.project-img img { width: 100%; height: 100%; object-fit: cover }
.project-body { padding: 1.4rem 1.4rem 1.2rem; flex: 1; display: flex; flex-direction: column; gap: .85rem }
.project-title { font-family: var(--display); font-weight: 600; font-size: 1.12rem; color: var(--ink) }
.project-desc { font-size: .84rem; color: var(--ink2); line-height: 1.7; flex: 1 }
.project-tech { display: flex; flex-wrap: wrap; gap: .35rem }
.tech-tag {
  font-size: .7rem; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink2);
  padding: .2rem .6rem; border-radius: 100px; font-family: var(--mono);
  transition: border-color .2s, color .2s;
}
.tech-tag:hover { border-color: var(--line2); color: var(--accent-soft) }
.project-links {
  display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: .3rem;
  border-top: 1px solid var(--line); padding-top: .95rem;
}
.project-link {
  font-size: .84rem; color: var(--ink2); text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: calc(var(--tap) - 14px); font-weight: 500;
  transition: color .2s;
}
.project-link i { color: var(--accent); font-size: .8rem }
.project-link:hover { color: var(--accent) }

@media (min-width: 700px) {
  .projects-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) }
}

/* ===== ACHIEVEMENTS ===== */
.ach-outline { font-family: var(--display); font-weight: 600; font-size: 1.5rem; color: var(--ink); margin-bottom: .5rem; display: flex; align-items: center; gap: .6rem }
.ach-outline i { color: var(--accent); font-size: 1.1rem }
.ach-outline-sub { color: var(--ink2); margin-bottom: 2rem; max-width: 640px }
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.1rem }
.ach-card {
  padding: 0; display: flex; flex-direction: column; gap: 0; cursor: pointer; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color .2s, background .2s, transform .2s;
}
.ach-card:hover { border-color: var(--line-strong); background: var(--card-hover); transform: translateY(-2px) }
.ach-head {
  display: flex; align-items: flex-start; gap: 1rem; width: 100%;
  padding: 1.4rem 1.4rem;
}
.ach-icon {
  width: 46px; height: 46px; border-radius: 9px; background: var(--bg-soft);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; color: var(--accent); flex-shrink: 0;
}
.ach-content { flex: 1; min-width: 0 }
.ach-title { font-family: var(--display); font-weight: 600; font-size: 1rem; color: var(--ink); margin-bottom: .35rem }
.ach-desc { font-size: .82rem; color: var(--ink3); line-height: 1.6 }
.ach-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--mono); font-size: .68rem; margin-top: .7rem;
  padding: .3rem .7rem; border-radius: 5px; font-weight: 500;
}
.ach-badge.gold { background: var(--accent-wash); color: var(--accent-soft); border: 1px solid var(--line2) }
.ach-badge.blue, .ach-badge.silver { background: var(--bg-soft); color: var(--ink2); border: 1px solid var(--line) }
.ach-badge .chev { font-size: .7em; transition: transform .25s }
.ach-card.open .ach-head .ach-badge .chev { transform: rotate(180deg) }
.ach-panel { max-height: 0; overflow: hidden; margin-top: 0; transition: max-height .45s ease; padding: 0 1.4rem }
.ach-panel.open { max-height: 4600px; margin-top: 0; border-top: 1px solid var(--line); padding: 1.25rem 1.4rem 1.5rem }
.ach-panel p { color: var(--ink2); font-size: .85rem; line-height: 1.7 }
.ach-entry { margin-bottom: 1.75rem }
.ach-entry:last-child { margin-bottom: 0 }
.ach-entry + .ach-entry { border-top: 1px solid var(--line); padding-top: 1.75rem }
.ach-entry-title { font-family: var(--display); font-weight: 600; font-size: 1.08rem; color: var(--accent-soft); margin-bottom: .3rem; display: flex; align-items: center; gap: .5rem }
.ach-entry-title.gold { color: var(--accent) }
.ach-entry-title i { font-size: .9rem }
.ach-entry img {
  width: 100%; max-width: 440px; border-radius: var(--r-md);
  border: 1px solid var(--line); margin-top: .85rem; background: var(--bg-elev);
}

/* ===== EXPERIENCE ===== */
.exp-timeline { display: flex; flex-direction: column; gap: 1.25rem }
.exp-item { padding: 1.6rem 1.5rem; display: grid; grid-template-columns: auto 1fr; gap: 1.15rem; align-items: flex-start }
.exp-logo {
  width: 52px; height: 52px; border-radius: 10px; background: var(--bg-soft);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.exp-logo img { width: 100%; height: 100%; object-fit: cover }
.exp-header { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; margin-bottom: .7rem }
.exp-role { font-family: var(--display); font-weight: 600; font-size: 1.08rem; color: var(--ink) }
.exp-org { font-size: .88rem; color: var(--ink2) }
.exp-duration {
  font-family: var(--mono); font-size: .7rem; color: var(--ink3);
  background: var(--bg-soft); padding: .24rem .7rem; border-radius: 100px;
}
.exp-desc { font-size: .86rem; color: var(--ink2); line-height: 1.75; margin-bottom: .95rem }
.exp-tags { display: flex; flex-wrap: wrap; gap: .35rem }
.exp-tag {
  font-size: .7rem; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink3);
  padding: .24rem .6rem; border-radius: 100px; font-family: var(--mono);
}

@media (min-width: 600px) {
  .exp-timeline { gap: 1.25rem }
  .exp-header { flex-direction: row; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .6rem }
  .exp-duration { white-space: nowrap }
}

/* ===== FUN FACTS (flat editorial grid) ===== */
.facts-grid { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line) }
.fact-card { padding: 1.5rem 0; border-bottom: 1px solid var(--line) }
.fact-emoji { font-size: 1.4rem; margin-bottom: .75rem; color: var(--accent-soft) }
.fact-text { font-size: .88rem; color: var(--ink2); line-height: 1.65; max-width: 40ch }

@media (min-width: 600px) { .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem } }
@media (min-width: 900px) { .facts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 3rem } }

/* ===== CONTACT ===== */
.contact-grid { display: flex; flex-direction: column; gap: 3rem; align-items: stretch }
.contact-info { display: flex; flex-direction: column; border-top: 1px solid var(--line) }
.contact-item { display: flex; align-items: flex-start; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line) }
.contact-icon {
  width: 42px; height: 42px; border-radius: 9px; background: var(--bg-soft);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: .95rem; flex-shrink: 0;
}
.contact-label { font-size: .68rem; color: var(--ink3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .2rem }
.contact-value { font-size: .92rem; color: var(--ink); overflow-wrap: anywhere }
.social-links { display: flex; align-items: center; justify-content: flex-start; gap: 12px; flex-wrap: wrap; margin-top: 1.6rem }
.social-btn {
  width: 46px; height: 46px; border-radius: 9px; background: var(--bg-soft);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--ink2); text-decoration: none; transition: border-color .2s, color .2s, transform .15s; cursor: pointer;
}
.social-btn i { font-size: 1.05rem }
.social-btn:hover { border-color: var(--accent); color: var(--accent-soft); transform: translateY(-2px) }

/* Form */
.contact-form {
  display: flex; flex-direction: column; gap: 1.05rem; width: 100%;
  padding: 2rem 1.6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 1.05rem }
.form-group { display: flex; flex-direction: column; gap: .45rem }
.form-label { font-size: .84rem; color: var(--ink2); font-weight: 500 }
.form-label .req { color: var(--accent) }
.form-input {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .85rem 1rem; min-height: 50px;
  color: var(--ink); font-size: 1rem; /* >=16px prevents iOS focus zoom */
  font-family: var(--sans); outline: none; resize: none;
  transition: border-color .2s, background .2s;
}
.form-input::placeholder { color: var(--ink3) }
.form-input:focus { border-color: var(--accent); background: var(--bg) }
.form-input:hover:not(:focus) { border-color: var(--line-strong) }
.contact-form .btn-primary { width: 100% }
#formMsg { min-height: 1.4rem }

@media (min-width: 520px) { .form-row { grid-template-columns: 1fr 1fr; gap: 1rem } }
@media (min-width: 768px) {
  .contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 4rem); align-items: start }
  .social-links { justify-content: flex-start }
}

/* ===== FOOTER ===== */
footer { background: var(--bg-elev); border-top: 1px solid var(--line); padding: 3rem 1.25rem 2rem }
.footer-inner { max-width: var(--container); margin: 0 auto }
.footer-top {
  display: flex; flex-direction: column; gap: 1.6rem;
  padding-bottom: 2rem; border-bottom: 1px solid var(--line);
}
.footer-brand { max-width: 380px; display: flex; flex-direction: column; gap: .8rem }
.footer-logo { font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--ink); text-decoration: none }
.footer-logo .hl { color: var(--accent) }
.footer-tagline { font-family: var(--mono); font-size: .7rem; color: var(--ink3); letter-spacing: .06em; text-transform: uppercase; line-height: 1.7 }
.footer-nav { display: flex; flex-wrap: wrap; gap: .35rem 1.4rem }
.footer-nav a {
  font-size: .86rem; color: var(--ink2); text-decoration: none; transition: color .2s;
  padding: .35rem .1rem;
}
.footer-nav a:hover, .footer-nav a.active { color: var(--accent-soft) }
.footer-copy {
  margin-top: 1.75rem;
  font-family: var(--mono); font-size: .72rem; color: var(--ink3);
  text-align: center; line-height: 1.8;
}
.footer-copy a { color: var(--ink2); text-decoration: none }
.footer-copy a:hover { color: var(--accent) }

@media (min-width: 600px) { footer { padding: 3.5rem 2rem 2rem } }
@media (min-width: 768px) {
  .footer-top { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 2.5rem }
  .footer-nav { max-width: 460px; justify-content: flex-end }
}

/* ===== SCROLL TO TOP ===== */
#scrolltop {
  position: fixed; bottom: 1.25rem; right: 1.25rem;
  width: 44px; height: 44px;
  border-radius: 9px; background: var(--bg-elev); border: 1px solid var(--line-strong); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink2); font-size: 1.05rem;
  opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s, color .2s, border-color .2s; z-index: 50;
}
#scrolltop.show { opacity: 1; transform: translateY(0) }
#scrolltop:hover { color: var(--accent); border-color: var(--accent) }
@media (min-width: 768px) { #scrolltop { bottom: 2rem; right: 2rem } }

/* ===== ANIMATIONS ===== */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease }
.fade-in.visible { opacity: 1; transform: none }
.fade-left { opacity: 0; transform: translateX(-16px); transition: opacity .6s ease, transform .6s ease }
.fade-left.visible { opacity: 1; transform: none }
.stagger-1 { transition-delay: .08s }
.stagger-2 { transition-delay: .16s }
.stagger-3 { transition-delay: .24s }
.stagger-4 { transition-delay: .32s }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important }
  .fade-in, .fade-left { opacity: 1; transform: none }
}
