/* ==========================================================================
   Kunal Vyas — profile site
   Palette
     Ink        #14273D  headings, primary buttons, footer
     Harbour    #2E4B69  links, secondary text accents
     Slate      #4B5967  body text
     Fog        #E3E9EE  bands, quiet surfaces
     Paper      #F9FAFB  page background
     Sea glass  #5F9383  focus rings, markers (decorative only)
   ========================================================================== */

:root {
  --ink: #14273D;
  --harbour: #2E4B69;
  --slate: #4B5967;
  --fog: #E3E9EE;
  --paper: #F9FAFB;
  --seaglass: #5F9383;
  --rule: #D5DDE4;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --date-col: 10rem;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--slate);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
}

h2 { font-size: clamp(1.75rem, 3vw, 2.125rem); }

p { margin: 0 0 1em; }

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

a {
  color: var(--harbour);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { color: var(--ink); text-decoration-color: var(--seaglass); }

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

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.6em 1em;
  background: var(--ink);
  color: var(--paper);
}
.skip-link:focus { top: 12px; color: var(--paper); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--rule); }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 76px;
}

.site-name {
  margin-right: auto;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-name:hover { color: var(--ink); }

.nav {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: block;
  padding-block: 6px;
  border-bottom: 1px solid transparent;
  color: var(--slate);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--seaglass); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

@media (max-width: 760px) {
  .site-header__inner { flex-wrap: wrap; gap: 2px 20px; padding-block: 14px; }
  .site-name { flex-basis: 100%; }
  .nav { flex-wrap: wrap; gap: 0 20px; }
  .site-header .nav-cv { display: none; }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9em 1.3em;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font: 600 0.9375rem/1 var(--sans);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.button:hover { background: var(--harbour); border-color: var(--harbour); color: #fff; }

.button--quiet { background: transparent; color: var(--ink); }
.button--quiet:hover { background: var(--fog); border-color: var(--ink); color: var(--ink); }

.button--small { padding: 0.7em 1em; font-size: 0.875rem; }

/* ---------- Home: hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px 72px;
  padding-block: clamp(56px, 9vw, 112px) clamp(56px, 8vw, 96px);
}

.hero__name {
  font-size: clamp(3rem, 7.5vw, 5.5rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.hero__role {
  margin: 1rem 0 1.75rem;
  color: var(--harbour);
  font-size: 1.125rem;
  font-weight: 500;
}

.hero__lede {
  max-width: 44ch;
  margin-bottom: 2.25rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.5;
}

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

.hero__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.hero__portrait { margin: 0; }
.hero__portrait img {
  width: clamp(168px, 22vw, 248px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero__portrait { order: -1; }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--rule);
}

.section--fog { background: var(--fog); border-top: 0; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 24px 64px;
}

.split__aside p { margin-top: 1rem; max-width: 36ch; }

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

.prose p { max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }

.section-head p { max-width: 60ch; margin: 0.75rem 0 0; }

/* ---------- Home: career strip ---------- */

.career {
  display: flex;
  gap: 3px;
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
}

.career__item {
  flex: var(--months) 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.career__bar {
  height: 64px;
  background: var(--shade);
  transform-origin: left center;
  animation: career-grow 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 110ms);
}

.career__item:nth-child(1) { --shade: #C3CFDB; --i: 0; }
.career__item:nth-child(2) { --shade: #9CB0C4; --i: 1; }
.career__item:nth-child(3) { --shade: #7690AA; --i: 2; }
.career__item:nth-child(4) { --shade: #54708F; --i: 3; }
.career__item:nth-child(5) { --shade: #3A5776; --i: 4; }
.career__item:nth-child(6) { --shade: #14273D; --i: 5; }

.career__label {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
  white-space: nowrap;
}

.career__org { color: var(--ink); font-size: 0.9375rem; font-weight: 600; }
.career__years { font-size: 0.8125rem; font-variant-numeric: tabular-nums; }

/* Short tenures get their label dropped one row so names don't collide */
.career__item--lower .career__label { padding-top: 60px; }
.career__item--lower .career__label::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 56px;
  border-left: 1px solid var(--rule);
}

@keyframes career-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@media (max-width: 760px) {
  .career { flex-direction: column; gap: 14px; }
  .career__item {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    align-items: center;
    gap: 14px;
  }
  .career__label,
  .career__item--lower .career__label { order: -1; padding-top: 0; }
  .career__item--lower .career__label::before { content: none; }
  .career__bar { height: 22px; width: calc(var(--months) / 80 * 100%); }
}

/* ---------- Home: outcomes ---------- */

.outcomes { margin: 0; }

.outcome {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 6px 32px;
  padding-block: 26px;
  border-top: 1px solid var(--rule);
}
.outcome:first-child { padding-top: 4px; border-top: 0; }

.outcome dt {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 2.125rem;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
}

.outcome dd { margin: 0; }
.outcome dd p { max-width: 56ch; margin-bottom: 0.4rem; }
.outcome .outcome__source { margin: 0; font-size: 0.875rem; color: var(--harbour); }

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

/* ---------- Page heads ---------- */

.page-head { padding-block: clamp(48px, 8vw, 96px) clamp(36px, 5vw, 56px); }

.page-head h1 {
  font-size: clamp(2.75rem, 6vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.015em;
}

.page-head__lede {
  max-width: 46ch;
  margin: 1.25rem 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 2vw, 1.375rem);
  line-height: 1.5;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

/* ---------- Experience ---------- */

.company {
  display: grid;
  grid-template-columns: var(--date-col) minmax(0, 1fr);
  gap: 12px 48px;
  padding-block: 56px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 16px;
}

.company__years {
  position: sticky;
  top: 24px;
  align-self: start;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.3;
  font-variant-numeric: lining-nums;
}

.company__name { font-size: clamp(1.75rem, 3vw, 2.125rem); }
.company__place { margin: 0.4rem 0 0; font-size: 0.9375rem; }
.company__head { margin-bottom: 36px; }

.role + .role { margin-top: 52px; }

.role__title { font-size: 1.5rem; }

.role__dates {
  margin: 0.35rem 0 1rem;
  color: var(--harbour);
  font-size: 0.9375rem;
  font-weight: 500;
}

.role p, .role li { max-width: 70ch; }

.role__points { margin: 0 0 1.5rem; padding-left: 1.1em; }
.role__points li + li { margin-top: 0.55em; }
.role__points li::marker { color: var(--seaglass); }

.role .role__tech {
  margin: 0;
  padding-left: 16px;
  border-left: 2px solid var(--fog);
  font-size: 0.9375rem;
}
.role__tech-label { display: block; color: var(--ink); font-size: 0.875rem; font-weight: 600; }

/* A promotion path inside one company, drawn as a connected line */
.roles--progression { position: relative; padding-left: 34px; }
.roles--progression::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 5px;
  border-left: 2px solid var(--fog);
}
.roles--progression .role { position: relative; }
.roles--progression .role::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: -34px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--seaglass);
  border-radius: 50%;
  background: var(--paper);
}
.roles--progression .role:first-child::before { background: var(--seaglass); }

@media (max-width: 760px) {
  .company { grid-template-columns: 1fr; padding-block: 44px; }
  .company__years { position: static; font-size: 1.25rem; }
}

/* ---------- Expertise ---------- */

.areas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 64px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.area { padding-block: 28px; border-top: 1px solid var(--rule); }
.area h3 { font-size: 1.375rem; margin-bottom: 0.5rem; }
.area p { margin: 0; }

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

.toolkit { margin: 0; }

.toolkit__row {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 4px 40px;
  padding-block: 20px;
  border-top: 1px solid var(--rule);
}
.toolkit__row:first-child { padding-top: 4px; border-top: 0; }

.toolkit dt { color: var(--ink); font-weight: 600; }
.toolkit dd { margin: 0; max-width: 60ch; }

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

/* ---------- Education ---------- */

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

.entry {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 4px 32px;
  padding-block: 22px;
  border-top: 1px solid var(--rule);
}
.entry:first-child { padding-top: 4px; border-top: 0; }

.entry__years {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-variant-numeric: lining-nums;
}

.entry h3 { font-size: 1.375rem; }
.entry p { margin: 0.25rem 0 0; }

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

/* ---------- Blog: table of contents ---------- */

.toc { padding-bottom: clamp(64px, 9vw, 112px); }

.toc__year {
  display: grid;
  grid-template-columns: var(--date-col) minmax(0, 1fr);
  gap: 12px 48px;
  padding-block: 40px;
  border-top: 1px solid var(--rule);
}

.toc__year-title { font-size: 1.5rem; font-variant-numeric: lining-nums; }

.toc__list { margin: 0; padding: 0; list-style: none; }
.toc__entry + .toc__entry { margin-top: 36px; }

.toc__title { font-size: 1.625rem; line-height: 1.25; }
.toc__title a { color: var(--ink); text-decoration: none; }
.toc__title a:hover { text-decoration: underline; text-decoration-color: var(--seaglass); }

.toc__summary { max-width: 62ch; margin: 0.5rem 0; }

.toc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  color: var(--harbour);
  font-size: 0.875rem;
}

.toc__empty {
  margin: 0;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.3125rem;
  line-height: 1.5;
}

/* Hides the empty message once a post exists, and hides empty year groups */
.toc:has(.toc__entry) .toc__empty { display: none; }
.toc__year:not(:has(.toc__entry)) { display: none; }

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

/* ---------- Blog: post ---------- */

.post {
  max-width: 44rem;
  margin-inline: auto;
  padding-block: clamp(48px, 8vw, 96px);
}

.post__back { font-size: 0.9375rem; }

.post__header h1 {
  margin-top: 28px;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.015em;
}

.post__standfirst {
  margin: 1rem 0 0;
  color: var(--slate);
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.5;
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 1.25rem 0 0;
  color: var(--harbour);
  font-size: 0.9375rem;
}

.post__body {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.7;
}

.post__body h2 { margin: 2em 0 0.6em; font-size: 1.875rem; }
.post__body h3 { margin: 1.6em 0 0.5em; font-size: 1.4375rem; }
.post__body p { margin-bottom: 1.1em; }
.post__body ul, .post__body ol { margin: 0 0 1.1em; padding-left: 1.2em; }
.post__body li + li { margin-top: 0.35em; }
.post__body li::marker { color: var(--seaglass); }

.post__body blockquote {
  margin: 1.6em 0;
  padding-left: 1.2em;
  border-left: 3px solid var(--seaglass);
  font-style: italic;
}

.post__body code {
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--fog);
  font-family: var(--mono);
  font-size: 0.82em;
}

.post__body pre {
  margin: 1.6em 0;
  padding: 20px 22px;
  overflow-x: auto;
  border-radius: 4px;
  background: var(--ink);
  color: #E6ECF2;
  font-size: 0.95rem;
  line-height: 1.55;
}
.post__body pre code { padding: 0; background: none; font-size: inherit; color: inherit; }

.post__body figure { margin: 2em 0; }
.post__body figcaption { margin-top: 0.6em; color: var(--slate); font-family: var(--sans); font-size: 0.875rem; }

.post__body table {
  width: 100%;
  margin: 1.6em 0;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.post__body th, .post__body td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.post__body th { color: var(--ink); font-weight: 600; }

.post__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 52px 40px;
  background: var(--ink);
  color: #C5D1DC;
}

.site-footer a { color: #fff; }
.site-footer a:hover { color: #fff; text-decoration-color: var(--seaglass); }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px 64px;
}

.site-footer__name {
  margin: 0 0 0.2rem;
  color: #fff;
  font-family: var(--serif);
  font-size: 1.5rem;
}

.site-footer__inner p { margin: 0; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__inner .site-footer__copy {
  flex-basis: 100%;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.875rem;
}

/* ---------- Motion & print ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .site-header nav, .nav-cv, .hero__actions, .skip-link { display: none; }
  .site-footer { background: none; color: var(--ink); }
  .site-footer a { color: var(--ink); }
  .company__years { position: static; }
}
