/* Sarvesh E B — sarvesheb.dev
   Hand-written. One file. No build step.
   Palette: warm paper / near-black ink, one muted teal accent. */

:root {
  --paper: #fcfcfa;
  --ink: #15181b;
  --muted: #5c6773;
  --rule: #e4e6e8;
  --accent: #1c7466;
  --accent-soft: #e6f2ef;

  --measure: 45rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --space: clamp(2.75rem, 6vw, 4.5rem);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.2, .6, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d0f11;
    --ink: #e8ebee;
    --muted: #98a3ae;
    --rule: #23272b;
    --accent: #5cc3ad;
    --accent-soft: #102320;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, .35vw + .95rem, 1.075rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
  hanging-punctuation: first;
}

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

/* ---------- skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: .75rem 1rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--accent);
  z-index: 10;
}
.skip:focus { left: 1rem; }

/* ---------- focus ---------- */

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

/* ---------- links ---------- */

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: text-decoration-color .18s var(--ease), color .18s var(--ease);
}
a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* ---------- header ---------- */

.site {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
}

.site nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--measure);
  margin-inline: auto;
  padding: .95rem var(--gutter) .9rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
}

nav ul {
  display: flex;
  gap: clamp(.85rem, 2.4vw, 1.6rem);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
nav ul::-webkit-scrollbar { display: none; }

nav ul a {
  font-size: .78rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
nav ul a:hover { color: var(--ink); }

/* ---------- hero ---------- */

.hero { padding-top: clamp(3.5rem, 11vw, 7rem); }

.eyebrow {
  margin: 0 0 1.4rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::before {
  content: "";
  width: 1.7rem;
  height: 1px;
  background: var(--accent);
  flex: none;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.55rem, 8.5vw, 4.15rem);
  line-height: 1.03;
  letter-spacing: -.022em;
}

.lede {
  max-width: 34rem;
  margin: 1.35rem 0 0;
  font-size: clamp(1.06rem, .55vw + 1rem, 1.19rem);
  line-height: 1.6;
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  text-wrap: pretty;
}
.lede strong { font-weight: 600; }

/* ---------- link rows ---------- */

.links {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.5rem;
  margin: 1.9rem 0 0;
  padding: 0;
  list-style: none;
}
.links a {
  font-size: .87rem;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.links a::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width .22s var(--ease);
}
.links a:hover { color: var(--accent); }
.links a:hover::after { width: .9rem; }

.links--big a { font-size: .95rem; }

/* ---------- sections ---------- */

main > section { padding-top: var(--space); }

/* the sticky header must not cover a heading that we just jumped to */
:target,
section[id] { scroll-margin-block-start: 3rem; }

h2 {
  margin: 0 0 1.6rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -.005em;
}

.section-lede {
  margin: -.65rem 0 1.6rem;
  color: var(--muted);
  font-size: .95rem;
  max-width: 33rem;
  text-wrap: pretty;
}

.note {
  margin: 1.5rem 0 0;
  font-size: .85rem;
  color: var(--muted);
  max-width: 34rem;
  text-wrap: pretty;
}

.sep { color: var(--muted); opacity: .6; padding-inline: .1em; }

/* ---------- experience ---------- */

.timeline { margin: 0; padding: 0; list-style: none; }

.exp {
  display: grid;
  grid-template-columns: 11.5rem 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.exp:first-child { border-top: 0; padding-top: .35rem; }

.period {
  margin: 0;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.dur {
  display: block;
  font-size: .74rem;
  color: color-mix(in srgb, var(--muted) 70%, var(--paper));
}

.org {
  margin: .3rem 0 0;
  font-size: .9rem;
  color: var(--muted);
}
.org .tag {
  display: inline-block;
  margin-left: .35rem;
  padding: .05rem .45rem;
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  border-radius: 999px;
  vertical-align: .1em;
}

.stack {
  margin: .7rem 0 0;
  font-family: var(--mono);
  font-size: .73rem;
  letter-spacing: .02em;
  color: var(--muted);
}

/* ---------- projects ---------- */

.projects { margin: 0; padding: 0; list-style: none; }

.proj {
  display: block;
  padding: 1.3rem 0 1.35rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.projects li:first-child .proj { border-top: 0; padding-top: .3rem; }

.proj-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.proj h3 { transition: color .18s var(--ease); }
.proj:hover h3 { color: var(--accent); }

.arrow {
  flex: none;
  font-size: .95rem;
  color: var(--muted);
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.proj:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }

.proj-desc {
  display: block;
  margin: .4rem 0 0;
  max-width: 36rem;
  font-size: .93rem;
  line-height: 1.6;
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
  text-wrap: pretty;
}

.proj-meta {
  display: block;
  margin: .6rem 0 0;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .04em;
  color: color-mix(in srgb, var(--muted) 78%, var(--paper));
}

/* ---------- skills ---------- */

.skills { margin: 0; }

.skills > div {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding: .72rem 0;
  border-top: 1px solid var(--rule);
}
.skills > div:first-child { border-top: 0; padding-top: 0; }

.skills dt {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: .18rem;
}
.skills dd { margin: 0; font-size: .95rem; }

/* ---------- contact / footer ---------- */

.contact-p {
  margin: 0;
  max-width: 34rem;
  text-wrap: pretty;
}

.hero + section,
main > section:last-child { padding-bottom: var(--space); }

.site-foot {
  border-top: 1px solid var(--rule);
  padding-block: 1.6rem 2.4rem;
  font-size: .8rem;
  line-height: 1.7;
  color: var(--muted);
}
.site-foot p { margin: 0; }
.colophon {
  margin-top: .3rem !important;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .01em;
  opacity: .75;
}

/* ---------- narrow ---------- */

@media (max-width: 40rem) {
  .site nav { align-items: center; }
  nav ul { gap: .95rem; }
  nav ul a { font-size: .72rem; letter-spacing: .08em; }

  .exp {
    grid-template-columns: 1fr;
    gap: .45rem;
    padding-block: 1.35rem;
  }
  .period { font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; }
  .dur { display: inline; margin-left: .4rem; }
  .dur::before { content: "· "; }

  .skills > div {
    grid-template-columns: 1fr;
    gap: .15rem;
  }
}

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

/* ---------- 404 ---------- */

.notfound {
  padding-top: clamp(4rem, 14vw, 9rem);
  padding-bottom: clamp(4rem, 14vw, 9rem);
}

/* ---------- print ---------- */

@media print {
  .site, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
  .exp { break-inside: avoid; }
}
