/* rajshubham.com: the living datasheet. Tokens only; nothing shared with websuprime's Ledger. */
:root {
  --paper: #FFFFFF;
  --surface: #F5F6F7;
  --ink: #111418;
  --muted: #5B626B;
  --rule: #CDD2D8;
  --marker: #FFD43B;      /* only ever a fill behind ink text, or the waveform's high state */
  --on-marker: #111418;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 40px; --s7: 64px;
  --measure: 1120px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111418;
    --surface: #1A1E23;
    --ink: #ECEEF0;
    --muted: #A0A7B0;
    --rule: #343A42;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
code, .mono, pre { font-family: var(--mono); font-size: 0.86em; }
mark { background: var(--marker); color: var(--on-marker); padding: 0 .18em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s4); top: var(--s4); background: var(--paper); padding: var(--s2) var(--s3); z-index: 10; }

/* Running header / footer, like a printed sheet */
.run {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); align-items: center; justify-content: space-between;
  max-width: var(--measure); margin: 0 auto; padding: var(--s3) var(--s4);
  font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.run--head { border-bottom: 1px solid var(--ink); }
.run--foot { border-top: 1px solid var(--ink); margin-top: var(--s7); padding-bottom: var(--s6); }
.run a { text-decoration: none; }
.run a:hover, .run a[aria-current] { color: var(--ink); text-decoration: underline; }
.run__part { display: inline-flex; gap: var(--s2); align-items: center; color: var(--ink); }
.run__mark { width: 18px; height: 18px; }
.run__nav { display: flex; gap: var(--s4); }

main { max-width: var(--measure); margin: 0 auto; padding: 0 var(--s4); }

/* Title block */
.title {
  display: grid; gap: var(--s5); padding: var(--s6) 0 var(--s5);
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 860px) { .title { grid-template-columns: 1fr 320px; align-items: end; } }
.label { margin: 0 0 var(--s3); font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.title__name {
  margin: 0; font-weight: 800; font-stretch: 72%; text-transform: uppercase;
  font-size: clamp(44px, 9vw, 104px); line-height: .9; letter-spacing: -.01em;
}
.title__name--doc { text-transform: none; font-stretch: 85%; font-weight: 700; font-size: clamp(34px, 6vw, 64px); line-height: 1; }
.title__role { margin: var(--s4) 0 0; font-size: 19px; font-weight: 500; }
.title__summary { margin: var(--s4) 0 0; max-width: 60ch; color: var(--muted); }
.title__facts { margin: 0; border-top: 1px solid var(--ink); }
.title__facts div, .order div { display: grid; grid-template-columns: 112px 1fr; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.title__facts dt, .order dt { font: 500 12px/1.9 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.title__facts dd, .order dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4);
  border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
  font: 500 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 200ms var(--ease);
}
.btn:hover { background: var(--surface); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--ink); box-shadow: inset 0 -4px 0 var(--marker); }
.btn:disabled { opacity: .5; cursor: progress; }

/* Sections */
.sheet { display: grid; gap: 0 var(--s6); }
@media (min-width: 860px) { .sheet { grid-template-columns: 1fr 1fr; } }
.sec { padding: var(--s5) 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.sec--span { grid-column: 1 / -1; }
.sec h2 {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s3);
  margin: 0 0 var(--s4); font-size: 22px; font-weight: 700; font-stretch: 85%; line-height: 1.2;
}
.sec__no { font: 500 13px/1 var(--mono); padding: 5px 7px; border: 1px solid var(--ink); }
.sec__plain { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.note { color: var(--muted); font-size: 14px; }
.lead { font-size: 19px; max-width: 64ch; }
.num { text-align: right; font-family: var(--mono); font-size: 14px; }
.nowrap { white-space: nowrap; }
.scroll { overflow-x: auto; }

.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: var(--s2) 0 var(--s2) 28px; border-top: 1px solid var(--rule); }
.ticks li:first-child { border-top: 0; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 1.05em; width: 12px; height: 6px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg); }

/* Tables: datasheet hairlines */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
thead th { font: 500 12px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
tbody th { font-weight: 500; }
.chars td[data-k] { transition: background-color 600ms var(--ease); }
.chars td.is-fresh { background: var(--marker); color: var(--on-marker); }
.revs ul { margin: 0; padding-left: 18px; }
.revs li + li { margin-top: var(--s1); }

/* Pin configuration */
.pinwrap { display: grid; gap: var(--s5); align-items: start; }
@media (min-width: 860px) { .pinwrap { grid-template-columns: 420px 1fr; } }
.chip { margin: 0; }
.chip__svg { width: 100%; max-width: 420px; height: auto; display: block; }
.chip__body { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.chip__notch { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chip__dot { fill: var(--ink); }
.chip__leg { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chip__part { font: 700 20px var(--sans); font-stretch: 72%; fill: var(--ink); letter-spacing: .04em; }
.chip__sub { font: 500 10px var(--mono); fill: var(--muted); letter-spacing: .12em; }
.chip__no { font: 500 11px var(--mono); fill: var(--muted); }
.chip__name { font: 500 13px var(--mono); fill: var(--ink); }
a.chip__pin:hover .chip__leg, a.chip__pin:focus-visible .chip__leg { fill: var(--marker); }
a.chip__pin:hover .chip__name { text-decoration: underline; }
.pins td, .pins th { padding: 6px var(--s3); }

/* Timing diagram */
.wave__svg { width: 100%; height: auto; display: block; background: var(--surface); border: 1px solid var(--rule); }
.wave__status { margin: var(--s2) 0 0; font-size: 13px; color: var(--muted); min-height: 1.6em; }
.wave__bar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s3); }
.wave__bar .note { margin: 0; flex: 1 1 220px; }
.w-lane { font: 500 12px var(--mono); fill: var(--ink); letter-spacing: .04em; }
.w-val { font: 500 12px var(--mono); fill: var(--muted); }
.w-val--on { fill: var(--ink); }
.w-axis { stroke: var(--rule); stroke-width: 1; }
.w-tick { font: 400 11px var(--mono); fill: var(--muted); }
.w-sig { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: miter; }
.w-high { fill: var(--marker); }
.w-dim { stroke: var(--muted); stroke-width: 1; }
.wave.is-drawing .w-sig { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 600ms ease-in-out forwards; }
.wave.is-drawing .w-high { opacity: 0; animation: fade 240ms ease-out 400ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* Case studies */
.apps { display: grid; gap: var(--s5); }
@media (min-width: 860px) { .apps { grid-template-columns: 1fr 1fr; } }
.app { border-top: 1px solid var(--ink); padding-top: var(--s4); }
.app h3 { margin: 0 0 var(--s2); font-size: 26px; font-stretch: 85%; font-weight: 700; line-height: 1.1; }
.app h3 a { text-decoration: none; }
.app h3 a:hover { text-decoration: underline; }
.app__stack { color: var(--muted); }

.doc { max-width: 760px; }
.flow { list-style: none; counter-reset: f; margin: 0; padding: 0; }
.flow li { counter-increment: f; display: grid; grid-template-columns: 44px 1fr; gap: var(--s1) var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--rule); }
.flow li::before { content: counter(f, decimal-leading-zero); grid-row: span 2; font: 500 13px/1.8 var(--mono); color: var(--muted); }
.flow__t { font-weight: 600; }
.hard + .hard { border-top: 1px solid var(--rule); }
.hard h3 { margin: var(--s3) 0 var(--s1); font-size: 18px; }
.hard p { margin: 0 0 var(--s3); }
.doc__nav { display: flex; flex-wrap: wrap; gap: var(--s5); padding: var(--s5) 0; font-weight: 500; }

/* Ordering / terminal */
.order { margin: 0 0 var(--s5); max-width: 640px; }
.term { margin: 0; padding: var(--s4); background: var(--ink); color: var(--paper); overflow-x: auto; font-size: 13px; line-height: 1.7; }
.term__p { color: var(--marker); }
.term__c { color: #8A939D; }

/* Résumé page = the printable datasheet */
.cv { max-width: 820px; padding-top: var(--s6); }
.cv__head { display: grid; gap: var(--s4); border-bottom: 1px solid var(--ink); padding-bottom: var(--s5); }
@media (min-width: 760px) { .cv__head { grid-template-columns: 1fr auto; align-items: end; } }
.cv .title__name { font-size: clamp(40px, 7vw, 72px); }
.cv__actions { display: flex; gap: var(--s3); margin: 0; }
.cv__role { padding: var(--s3) 0; border-top: 1px solid var(--rule); }
.cv__role:first-of-type { border-top: 0; }
.cv__role h3 { margin: 0; font-size: 17px; }
.cv__role ul { margin: var(--s2) 0 0; padding-left: 18px; }
.cv__when { margin: 0; color: var(--muted); }
.cv .sec h2 { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .wave.is-drawing .w-sig { stroke-dasharray: none; }
  .wave.is-drawing .w-high { opacity: 1; }
}

@media print {
  :root { --paper: #fff; --ink: #000; --muted: #444; --rule: #bbb; --surface: #fff; }
  body { font-size: 11pt; line-height: 1.45; }
  .run--head nav, .noprint, .skip, .wave__bar, .actions { display: none !important; }
  .run--foot { margin-top: var(--s5); }
  a { text-decoration: none; }
  .sec { break-inside: avoid; padding: var(--s3) 0; }
  .cv { padding-top: 0; }
  @page { margin: 14mm 14mm; }
}
