/* ==========================================================
   Dhrumil Kherde · Portfolio v2 · "The working drawing"
   Paper, ink, one drafting red. No gradients.
   ========================================================== */

:root {
  --paper: #f2f3ef;
  --paper-2: #e9ebe4;
  --ink: #17191b;
  --ink-2: #575d60;
  --line: #d4d8cd;
  --line-strong: #b9beb1;
  --red: #d92c14;
  --dark: #131518;
  --paper-on-dark: #e8eae3;

  --font-sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --frame-w: 1240px;
  --pad: clamp(20px, 4vw, 48px);
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 40px;
  --sp-5: 64px;
  --sp-6: 104px;
  --sp-7: 160px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

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

::selection { background: var(--ink); color: var(--paper); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- type voices ---------- */

.eyebrow, .nav-status, .sheet-head, .side-label, .fact-label,
.bom, .tolerances, .tb-key, .redline-note {
  font-family: var(--font-mono);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  height: 64px;
}

.nav-mark { color: var(--ink); display: inline-flex; }

.nav-links {
  display: flex;
  gap: var(--sp-3);
  margin-left: auto;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  transition: color 0.15s var(--ease);
}
.nav-links a:hover { color: var(--ink); }

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(72px, 12vh, 140px);
  padding-bottom: var(--sp-6);
}

.hero .eyebrow { margin-bottom: var(--sp-3); }

.hero-headline {
  position: relative;
  /* room on the right for the vertical dimension line */
  padding-right: clamp(100px, 9vw, 130px);
  width: fit-content;
}

.hero h1 {
  font-weight: 780;
  font-stretch: 122%;
  font-size: clamp(44px, 8.2vw, 108px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-transform: none;
}

.h1-line { display: block; width: fit-content; position: relative; }
.h1-line-two { color: var(--red); }

.redline-note {
  margin-top: 46px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.redline-note::before { content: "// "; color: var(--red); }

.hero-foot {
  margin-top: var(--sp-5);
  display: grid;
  grid-template-columns: minmax(0, 56ch) 1fr;
  gap: var(--sp-4);
  align-items: end;
}

.hero-sub {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-2);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
}

/* ---------- buttons & links ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  padding: 14px 22px;
  border: 1px solid var(--ink);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); }

.link-arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 3px;
  transition: border-color 0.15s var(--ease);
  width: fit-content;
}
.link-arrow:hover { border-color: var(--red); }

/* ---------- facts strip ---------- */

.facts {
  border-block: 1px solid var(--line);
  background: var(--paper-2);
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.fact {
  padding: var(--sp-3) var(--sp-3) var(--sp-3) 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fact + .fact { border-left: 1px solid var(--line); padding-left: var(--sp-3); }

.fact-num {
  font-weight: 740;
  font-stretch: 116%;
  font-size: clamp(22px, 2.4vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1;
}

.fact-label {
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ---------- sections ---------- */

.section-head { margin-bottom: var(--sp-5); }

.section-head h2 {
  font-weight: 760;
  font-stretch: 120%;
  font-size: clamp(30px, 4.4vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.section-note {
  margin-top: var(--sp-2);
  max-width: 62ch;
  color: var(--ink-2);
}

/* ---------- work sheets ---------- */

.work { padding-block: var(--sp-7) var(--sp-6); }

.sheet { margin-bottom: var(--sp-6); }
.sheet:last-child { margin-bottom: 0; }

.sheet-head {
  display: flex;
  gap: var(--sp-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.sheet-head span:first-child { color: var(--ink); font-weight: 500; }
.sheet-head-right { margin-left: auto; }

.sheet-body {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--sp-4);
  padding-top: var(--sp-4);
  align-items: start;
}

.sheet-media {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
  aspect-ratio: 4 / 3;
}

.sheet-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.7s var(--ease);
}

.sheet:hover .sheet-media img { transform: scale(1.015); }

.sheet-media-tall { aspect-ratio: 4 / 3.4; }

.sheet-text h3 {
  font-weight: 700;
  font-stretch: 112%;
  font-size: clamp(21px, 2.2vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: var(--sp-2);
}

.sheet-text p {
  color: var(--ink-2);
  margin-bottom: var(--sp-2);
}

.tolerances {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  margin: var(--sp-3) 0;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.tolerances strong {
  display: block;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0;
  color: var(--ink);
}

.proof {
  border-left: 2px solid var(--red);
  padding-left: var(--sp-2);
  margin-bottom: var(--sp-3);
  font-size: 15px;
  color: var(--ink-2);
}

.proof cite {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- shipped / BOM ---------- */

.shipped {
  border-block: 1px solid var(--line);
  background: var(--paper-2);
  padding-block: var(--sp-6);
}

.bom {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.5;
}

.bom th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 0 var(--sp-2) 10px 0;
  border-bottom: 1px solid var(--ink);
}

.bom td {
  padding: 14px var(--sp-2) 14px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.bom td:first-child { color: var(--ink-2); width: 5%; }
.bom td:nth-child(2) { width: 20%; white-space: nowrap; }
.bom td:nth-child(3) { color: var(--ink-2); width: 42%; font-family: var(--font-sans); font-size: 15px; }
.bom td:nth-child(4) { color: var(--ink-2); width: 23%; }

.bom td a {
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color 0.15s var(--ease);
}
.bom td a:hover { border-color: var(--red); }

.bom-live { color: var(--red); font-weight: 500; text-transform: uppercase; font-size: 12px; letter-spacing: 0.08em; }

.bom-link-col { width: 10%; }

/* ---------- about ---------- */

.about { padding-block: var(--sp-7); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 64ch) 1fr;
  gap: var(--sp-5);
}

.about-text p { color: var(--ink-2); margin-bottom: var(--sp-3); font-size: 18px; }
.about-text p:last-child { margin-bottom: 0; }

.about-side { padding-top: 6px; }

.side-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: var(--sp-2);
}
.side-label + .side-list { margin-bottom: var(--sp-4); }

.side-list { list-style: none; }
.side-list li {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

/* ---------- footer / title block ---------- */

.footer {
  background: var(--dark);
  color: var(--paper-on-dark);
  padding-block: var(--sp-6) var(--sp-4);
}

.footer-kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--paper-on-dark) 55%, transparent);
  margin-bottom: var(--sp-2);
}

.footer-email {
  display: inline-block;
  font-weight: 760;
  font-stretch: 120%;
  font-size: clamp(28px, 5.6vw, 72px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-decoration: none;
  color: var(--paper-on-dark);
  margin-bottom: var(--sp-5);
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s var(--ease);
  overflow-wrap: anywhere;
}
.footer-email:hover { border-color: var(--red); }

.title-block {
  display: grid;
  grid-template-columns: repeat(6, auto) 1fr;
  border: 1px solid color-mix(in srgb, var(--paper-on-dark) 30%, transparent);
}

.tb-cell {
  padding: 12px 18px;
  border-right: 1px solid color-mix(in srgb, var(--paper-on-dark) 30%, transparent);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tb-cell:last-child { border-right: 0; }

.tb-key {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--paper-on-dark) 50%, transparent);
}

.tb-val { font-size: 13.5px; white-space: nowrap; }

.tb-links {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
}

.tb-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper-on-dark);
  border-bottom: 1px solid color-mix(in srgb, var(--paper-on-dark) 35%, transparent);
  padding-bottom: 2px;
  transition: border-color 0.15s var(--ease);
}
.tb-links a:hover { border-color: var(--red); }

/* ---------- redline annotations (drawn by JS) ---------- */

.redline {
  position: absolute;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.redline.on { opacity: 1; }

/* vertical dimension line: ticks top/bottom */
.redline-v {
  border-right: 1px solid var(--red);
  width: 0;
}
.redline-v::before, .redline-v::after {
  content: "";
  position: absolute;
  right: -5px;
  width: 11px;
  height: 1px;
  background: var(--red);
}
.redline-v::before { top: 0; }
.redline-v::after { bottom: 0; }

.redline-v .redline-label {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}

/* horizontal dimension line: ticks left/right */
.redline-h {
  border-top: 1px solid var(--red);
  height: 0;
}
.redline-h::before, .redline-h::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 1px;
  height: 11px;
  background: var(--red);
}
.redline-h::before { left: 0; }
.redline-h::after { right: 0; }

.redline-h .redline-label {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .redline { transition: none; }
  .live-dot { animation: none; }
  .sheet-media img { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .facts-grid { grid-template-columns: repeat(3, 1fr); }
  .fact { padding-block: var(--sp-2); }
  .fact:nth-child(4) { border-left: 0; padding-left: 0; }
  .fact:nth-child(n+4) { border-top: 1px solid var(--line); }

  .sheet-body, .sheet-body-flag { grid-template-columns: 1fr; }
  .sheet-media-tall { aspect-ratio: 4 / 3; }

  .about-grid { grid-template-columns: 1fr; gap: var(--sp-4); }

  .title-block { grid-template-columns: repeat(3, 1fr); }
  .tb-cell { border-top: 1px solid color-mix(in srgb, var(--paper-on-dark) 30%, transparent); margin-top: -1px; }
  .tb-links { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .nav-inner { gap: var(--sp-2); }
  .nav-status { display: none; }
  .nav-links { gap: var(--sp-2); }
  .nav-links a { font-size: 12px; }

  .hero { padding-top: 56px; }
  .hero-headline { padding-right: 0; }
  .hero-foot { grid-template-columns: 1fr; }
  .hero-cta { align-items: flex-start; }

  .facts-grid { grid-template-columns: 1fr 1fr; }
  .fact + .fact { border-left: 0; padding-left: 0; }
  .fact:nth-child(even) { border-left: 1px solid var(--line); padding-left: var(--sp-2); }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }

  .work { padding-block: var(--sp-6) var(--sp-5); }
  .about { padding-block: var(--sp-6); }

  .sheet-head { flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); }
  .sheet-head-right { display: none; }

  /* title block collapses to a 2-column card */
  .title-block { grid-template-columns: 1fr 1fr; }
  .tb-cell { padding: 10px 14px; }
  .tb-cell:nth-child(even) { border-right: 0; }
  .tb-val { white-space: normal; }
  .tb-links { justify-content: flex-start; gap: var(--sp-2); flex-wrap: wrap; }

  /* BOM collapses to cards */
  .bom thead { display: none; }
  .bom tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 4px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .bom td { display: block; padding: 0; border: 0; width: auto !important; }
  .bom td:nth-child(3) { grid-column: 1 / -1; }
  .bom td:nth-child(4) { grid-column: 1 / -1; font-size: 12px; }
}
