/* ------------------------------------------------------------------
   salman.build — CV: the head, the timeline, the evidence panels,
   the badges and the education list. Every token comes from site.css.
   ------------------------------------------------------------------ */

/* 1. Head ---------------------------------------------------------- */

.cv-head {
  padding-block: clamp(36px, 5vw, 64px) clamp(28px, 4vw, 44px);
}

.cv-head .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px 40px;
  align-items: end;
}

@media (min-width: 760px) {
  .cv-head .wrap { grid-template-columns: 1fr auto; }
}

.cv-head .label { margin: 0; }
.cv-head h1 { margin: 0; font-size: clamp(2.25rem, 5vw, 3.5rem); }

.cv-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* The key and the three small buttons sit on one line, bottoms level. */
.cv-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

/* ---- The key ------------------------------------------------------
   The download is the one control on the page you can feel: a tall cap
   on a 5px seat, a thick chrome edge, a domed face with a light strip
   at the top and a shade along the bottom, and an LED in the corner.
   Pressing it seats the whole cap flush into the page. */
.keycap {
  --raise: 5px;
  position: relative;
  min-height: 64px;
  gap: 16px;
  padding: 0 22px 0 26px;
  border-width: 2px;
  border-radius: calc(var(--radius) + 2px);
  /* The face is domed: lighter at the crown, darker where it meets the
     bottom shade. The edge keeps the system's chrome ramp. */
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--btn-bg) 86%, white) 0%,
      var(--btn-bg) 44%,
      color-mix(in srgb, var(--btn-bg) 94%, black) 100%
    ) padding-box,
    linear-gradient(
      165deg,
      var(--chrome-sky-1) 0%,
      var(--chrome-sky-2) 22%,
      var(--chrome-horizon) 48%,
      var(--chrome-glint) 54%,
      var(--chrome-ground-2) 78%,
      var(--chrome-ground-3) 100%
    ) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -3px 0 rgba(0, 0, 0, 0.22),
    var(--raise) var(--raise) 0 0 var(--btn-edge);
}

@media (hover: hover) {
  .keycap:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.34),
      inset 0 -3px 0 rgba(0, 0, 0, 0.22),
      calc(var(--raise) + 1px) calc(var(--raise) + 1px) 0 0 var(--btn-edge);
  }
}

/* Seated: the dome inverts, the shadow collapses to nothing. */
.keycap:active,
.keycap.is-pressed {
  box-shadow:
    inset 0 3px 0 rgba(0, 0, 0, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 0 var(--btn-edge);
}

/* The LED, top-left, lit: the same 5px square as the rocker's, in a
   hairline bezel so it reads as a light and not as a chip of paint. */
.keycap-led {
  position: absolute;
  top: 9px;
  left: 10px;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--green-ink);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .keycap-led {
  background: #f4f8f1;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.keycap-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.1;
}

.keycap-label {
  font-size: 1.0625rem;
  font-weight: 500;
}

.keycap-sub {
  line-height: 1;
  color: color-mix(in srgb, var(--green-ink) 76%, transparent);
}

.keycap .ic { flex: none; }

/* The answer to a press: one mono line, and then it goes. The row is
   held open so nothing below it moves. */
.dl-note {
  margin: 0;
  padding-left: 2px;
  min-height: 1.5em;
  opacity: 0;
  transition: opacity 160ms ease;
}

.dl-note.is-on { opacity: 1; }

@media (max-width: 559px) {
  .keycap { min-height: 60px; padding: 0 18px 0 20px; gap: 12px; }
  /* The line holds to one row at 390 so nothing below it moves. */
  .dl-note { font-size: 0.6875rem; }
}

/* Narrower than that it takes two rows: hold both. */
@media (max-width: 359px) {
  .dl-note { min-height: 3em; }
}

.cv-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
}

/* Blockify the cells so the buttons sit on the same line as the primary,
   not on a text baseline. */
.cv-links li { display: flex; }

/* 2. Timeline ------------------------------------------------------ */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  border-top: 1px solid var(--rule);
}

.role {
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.role > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px 18px;
  padding: 22px 0;
  align-items: start;
  -webkit-tap-highlight-color: transparent;
  outline-offset: 6px;
}

.role > summary::-webkit-details-marker { display: none; }

@media (max-width: 879px) {
  .role > summary > * { grid-column: 2; }
  .role > summary > .node { grid-column: 1; grid-row: 1 / span 4; }
  .role .num .number { margin-top: 4px; }
}

@media (min-width: 880px) {
  .role > summary {
    grid-template-columns: 28px 176px minmax(0, 1.6fr) minmax(0, 1fr) 132px;
    gap: 10px 24px;
  }
}

/* The track and the node. The node is the pressable. */
.role .node {
  position: relative;
  width: 28px;
  display: flex;
  justify-content: center;
  align-self: stretch;
}

/* The spine runs the whole height of the role, so it stays unbroken
   when the body unfolds. It starts and ends at the first and last knob. */
.role::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 13.5px;
  width: 1px;
  background: var(--rule);
}

.timeline > li:first-child .role::before { top: 35px; }
.timeline > li:last-child .role::before { bottom: auto; height: 35px; }

.role .knob {
  --raise: 2px;
  --dx: 0px;
  --dy: 0px;
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--raise) var(--raise) 0 0 var(--ink);
  transform: translate(var(--dx), var(--dy));
  transition: transform var(--press-out), box-shadow var(--press-out), background-color 140ms ease;
}

.role .knob::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 1.5px;
  background: var(--rule);
  transition: background-color 140ms ease;
}

@media (hover: hover) {
  .role > summary:hover .knob {
    --dx: -1px;
    --dy: -1px;
    box-shadow: calc(var(--raise) + 1px) calc(var(--raise) + 1px) 0 0 var(--ink);
    transition: transform var(--lift), box-shadow var(--lift);
  }
  .role[open] > summary:hover .knob {
    --dx: var(--raise);
    --dy: var(--raise);
    box-shadow: 0 0 0 0 var(--ink);
  }
}

.role > summary:active .knob,
.role[open] > summary .knob {
  --dx: var(--raise);
  --dy: var(--raise);
  box-shadow: 0 0 0 0 var(--ink);
}

.role > summary:active .knob { transition: transform var(--press-in), box-shadow var(--press-in); }

.role[open] .knob::after { background: var(--green); }

.role .dates {
  padding-top: 0.35em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.role .dates .when { color: var(--ink-2); white-space: nowrap; }

/* Employer, client, internship or voluntary: never in doubt. */
.role .org-type {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.5em;
  font-size: 0.6875rem;
  color: var(--ink-3);
  background: var(--page);
  white-space: nowrap;
}

@media (min-width: 880px) {
  .role .dates { display: block; }
  .role .dates .org-type { display: inline-block; margin-top: 8px; }
}

.role h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  margin: 0 0 4px;
}

.role .org {
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 1rem;
}

.role .one {
  margin: 0;
  color: var(--ink-2);
  font-size: 1rem;
}

.role .num .number { font-size: clamp(1.25rem, 2vw, 1.5rem); }
.role .num .number small { font-size: 0.8125rem; }

.role .ctl { display: flex; align-items: flex-start; }

@media (min-width: 880px) {
  .role .ctl { justify-content: flex-end; padding-top: 2px; }
}

.role[open] > summary { border-bottom: 1px dashed var(--rule); }

.role-body {
  padding: 28px 0 36px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px 40px;
}

@media (min-width: 880px) {
  .role-body { grid-template-columns: 28px 176px minmax(0, 1fr); column-gap: 24px; }
  .role-body > * { grid-column: 3; }
}

/* Only the bullets: the lists inside an evidence panel draw themselves. */
.role-body > ul {
  margin: 0;
  padding-left: 1.1em;
  max-width: var(--measure);
  list-style: disc;
}

.role-body > ul > li { margin-bottom: 0.5em; }
.role-body > ul > li:last-child { margin-bottom: 0; }

.role-body .note { margin: 0; font-size: 0.9375rem; }

.role-body .note a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 500;
  color: var(--ink);
}

.role-body .note a:hover { color: var(--green); }
.role-body .note .ic { transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1); }
.role-body .note a:hover .ic { transform: translateX(3px); }

/* 3. Evidence panels ----------------------------------------------- */
/* A rule above, a mono label, the thing. No card inside a card. */

.evidence {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px 32px;
}

@media (min-width: 760px) {
  .evidence { grid-template-columns: 150px minmax(0, 1fr); }
  .evidence > .label { padding-top: 0.45em; }
}

/* Wide: the panel takes the whole row, its label under the dates column. */
@media (min-width: 880px) {
  .role-body > .evidence { grid-column: 1 / -1; grid-template-columns: 228px minmax(0, 1fr); column-gap: 24px; }
  .role-body > .evidence > .label { padding-left: 52px; }
}

/* A wide flow shrunk to a phone is unreadable, so it keeps its size and
   the frame scrolls instead. */
@media (max-width: 719px) {
  /* The grid tracks must not grow to the drawing's width. */
  .role-body > *,
  .evidence > * { min-width: 0; }
  .evidence .diagram { overflow-x: auto; overscroll-behavior-x: contain; }
  .evidence .diagram svg { min-width: 560px; }
}

.evidence .notes {
  margin: 10px 0 0;
  color: var(--ink-3);
  font-size: 0.875rem;
  max-width: 62ch;
}

.exhibits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

/* The notification is the narrow one, the shelf the wide one. */
@media (min-width: 1000px) {
  .exhibits { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; }
}

.exhibit-head {
  margin: 0 0 10px;
  color: var(--ink-3);
}

/* 4. Exhibit 1: the push notification ------------------------------ */

.notif {
  --raise: 2px;
  --dx: 0px;
  --dy: 0px;
  display: block;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 12px 13px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--page);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: var(--raise) var(--raise) 0 0 var(--ink);
  transform: translate(var(--dx), var(--dy));
  transition: transform var(--press-out), box-shadow var(--press-out);
}

@media (hover: hover) {
  .notif:hover {
    --dx: -1px;
    --dy: -1px;
    box-shadow: calc(var(--raise) + 1px) calc(var(--raise) + 1px) 0 0 var(--ink);
    transition: transform var(--lift), box-shadow var(--lift);
  }
}

.notif:active,
.notif.is-pressed,
.notif[aria-expanded="true"] {
  --dx: var(--raise);
  --dy: var(--raise);
  box-shadow: 0 0 0 0 var(--ink);
}

.notif:active { transition: transform var(--press-in), box-shadow var(--press-in); }

.notif-top {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 46px;
  gap: 3px 10px;
  align-items: start;
  transition: opacity 200ms ease, transform 200ms ease;
}

.notif .app {
  grid-column: 1;
  grid-row: 1 / 4;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink-3);
  border-radius: 9px;
  background: var(--surface);
  display: grid;
  place-items: center;
}

.notif .app .sq { width: 9px; height: 9px; vertical-align: 0; }

.notif .title {
  grid-column: 2;
  grid-row: 1;
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.3;
}

.notif .when {
  grid-column: 3;
  grid-row: 1;
  padding-top: 1px;
  font-size: 0.6875rem;
}

.notif .body {
  grid-column: 2 / 4;
  grid-row: 2;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.35;
}

.notif .cta {
  grid-column: 2 / 4;
  grid-row: 3;
  justify-self: start;
  margin-top: 8px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.25em 0.6em;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--surface);
}

/* The thumbnail: the same frame language as everything else. */
.notif .shot {
  grid-column: 4;
  grid-row: 1 / 4;
  width: 46px;
  height: 46px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  padding: 5px;
  overflow: hidden;
}

/* Pressed open: the card grows in place and the big image unfolds. */
.notif-big {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--open);
}

.notif[aria-expanded="true"] .notif-big { grid-template-rows: 1fr; }

.notif-big-inner {
  min-height: 0;
  overflow: hidden;
}

.notif-hero {
  display: grid;
  place-items: center;
  margin-top: 12px;
  padding: 14px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background:
    radial-gradient(70% 90% at 50% 25%, var(--sage-tint), transparent 70%),
    var(--surface);
}

.notif-hero .pal { width: auto; height: 100%; max-width: 100%; }

/* The swap: the old one slides down and fades, the new one settles in. */
.notif.is-out .notif-top { opacity: 0; transform: translateY(7px); }

.notif.is-in .notif-top {
  animation: notif-settle 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes notif-settle {
  from { opacity: 0; transform: translateY(-9px); }
  to { opacity: 1; transform: none; }
}

/* The strip under the card names what changed in this variant. */
.notif-exhibit .strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 12px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--rule);
}

.notif-exhibit .strip .hint { color: var(--ink-3); opacity: 0.85; }

/* 5. Exhibit 2: the homepage shelf --------------------------------- */

.shelf .bezel-bar { align-items: center; padding-bottom: 10px; }

.shelf-screen {
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) - 2px);
  background: var(--page);
  padding: 14px;
  transition: opacity 160ms ease;
}

.shelf.is-flip .shelf-screen { opacity: 0.25; }

.shelf-title {
  margin: 0 0 12px;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

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

@media (max-width: 519px) {
  .shelf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ptile {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  height: 100%;
}

.ptile-art {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 12px;
}

.ptile .pname {
  font-size: 0.875rem;
  line-height: 1.25;
  color: var(--ink);
}

.ptile .pprice {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--ink-2);
  text-transform: none;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* 6. Placeholder imagery ------------------------------------------- */
/* Drawn shapes, not photographs: sage, stone and the one green. */

.pal-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* The shapes carry their own paint as tokens, so the colours follow the
   theme through the <use> and there is nothing to keep in step here. */
.pal { width: 100%; height: 100%; display: block; }

/* 7. The numbers beside the exhibits ------------------------------- */

.num-tiles {
  list-style: none;
  margin: 26px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

@media (min-width: 760px) {
  .num-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.num-tiles li { min-width: 0; }
.num-tiles .number { margin: 0; font-size: clamp(1.25rem, 2vw, 1.625rem); }
.num-tiles .number small { font-size: 0.8125rem; }

/* 8. Certifications: embossed badges ------------------------------- */
/* One size, one grid, a green-tinted face and a grain over it, so they
   belong to the page rather than sitting on top of it. */

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

.badge {
  --raise: 3px;
  --btn-bg: color-mix(in srgb, var(--surface) 92%, var(--green));
  position: relative;
  width: 260px;
  height: 84px;
  min-height: 0;
  padding: 0 14px 0 13px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 14px;
  grid-template-rows: auto auto;
  align-content: center;
  justify-content: start;
  gap: 2px 13px;
  overflow: hidden;
  text-align: left;
  line-height: 1.3;
  white-space: normal;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.07),
    var(--raise) var(--raise) 0 0 var(--btn-edge);
}

/* The grain, pressed into the face. */
.badge::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/assets/img/grain.png");
  background-size: 200px 200px;
  opacity: 0.1;
  mix-blend-mode: multiply;
}

:root[data-theme="dark"] .badge {
  --btn-bg: color-mix(in srgb, var(--surface) 86%, var(--green));
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.42),
    var(--raise) var(--raise) 0 0 var(--btn-edge);
}

:root[data-theme="dark"] .badge::before {
  mix-blend-mode: overlay;
  opacity: 0.3;
}

@media (hover: hover) {
  .badge:hover {
    box-shadow:
      inset 0 1px 0 0 rgba(255, 255, 255, 0.55),
      inset 0 -1px 0 0 rgba(0, 0, 0, 0.07),
      calc(var(--raise) + 1px) calc(var(--raise) + 1px) 0 0 var(--btn-edge);
  }
  :root[data-theme="dark"] .badge:hover {
    box-shadow:
      inset 0 1px 0 0 rgba(255, 255, 255, 0.07),
      inset 0 -1px 0 0 rgba(0, 0, 0, 0.42),
      calc(var(--raise) + 1px) calc(var(--raise) + 1px) 0 0 var(--btn-edge);
  }
}

.badge:active,
.badge.is-pressed {
  box-shadow:
    inset 0 1px 0 0 rgba(0, 0, 0, 0.1),
    0 0 0 0 var(--btn-edge);
}

.badge > * { position: relative; z-index: 1; }

.badge .seal {
  grid-row: 1 / 3;
  align-self: center;
  width: 44px;
  height: 44px;
  border: 1px solid color-mix(in srgb, var(--green) 70%, var(--ink));
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  box-shadow:
    inset 0 0 0 3px var(--btn-bg),
    inset 0 0 0 4px color-mix(in srgb, var(--green) 55%, var(--rule));
}

.badge .name {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  font-weight: 500;
  font-size: 1rem;
}

.badge .issuer {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  font-size: 0.6875rem;
  color: var(--ink-2);
}

.badge > .ic {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--ink-3);
}

.badges-note { margin: 16px 0 0; }

/* 9. Education ----------------------------------------------------- */

.edu {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.edu li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 760px) {
  .edu li { grid-template-columns: 176px 1fr; }
  .edu .meta { padding-top: 0.3em; }
}

.edu .deg { margin: 0; font-weight: 500; }
.edu .det { margin: 0; color: var(--ink-2); font-size: 1rem; }

/* 10. Motion off ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .dl-note,
  .notif,
  .notif-top,
  .notif-big,
  .shelf-screen,
  .role-body .note .ic {
    transition: none !important;
  }
  .notif.is-in .notif-top { animation: none; }
  .notif.is-out .notif-top { opacity: 1; transform: none; }
  .shelf.is-flip .shelf-screen { opacity: 1; }
}
