/* ==========================================================================
   Anurag G.C. — portfolio
   Lightweight, dependency-free stylesheet.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #556070;
  --border: #e3e8f0;
  --accent: #1d4ed8;
  --accent-soft: #e8eefc;
  --accent-contrast: #ffffff;
  --halo-1: #dbe6ff;
  --halo-2: #b9cdfb;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);

  --radius: 14px;
  --container: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --surface: #0f1829;
    --card: #121c30;
    --text: #e6ebf3;
    --muted: #9aa6b8;
    --border: #1f2a40;
    --accent: #7aa2ff;
    --accent-soft: #18264a;
    --accent-contrast: #0b1220;
    --halo-1: #1a2950;
    --halo-2: #2a4285;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #0f1829;
  --card: #121c30;
  --text: #e6ebf3;
  --muted: #9aa6b8;
  --border: #1f2a40;
  --accent: #7aa2ff;
  --accent-soft: #18264a;
  --accent-contrast: #0b1220;
  --halo-1: #1a2950;
  --halo-2: #2a4285;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--accent-contrast);
  padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  font-weight: 600; font-size: .975rem; line-height: 1;
  border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--card); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 9px 14px; font-size: .9rem; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* theme icons */
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted); font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px;
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.header__actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 80px; }
.hero__grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-block; margin-bottom: 18px;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 6px 12px; border-radius: 999px;
}
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 18px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.lead strong { color: var(--text); font-weight: 600; }

.highlights { margin: 22px 0 30px; display: grid; gap: 8px; }
.highlights li { display: flex; align-items: center; gap: 10px; font-size: .98rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.social { display: flex; gap: 8px; margin-top: 28px; }
.social a {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 10px; border: 1px solid var(--border); color: var(--muted);
  transition: color .15s, border-color .15s;
}
.social a:hover { color: var(--accent); border-color: var(--accent); }

/* Portrait: head pops out above a halo circle, shoulders clipped to its curve */
.hero__photo { display: flex; justify-content: center; }
.photo-frame {
  --s: clamp(240px, 30vw, 360px);
  position: relative; width: var(--s); height: calc(var(--s) * 1.2);
}
.photo-frame::before {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--halo-1), var(--halo-2));
}
.photo-frame img {
  position: relative; width: 100%; height: 100%; object-fit: cover; object-position: bottom;
  border-radius: 0 0 calc(var(--s) / 2) calc(var(--s) / 2);
}

/* ---------- sections ---------- */
.section { padding: 88px 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__title {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: 36px;
}
.section__title span { font-size: .9rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* about */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: start; }
.about p { color: var(--muted); font-size: 1.08rem; }
.facts {
  margin: 0; display: grid; gap: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px 22px;
}
.facts div { padding: 14px 0; border-bottom: 1px solid var(--border); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }

/* timeline */
.timeline { position: relative; display: grid; gap: 28px; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border);
}
.timeline__item { position: relative; }
.timeline__item::before {
  content: ""; position: absolute; left: -28px; top: 7px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent);
}
.timeline__head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.timeline__head h3 { font-size: 1.2rem; }
.timeline__head h4 { font-size: 1.05rem; }
.date { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.org { color: var(--accent); font-weight: 600; font-size: .97rem; margin: 4px 0 8px; }
.timeline__item ul li, .entry ul li { position: relative; padding-left: 18px; color: var(--muted); margin-bottom: 4px; }
.timeline__item ul li::before {
  content: ""; position: absolute; left: 2px; top: .7em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .6;
}

/* projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); }
.card--featured { grid-column: 1 / -1; background: linear-gradient(135deg, var(--accent-soft), var(--card) 70%); }
.card__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 24px; }
.card__top .date:only-child { margin-left: auto; }
.card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card--featured h3 { font-size: 1.4rem; }
.card p { color: var(--muted); font-size: .98rem; }
.card .tags { margin-top: auto; }
.card__link { margin-top: 16px; font-weight: 600; font-size: .95rem; align-self: flex-start; }
.badge {
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-contrast); padding: 4px 10px; border-radius: 999px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: .82rem; font-weight: 500; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
}
.more { margin: 28px 0 0; font-weight: 600; }

/* skills */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.skill-group {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.skill-group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }

/* education & recognition */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.sub {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  padding-bottom: 10px; border-bottom: 1px solid var(--border); margin: 0 0 18px;
}
.entry + .sub, .entry ~ .sub { margin-top: 36px; }
.entry { margin-bottom: 20px; }
.entry p:last-child { margin-bottom: 0; }
.entry .muted { font-size: .97rem; margin-top: 6px; }

/* contact */
.contact { text-align: center; max-width: 760px; }
.contact .section__title { justify-content: center; }
.contact .lead { margin: 0 auto 28px; }
.contact__links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.contact__social { display: flex; justify-content: center; gap: 24px; margin-top: 26px; font-weight: 600; }

/* footer */
.footer { padding: 28px 0; color: var(--muted); font-size: .92rem; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .skills { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .header__actions { margin-left: auto; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px; font-size: 1rem; }

  .hero { padding: 40px 0 56px; }
  .hero__grid { grid-template-columns: 1fr; gap: 28px; }
  .hero__photo { order: -1; }
  .photo-frame { --s: 220px; }
  .about, .two-col { grid-template-columns: 1fr; gap: 32px; }
  .projects { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .hide-sm { display: none; }
  .eyebrow { font-size: .7rem; letter-spacing: .05em; padding: 6px 10px; }
  .skills { grid-template-columns: 1fr; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
  .timeline__head { flex-direction: column; gap: 2px; }
  .footer__inner { flex-direction: column; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
