/* ==========================================================================
   rabindrayadav.com: "the technical memo"
   One serif family, one blue, ruled rows, no animation, no frameworks.
   Design notes: docs/redesign-2026-07-memo.md
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --paper: #fcfcfa;
  --panel: #f4f4f0;
  --ink: #1c1c1a;
  --ink-2: #5f5f5a;
  --ink-3: #85857e;
  --rule: #e2e1db;
  --rule-2: #c9c8c0;
  --link: #1a41c8;
  --link-hover: #10309f;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", "Menlo", "Consolas", monospace;

  --measure: 44rem;
  --wide: 60rem;
  --pad: clamp(18px, 5vw, 40px);
}

/* ---------- reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  overflow-x: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul,
ol {
  padding-left: 1.2em;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  font-size: 0.9rem;
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---------- header ---------- */
.top {
  border-bottom: 1px solid var(--rule-2);
}

.top__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  padding-block: 18px;
}

.top__name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.top__name:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.top__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  font-size: 0.95rem;
}

.top__nav a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.top__nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--ink);
}

/* ---------- page scaffold ---------- */
main {
  padding-block: clamp(36px, 6vw, 72px) clamp(40px, 6vw, 72px);
}

h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.page-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  margin-top: 10px;
}

.page-sub {
  max-width: var(--measure);
  color: var(--ink-2);
  margin-top: 14px;
}

/* section heading: the ruled-row primitive */
h2.sec {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  border-top: 1px solid var(--rule-2);
  padding-top: 1.1rem;
  margin-top: clamp(2.6rem, 6vw, 3.6rem);
}

.sec + * {
  margin-top: 1.1rem;
}

/* ---------- prose ---------- */
.prose {
  max-width: var(--measure);
}

.prose p + p {
  margin-top: 1em;
}

.prose .lead {
  font-size: clamp(1.2rem, 2.2vw, 1.4rem);
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.prose .lead + p,
.prose p + .lead {
  margin-top: 1.1em;
}

/* ---------- intro (home) ---------- */
.intro__prose {
  margin-top: clamp(20px, 3.5vw, 30px);
}

/* ---------- terminal artifact ---------- */
.term-fig {
  max-width: var(--measure);
  margin-top: clamp(26px, 4vw, 38px);
}

.term {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: clamp(0.68rem, 1.6vw, 0.8rem);
  line-height: 1.75;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
}

.term .dim {
  color: var(--ink-2);
}

/* the one orchestrated moment: the query types itself, then the cursor
   keeps blinking like a real prompt. JS-driven; static without JS. */
.term .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 1px;
  background: var(--ink-2);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.term-fig figcaption {
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin-top: 9px;
}

/* ---------- numbers table ---------- */
.numbers {
  width: 100%;
  border-collapse: collapse;
}

.numbers td {
  border-top: 1px solid var(--rule);
  padding: 11px 14px 11px 0;
  vertical-align: baseline;
}

.numbers tr:first-child td {
  border-top: 0;
}

.numbers tr:last-child td {
  border-bottom: 1px solid var(--rule);
}

.numbers .fig {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  width: 7.2rem;
  font-variant-numeric: tabular-nums;
}

.numbers .what {
  font-size: 0.975rem;
  color: var(--ink-2);
}

.numbers .when {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
  padding-right: 0;
}

@media (max-width: 560px) {
  .numbers .when {
    display: none;
  }
}

/* ---------- work list ---------- */
.worklist {
  max-width: var(--measure);
}

.work {
  border-top: 1px solid var(--rule);
  padding: 16px 12px;
  margin-inline: -12px;
  transition: background 0.2s ease;
}

.work:hover {
  background: var(--panel);
}

.worklist .work:first-child {
  border-top: 0;
}

.worklist .work:last-child {
  border-bottom: 1px solid var(--rule);
}

.work h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
}

.work p {
  font-size: 0.975rem;
  color: var(--ink-2);
  margin-top: 3px;
}

.work .meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  margin-top: 7px;
}

/* ---------- now ---------- */
.asof {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-3);
}

.now {
  max-width: var(--measure);
  margin-top: 0.7rem;
}

.now li {
  margin-block: 0.5rem;
}

.now li::marker {
  color: var(--ink-3);
}

/* ---------- projects page ---------- */
.project {
  max-width: var(--measure);
  border-top: 1px solid var(--rule-2);
  padding-top: 1.2rem;
  margin-top: clamp(2.4rem, 5vw, 3.2rem);
  scroll-margin-top: 24px;
}

/* arriving via an anchor link briefly marks the entry, like a hand
   pointing at the right line */
.project:target {
  animation: mark 1.6s ease-out 1;
}

@keyframes mark {
  from {
    background: color-mix(in srgb, var(--link) 7%, transparent);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--link) 7%, transparent);
  }
  to {
    background: transparent;
    box-shadow: none;
  }
}

.project h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.project .meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-2);
  margin-top: 6px;
}

.project .body {
  margin-top: 14px;
}

.project .body p + p {
  margin-top: 0.9em;
}

/* ---------- about timeline ---------- */
.stint {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 6px 28px;
  border-top: 1px solid var(--rule);
  padding-block: 18px;
  max-width: var(--measure);
}

.stints .stint:last-child {
  border-bottom: 1px solid var(--rule);
}

.stint__when {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-2);
  padding-top: 4px;
}

.stint h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.stint__org {
  font-size: 0.9rem;
  color: var(--ink-2);
  margin-top: 1px;
}

.stint__body {
  font-size: 0.95rem;
  color: var(--ink-2);
  line-height: 1.65;
  margin-top: 8px;
}

@media (max-width: 620px) {
  .stint {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ---------- resume ---------- */
.resume {
  max-width: 51rem;
}

.resume-actions {
  margin-bottom: 22px;
}

.btn {
  font-family: var(--serif);
  font-size: 0.92rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.resume-name {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.resume-contact {
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.9;
  margin-top: 8px;
}

.resume h2.resume-sec {
  font-size: 1.05rem;
  font-weight: 700;
  border-top: 1px solid var(--rule-2);
  padding-top: 0.9rem;
  margin: 2rem 0 0.9rem;
}

.resume-entry + .resume-entry {
  margin-top: 24px;
}

.resume-entry__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 20px;
}

.resume-entry__role {
  font-size: 1.05rem;
  font-weight: 600;
}

.resume-entry__org {
  font-size: 0.92rem;
  color: var(--ink-2);
  margin-top: 1px;
}

.resume-entry__dates {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-2);
  white-space: nowrap;
}

.resume-entry ul {
  margin-top: 8px;
  padding-left: 1.15em;
}

.resume-entry li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-2);
  margin-block: 4px;
}

.resume-entry li::marker {
  color: var(--ink-3);
}

.resume-entry li strong {
  color: var(--ink);
  font-weight: 600;
}

.resume-summary,
.resume-cert {
  font-size: 0.95rem;
  color: var(--ink-2);
  line-height: 1.65;
}

.resume-skills {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 24px;
  font-size: 0.95rem;
}

.resume-skills dt {
  font-weight: 600;
  font-size: 0.88rem;
}

.resume-skills dd {
  margin: 0;
  color: var(--ink-2);
}

@media (max-width: 560px) {
  .resume-skills {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .resume-skills dd {
    margin-bottom: 10px;
  }
}

/* ---------- contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
  margin-top: clamp(24px, 4vw, 40px);
}

.channels {
  padding: 0;
  list-style: none;
  margin-top: 18px;
}

.channels li {
  border-top: 1px solid var(--rule);
}

.channels li:last-child {
  border-bottom: 1px solid var(--rule);
}

.channels a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 16px;
  padding: 13px 0;
  text-decoration: none;
  transition: padding-left 0.2s ease;
}

.channels a:hover {
  padding-left: 8px;
}

.channels .ch-name {
  font-weight: 600;
  color: var(--ink);
}

.channels .ch-val {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-2);
  word-break: break-all;
}

.channels a:hover .ch-name {
  color: var(--link-hover);
  text-decoration: underline;
}

/* form */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 140px;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--link);
  outline-offset: 0;
  border-color: var(--link);
}

.form-note {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.6;
}

@media (max-width: 760px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--rule-2);
  padding-block: 22px 56px;
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.8;
}

.foot__colophon {
  color: var(--ink-3);
  margin-top: 2px;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .term .cursor {
    animation: none;
  }
  .project:target {
    animation: none;
  }
  a,
  .top__nav a,
  .btn,
  .work,
  .channels a {
    transition: none;
  }
}

/* ---------- print (resume, one page) ---------- */
@media print {
  @page {
    size: letter;
    margin: 0.4in 0.5in;
  }
  body {
    background: #fff;
    font-size: 9.5pt;
  }
  .top,
  .foot,
  .resume-actions,
  .skip-link,
  .page-head {
    display: none !important;
  }
  main {
    padding: 0;
  }
  .wrap {
    padding-inline: 0;
    max-width: none;
  }
  .resume {
    max-width: none;
  }
  .resume-name {
    font-size: 17pt;
  }
  .resume-contact {
    font-size: 7.2pt;
    line-height: 1.5;
    margin-top: 3pt;
  }
  .resume h2.resume-sec {
    font-size: 8.5pt;
    margin: 7pt 0 4pt;
    padding-top: 3pt;
    border-top-color: #999;
  }
  .resume-summary {
    font-size: 8.5pt;
    line-height: 1.4;
  }
  .resume-cert {
    font-size: 8.5pt;
  }
  .resume-skills {
    font-size: 8pt;
    grid-template-columns: 108pt 1fr;
    gap: 0 12pt;
  }
  .resume-skills dt {
    font-size: 7.5pt;
  }
  .resume-entry {
    break-inside: avoid;
  }
  .resume-entry + .resume-entry {
    margin-top: 5pt;
  }
  .resume-entry__role {
    font-size: 10pt;
  }
  .resume-entry__org {
    font-size: 8pt;
    margin-top: 0;
  }
  .resume-entry__dates {
    font-size: 7.5pt;
  }
  .resume-entry ul {
    margin-top: 2pt;
    padding-left: 10pt;
  }
  .resume-entry li {
    font-size: 8.5pt;
    line-height: 1.35;
    margin-block: 0.5pt;
  }
  .resume-entry li,
  .resume-entry__org,
  .resume-skills dd,
  .resume-summary,
  .resume-cert {
    color: #333;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
}
