/* ============================================================
   Prudhvi Vuppalapati — analytics engineer

   Design note. The page is organised the way a warehouse is:
   a schema rail on the left, and a medallion pipeline
   (ingest -> model -> serve) that classifies the work.

   The three metals are SEMANTIC, not decorative. --ingest,
   --model and --serve mean a layer of the pipeline and are
   used nowhere else. Everything else is ink on paper.

   All foreground/background pairs below are >= 4.5:1 in both
   colour schemes.
   ============================================================ */

/* Fonts are self-hosted and subset to the glyphs this site uses. Google's
   stylesheet was a render-blocking third-party request that shipped 147KB
   across 21 files — including a Plex Sans 600 the page never painted — and
   handed every visitor's IP to Google, which the footer promises it doesn't do.
   These five files are 80KB and same-origin. */

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light dark;

  /* ground */
  --paper:   #EDEFF2;
  --panel:   #E4E7EC;
  --ink:     #15171C;   /* 15.56:1 */
  --ink-2:   #4A5260;   /*  6.84:1 */
  --ink-3:   #5C6574;   /*  5.11:1 */
  --rule:    #CDD3DC;

  /* medallion layers — semantic only */
  --ingest:  #95552B;   /*  5.05:1 */
  --model:   #40566E;   /*  6.57:1 */
  --serve:   #7E5D07;   /*  5.27:1 */

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --rail-w: 15.5rem;
  --measure: 62rem;

  --step: 0.25rem;
  --gap-1: 0.5rem;
  --gap-2: 1rem;
  --gap-3: 1.5rem;
  --gap-4: 2.5rem;
  --gap-5: 4rem;
  --gap-6: 6.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #101319;
    --panel:  #171B23;
    --ink:    #E7EAEF;   /* 15.42:1 */
    --ink-2:  #A8B1BF;   /*  8.60:1 */
    --ink-3:  #7F8899;   /*  5.21:1 */
    --rule:   #262C36;

    --ingest: #D08A55;   /*  6.60:1 */
    --model:  #8AA6C4;   /*  7.38:1 */
    --serve:  #D2A62B;   /*  8.17:1 */
  }
}

/* ------------------------------------------------------------ reset */

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

body, h1, h2, h3, p, ul, ol, li, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 1px;
}

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gap-2);
  top: -4rem;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: top 120ms ease;
}
.skip:focus { top: var(--gap-2); }

/* ------------------------------------------------------------ shell */

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  align-items: start;
  /* Keeps the rail beside the text instead of stranding a narrow column on the
     left of an ultra-wide display. */
  max-width: 88rem;
  margin-inline: auto;
}

/* ------------------------------------------------------------- rail */

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--rule);
  background: var(--paper);
}

.rail-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--gap-4) var(--gap-3);
  gap: var(--gap-4);
}

.rail-brand { text-decoration: none; display: block; }


.rail-brand-name {
  display: block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.rail-brand-role {
  display: block;
  margin-top: var(--step);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.rail-toggle { display: none; }

.rail-nav { flex: 1; }

.rail-schema {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: var(--gap-1);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--gap-1);
}

.rail-nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-1);
  padding: 0.4rem 0;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.rail-nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }

.rail-nav a[aria-current='true'] { color: var(--ink); font-weight: 500; }
.rail-nav a[aria-current='true'] .rail-name::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 0.55em;
  width: 4px; height: 4px;
  background: var(--ink);
}

.rail-name { position: relative; }
.rail-type { color: var(--ink-3); font-size: 0.6875rem; }

.rail-foot {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  display: grid;
  gap: var(--step);
}

.rail-status { color: var(--ink-2); display: flex; align-items: center; gap: 0.45rem; }

.dot {
  width: 6px; height: 6px;
  background: var(--serve);
  border-radius: 50%;
  flex: none;
}

.rail-links { display: flex; gap: var(--gap-2); margin-top: var(--gap-1); }
.rail-links a { color: var(--ink-2); text-underline-offset: 3px; }
.rail-links a:hover { color: var(--ink); }

/* ------------------------------------------------------------- main */

.main {
  max-width: var(--measure);
  padding: var(--gap-6) var(--gap-4) var(--gap-5);
  min-width: 0;
}

.sec { padding-block-end: var(--gap-6); }
.sec-contact { padding-block-end: var(--gap-5); }

.sec-head { margin-bottom: var(--gap-4); }

.sec-mark {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: var(--gap-1);
  border-bottom: 1px solid var(--rule);
}

.sec-title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-wrap: balance;
  margin-top: var(--gap-3);
}

.sec-intro {
  margin-top: var(--gap-2);
  max-width: 46rem;
  color: var(--ink-2);
}

.sub-title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
  margin-top: var(--gap-5);
  padding-bottom: var(--gap-1);
  border-bottom: 1px solid var(--rule);
}

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

.sec-profile { padding-block-end: var(--gap-5); }

/* Copy on the left, portrait on the right. The image is written first in the
   markup so that on a narrow screen it appears above the text without any
   reordering trickery; on wide screens grid placement moves it to column two. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: var(--gap-4);
  align-items: start;
}

.hero-text { grid-column: 1; grid-row: 1; min-width: 0; }

.hero-portrait {
  grid-column: 2;
  grid-row: 1;
  margin: var(--gap-3) 0 0;
}

.hero-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--rule);
  background: var(--panel);
}

.hero-kicker {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-top: var(--gap-3);
}

.hero-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(2.5rem, 6.6vw, 4.75rem);
  letter-spacing: -0.05em;
  line-height: 0.98;
  margin-top: var(--gap-2);
}

.hero-thesis {
  font-weight: 500;
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin-top: var(--gap-3);
  padding-top: var(--gap-3);
  border-top: 1px solid var(--rule);
}

.hero-body { margin-top: var(--gap-3); max-width: 44rem; display: grid; gap: var(--gap-2); }
.hero-body p { color: var(--ink-2); }

.hero-actions {
  margin-top: var(--gap-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
}

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--ink);
  transition: background-color 120ms ease, color 120ms ease;
}

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

.btn-quiet { border-color: var(--rule); color: var(--ink-2); }
.btn-quiet:hover { border-color: var(--ink); color: var(--ink); }

/* -------------------------------------------------- medallion strip */
/* The three top rules butt against each other to form one continuous
   line that changes colour at each layer boundary. That line is the
   pipeline. */

.layers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: var(--gap-3);
}

.layer {
  position: relative;
  border-top: 2px solid var(--rule);
  padding: var(--gap-2) var(--gap-2) var(--gap-2) 0;
}

.layer-rule {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i) * 160ms);
}

.layers.is-drawn .layer-rule { transform: scaleX(1); }

.layer[data-layer='ingest'] { color: var(--ingest); }
.layer[data-layer='model']  { color: var(--model); }
.layer[data-layer='serve']  { color: var(--serve); }

.layer-title {
  display: block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: currentColor;
}

.layer-count {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
  margin-top: 2px;
}

.layer-blurb {
  display: block;
  font-size: 0.875rem;
  color: var(--ink-2);
  margin-top: var(--gap-1);
  padding-right: var(--gap-2);
  max-width: 24ch;
}

/* ----------------------------------------------------------- ledger */

.ledger { display: grid; }

.row {
  display: grid;
  grid-template-columns: 3px 5.5rem minmax(0, 1fr) 12rem;
  gap: 0 var(--gap-3);
  padding: var(--gap-3) 0 var(--gap-4);
  border-top: 1px solid var(--rule);
}

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

/* One project carries the most weight. Without this every row reads as equally
   important, which is the flaw the old eleven-identical-cards grid had. */
.row-flag {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: currentColor;
  margin-bottom: var(--gap-1);
}

.row.is-flagship .row-title { font-size: 1.55rem; }
.row.is-flagship .row-one { font-size: 1.125rem; }
.row:not(.is-flagship) .row-title { font-size: 1.125rem; }
.row:not(.is-flagship) .dgm { max-width: 34rem; }
.row:not(.is-flagship) .row-fig { margin-top: var(--gap-2); }
.row[hidden] { display: none; }

.row-spine { background: currentColor; }
.row[data-layer='ingest'] { color: var(--ingest); }
.row[data-layer='model']  { color: var(--model); }
.row[data-layer='serve']  { color: var(--serve); }

.row-layer {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: currentColor;
  padding-top: 0.35rem;
}

.row-main { color: var(--ink); min-width: 0; }

.row-title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.row-sub {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0;
  color: var(--ink-3);
  margin-top: var(--step);
}

.row-one {
  font-weight: 500;
  font-size: 1.0625rem;
  margin-top: var(--gap-2);
}

.row-body { color: var(--ink-2); margin-top: var(--gap-1); }

.row-detail {
  color: var(--ink-3);
  font-size: 0.9375rem;
  margin-top: var(--gap-2);
  padding-left: var(--gap-2);
  border-left: 1px solid var(--rule);
}

.row-link { padding-top: 0.3rem; }

.row-link a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-2);
  text-decoration: none;
}

.row-slug { white-space: nowrap; }

.row-link a:hover { color: var(--ink); }
.row-link a:hover .row-slug { text-decoration: underline; text-underline-offset: 3px; }
.row-link .arrow { transition: transform 140ms ease; }
.row-link a:hover .arrow { transform: translate(2px, -2px); }

/* ---------------------------------------------------- figures, marks */

.row-fig { margin: var(--gap-3) 0 0; }

/* Diagrams are authored SVG rather than generated bitmaps: about 2KB each
   instead of 60KB, crisp at any size, exactly on-palette in both schemes
   because they inherit currentColor, and — the reason that matters — they can
   carry real labels. An unlabelled schematic is texture, not information. */
.dgm {
  display: block;
  width: 100%;
  max-width: 40rem;
  height: auto;
  overflow: visible;
}

.d-box { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.d-box.is-accent { stroke: currentColor; fill: currentColor; fill-opacity: 0.1; }
.d-box.is-heavy { stroke-width: 1.5; fill-opacity: 0.14; }
.d-box.is-dashed-box { stroke-dasharray: 3 3; }

.d-line { stroke: var(--ink-3); stroke-width: 1; fill: none; }
.d-line.is-accent { stroke: currentColor; }
.d-line.is-dashed { stroke-dasharray: 3 3; }

.d-head { fill: var(--ink-3); stroke: none; }
.d-head.is-accent-fill { fill: currentColor; }

.d-label,
.d-sub {
  font-family: var(--mono);
  text-anchor: middle;
  dominant-baseline: auto;
}

.d-label { font-size: 12px; font-weight: 500; fill: var(--ink); }
.d-sub { font-size: 10px; fill: var(--ink-3); }

.d-label.is-accent-text,
.d-sub.is-accent-text { fill: currentColor; }

.d-sub.d-start { text-anchor: start; }
.d-sub.d-end { text-anchor: end; }

/* Retention decay, drawn in flat tints of the layer colour. */
.d-cells rect { stroke: var(--paper); stroke-width: 1; fill: currentColor; }
.d-cells .c1 { fill-opacity: 0.85; }
.d-cells .c2 { fill-opacity: 0.62; }
.d-cells .c3 { fill-opacity: 0.45; }
.d-cells .c4 { fill-opacity: 0.32; }
.d-cells .c5 { fill-opacity: 0.22; }
.d-cells .c6 { fill-opacity: 0.14; }

/* Legacy raster figures, kept working if a project sets figureStyle to "png". */
.row-fig img {
  display: block;
  width: 100%;
  max-width: 36rem;
  height: auto;
  border: 1px solid var(--rule);
  background: #edeff2;
}

@media (prefers-color-scheme: dark) {
  .row-fig img { filter: invert(1) hue-rotate(180deg); }
}

/* Employer / institution mark. A monogram set in the page's own type unless a
   real logo file has been supplied — no invented trademarks. */
.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.45rem;
  margin-bottom: var(--gap-2);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

/* A real wordmark, inlined and inheriting currentColor. Reproduced in one colour
   so it sits inside the page palette — colour on this page means a pipeline
   layer, and a brand red would break that. */
.mark-logo {
  display: flex;
  align-items: center;
  height: 2.4rem;
  margin-bottom: var(--gap-2);
  color: var(--ink-2);
}

.mark-logo svg {
  display: block;
  height: var(--mark-h, 1.2rem);
  width: auto;
  max-width: 100%;
}

/* ------------------------------------------------------------- tags */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-1);
  margin-top: var(--gap-2);
}

.tags li {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
}

.tags .is-evidenced { color: var(--ink); border-color: var(--ink-3); }

.tags .is-evidenced::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--serve);
  margin-right: 0.4rem;
  vertical-align: 0.12em;
}

/* ------------------------------------------------------------ roles */

.roles { display: grid; }

.role {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--gap-3);
  padding: var(--gap-4) 0;
  border-top: 1px solid var(--rule);
}
.role:last-child { border-bottom: 1px solid var(--rule); }

.role-when { font-family: var(--mono); font-size: 0.8125rem; }
.role-period { color: var(--ink-2); }
.role-len { color: var(--ink-3); font-size: 0.6875rem; margin-top: 2px; }

.role.is-current .role-period::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--serve);
  margin-left: 0.45rem;
  vertical-align: 0.05em;
}

.role-title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.025em;
}

.role-co { font-size: 0.9375rem; color: var(--ink-2); margin-top: var(--step); }
.role-co span { color: var(--ink-3); }

.role-bullets { margin-top: var(--gap-2); display: grid; gap: var(--gap-1); }

.role-bullets li {
  position: relative;
  padding-left: var(--gap-2);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.role-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px; height: 1px;
  background: var(--ink-3);
}

/* -------------------------------------------------------- education */

.edus { display: grid; }

.edu {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--gap-3);
  padding: var(--gap-3) 0;
  border-bottom: 1px solid var(--rule);
}

.edu-date { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-2); }
.edu-degree { font-family: var(--mono); font-weight: 600; font-size: 1rem; letter-spacing: -0.02em; }
.edu-where { font-size: 0.9375rem; color: var(--ink-2); margin-top: var(--step); }
.edu-where span { color: var(--ink-3); }

/* ----------------------------------------------------------- skills */

/* Column flow rather than a grid: a grid equalises row heights, which leaves a
   short group like "Languages" padded out to the height of a long one. */
.skill-grid {
  columns: 3 17rem;
  column-gap: var(--gap-4);
}

.skill-group {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  min-width: 0;
  margin-bottom: var(--gap-4);
}

.skill-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  padding-bottom: var(--gap-1);
  border-bottom: 1px solid var(--rule);
}

.skill-note { font-size: 0.875rem; color: var(--ink-3); margin-top: var(--gap-1); }

/* ---------------------------------------------------------- contact */

.contact { max-width: 40rem; }
.contact-lead { color: var(--ink-2); }

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

.contact-email {
  font-family: var(--mono);
  font-size: clamp(1rem, 2.4vw, 1.375rem);
  letter-spacing: -0.02em;
  text-underline-offset: 5px;
}

.copy {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-2);
  background: none;
  border: 1px solid var(--rule);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
.copy:hover { border-color: var(--ink); color: var(--ink); }
.copy[data-copied='true'] { border-color: var(--serve); color: var(--serve); }

.contact-alt { margin-top: var(--gap-3); color: var(--ink-3); font-size: 0.9375rem; }

/* ------------------------------------------------------------- foot */

.foot {
  border-top: 1px solid var(--rule);
  padding-top: var(--gap-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--gap-1);
}

/* -------------------------------------------------------------- 404 */

.oops {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(4rem, 18vh, 9rem) var(--gap-3) var(--gap-5);
}

.oops-rule { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: var(--gap-4); }
.oops-rule i { display: block; height: 3px; }
.oops-rule i:nth-child(1) { background: var(--ingest); }
.oops-rule i:nth-child(2) { background: var(--model); }
.oops-rule i:nth-child(3) { background: var(--serve); }

.oops-title {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  letter-spacing: -0.04em;
  margin-top: var(--gap-3);
}

.oops-body { margin-top: var(--gap-2); color: var(--ink-2); }

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

@media (max-width: 60rem) {
  .shell { grid-template-columns: 1fr; }

  .rail {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 20;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .rail-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-2);
    padding: var(--gap-2) var(--gap-3);
  }


  .rail-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--rule);
    padding: 0.45rem 0.7rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-2);
    cursor: pointer;
  }

  .rail-toggle-bars { display: grid; gap: 3px; width: 14px; }
  .rail-toggle-bars i {
    display: block;
    height: 1.5px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
  }
  .rail-toggle[aria-expanded='true'] { color: var(--ink); border-color: var(--ink); }
  .rail-toggle[aria-expanded='true'] .rail-toggle-bars i:first-child { transform: translateY(2.25px) rotate(45deg); }
  .rail-toggle[aria-expanded='true'] .rail-toggle-bars i:last-child  { transform: translateY(-2.25px) rotate(-45deg); }

  /* Closed menu is removed from the layout AND the tab order — the old
     build left it off-screen but still focusable. */
  .rail-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: var(--gap-2) var(--gap-3) var(--gap-3);
  }
  .rail-nav.is-open { display: block; }

  .rail-foot { display: none; }

  .main { padding: var(--gap-5) var(--gap-3) var(--gap-4); max-width: none; }

  .layers { grid-template-columns: 1fr; }
  .layer { padding-right: 0; }
  .layer-blurb { max-width: none; }

  .row {
    grid-template-columns: 3px minmax(0, 1fr);
    gap: 0 var(--gap-2);
  }
  .row-layer { grid-column: 2; padding-top: 0; margin-bottom: var(--gap-1); }
  .row-main  { grid-column: 2; }
  .row-link  { grid-column: 2; padding-top: var(--gap-2); }

  .role, .edu { grid-template-columns: 1fr; gap: var(--gap-2); }

  .hero { grid-template-columns: 1fr; gap: var(--gap-3); }
  .hero-text, .hero-portrait { grid-column: 1; grid-row: auto; }
  .hero-portrait { margin-top: 0; width: 8.5rem; }
}

@media (max-width: 34rem) {
  .main { padding-left: var(--gap-2); padding-right: var(--gap-2); }
  .rail-inner { padding-left: var(--gap-2); padding-right: var(--gap-2); }
  .rail-nav { padding-left: var(--gap-2); padding-right: var(--gap-2); }
  .hero-thesis { max-width: none; }
  .btn { width: 100%; text-align: center; }
}

/* --------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .layer-rule { transform: scaleX(1); }
}

/* ----------------------------------------------------------- print */

@media print {
  .rail, .hero-actions, .copy, .skip { display: none; }
  .shell { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .row, .role { break-inside: avoid; }
  .row-link a::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #555; }
}
