/* =========================================================================
   Tushar Tilwani — personal site
   System-font stack only (no network font requests) for fast first paint.
   ========================================================================= */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  --surface: #ffffff;
  --border: #e4e8f0;
  --ink: #131722;
  --ink-soft: #424b5e;
  --muted: #5b6275;
  --accent: #3a55ff;
  --accent-ink: #2b40d6;
  --accent-2: #0d9488;
  --shadow: 0 1px 2px rgba(19, 23, 34, .04), 0 8px 24px rgba(19, 23, 34, .06);
  --radius: 14px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d111c;
    --bg-alt: #121829;
    --surface: #151b2c;
    --border: #232c42;
    --ink: #eef1f8;
    --ink-soft: #c2cadb;
    --muted: #97a3ba;
    --accent: #6f8bff;
    --accent-ink: #93a8ff;
    --accent-2: #2dd4bf;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { color: var(--ink); font-weight: 650; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

.accent { color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================ HEADER / NAV ============================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin-inline: auto; padding: 12px 24px; gap: 16px;
}
.nav__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; }
.nav__brand:hover { text-decoration: none; }
.nav__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.nav__menu { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav__menu a {
  display: inline-block; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-soft); font-weight: 550; font-size: 15px;
}
.nav__menu a:hover { background: var(--bg-alt); color: var(--ink); text-decoration: none; }

.nav__toggle {
  display: none; flex-direction: column; gap: 5px; justify-content: center;
  width: 42px; height: 38px; padding: 8px; background: transparent;
  border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
}
.nav__toggle-bar { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }

/* ================================ HERO ================================ */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 7vw, 80px);
  background:
    radial-gradient(900px 420px at 12% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(720px 360px at 96% 8%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%);
}
.hero__eyebrow {
  margin: 0 0 14px; font-size: 14px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.hero__title {
  margin: 0 0 22px; font-size: clamp(2.1rem, 5.4vw, 3.6rem); font-weight: 760; max-width: 17ch;
}
.hero__lede {
  margin: 0 0 30px; max-width: 64ch; font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--ink-soft);
}
.hero__stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  list-style: none; margin: 0 0 30px; padding: 0; max-width: 720px;
}
.hero__stats li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat__num { font-size: clamp(1.4rem, 3.4vw, 1.9rem); font-weight: 760; color: var(--accent); letter-spacing: -.02em; }
.stat__label { font-size: 13.5px; color: var(--muted); line-height: 1.35; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 15.5px;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { background: var(--accent-ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-alt); }

.hero__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.hero__tags span {
  font-size: 13px; font-weight: 550; color: var(--ink-soft);
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}

/* =============================== SECTIONS =============================== */
.section { padding: clamp(56px, 8vw, 92px) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__kicker {
  margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.section__title { margin: 0 0 28px; font-size: clamp(1.5rem, 3.6vw, 2.1rem); font-weight: 720; max-width: 24ch; }

.prose { max-width: 70ch; }
.prose p { margin: 0 0 18px; color: var(--ink-soft); }
.prose p:last-child { margin-bottom: 0; }

/* =============================== TIMELINE =============================== */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.role {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow);
}
.role--compact { padding: 18px 22px; }
.role__head { margin-bottom: 14px; }
.role--compact .role__head { margin-bottom: 6px; }
.role__title { margin: 0 0 4px; font-size: 1.2rem; font-weight: 680; }
.role__company { color: var(--accent); font-weight: 600; }
.role__meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between;
  margin: 0; font-size: 14.5px; color: var(--muted);
}
.role__dates { white-space: nowrap; }
.role__summary { margin: 0 0 14px; color: var(--ink-soft); }
.role--compact .role__summary { margin: 0; font-size: 15px; }
.role__points { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 9px; }
.role__points li { color: var(--ink-soft); }
.role__stack { margin: 0; font-size: 13.5px; color: var(--muted); font-weight: 550; }

.edu { margin: 26px 0 0; padding: 18px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink-soft); font-size: 15.5px; }

/* ================================ SKILLS ================================ */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.skill-card h3 {
  margin: 0 0 14px; font-size: 1.05rem; font-weight: 680;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.skill-card ul { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; margin: 0; padding: 0; }
.skill-card li {
  font-size: 13.5px; font-weight: 550; color: var(--ink-soft);
  padding: 5px 11px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px;
}

/* ============================= FEATURED WORK ============================= */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.work-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
.work-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(19,23,34,.08), 0 18px 40px rgba(19,23,34,.12); }
.work-card__title { margin: 0 0 4px; font-size: 1.18rem; font-weight: 680; }
.work-card__org { margin: 0 0 14px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.work-card p { margin: 0 0 16px; color: var(--ink-soft); font-size: 15.5px; }
.work-card__metrics {
  margin: auto 0 0; padding: 14px 0 0; list-style: none; display: grid; gap: 6px;
  border-top: 1px solid var(--border);
}
.work-card__metrics li { font-size: 14px; color: var(--ink-soft); padding-left: 20px; position: relative; }
.work-card__metrics li::before {
  content: ""; position: absolute; left: 4px; top: 9px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent-2);
}

/* =============================== CONTACT =============================== */
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.contact-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink);
  transition: transform .12s ease, border-color .12s ease;
}
.contact-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.contact-card__label { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.contact-card__value { font-size: 16px; font-weight: 600; color: var(--accent-ink); }

/* ================================ FOOTER ================================ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 28px 0; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; font-size: 14px; color: var(--muted); }
.site-footer__links { display: flex; gap: 18px; }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 860px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: 1fr; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 10px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a { display: block; padding: 11px 12px; }
  .skills-grid, .contact-cards { grid-template-columns: 1fr; }
  .role__meta { justify-content: flex-start; }
}
