/* ==========================================================================
   Vansh Singh — portfolio
   Black & white editorial minimalism. Grayscale only, no color accents.
   ========================================================================== */

:root {
  /* Grayscale-only palette */
  --ink:        #0a0a0a;   /* near-black text */
  --ink-soft:   #2b2b2b;
  --muted:      #6b6b6b;   /* secondary text */
  --faint:      #9a9a9a;   /* tertiary / captions */
  --line:       #e4e4e4;   /* hairline dividers */
  --line-soft:  #efefef;
  --surface:    #f6f6f6;   /* subtle panel */
  --paper:      #ffffff;   /* page background */
  --invert-bg:  #0a0a0a;   /* inverted (dark) sections */
  --invert-fg:  #ffffff;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --maxw: 980px;
  --gutter: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.08; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
strong { font-weight: 600; color: var(--ink); }
img, svg { max-width: 100%; display: block; }

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

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: var(--invert-fg);
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.18s var(--ease);
}
.skip-link:focus { top: 12px; }

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

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.nav {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 600;
}
.nav__mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 3px 6px;
  line-height: 1;
}
.nav__name { font-size: 15px; letter-spacing: -0.01em; }

.nav__links {
  display: flex;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 14px;
}
.nav__links a {
  text-decoration: none;
  color: var(--muted);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--ink);
  transition: width 0.25s var(--ease);
}
.nav__links a:hover,
.nav__links a:focus-visible { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

@media (max-width: 620px) {
  .nav__links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(72px, 16vh, 168px) 0 clamp(56px, 9vh, 104px);
  border-bottom: 1px solid var(--line);
}
.hero__eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(56px, 12vw, 132px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
}
.hero__lede {
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 40ch;
  margin-bottom: 30px;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 38px;
}
.meta-dot { color: var(--faint); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  transition: background 0.22s var(--ease), color 0.22s var(--ease),
              transform 0.22s var(--ease);
}
.btn--primary { background: var(--ink); color: var(--invert-fg); }
.btn--primary:hover,
.btn--primary:focus-visible { background: #2c2c2c; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover,
.btn--ghost:focus-visible { background: var(--ink); color: var(--invert-fg); transform: translateY(-2px); }

/* ---------- Sections ---------- */
.section {
  padding: clamp(56px, 9vh, 104px) 0;
  border-bottom: 1px solid var(--line);
}
.section__head { margin-bottom: 44px; }
.section__kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.section__title {
  font-family: var(--serif);
  font-size: clamp(32px, 5.5vw, 52px);
  letter-spacing: -0.025em;
}
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--invert-fg);
  background: var(--ink);
  padding: 3px 8px;
  border-radius: 4px;
  vertical-align: middle;
}
/* Quiet status tag (outlined) — e.g. private/proprietary repos with no link */
.tag--muted {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

/* ---------- Featured platform ---------- */
.featured__lede {
  font-family: var(--serif);
  font-size: clamp(20px, 2.8vw, 27px);
  line-height: 1.5;
  color: var(--ink);
  max-width: 60ch;
  margin-bottom: 52px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.stat {
  padding: 28px 24px 28px 0;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: none; }
.stat__num {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 46px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.stat__label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

@media (max-width: 720px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line); padding-right: 20px; padding-left: 0; }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-last-child(-n+2) { border-bottom: none; }
}

.pipeline {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
}
.pipe {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
}
.pipe__arrow { color: var(--faint); font-family: var(--mono); }

/* ---------- Projects ---------- */
.projects { border-top: 1px solid var(--line); }
.project {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px 28px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.3s var(--ease);
}
.project:hover { padding-left: 8px; }
.project__index {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  padding-top: 6px;
}
.project__name {
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 32px);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}
.project__name .tag--muted {
  font-size: 10px;
  transform: translateY(-3px);
}
.project__desc {
  color: var(--ink-soft);
  max-width: 58ch;
  margin-bottom: 16px;
}
.project__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project__stack li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 4px 10px;
}

@media (max-width: 540px) {
  .project { grid-template-columns: 1fr; gap: 6px; }
  .project__index { padding-top: 0; }
}

/* ---------- Open Source ---------- */
.oss {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
/* 10 cards: keep rows even and links bottom-aligned across each row */
.oss-card { min-height: 100%; }
.oss-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  padding: 30px 28px;
  transition: background 0.22s var(--ease);
}
.oss-card:hover { background: var(--surface); }
.oss-card__name {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 28px);
  margin-bottom: 12px;
}
.oss-card__desc {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.oss-card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.oss-card__stack li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 4px 10px;
}
.oss-card:hover .oss-card__stack li { background: var(--paper); }
.oss-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: auto;
}
.oss-card__links a {
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  padding-bottom: 2px;
}
.oss-card__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--line);
  transition: background 0.2s var(--ease);
}
.oss-card__links a:hover,
.oss-card__links a:focus-visible { color: var(--ink); }
.oss-card__links a:hover::after { background: var(--ink); }

.oss__all {
  margin-top: 36px;
  font-family: var(--mono);
  font-size: 14px;
}
.oss__all a {
  text-decoration: none;
  color: var(--ink);
  position: relative;
  padding-bottom: 2px;
}
.oss__all a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--ink);
  transition: width 0.25s var(--ease);
}
.oss__all a:hover::after,
.oss__all a:focus-visible::after { width: 100%; }

@media (max-width: 640px) {
  .oss { grid-template-columns: 1fr; }
}

/* ---------- Experience timeline ---------- */
.timeline { border-top: 1px solid var(--line); }
.entry {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px 32px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}
.entry__when {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}
.entry__role {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.entry__org {
  font-size: 14.5px;
  color: var(--muted);
  margin-bottom: 12px;
}
.entry__detail { color: var(--ink-soft); max-width: 60ch; }

@media (max-width: 640px) {
  .entry { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- Skills ---------- */
.skills { border-top: 1px solid var(--line); }
.skills__group {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px 32px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.skills__label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}
.skills__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.skills__list span {
  font-size: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.skills__list span:hover { border-color: var(--ink); background: var(--surface); }

@media (max-width: 640px) {
  .skills__group { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- Contact (inverted) ---------- */
.section--contact {
  background: var(--invert-bg);
  color: var(--invert-fg);
  border-bottom: none;
}
.section--contact .section__kicker { color: var(--faint); }
.contact__title {
  font-family: var(--serif);
  max-width: 18ch;
  margin-bottom: 40px;
  color: var(--invert-fg);
}
.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}
.contact__links a {
  font-family: var(--mono);
  font-size: 15px;
  text-decoration: none;
  color: var(--invert-fg);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 11px 22px;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), transform 0.22s var(--ease);
}
.contact__links a:hover,
.contact__links a:focus-visible {
  background: var(--invert-fg);
  color: var(--invert-bg);
  transform: translateY(-2px);
}

/* Contact intro line + direct fallback (inverted) */
.contact__lede {
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(17px, 2vw, 19px);
  max-width: 46ch;
  margin-top: -20px;
  margin-bottom: 36px;
}
.contact__direct {
  font-family: var(--mono);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 28px;
  margin-bottom: 36px;
}
.contact__direct a {
  color: var(--invert-fg);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 1px;
  transition: border-color 0.2s var(--ease);
}
.contact__direct a:hover,
.contact__direct a:focus-visible { border-bottom-color: var(--invert-fg); }

/* ---------- Contact form (inverted) ---------- */
.contact-form {
  max-width: 620px;
  margin-bottom: 4px;
}
.contact-form__row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 22px;
  margin-bottom: 22px;
}
.contact-form__field {
  display: flex;
  flex-direction: column;
  margin-bottom: 22px;
}
.contact-form__row .contact-form__field { margin-bottom: 0; }
.contact-form__label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 9px;
}
.contact-form__input {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--invert-fg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.contact-form__input::placeholder { color: rgba(255, 255, 255, 0.35); }
.contact-form__input:hover { border-color: rgba(255, 255, 255, 0.4); }
.contact-form__input:focus {
  outline: none;
  border-color: var(--invert-fg);
  background: rgba(255, 255, 255, 0.07);
}
.contact-form__textarea { resize: vertical; min-height: 120px; }

.contact-form__honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.contact-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-top: 28px;
}
/* Submit button — light-on-dark variant of .btn for the inverted section */
.contact-form__submit {
  background: var(--invert-fg);
  color: var(--invert-bg);
  border-color: var(--invert-fg);
  cursor: pointer;
}
.contact-form__submit:hover,
.contact-form__submit:focus-visible {
  background: rgba(255, 255, 255, 0.86);
  transform: translateY(-2px);
}
.contact-form__submit:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}
.contact-form__status {
  font-family: var(--mono);
  font-size: 13.5px;
  margin: 0;
}
.contact-form__status.is-ok { color: rgba(255, 255, 255, 0.85); }
.contact-form__status.is-error { color: rgba(255, 255, 255, 0.85); }

@media (max-width: 540px) {
  .contact-form__row { grid-template-columns: 1fr; gap: 0; }
  .contact-form__row .contact-form__field { margin-bottom: 22px; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--invert-bg);
  color: var(--faint);
  padding: 28px 0 40px;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 26px;
  font-family: var(--mono);
  font-size: 12px;
}
.footer__copy { color: rgba(255, 255, 255, 0.7); }

/* ---------- Scroll reveal (subtle motion) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
