/* ==========================================================
     Sarthak Poswal | Technical writing portfolio
     Plain CSS. No frameworks, no JavaScript.
     ========================================================== */

  /* ---------- Design tokens ---------- */
  :root {
    --page: #ffffff;
    --ink: #17212b;
    --muted: #4d5b69;
    --rule: #d8dfe6;
    --surface: #f2f5f8;
    --accent: #0e6b6b;
    --accent-ink: #0a5252;
    --accent-soft: #e4f1f0;

    --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;

    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2.5rem;
    --space-5: 4rem;

    --measure: 42rem;
  }

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

  html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 1rem;
  }

  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

  body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
  }

  h1,
  h2,
  h3,
  h4 {
    margin: 0;
    font-weight: 600;
    line-height: 1.25;
  }

  p {
    margin: 0 0 var(--space-2);
    max-width: var(--measure);
  }

  ul,
  ol {
    margin: 0 0 var(--space-2);
    padding-left: 1.25rem;
    max-width: var(--measure);
  }

  li {
    margin-bottom: 0.4rem;
  }

  a {
    color: var(--accent-ink);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }

  a:hover {
    text-decoration-thickness: 2px;
  }

  a:focus-visible,
  summary:focus-visible,
  pre:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }

  code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--surface);
    padding: 0.1em 0.35em;
    border-radius: 3px;
  }

  pre {
    margin: 0 0 var(--space-2);
    padding: var(--space-2);
    overflow-x: auto;
    background: var(--surface);
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.55;
  }

  pre code {
    padding: 0;
    background: none;
    font-size: inherit;
  }

  .meta {
    color: var(--muted);
    font-size: 0.9375rem;
  }

  /* ---------- Layout ---------- */
  .wrap {
    width: 100%;
    max-width: 62rem;
    margin: 0 auto;
    padding: 0 1.25rem;
  }

  .skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    padding: 0.5rem 1rem;
    background: var(--ink);
    color: #fff;
    z-index: 10;
  }

  .skip-link:focus {
    left: 0;
  }

  /* ---------- Header and navigation ---------- */
  .site-header {
    border-bottom: 1px solid var(--rule);
  }

  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1) var(--space-3);
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }

  .brand {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
  }

  .nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: none;
  }

  .nav-list li {
    margin: 0;
  }

  .nav-list a {
    color: var(--muted);
    font-size: 0.9375rem;
    text-decoration: none;
  }

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

  /* ---------- Intro ---------- */
  .intro {
    padding: var(--space-5) 0 var(--space-4);
  }

  .intro h1 {
    font-size: clamp(2.25rem, 6vw, 3.5rem);
    letter-spacing: -0.02em;
  }

  .intro .role {
    margin: var(--space-1) 0 var(--space-3);
    color: var(--accent-ink);
    font-size: 1.25rem;
    font-weight: 500;
  }

  .intro .lead {
    font-size: 1.1875rem;
    max-width: 40rem;
  }

  .intro-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin-top: var(--space-3);
  }

  .button {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    background: var(--accent);
    color: #fff;
    border-radius: 4px;
    font-weight: 500;
    text-decoration: none;
  }

  .button:hover {
    background: var(--accent-ink);
  }

  /* ---------- Sections ---------- */
  .section {
    padding: var(--space-4) 0;
    border-top: 1px solid var(--rule);
  }

  .section > .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }

  .section-title {
    font-size: 1.25rem;
  }

  .section-body {
    min-width: 0;
  }

  @media (min-width: 56rem) {
    .section > .wrap {
      grid-template-columns: 10rem minmax(0, 1fr);
      gap: var(--space-4);
    }

    .section-title {
      position: sticky;
      top: var(--space-3);
      align-self: start;
    }
  }

  /* ---------- About: quick facts ---------- */
  .facts {
    margin: var(--space-3) 0 0;
    padding: 0;
    max-width: var(--measure);
    border-top: 1px solid var(--rule);
  }

  .facts > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .facts dt {
    color: var(--muted);
    font-size: 0.9375rem;
  }

  .facts dd {
    margin: 0;
    font-weight: 500;
  }

  @media (min-width: 40rem) {
    .facts > div {
      grid-template-columns: 9rem minmax(0, 1fr);
      gap: var(--space-2);
    }
  }

  /* ---------- Work: featured sample ---------- */
  .doc-sample {
    margin: var(--space-3) 0 var(--space-4);
    max-width: 46rem;
    border: 1px solid var(--rule);
    border-radius: 6px;
    overflow: hidden;
  }

  .doc-sample-bar {
    margin: 0;
    max-width: none;
    padding: 0.6rem var(--space-3);
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.875rem;
  }

  .doc-sample-body {
    padding: var(--space-3);
  }

  .doc-sample h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-1);
  }

  .doc-sample h4 {
    margin: var(--space-3) 0 var(--space-1);
    font-size: 1.0625rem;
  }

  .steps {
    padding-left: 1.5rem;
  }

  .steps > li {
    margin-bottom: var(--space-3);
    padding-left: 0.25rem;
  }

  .steps > li > p:last-child,
  .steps > li > pre:last-child {
    margin-bottom: 0;
  }

  .note {
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    border-radius: 0 4px 4px 0;
  }

  .note p {
    margin: 0;
  }

  .note code {
    background: rgba(255, 255, 255, 0.7);
  }

  /* ---------- Work: other samples ---------- */
  .list-heading {
    margin-bottom: var(--space-1);
    font-size: 1.125rem;
  }

  .sample-list {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 46rem;
  }

  .sample-list > li {
    margin: 0;
    padding: var(--space-3) 0;
    border-top: 1px solid var(--rule);
  }

  .sample-list h4 {
    font-size: 1.0625rem;
    margin-bottom: 0.25rem;
  }

  .sample-list .meta {
    margin-bottom: 0.5rem;
  }

  .sample-list p:last-child {
    margin-bottom: 0;
  }

  details {
    margin-top: var(--space-2);
    max-width: var(--measure);
  }

  summary {
    cursor: pointer;
    color: var(--accent-ink);
    font-weight: 500;
  }

  details[open] summary {
    margin-bottom: var(--space-2);
  }

  /* ---------- Process ---------- */
  .process {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
    max-width: var(--measure);
  }

  .process > li {
    position: relative;
    margin: 0;
    padding: 0 0 var(--space-3) 2.75rem;
    counter-increment: step;
  }

  .process > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.9rem;
    height: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    border-radius: 50%;
    color: var(--accent-ink);
    font-size: 0.9375rem;
    font-weight: 600;
  }

  /* connecting line between steps */
  .process > li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 0.95rem;
    top: 2.1rem;
    bottom: 0.25rem;
    width: 1px;
    background: var(--rule);
  }

  .process h3 {
    font-size: 1.0625rem;
    margin-bottom: 0.2rem;
  }

  .process p {
    margin: 0;
  }

  /* ---------- Skills ---------- */
  .skill-groups {
    margin: 0;
    padding: 0;
    max-width: var(--measure);
    border-top: 1px solid var(--rule);
  }

  .skill-groups > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .skill-groups dt {
    font-weight: 600;
  }

  .skill-groups dd {
    margin: 0;
    color: var(--muted);
  }

  @media (min-width: 40rem) {
    .skill-groups > div {
      grid-template-columns: 11rem minmax(0, 1fr);
      gap: var(--space-2);
    }
  }

  /* ---------- Experience and education ---------- */
  .job {
    margin-bottom: var(--space-4);
  }

  .job:last-child {
    margin-bottom: 0;
  }

  .job-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem var(--space-2);
    max-width: var(--measure);
  }

  .job h3 {
    font-size: 1.125rem;
  }

  .dates {
    margin: 0;
    color: var(--muted);
    font-size: 0.9375rem;
  }

  .company {
    margin: 0.15rem 0 var(--space-2);
    color: var(--muted);
  }

  /* ---------- Contact ---------- */
  .contact-list {
    margin: var(--space-2) 0 0;
    padding: 0;
    list-style: none;
  }

  .contact-list li {
    margin-bottom: 0.6rem;
  }

  .contact-label {
    display: inline-block;
    min-width: 9.5rem;
    color: var(--muted);
  }

  /* ---------- Footer ---------- */
  .site-footer {
    padding: var(--space-3) 0 var(--space-4);
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.9375rem;
  }

  .site-footer p {
    margin: 0;
    max-width: none;
  }

  /* ---------- Small screens ---------- */
  @media (max-width: 40rem) {
    body {
      font-size: 1rem;
    }

    .intro {
      padding-top: var(--space-4);
    }

    .doc-sample-body {
      padding: var(--space-2);
    }

    .doc-sample h3 {
      font-size: 1.25rem;
    }

    .contact-label {
      display: block;
      min-width: 0;
      font-size: 0.9375rem;
    }
  }

  /* ---------- Print ---------- */
  @media print {
    .site-header,
    .skip-link,
    .intro-links .button {
      display: none;
    }

    .section {
      break-inside: avoid;
    }

    .section-title {
      position: static;
    }
  }
