/* ============================================================
   ashishmeshram.com — design system
   Aesthetic: precision test-lab. Graph-paper grid, hairline
   rules, instrument mono labels. Accent = HV signal orange,
   the colour of high-voltage cabling in the EVs Ashish tests.
   Type: Archivo (display/body) + IBM Plex Mono (data).
   ============================================================ */

:root {
  --paper: #f7f6f1;
  --paper-2: #ffffff;
  --ink: #16181b;
  --ink-soft: #4d5158;
  --ink-faint: #8a8e95;
  --line: #ddd9cf;
  --line-soft: #e8e5dc;
  --hv: #ff4d00;          /* HV signal orange */
  --hv-deep: #c43a00;
  --hv-tint: #fff0e8;
  --grid: rgba(22, 24, 27, 0.045);
  --radius: 2px;
  --maxw: 1120px;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

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

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

body {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--hv); color: #fff; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--hv);
  outline-offset: 3px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- mono utility labels ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.mono .tick { color: var(--hv); }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 241, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  position: relative;
  background: var(--paper-2);
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: -1.5px;
  bottom: -1.5px;
  width: 9px;
  height: 9px;
  background: var(--hv);
}
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--hv); }
.nav-links a.nav-cta {
  border: 1.5px solid var(--ink);
  padding: 7px 16px;
  color: var(--ink);
  font-weight: 600;
}
.nav-links a.nav-cta:hover { background: var(--ink); color: var(--paper); }
.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--ink);
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
@media (max-width: 820px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 20px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 0; font-size: 1rem; border-bottom: 1px solid var(--line-soft); }
  .nav-links a.nav-cta { border: 1.5px solid var(--ink); margin-top: 14px; text-align: center; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 14px 26px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, color 0.15s;
}
.btn:hover { background: var(--hv); border-color: var(--hv); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.hv { background: var(--hv); border-color: var(--hv); color: #fff; }
.btn.hv:hover { background: var(--hv-deep); border-color: var(--hv-deep); }
.btn .arr { font-family: var(--font-mono); }

/* ---------- section scaffolding ---------- */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section.flush { border-top: none; }
.sec-head { margin-bottom: 48px; }
.sec-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.sec-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; }
.sec-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); max-width: 22ch; }
.sec-title em { font-style: normal; color: var(--hv); }
.lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 62ch; }

/* ---------- hero (shared bones) ---------- */
.hero { position: relative; overflow: hidden; padding: 88px 0 72px; }
.hero-eyebrow { margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  line-height: 0.98;
}
.hero h1 .hv { color: var(--hv); }
.hero .sub {
  margin-top: 26px;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 56ch;
}
.hero-cta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }

/* oscilloscope trace */
.trace-wrap { margin-top: 56px; border: 1px solid var(--line); background: var(--paper-2); position: relative; }
.trace-wrap .trace-meta {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
@media (max-width: 680px) {
  .trace-meta .mono:nth-child(2),
  .trace-meta .mono:nth-child(3) { display: none; }
}
.trace-svg { width: 100%; height: auto; display: block; }
.trace-line {
  fill: none;
  stroke: var(--hv);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-dasharray: 5200;
  stroke-dashoffset: 5200;
  animation: trace-draw 3.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}
.trace-line.glow { stroke-width: 5; opacity: 0.35; }
.trace-ch2 {
  fill: none;
  stroke: #b9b5a8;
  stroke-width: 1.75;
  stroke-dasharray: 1300;
  stroke-dashoffset: 1300;
  animation: trace-draw 3s ease-out 0.15s forwards;
}
@keyframes trace-draw { to { stroke-dashoffset: 0; } }
.scan-cursor { animation: scan-sweep 9s linear 3.9s infinite; }
@keyframes scan-sweep {
  from { transform: translateX(0); }
  to { transform: translateX(1120px); }
}
@media (prefers-reduced-motion: reduce) {
  .trace-line, .trace-ch2 { stroke-dasharray: none; stroke-dashoffset: 0; }
  .scan-cursor { display: none; }
}

/* ---------- readout stats ---------- */
.readouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.readout { padding: 24px 24px 22px; border-right: 1px solid var(--line-soft); }
.readout:last-child { border-right: none; }
.readout::before {
  content: "";
  display: block;
  width: 22px;
  height: 3px;
  background: var(--hv);
  margin-bottom: 14px;
}
.readout .val {
  font-family: var(--font-mono);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.readout .val small { font-size: 0.55em; color: var(--hv); font-weight: 600; }
.readout .key { margin-top: 6px; }
@media (max-width: 820px) {
  .readout { border-bottom: 1px solid var(--line-soft); }
}

/* ---------- cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 920px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.cell {
  background: var(--paper-2);
  padding: 32px 28px;
  transition: background 0.15s;
}
.cell:hover { background: var(--hv-tint); }
.cell h3 { font-size: 1.06rem; margin: 14px 0 10px; }
.cell p { font-size: 0.92rem; color: var(--ink-soft); }
.cell .idx { color: var(--hv); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--paper);
}

/* ---------- timeline ---------- */
.timeline { border-left: 1.5px solid var(--ink); margin-left: 6px; }
.t-item { position: relative; padding: 0 0 44px 36px; }
.t-item:last-child { padding-bottom: 4px; }
.t-item::before {
  content: "";
  position: absolute;
  left: -6.5px;
  top: 7px;
  width: 12px;
  height: 12px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}
.t-item.now::before { background: var(--hv); border-color: var(--hv); }
.t-item .when { margin-bottom: 8px; }
.t-item h3 { font-size: 1.12rem; }
.t-item .org { font-size: 0.9rem; color: var(--ink-soft); margin: 4px 0 12px; }
.t-item ul { list-style: none; }
.t-item li {
  font-size: 0.93rem;
  color: var(--ink-soft);
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.t-item li::before { content: "›"; position: absolute; left: 0; color: var(--hv); font-weight: 700; }
.t-item strong { color: var(--ink); font-weight: 600; }

/* ---------- book panels ---------- */
.book-panel {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper-2);
  padding: 48px;
}
.book-panel.rev { grid-template-columns: 1fr 300px; }
.book-panel.rev .book-cover { order: 2; }
@media (max-width: 860px) {
  .book-panel, .book-panel.rev { grid-template-columns: 1fr; padding: 32px 24px; gap: 32px; }
  .book-panel.rev .book-cover { order: 0; }
  .book-cover { max-width: 280px; margin: 0 auto; }
}
.book-cover {
  position: relative;
  box-shadow: 10px 10px 0 0 var(--hv);
}
.book-cover img { border: 1.5px solid var(--ink); }
.book-panel h2, .book-panel h3.bk { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 14px 0 6px; }
.book-panel .bk-sub { font-weight: 600; color: var(--hv-deep); font-size: 1rem; margin-bottom: 16px; }
.book-panel p { color: var(--ink-soft); font-size: 0.98rem; }
.book-panel .hero-cta { margin-top: 28px; }

/* feature list inside book pages */
.feat { display: flex; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line-soft); }
.feat:last-child { border-bottom: none; }
.feat .f-idx { font-family: var(--font-mono); font-size: 0.78rem; color: var(--hv); font-weight: 600; min-width: 30px; padding-top: 4px; }
.feat h3 { font-size: 1.02rem; margin-bottom: 6px; }
.feat p { font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 7px; }
.field input, .field select {
  width: 100%;
  font-family: var(--font-display);
  font-size: 0.96rem;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: var(--radius);
}
.field input:focus, .field select:focus { border-color: var(--hv); outline: none; }

/* ---------- footer ---------- */
.footer { border-top: 1.5px solid var(--ink); padding: 56px 0 40px; margin-top: 96px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 16px; font-weight: 500; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 9px; }
.footer a { text-decoration: none; font-size: 0.92rem; color: var(--ink-soft); }
.footer a:hover { color: var(--hv-deep); }
.footer .sig { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.footer .sig-sub { font-size: 0.88rem; color: var(--ink-soft); }
.footer-base {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- misc ---------- */
.quoteblock {
  border-left: 3px solid var(--hv);
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 32px 36px;
  font-size: 1.15rem;
  line-height: 1.55;
  font-weight: 500;
  max-width: 760px;
}
.quoteblock cite { display: block; margin-top: 16px; font-style: normal; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
