/* ============================================================
   Neeraj Chormale — portfolio
   Modern, black, monospace. Monochrome with hairline rules.
   ============================================================ */

:root {
  --bg:       #0a0a0a;
  --bg-2:     #111111;
  --text:     #ededed;
  --soft:     #c4c4c4;
  --muted:    #7c7c7c;
  --faint:    #565656;
  --line:     rgba(255, 255, 255, 0.10);
  --line-2:   rgba(255, 255, 255, 0.18);

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;

  --measure: 40rem;
  --label-w: 8rem;
  --gap: 2.75rem;
  --space: clamp(4rem, 9vw, 6.5rem);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(0.875rem, 0.82rem + 0.22vw, 0.95rem);
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(237, 237, 237, 0.16); }

/* ---------- Links ---------- */
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--line-2);
  transition: text-decoration-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
a:hover { color: #fff; text-decoration-color: currentColor; }

/* ---------- Page frame ---------- */
.page {
  max-width: calc(var(--label-w) + var(--gap) + var(--measure));
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 5vw, 3rem) 4rem;
}

/* ---------- Meta / small caps ---------- */
.meta {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta a { color: var(--muted); text-decoration-color: transparent; }
.meta a:hover { color: var(--text); text-decoration-color: currentColor; }

.clock {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.clock:not(:empty)::before { content: "· "; }

/* ============================================================
   Masthead
   ============================================================ */
.masthead { margin-bottom: var(--space); }
.masthead__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.8rem;
}
.masthead__links { display: flex; gap: 1.5rem; }
.masthead__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.ico {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}

.masthead__name {
  font-weight: 600;
  font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.masthead__role {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1.1rem;
}
.masthead__role em { font-style: normal; }

.lead {
  font-size: clamp(1rem, 0.92rem + 0.4vw, 1.15rem);
  line-height: 1.65;
  color: var(--soft);
  max-width: 36rem;
  margin-top: 2.4rem;
  text-wrap: pretty;
}
.standfirst {
  color: var(--muted);
  margin-top: 1.4rem;
  max-width: 36rem;
  font-size: 0.9rem;
}

/* ============================================================
   Section rows — marginalia label + content
   ============================================================ */
.row {
  display: grid;
  grid-template-columns: var(--label-w) minmax(0, 1fr);
  gap: var(--gap);
  padding-top: var(--space);
  border-top: 1px solid var(--line);
}

.row__label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  position: sticky;
  top: 2rem;
  height: fit-content;
}
.row__label .num {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--faint);
  margin-bottom: 0.45rem;
  font-weight: 400;
}

.row__body { max-width: var(--measure); }

/* ---------- Entries (work + projects) ---------- */
.entry + .entry {
  margin-top: 2.4rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--line);
}
.entry__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 0.85rem;
}
.entry__title {
  font-weight: 600;
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.18rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
}
.entry__title .org { color: var(--muted); font-weight: 400; }

.entry__year {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.25em;
}

.entry p { color: var(--soft); }
.entry p strong { color: var(--text); font-weight: 600; }

.entry__links {
  display: flex;
  gap: 1.2rem;
  flex-shrink: 0;
  padding-top: 0.3em;
}
.entry__links a {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration-color: transparent;
  white-space: nowrap;
}
.entry__links a:hover { color: var(--text); text-decoration-color: currentColor; }

.stack {
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--faint);
  margin-top: 0.9rem;
}

.row__more { margin-top: 2.4rem; color: var(--muted); font-size: 0.85rem; }

/* ---------- Toolkit ---------- */
.toolkit { display: flex; flex-direction: column; gap: 0; }
.toolkit > div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.2rem;
  align-items: baseline;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}
.toolkit > div:first-child { padding-top: 0; }
.toolkit > div:last-child { border-bottom: none; padding-bottom: 0; }
.toolkit dt {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.toolkit dd { color: var(--text); font-size: 0.9rem; }

/* ---------- Credentials ---------- */
.subhead {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1rem;
}
.row__body .subhead + .creds { margin-bottom: 2.6rem; }
.creds { display: flex; flex-direction: column; }
.creds li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.creds li:last-child { border-bottom: none; }
.cert__name { font-size: 0.9rem; color: var(--text); }
.cert { color: var(--text); text-decoration-color: transparent; }
.cert:hover { color: #fff; }
.cert:hover .cert__name { text-decoration: underline; text-underline-offset: 0.22em; }
.cert [aria-hidden] { color: var(--muted); font-size: 0.85em; }
.creds .entry__year { padding-top: 0; }

/* ---------- Contact ---------- */
.contact-lead { color: var(--soft); max-width: 32rem; }
.contact-email {
  font-weight: 500;
  font-size: clamp(1.15rem, 0.9rem + 1.2vw, 1.9rem);
  line-height: 1.2;
  margin: 1rem 0 1.5rem;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}
.contact-email a { text-decoration-color: var(--line-2); }
.contact-also a { color: var(--muted); }
.contact-also a:hover { color: var(--text); }

/* ---------- Colophon ---------- */
.colophon {
  margin-top: var(--space);
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ============================================================
   Entrance — sections settle in as you scroll to them.
   Scoped to .js so a no-JS page still renders fully, no flash.
   JS adds .is-visible (via IntersectionObserver).
   ============================================================ */
.js .masthead,
.js .row,
.js .colophon {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .masthead,
  .js .row,
  .js .colophon { transition: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 680px) {
  :root { --gap: 1.4rem; }
  .row { grid-template-columns: 1fr; gap: 1.6rem; }
  .row__label { position: static; top: auto; }
  .row__label .num { display: inline; margin-right: 0.5rem; }
  .toolkit > div { grid-template-columns: 1fr; gap: 0.3rem; }
  .entry__head { flex-direction: column; gap: 0.3rem; }
  .entry__year, .entry__links { padding-top: 0; }
  .creds li { flex-direction: column; gap: 0.2rem; align-items: flex-start; }
}
