/* Hallmark · check · built: the project · theme: custom · idea: "the about page is a letter, signed, with its sketches hung in the margin" · genre: editorial · shape: letter · hero: the greeting, the live portrait set inside it like a word · signature: the drawn portrait and the five chapter sketches · labels: body face, untracked */
/* Hallmark · pre-emit critique: P4 H5 E4 S5 R4 V5 · weakest: E, the old page was a numbered timeline on a dotted rail with no first screen; it is now one letter with a greeting that owns the fold */
/* Hallmark · dropped .cass-panel, .tl-num, .tl-meta · the cassette tracklist and the numbered rail are retired; their six roles are now the career staircase and their five chapters the letter */
/* Hallmark · reworded "About Derrick Lionardy" to "Hi, I’m Derrick." · the screen-reader title became the visible greeting */

/* ============================================================
   ABOUT, AS A LETTER

   One column of first-person prose at a reading measure. Each
   chapter's title runs into its own paragraph (a real h2, set
   inline), and its sketch hangs in the margin beside it on the
   same instant-film stock as the portrait and the drawing wall.
   The page opens on a greeting with the live portrait inside the
   sentence, and closes on a signature.

   Loaded after audit-styles.css and theme.css; the old timeline
   rules there no longer match anything on this page.
   ============================================================ */

:root {
  --letter-face: var(--font-screen, "Plus Jakarta Sans", system-ui, sans-serif);
  --letter-measure: 34rem;
  /* the site's instant-film card stock, one definition for every print here */
  --letter-film: linear-gradient(177deg, #fffffe 0%, #f6f3ec 70%, #efe9dd 100%);
  /* tight and directional, tinted to the warm surface */
  --letter-print-shadow:
    0 2px 4px rgba(20, 16, 10, 0.10),
    0 10px 22px rgba(20, 16, 10, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(0, 0, 0, 0.045);
  --letter-photo-edge:
    inset 0 0 0 1px rgba(0, 0, 0, 0.10),
    inset 0 3px 10px rgba(0, 0, 0, 0.22);
  --letter-panel: var(--panel, #e4e0d8);
}

/* ---------- the greeting ---------- */

.letter-hero {
  /* the greeting fills the first screen and only the first screen: the
     viewport less the 96px the sticky header occupies, so the letter's
     first line never peeks in above the fold */
  min-height: calc(100svh - 96px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(28px, 3.5vw, 44px);
  padding-block: clamp(40px, 6vw, 72px);
}

.letter-hero__title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1em 0.24em;
  font-family: var(--letter-face);
  font-size: clamp(54px, 8.6vw, 124px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--ink);
  overflow-wrap: break-word;
  min-width: 0;
}

/* the portrait is a print set into the sentence, sized in em so it
   scales with the greeting at every width */
.letter-hero__print {
  display: block;
  flex: none;
  width: 1.24em;
  padding: 0.07em 0.07em 0.19em;
  border-radius: 0.03em;
  background: var(--letter-film);
  box-shadow: var(--letter-print-shadow);
  transform: rotate(-4deg);
}
.letter-hero__print .avatar {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 0;
  border-radius: 2px;
  box-shadow: var(--letter-photo-edge);
}

.letter-hero__lede {
  margin: 0;
  max-width: var(--letter-measure);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.5;
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* ---------- the letter ---------- */

.letter {
  display: flex;
  flex-direction: column;
  gap: clamp(72px, 9vw, 120px);
  padding-bottom: clamp(112px, 13vw, 176px);
}

.letter__part {
  display: grid;
  grid-template-columns: minmax(0, var(--letter-measure)) minmax(0, 1fr);
  gap: 32px clamp(48px, 7vw, 104px);
  align-items: start;
}

.letter__text {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.75;
  color: var(--ink-muted);
}
/* the chapter title runs into its paragraph: a real heading, set inline */
.letter__lead,
.letter__text p {
  display: inline;
  margin: 0;
}
.letter__lead {
  font: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* each sketch hangs at its own width, tilt and drop so the margin
   reads as hand-placed rather than as a column of equal boxes */
.letter__sketch {
  margin: var(--sketch-drop, 0px) 0 0;
  width: min(var(--sketch-w, 300px), 100%);
  justify-self: var(--sketch-side, start);
}
.letter__print {
  padding: 10px 10px 28px;
  border-radius: 3px;
  background: var(--letter-film);
  box-shadow: var(--letter-print-shadow);
  transform: rotate(var(--sketch-tilt, 1.5deg));
}
.letter__print img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  box-shadow: var(--letter-photo-edge);
}

/* ---------- the chapter scenes ----------
   A scene is a small place drawn in code (postcards/renderer.js). It
   has no card around it: its own spray-grain edge dissolves it into the
   page, and a cloud or a bird may cross that edge. The poster <img>
   holds the same picture until the canvas takes its place. */
.letter__sketch--scene {
  --sketch-tilt: 0deg;
}
.letter__sketch--scene img,
.letter__sketch--scene .letter__scene {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}
.letter__sketch--scene .letter__scene[tabindex] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.letter__sketch--scene .letter__scene:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 6px;
}
/* the postmark: where the picture was made, as a plain line under it */
.letter__postmark {
  margin: 4px 0 0;
  font-family: var(--letter-face);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-muted);
  text-align: center;
}

.letter__part--1 { --sketch-w: 300px; --sketch-tilt: 1.5deg; }
.letter__part--2 { --sketch-w: 380px; --sketch-tilt: -1deg; --sketch-side: center; --sketch-drop: 24px; }
.letter__part--3 { --sketch-w: 260px; --sketch-tilt: 2deg; --sketch-side: end; }
.letter__part--4 { --sketch-w: 360px; --sketch-tilt: -1.5deg; --sketch-drop: 12px; }
.letter__part--5 { --sketch-w: 320px; --sketch-tilt: 1deg; --sketch-side: center; }

/* ---------- the page's section heads: one size, set once ---------- */

.letter-title {
  margin: 0 0 clamp(28px, 3.5vw, 40px);
  font-family: var(--letter-face);
  font-size: clamp(32px, 4vw, 48px);
  font-style: normal;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word;
  min-width: 0;
}

/* ---------- the career staircase ----------

   Solid steps standing edge to edge on one floor, so together they make
   a single stair silhouette. A step is as wide as the years the role
   lasted (on a 2018 to 2026 scale of nine columns) and as tall as its
   level; the start year is printed at its foot, which makes the floor
   the axis. Tone deepens with seniority, the current step in full ink.
   Every colour is mixed from --ink and --bg, so the stair follows the
   room light without a single night override. */

:root {
  --career-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --career-step: 68px;
  --career-base: 76px;
  --career-nosing: 18px;
}

.career {
  padding-bottom: clamp(112px, 13vw, 176px);
}

.career__title {
  margin-bottom: 16px;
}

/* the readout: whichever step is on show, in full words */
.career__readout {
  min-height: 3.6em;
}
.career__pick-title {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.career__pick-meta {
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

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

.career__step {
  grid-column: var(--start) / span var(--span);
  grid-row: 1;
  min-width: 0;
}

/* every step is a real button; the whole column, label to floor, is the
   target, so a short step is as easy to hit as a tall one */
.career__btn {
  appearance: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* never disabled today; if a step ever is, it says so three ways */
.career__btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.career__btn:disabled .career__role {
  text-decoration: line-through;
}
.career__btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
  border-radius: 4px;
}

/* the steps rise in order, once, as the chart scrolls in: transform only
   and never hidden, so a reveal that does not fire still shows the stair */
html.js .career__step.reveal {
  transition: transform 640ms var(--career-ease);
  transition-delay: calc(var(--i) * 70ms);
}

.career__role {
  padding: 0 12px 14px 2px;
  font-size: clamp(16px, 1.5vw, 18px);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink-muted);
}
.career__step.is-shown .career__role {
  color: var(--ink);
  font-weight: 750;
}
/* the full range is for screen readers; the floor shows the scale */
.career__years {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.career__block {
  display: block;
  height: calc(var(--career-base) + (var(--level) - 1) * var(--career-step));
  /* only the exposed outer corner is rounded: the stair nosing */
  border-radius: var(--career-nosing) 0 0 0;
  background: color-mix(in oklab, var(--ink) var(--tone), var(--bg));
  /* a lip of light along the tread, self-coloured, no drawn line */
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--bg) 40%, transparent);
  transition:
    background-color 220ms ease,
    transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
/* once the script is live, the step on show keeps its tone and the rest
   recede to half, so the stair still reads but one step is clearly chosen */
.career__steps.is-live .career__step:not(.is-shown) .career__block {
  background: color-mix(in oklab, var(--ink) calc(var(--tone) * 0.5), var(--bg));
}
/* press: the tread gives a pixel, like a step taking weight */
.career__btn:active .career__block {
  transform: translateY(2px);
}
.career__step.is-current .career__block {
  border-radius: var(--career-nosing) var(--career-nosing) 0 0;
}
.career__mobile-year { display: none; }

.career__from {
  padding: 14px 0 0 2px;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.career__step.is-current .career__from::after {
  content: " to now";
}

/* wide screens: the heading sits in the empty corner above the low steps */
@media (min-width: 1100px) {
  .career {
    display: grid;
    grid-template: "chart" auto / minmax(0, 1fr);
  }
  .career__head,
  .career__steps {
    grid-area: chart;
  }
  .career__head {
    align-self: start;
    justify-self: start;
    max-width: 30rem;
    position: relative;
    z-index: 1;
  }
  .career__steps { margin-top: 0; }
}

/* ---------- off the clock ---------- */

.about-shots {
  padding-bottom: clamp(96px, 12vw, 160px);
}
.about-shots__title {
  margin-bottom: 12px;
}

.about-shots__hint {
  margin: 0 0 clamp(32px, 4vw, 48px);
  font-family: var(--letter-face);
  font-style: normal;
  font-size: 18px;
  color: var(--ink-muted);
}

/* ---------- smaller screens ---------- */

@media (max-width: 860px) {
  .letter__part {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .letter__sketch {
    --sketch-side: start;
    --sketch-drop: 0px;
    width: min(var(--sketch-w, 300px), 86%);
  }
  .letter__part:nth-child(even) .letter__sketch { justify-self: end; }
}

@media (max-width: 760px) {
  .career__steps {
    display: flex;
    flex-direction: column-reverse;
    margin-top: 40px;
  }
  .career__step {
    position: relative;
    display: block;
    width: calc(40% + (var(--level) - 1) * 12%);
  }
  html.js .career__step.reveal { transform: translateX(-14px); }
  html.js .career__step.reveal.is-in { transform: none; }
  .career__block {
    height: 56px;
    border-radius: 0 var(--career-nosing) 0 0;
    background: color-mix(in oklab, var(--ink) var(--tone-m), var(--bg));
  }
  .career__step.is-current .career__block {
    border-radius: 0 var(--career-nosing) var(--career-nosing) 0;
  }
  /* the role and year ride inside the slab, inked for its own tone */
  .career__role,
  .career__mobile-year {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    color: var(--on);
  }
  .career__role { left: 16px; }
  .career__step.is-shown .career__role { color: var(--on); font-weight: 750; }
  .career__btn { display: block; height: auto; }
  .career__steps.is-live .career__step:not(.is-shown) .career__block {
    background: color-mix(in oklab, var(--ink) var(--tone-m), var(--bg));
  }
  .career__step.is-shown .career__block {
    box-shadow: inset 0 0 0 2px var(--on);
  }
  .career__mobile-year {
    display: block;
    right: 16px;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  .career__step.is-current .career__mobile-year::after { content: " to now"; }
  .career__from { display: none; }
}

@media (max-width: 640px) {
  .letter-hero { min-height: 0; padding-block: 48px 56px; }

}

@media (prefers-reduced-motion: reduce) {
  html.js .career__step.reveal {
    transform: none;
    transition: none;
  }
  .career__block { transition: background-color 220ms ease; }
  .career__btn:active .career__block { transform: none; }
}
