/* =====================================================================
   Atanu Mondal portfolio

   Concept: the site is a waveform viewer. Pages are tabs, headings are bus
   values, the landing page is a simulation run you can scrub. Unknown or
   placeholder values use the X state (red hatch), the way a simulator shows
   a signal nobody has driven yet.

   Colour: one cool ink background, blue for signals, amber for the cursor and
   actions, red only for X (unknown), green only for PASS.
   Type: Geist for reading, Geist Mono for signal names and values.
   Motion: one orchestrated moment (the landing-page run). Everything else
   reacts to what the visitor does.
   ===================================================================== */

:root {
  --bg: #0a0e17;
  --surface: #0f1522;
  --surface-2: #141c2c;
  --line: #1f2b41;
  --line-2: #2c3b57;
  --text: #e8edf6;
  --muted: #8e9bb3;
  --signal: #7aa8ff;
  --amber: #ffc857;
  --x: #ff7a7a;
  --pass: #6fe3a5;

  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 10px;
  --wrap: 1120px;
}

/* ---------- page transitions (tab to tab) ---------- */

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.22s; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ---------- base ---------- */

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; padding-bottom: 96px; }

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

a { color: inherit; }

p { margin: 0 0 1em; }

h1, h2, h3 { margin: 0; font-family: var(--sans); }

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 60;
  padding: 8px 14px;
  background: var(--amber);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
}
.skip:focus { top: 12px; }

.section { padding-top: 88px; }

.lede {
  max-width: 44em;
  margin: 10px 0 32px;
  color: var(--muted);
}

/* ---------- title bar with tabs ---------- */

.chrome {
  position: sticky;
  top: 0;
  z-index: 40;
  view-transition-name: chrome;
  background: rgba(10, 14, 23, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.chrome-in {
  display: flex;
  align-items: stretch;
  gap: 28px;
  max-width: var(--wrap);
  min-height: 60px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand svg { width: 24px; height: 24px; flex: none; }

.tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.tabs a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.tabs a:hover,
.tabs a[aria-current="page"] { color: var(--text); }

.ind {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--amber);
  view-transition-name: tab-ind;
}

.chrome-btns { display: flex; align-items: center; gap: 8px; }

.chrome .mail {
  align-self: center;
  padding: 7px 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s;
}

.chrome .mail:hover { border-color: var(--amber); }

/* ---------- shared components ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font: 500 0.78rem/1.2 var(--mono);
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.btn:hover { border-color: var(--signal); }

.btn.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--bg);
  font-weight: 600;
}

.btn.primary:hover { background: #ffd47f; border-color: #ffd47f; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font: 500 0.76rem/1.5 var(--mono);
  color: var(--muted);
  white-space: nowrap;
}

.chip.is-pass { color: var(--pass); border-color: rgba(111, 227, 165, 0.4); }
.chip.is-wip { color: var(--amber); border-color: rgba(255, 200, 87, 0.4); }
.chip.is-x { color: var(--x); border-color: rgba(255, 122, 122, 0.45); border-style: dashed; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* bus value: the hexagonal shape a simulator draws for a multi-bit signal */

.hexbus {
  --cut: 12px;
  --hex: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%);
  --c: var(--signal);
  padding: 1.5px;
  background: var(--c);
  clip-path: var(--hex);
}

.hexbus > .in {
  background: var(--surface);
  clip-path: var(--hex);
  color: var(--text);
}

.hexbus.is-x { --c: var(--x); }

.hexbus.is-x > .in {
  background:
    repeating-linear-gradient(135deg, rgba(255, 122, 122, 0.2) 0 5px, rgba(255, 122, 122, 0) 5px 10px),
    var(--surface);
  color: var(--x);
}

/* ---------- footer ---------- */

.foot {
  padding: 26px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
}

.foot p { margin: 0; }

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot a { text-underline-offset: 4px; }
.foot a:hover { color: var(--text); }

/* =====================================================================
   Landing page: the viewer
   ===================================================================== */

.hero { padding-top: 40px; }

.viewer .readout {
  display: inline-block;
  min-width: 11ch;
  text-align: right;
  color: var(--amber);
}

.bar-right { display: inline-flex; align-items: center; gap: 14px; }

.replay {
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 500 0.74rem/1.4 var(--mono);
  cursor: pointer;
  transition: border-color 0.15s;
}

.replay:hover { border-color: var(--amber); }

.vbody {
  --namew: 92px;
  --valw: 176px;
  --padr: 16px;
  position: relative;
  container-type: inline-size;
  touch-action: pan-y;
}

.vbody:focus-visible { outline-offset: -3px; }

.vgrid {
  position: absolute;
  top: 30px;
  bottom: 0;
  left: calc(var(--namew) + var(--valw));
  right: var(--padr);
  border-right: 1px solid var(--line);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 20% 100%;
  pointer-events: none;
}

.vrow {
  display: grid;
  grid-template-columns: var(--namew) var(--valw) minmax(0, 1fr);
  align-items: center;
  border-top: 1px solid var(--line);
}

.vrow.ruler { height: 30px; border-top: 0; }

.vname {
  padding-left: 16px;
  font: 500 0.8rem/1 var(--mono);
  color: var(--muted);
}

.vval {
  padding-right: 12px;
  overflow: hidden;
  font: 500 0.8rem/1 var(--mono);
  color: var(--amber);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vwave {
  position: relative;
  height: var(--h, 44px);
  margin-right: var(--padr);
}

.vruler { height: 30px; }

.tick {
  position: absolute;
  top: 50%;
  left: var(--x);
  transform: translate(-50%, -50%);
  font: 400 0.7rem/1 var(--mono);
  color: var(--muted);
  white-space: nowrap;
}

.tick.is-first { transform: translate(0, -50%); }
.tick.is-last { transform: translate(-100%, -50%); }

.js .vtrace { clip-path: inset(0 100% 0 0); }

.wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wave path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}

.seg {
  --cut: 10px;
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: var(--l);
  width: var(--w);
}

.seg > .in {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 calc(var(--cut) + 6px);
  overflow: hidden;
  font: 500 0.85rem/1.2 var(--mono);
  white-space: nowrap;
}

.seg.is-name > .in {
  justify-content: flex-start;
  padding-left: calc(var(--cut) + 14px);
  white-space: normal;
}

.seg h1 {
  font-size: clamp(1.4rem, 4.6cqw, 3.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.seg .short { display: none; }

.cursor-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--namew) + var(--valw));
  right: var(--padr);
  pointer-events: none;
}

.cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 0;
  border-left: 1.5px solid var(--amber);
}

.js .cursor { left: 0; }

.cursor::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5.5px;
  width: 10px;
  height: 9px;
  background: var(--amber);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* intro + education */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: start;
  margin-top: 44px;
}

.lead {
  max-width: 36em;
  margin: 0 0 28px;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  line-height: 1.6;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.edu {
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--r);
  background: var(--surface);
}

.edu h2 {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.edu-degree {
  margin: 12px 0 2px;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.edu-spec { margin: 0 0 18px; color: var(--muted); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* results log */

.log-lines { margin: 0; padding: 6px 0; list-style: none; }

.log-lines li {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.log-lines li:first-child { border-top: 0; }

.log-lines .pass { font: 600 0.8rem/1 var(--mono); color: var(--pass); }
.log-lines .what a { text-underline-offset: 4px; }
.log-lines .what a:hover { color: var(--amber); }
.log-lines .val { font: 500 0.85rem/1.4 var(--mono); color: var(--muted); }

.js [data-reveal]:not(.is-in) .log-lines li {
  opacity: 0;
  transform: translateX(-10px);
}

[data-reveal].is-in .log-lines li {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
  transition-delay: calc(var(--i, 0) * 140ms);
}

/* =====================================================================
   Skills: the testbench diagram
   ===================================================================== */

.skills-grid { display: block; }

.tb-wrap {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--line);
}

.tb { display: block; width: 100%; max-width: 900px; height: auto; margin: 0 auto; }

.tb .frame { fill: none; stroke: var(--line-2); stroke-dasharray: 4 6; }
.tb .group { fill: none; stroke: var(--line); }
.tb .wire { fill: none; stroke: var(--line-2); stroke-width: 1.4; }
.tb .arrow { fill: var(--line-2); }
.tb .box { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.2; transition: fill 0.15s, stroke 0.15s; }
.tb .sub { fill: var(--surface); stroke: var(--line); stroke-width: 1; }
.tb .g-name { font: 500 12.5px var(--mono); fill: var(--muted); }
.tb .n-name { font: 500 12.5px var(--mono); fill: var(--muted); }
.tb .n-skill { font: 600 14.5px var(--sans); fill: var(--text); }
.tb .n-small { font: 500 13px var(--sans); fill: var(--text); }
.tb .packet { fill: var(--amber); filter: drop-shadow(0 0 5px rgba(255, 200, 87, 0.9)); }

.node { cursor: pointer; outline: none; }
.node:hover > .box,
.node.is-hover > .box { stroke: var(--amber); }
.node.is-active > .box { stroke: var(--amber); fill: rgba(255, 200, 87, 0.1); }
.node:focus-visible > .box { stroke: var(--amber); stroke-width: 2.4; }

.skill-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 36px;
  align-items: start;
  padding: 8px 24px 16px;
}

.skill-group { padding: 14px 0 6px; }

.skill-group h3 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
}

.skill-group ul { margin: 0; padding: 0; list-style: none; }
.skill-item { border-bottom: 1px solid var(--line); }
.skill-item:last-child { border-bottom: 0; }

.skill-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 500 1rem/1.4 var(--sans);
  text-align: left;
  cursor: pointer;
}

.skill-btn:hover { color: var(--amber); }
.skill-item.is-active .skill-btn { color: var(--amber); }

.chev { position: relative; flex: none; width: 12px; height: 12px; }

.chev::before,
.chev::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.25s;
}

.chev::after { transform: rotate(90deg); }
.skill-item.is-active .chev::after { transform: rotate(0deg); }

.skill-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.skill-more > div {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s 0.28s;
}

.skill-item.is-active .skill-more { grid-template-rows: 1fr; }
.skill-item.is-active .skill-more > div { visibility: visible; transition-delay: 0s; }

html:not(.js) .skill-more { grid-template-rows: 1fr; }
html:not(.js) .skill-more > div { visibility: visible; }

.skill-more p { margin: 0 0 8px; color: var(--muted); font-size: 0.95rem; }
.skill-more .used { margin-bottom: 14px; font-size: 0.9rem; }
.skill-more .used a { color: var(--text); text-underline-offset: 3px; }
.skill-more .used a:hover { color: var(--amber); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

.toolbar span:first-child { font: 500 0.8rem var(--mono); color: var(--muted); margin-right: 4px; }

/* explore rows */

.explore { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.explore li { border-bottom: 1px solid var(--line); }

.explore a {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 5fr) 110px;
  gap: 6px 28px;
  align-items: baseline;
  padding: 24px 16px;
  text-decoration: none;
  background: linear-gradient(var(--surface-2), var(--surface-2)) no-repeat left center / 0% 100%;
  transition: background-size 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), padding-left 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.explore a:hover,
.explore a:focus-visible { background-size: 100% 100%; padding-left: 30px; }

.explore .name { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.explore .desc { color: var(--muted); }
.explore .meta { font: 500 0.8rem var(--mono); color: var(--amber); text-align: right; }

/* =====================================================================
   Inner pages
   ===================================================================== */

.pagehead { padding: 56px 0 0; }

.busline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.busline::after {
  content: "";
  flex: 1;
  border-top: 1.5px dashed var(--line-2);
}

.busline .sig { width: 44px; font: 500 0.8rem var(--mono); color: var(--muted); }

.pagebus { --cut: 16px; }
.pagebus > .in { padding: 12px calc(var(--cut) + 30px); }

.pagebus h1 {
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.page-intro { max-width: 40em; margin: 0 0 40px; color: var(--muted); }

/* projects */

.projects { display: grid; gap: 28px; }

.project-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }

.project-main { padding: 26px 28px 30px; }

.project-main h2 { margin-bottom: 12px; font-size: 1.6rem; }

.project-main p { max-width: 38em; color: var(--muted); }

.spec { margin: 22px 0 22px; }

.spec > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-top: 1px dashed var(--line-2);
  font-size: 0.94rem;
}

.spec dt { font: 500 0.78rem/1.7 var(--mono); color: var(--muted); }
.spec dd { margin: 0; }

.repo {
  display: inline-block;
  color: var(--amber);
  font-weight: 600;
  text-underline-offset: 4px;
}

.repo:hover { color: #ffd47f; }
.repo.is-private { color: var(--muted); font-weight: 500; text-decoration: none; }

.project-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
  padding: 26px 28px;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
}

.project-side h3 { font: 500 0.82rem var(--mono); color: var(--muted); }

.readout-list { margin: 0; padding: 0; list-style: none; font: 500 0.92rem/1.4 var(--mono); }

.readout-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-2);
}

.readout-list li:last-child { border-bottom: 0; }
.readout-list .k { color: var(--muted); }
.readout-list .v { color: var(--pass); text-align: right; }
.readout-list .v.is-amber { color: var(--amber); }

.meter { height: 12px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line-2); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 100%; background: var(--pass); transform-origin: left; }

.js [data-reveal]:not(.is-in) .meter > span { transform: scaleX(0); }
[data-reveal].is-in .meter > span { transform: scaleX(1); transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s; }

.big-number { font: 700 2.6rem/1 var(--sans); letter-spacing: -0.04em; color: var(--text); }
.big-number small { font: 500 0.9rem var(--mono); color: var(--muted); letter-spacing: 0; margin-left: 8px; }

.checklist { margin: 0; padding: 0; list-style: none; font-size: 0.94rem; }

.checklist li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
}

.checklist .mark {
  width: 10px;
  height: 10px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--pass);
}

.checklist .is-open .mark { background: transparent; border: 2px solid var(--amber); }
.checklist .is-open { color: var(--muted); }

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

.symbol { display: block; width: 100%; max-width: 380px; height: auto; }
.symbol .body { fill: var(--surface); stroke: var(--signal); stroke-width: 1.6; }
.symbol .pin { stroke: var(--line-2); stroke-width: 1.4; }
.symbol text { font: 500 10.5px var(--mono); fill: var(--muted); }
.symbol .title { fill: var(--text); font-weight: 600; }

.more-line { margin-top: 36px; color: var(--muted); }
.more-line a { color: var(--text); text-underline-offset: 4px; }
.more-line a:hover { color: var(--amber); }

/* certifications */

.cards { display: grid; gap: 22px; }

.cert-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); }

.cert-seal {
  display: grid;
  place-items: start center;
  padding: 28px 8px 28px 28px;
}

.hexseal {
  display: grid;
  place-items: center;
  width: 86px;
  height: 96px;
  padding: 2px;
  background: var(--signal);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.hexseal > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--surface-2);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  font: 700 1.1rem var(--mono);
  color: var(--amber);
}

.is-sample .hexseal { background: var(--x); }

.is-sample .hexseal > span {
  background:
    repeating-linear-gradient(135deg, rgba(255, 122, 122, 0.2) 0 5px, rgba(255, 122, 122, 0) 5px 10px),
    var(--surface-2);
  color: var(--x);
}

.is-sample.panel { border-style: dashed; border-color: rgba(255, 122, 122, 0.45); }

.cert-body { padding: 26px 28px 28px 20px; }
.cert-body h2 { margin-bottom: 6px; font-size: 1.5rem; }
.cert-body p { max-width: 42em; color: var(--muted); }
.cert-body .spec { margin: 14px 0 0; }

.sample-note { margin-top: 28px; color: var(--muted); font-size: 0.92rem; }

/* badges */

.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 32px 20px 26px;
  text-align: center;
}

.hexbadge {
  width: 132px;
  height: 148px;
  margin-bottom: 20px;
  padding: 2px;
  background: var(--signal);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hexbadge > .in {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  background: var(--surface-2);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.hexbadge .big { font: 700 1.7rem/1 var(--mono); color: var(--amber); }
.hexbadge .small { font: 500 0.74rem var(--sans); color: var(--muted); }

.badge:hover .hexbadge { transform: translateY(-6px) rotate(-3deg); }

.badge.is-sample { border-style: dashed; border-color: rgba(255, 122, 122, 0.45); }
.badge.is-sample .hexbadge { background: var(--x); }

.badge.is-sample .hexbadge > .in {
  background:
    repeating-linear-gradient(135deg, rgba(255, 122, 122, 0.2) 0 5px, rgba(255, 122, 122, 0) 5px 10px),
    var(--surface-2);
}

.badge.is-sample .hexbadge .big { color: var(--x); }

.badge h2 { font-size: 1.1rem; letter-spacing: -0.01em; margin-bottom: 4px; }
.badge p { margin: 0 0 14px; color: var(--muted); font-size: 0.92rem; }
.badge .chips { justify-content: center; margin-top: auto; }

/* journey */

.stages { margin: 0; padding: 0; list-style: none; }

.stage {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0 24px;
  padding-bottom: 48px;
}

.stage:last-child { padding-bottom: 0; }

.stage-node {
  --cut: 14px;
  align-self: start;
  width: 72px;
  height: 52px;
}

.stage-node > .in {
  display: grid;
  place-items: center;
  height: 100%;
  font: 700 1rem var(--mono);
  color: var(--muted);
  transition: color 0.4s;
}

.stage:not(:last-child)::before,
.stage:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 35px;
  top: 52px;
  bottom: 0;
  width: 2px;
}

.stage::before { background: var(--line-2); }

.stage::after {
  background: var(--amber);
  transform: scaleY(0);
  transform-origin: top;
}

.js .stage:not(.is-in) .stage-node { --c: var(--line-2); }

.stage.is-in::after { transform: scaleY(1); transition: transform 0.9s ease 0.35s; }
.stage.is-in .stage-node > .in { color: var(--amber); }
.stage-node { transition: background-color 0.4s; }
.stage.is-in .stage-node { --c: var(--amber); }

.stage-body { padding-top: 4px; }
.stage-body h2 { margin-bottom: 8px; font-size: 1.5rem; }
.stage-body p { max-width: 40em; color: var(--muted); }
.stage-body .chips { margin-top: 14px; }
.stage-body .links { margin: 12px 0 0; font-size: 0.94rem; }
.stage-body .links a { color: var(--text); text-underline-offset: 4px; margin-right: 18px; }
.stage-body .links a:hover { color: var(--amber); }

/* =====================================================================
   Error screen (switch set to offline, and the 404 page)
   ===================================================================== */

.fault { display: none; min-height: 100vh; align-items: center; padding: 48px 0; }

[data-site="offline"] .fault { display: grid; }
[data-site="offline"] body > :not(.fault) { display: none !important; }

.fault-panel { max-width: 760px; margin: 0 auto; }
.fault-body { padding: 8px 20px 28px; }

.frow {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}

.fsig { font: 500 0.8rem var(--mono); color: var(--muted); }
.fwave { display: block; border-top: 2px dashed var(--signal); opacity: 0.55; }
.fbus { --cut: 16px; display: inline-block; justify-self: start; }
.fbus > .in { padding: 10px calc(var(--cut) + 22px); }

.fbus h1 {
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.fmsg { margin: 24px 0 18px; max-width: 34em; color: var(--muted); }

.flinks { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; }
.flinks a { color: var(--amber); text-underline-offset: 4px; }
.flinks a:hover { color: var(--text); }

/* =====================================================================
   Responsive
   ===================================================================== */

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

@media (max-width: 820px) {
  .section { padding-top: 64px; }
  .intro { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .project-side { border-left: 0; border-top: 1px solid var(--line); }
  .explore a { grid-template-columns: minmax(0, 1fr) auto; }
  .explore .desc { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 760px) {
  .tb-wrap { display: none; }
}

@media (max-width: 640px) {
  .chrome-in { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding: 0 18px; }
  .brand, .chrome-btns { margin: 10px 0; }
  .chrome-btns { margin-left: auto; }

  .tabs {
    order: 3;
    flex: 0 0 100%;
    margin: 0 -18px;
    padding: 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 12px; white-space: nowrap; }
  .ind { bottom: 0; }

  .wrap { padding: 0 18px; }
  .hero { padding-top: 24px; }

  .vbody { --namew: 60px; --valw: 0px; --padr: 12px; }
  .vrow { grid-template-columns: var(--namew) minmax(0, 1fr); }
  .vval { display: none; }
  .vname { padding-left: 12px; font-size: 0.72rem; }
  .seg .full { display: none; }
  .seg .short { display: inline; }
  .seg > .in { font-size: 0.74rem; }
  .readout { min-width: 0; }
  .tick:nth-child(5) { display: none; }

  .log-lines li { grid-template-columns: 56px minmax(0, 1fr); padding: 14px 16px; }
  .log-lines .val { grid-column: 2; }

  .spec > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .project-main, .project-side { padding: 22px 20px; }

  .cert-grid { grid-template-columns: minmax(0, 1fr); }
  .cert-seal { place-items: start; padding: 22px 20px 0; }
  .cert-body { padding: 18px 20px 24px; }

  .stage { grid-template-columns: 52px minmax(0, 1fr); gap: 0 16px; }
  .stage-node { width: 52px; height: 42px; --cut: 10px; }
  .stage:not(:last-child)::before,
  .stage:not(:last-child)::after { left: 25px; top: 42px; }

  .pagebus > .in { padding: 10px calc(var(--cut) + 18px); }
  .busline .sig { width: auto; }
  .frow { grid-template-columns: 62px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  .pagebus-wrap { animation: wipe 0.8s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  @keyframes wipe {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tb .packet { display: none; }

  .explore a,
  .skill-more,
  .hexbadge,
  .meter > span,
  .stage::after,
  [data-reveal] .log-lines li { transition: none !important; }
}

/* =====================================================================
   Credentials: certificates, badges and the image viewer
   ===================================================================== */

button.btn { font-family: var(--sans); background: transparent; cursor: pointer; }
button.btn.primary { background: var(--amber); }
button.btn.primary:hover { background: #ffd47f; }

.btn.sm { padding: 8px 14px; font-size: 0.88rem; }

.text-link {
  align-self: center;
  color: var(--muted);
  font-size: 0.88rem;
  text-underline-offset: 4px;
}

.text-link:hover { color: var(--amber); }

html:not(.js) [data-view] { display: none; }

.sec-h { margin-top: 56px; }
.sec-h:first-child { margin-top: 0; }

.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* a credential card */

.cred {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 22px;
  align-items: start;
  padding: 26px 28px;
}

.cred h3 { margin-bottom: 6px; font-size: 1.2rem; letter-spacing: -0.015em; }

.cred-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0 0 12px;
  font: 500 0.8rem/1.5 var(--mono);
  color: var(--muted);
}

.cred-meta .issuer { color: var(--text); }

.cred-desc { max-width: 42em; margin: 0 0 16px; color: var(--muted); }

.cred-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* course path: parent certificate with its three courses underneath */

.path .cred-path {
  border-left: 3px solid var(--amber);
  padding-bottom: 30px;
}

.tree {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0 26px 28px;
  list-style: none;
}

.tree > li.cred-child {
  position: relative;
  margin-left: 65px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  gap: 0 18px;
}

.tree > li::before,
.tree > li::after {
  content: "";
  position: absolute;
  left: -23px;
  background: var(--line-2);
}

.tree > li::before { top: -15px; bottom: -15px; width: 2px; }
.tree > li:last-child::before { bottom: auto; height: 55px; }
.tree > li::after { top: 40px; width: 22px; height: 2px; }

.tree .hexseal { width: 60px; height: 68px; }
.tree .hexseal > span { font-size: 1rem; }

.cred-path .hexseal > span { color: var(--amber); font-size: 0.95rem; }

/* pathway badge: three badges feeding an AND gate */

.pathway-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px minmax(0, 0.8fr);
  align-items: center;
}

.pw-in {
  display: grid;
  grid-template-rows: repeat(3, 180px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pw-in > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 0 8px 0 24px;
  border-bottom: 1px solid var(--line);
}

.pw-in > li:last-child { border-bottom: 0; }

.pw-in h3 { margin-bottom: 2px; font-size: 1.05rem; }
.pw-in .cred-meta { margin-bottom: 4px; }
.pw-desc { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }

.pw-gate { display: block; width: 200px; height: 540px; }

.pw-wires path,
.pw-body,
.pw-out-wire {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2;
  stroke-linejoin: round;
}

.pw-body { fill: var(--surface-2); }
.pw-out-wire { stroke: var(--amber); }
.pw-gate text { font: 600 13px var(--mono); fill: var(--text); }

.pw-wires path,
.pw-out-wire { stroke-dasharray: 1; stroke-dashoffset: 0; }

.js [data-reveal]:not(.is-in) .pw-wires path,
.js [data-reveal]:not(.is-in) .pw-out-wire { stroke-dashoffset: 1; }

[data-reveal].is-in .pw-wires path { transition: stroke-dashoffset 0.8s ease 0.15s; }
[data-reveal].is-in .pw-out-wire { transition: stroke-dashoffset 0.5s ease 0.95s; }

.pw-join {
  display: none;
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font: 500 0.82rem var(--mono);
  color: var(--amber);
}

.pw-out {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 28px 28px 8px;
  text-align: center;
}

.pw-out h3 { margin-bottom: 6px; font-size: 1.2rem; letter-spacing: -0.015em; }
.pw-out .cred-meta { justify-content: center; }
.pw-out .cred-actions { justify-content: center; }

.hexbadge.is-pathway { background: var(--amber); width: 150px; height: 168px; }
.hexbadge.is-pathway .big { color: var(--amber); }
.hexbadge.sm { width: 60px; height: 68px; margin: 0; }
.hexbadge.sm .big { font-size: 0.95rem; }

.badge h3 { margin-bottom: 4px; font-size: 1.15rem; letter-spacing: -0.01em; }
.badge .cred-meta { justify-content: center; }
.badge .cred-actions { justify-content: center; margin-top: auto; }

/* image viewer */

html:has(dialog[open]) { overflow: hidden; }

.lb {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}

.lb::backdrop {
  background: rgba(5, 8, 14, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lb[open] { display: flex; flex-direction: column; }

.lb-bar { flex: none; }
.lb-bar > span:first-child { color: var(--text); }
.lb-count { color: var(--muted); }

.lb-stage {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 300px;
  padding: 24px;
  overflow: auto;
  background: var(--bg);
}

.lb-stage img {
  display: block;
  max-width: 100%;
  max-height: min(68vh, 720px);
  object-fit: contain;
  /* Siemens badges have a transparent background with black text, so every
     image sits on a light mat to stay readable on the dark page. */
  box-sizing: border-box;
  padding: 20px;
  border-radius: 12px;
  background: #eef2f8;
}

.lb-loading { font: 500 0.85rem var(--mono); color: var(--muted); }

.lb-missing { max-width: 30em; text-align: center; }
.lb-missing .hexseal { margin: 0 auto 18px; }
.lb-missing p { margin: 0 0 8px; color: var(--muted); }
.lb-missing .hint { font: 400 0.78rem var(--mono); }

.lb-foot {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.lb-nav { display: inline-flex; gap: 10px; }

@media (prefers-reduced-motion: no-preference) {
  .lb[open] { animation: lb-in 0.24s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .lb[open]::backdrop { animation: lb-fade 0.24s ease; }

  @keyframes lb-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
  }

  @keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
}

@media (prefers-reduced-motion: reduce) {
  .pw-wires path,
  .pw-out-wire { transition: none !important; }
}

@media (max-width: 1000px) {
  .pathway-grid { grid-template-columns: minmax(0, 1fr); }
  .pw-gate { display: none; }
  .pw-join { display: block; }
  .pw-in { grid-template-rows: none; }
  .pw-in > li { padding: 22px 24px; }
  .pw-out { padding: 28px 24px; }
  .cards.two { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .cred { grid-template-columns: minmax(0, 1fr); gap: 14px 0; padding: 22px 20px; }
  .tree { padding: 0 16px 22px; }
  .tree > li.cred-child { margin-left: 24px; padding: 18px 16px; }
  .tree > li::before, .tree > li::after { left: -13px; }
  .tree > li::after { width: 12px; }
  .pw-in > li { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px; }
  .lb-stage { padding: 14px; min-height: 220px; }
}

/* =====================================================================
   Projects: verification ladder and richer side panels
   ===================================================================== */

.project code, .ladder code, .note code {
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--surface-2);
  font: 500 0.84em var(--mono);
  color: var(--text);
}

.bar-right { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }

.rung-chip { color: var(--signal); border-color: rgba(122, 168, 255, 0.4); }
.rung-chip .rn {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--bg);
  font-size: 0.68rem;
  font-weight: 700;
}

/* the ladder: a waveform that steps up once per method */

.ladder { margin-bottom: 28px; }
.ladder-in { padding: 28px 28px 0; }
.ladder-in h2 { margin-bottom: 6px; font-size: 1.5rem; }
.ladder-in .lede { margin: 0 0 8px; max-width: 40em; }

.rungs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rung {
  position: relative;
  min-height: calc(112px + var(--h) * 44px);
  padding: 14px 16px 22px;
  border-top: 2px solid var(--signal);
  border-left: 2px solid var(--signal);
  background: linear-gradient(180deg, rgba(122, 168, 255, 0.1), rgba(122, 168, 255, 0.02));
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rung:last-child { border-right: 2px solid var(--signal); }

.rung .rn { font: 700 0.78rem var(--mono); color: var(--signal); }
.rung h3 { font-size: 1rem; letter-spacing: -0.01em; }
.rung p { margin: 0 0 6px; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }

.rung a {
  align-self: flex-start;
  color: var(--amber);
  font-size: 0.88rem;
  font-weight: 600;
  text-underline-offset: 4px;
}

.rung a:hover { color: #ffd47f; }

.rung.is-next {
  border-color: var(--amber);
  border-style: dashed;
  background:
    repeating-linear-gradient(135deg, rgba(255, 200, 87, 0.12) 0 6px, rgba(255, 200, 87, 0) 6px 12px),
    var(--surface);
}

.rung.is-next .rn { color: var(--amber); }

/* side panels */

.project-side { justify-content: flex-start; gap: 0; padding: 0; }

.side-block { padding: 20px 28px; border-bottom: 1px solid var(--line); }
.side-block:last-child { border-bottom: 0; }
.side-block h3 { margin: 0 0 12px; }

.side-block .big-number { margin-bottom: 12px; }
.side-block .meter { margin-top: 12px; }

.note { margin: 12px 0 0; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.note a { color: var(--text); text-underline-offset: 3px; }
.note a:hover { color: var(--amber); }

/* UART frame */

.frame {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.frame li {
  display: grid;
  place-items: center;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--surface);
  font: 500 0.66rem var(--mono);
  color: var(--muted);
}

.frame li b { font-weight: 500; }
.frame .f-start { border-color: var(--signal); color: var(--signal); }

.frame .f-stop {
  border-color: var(--x);
  color: var(--x);
  background:
    repeating-linear-gradient(135deg, rgba(255, 122, 122, 0.22) 0 4px, rgba(255, 122, 122, 0) 4px 8px),
    var(--surface);
}

/* UVM tree */

.tree-view {
  margin: 0;
  overflow-x: auto;
  font: 500 0.8rem/1.65 var(--mono);
  color: var(--muted);
}

.tree-view .n { color: var(--signal); font-weight: 600; }
.tree-view .c { color: var(--muted); opacity: 0.75; margin-left: 4px; }

/* coverage bins */

.bins { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; font: 500 0.8rem var(--mono); }

.bins li { display: grid; grid-template-columns: 8.4rem minmax(0, 1fr) 2.2rem; align-items: center; gap: 12px; }
.bins .k { color: var(--muted); white-space: nowrap; }
.bins .v { color: var(--pass); text-align: right; }
.bins .bar { height: 10px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line-2); overflow: hidden; }
.bins .bar > span { display: block; height: 100%; width: calc(var(--w) / 46 * 100%); background: var(--pass); transform-origin: left; }

.js [data-reveal]:not(.is-in) .bins .bar > span { transform: scaleX(0); }
[data-reveal].is-in .bins .bar > span { transform: scaleX(1); transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s; }

/* branches and bins that are not hit yet */

.lanes { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }
.lanes li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.lanes .chip { min-width: 7.5rem; }

.hits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }

.hit {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 1.5px solid var(--pass);
  border-radius: 6px;
  background: rgba(111, 227, 165, 0.08);
  font: 500 0.8rem var(--mono);
  color: var(--pass);
}

.hit.is-x {
  border-color: var(--x);
  color: var(--x);
  background:
    repeating-linear-gradient(135deg, rgba(255, 122, 122, 0.2) 0 5px, rgba(255, 122, 122, 0) 5px 10px),
    var(--surface);
}

/* roadmap */

.roadmap { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }

.roadmap li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
}

.roadmap .mark { width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--pass); }
.roadmap .is-open .mark { background: transparent; border: 2px solid var(--amber); }
.roadmap .is-open { color: var(--muted); }
.roadmap b { display: block; color: var(--text); font-weight: 600; }
.roadmap .is-open b { color: var(--amber); }

.roadmap .is-main {
  margin-top: 6px;
  padding: 12px 14px;
  border: 1.5px dashed var(--amber);
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 200, 87, 0.1) 0 6px, rgba(255, 200, 87, 0) 6px 12px),
    var(--surface);
  color: var(--text);
}

.roadmap .is-main .mark { margin-top: 6px; }

@media (max-width: 1000px) {
  .ladder-in { padding: 24px 20px 0; }

  .rungs { grid-template-columns: minmax(0, 1fr); gap: 0; padding-bottom: 0; }

  .rung {
    min-height: 0;
    padding: 16px 16px 18px 20px;
    border-top: 0;
    border-right: 0;
    border-left: 3px solid var(--signal);
    background: none;
  }

  .rung:last-child { border-right: 0; }
  .rung + .rung { border-top: 1px solid var(--line); }
  .rung.is-next { border-left-style: dashed; }
}

@media (max-width: 640px) {
  .side-block { padding: 18px 20px; }
  .bins li { grid-template-columns: 6.6rem minmax(0, 1fr) 1.8rem; gap: 8px; }
  .frame li { height: 32px; font-size: 0.6rem; }
  .bar-right { justify-content: flex-start; }
}

.chip.is-sem { color: var(--signal); border-color: rgba(122, 168, 255, 0.4); }

/* a path or course that is not completed yet */

.hexseal.is-x {
  background: var(--x);
}

.hexseal.is-x > span {
  background:
    repeating-linear-gradient(135deg, rgba(255, 122, 122, 0.22) 0 4px, rgba(255, 122, 122, 0) 4px 8px),
    var(--surface);
  color: var(--x);
}

.is-pending .cred-meta .chip { margin: 0; }

.cred-path.is-pending { border-left-color: var(--line-2); border-left-style: dashed; }
.cred-path.is-pending .hexseal > span { color: var(--x); }

.progress { display: grid; gap: 8px; max-width: 24rem; }
.progress .cred-meta { margin: 0; }

.segs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.segs li { height: 8px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line-2); }
.segs li.on { background: var(--pass); border-color: var(--pass); }

.tree > li.is-pending { border-style: dashed; }
