/* Copied from speculative-portfolio/src/style.css: reading window, case-study blocks and CV. */
.reader, .toast { --ink: #f5f5f5; --primary-text: #292929; }
/* the window keeps its own 24px edge gap, as on speculative-portfolio */
.reader { --pad: 24px; }
/* lock the homepage behind the open window */
html:has(.reader[open]) { overflow: hidden; }

/* confirmation toast (e.g. "Email copied") */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 2147483600;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgb(22 22 22 / 0.9);
  color: var(--ink);
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
  pointer-events: none;
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}


/* ---------- Reading page: a sheet over the board with a liquid-glass bar ---------- */

.reader {
  --win-bg: #fafafa;
  --win-text: #3a3a3a;
  --win-strong: #161616;
  --win-muted: #8c8c8c;
  --win-rule: #dedede;
  --win-radius: 22px;
  --bar-inset: 32px;   /* bar distance from the sheet's left/right edges */
  --bar-top: 16px;
  --bar-h: 44px;

  /* the dialog itself is the full-screen click-to-close area */
  position: fixed;
  inset: 0;
  width: 100dvw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 48px var(--pad);
  border: 0;
  background: transparent;
  color: var(--win-text);
  overflow: hidden;
}

.reader::backdrop {
  background: rgb(18 18 18 / 0.38);
  backdrop-filter: blur(2px) grayscale(0.6);
  -webkit-backdrop-filter: blur(2px) grayscale(0.6);
  animation: reader-fade 200ms ease both;
}

.reader[open] .reader__sheet { animation: reader-in 260ms cubic-bezier(0.2, 0.9, 0.25, 1) both; }
.reader.is-closing::backdrop { animation: reader-fade 200ms ease reverse both; }
.reader.is-closing .reader__sheet { animation: reader-out 200ms ease both; }

@keyframes reader-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes reader-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes reader-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: scale(0.96); }
}

/* animated project-coloured background behind the sheet (src/ambient.js) */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0; /* fades in / out; timing is set from ambient.js */
  pointer-events: none; /* clicks still reach the dialog, so clicking outside closes */
}
.ambient.is-visible { opacity: 1; }
.ambient.is-pixelated { image-rendering: pixelated; } /* keep pixel edges crisp on retina screens */

/* opening choreography (src/transitions.js) replaces the default CSS entrance */
.reader.is-choreographed[open] .reader__sheet { animation: none; }
.reader.is-choreographed.is-closing .reader__sheet { animation: reader-out 200ms ease both; }
/* closing choreography (src/transitions.js) replaces the default CSS exit */
.reader.is-closing.is-sinking .reader__sheet { animation: none; }

/* the sheet */
.reader__sheet {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%); /* every window, case studies and the CV, is the same width */
  height: 100%;
  margin: 0 auto;
  border-radius: var(--win-radius);
  background: var(--win-bg);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 0.1),
    0 30px 70px -10px rgb(0 30 45 / 0.45);
  overflow: hidden;
}

/* liquid-glass bar floating over the top of the content */
.reader__bar {
  position: absolute;
  top: var(--bar-top);
  left: var(--bar-inset);
  right: var(--bar-inset);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--bar-h);
  padding: 0 6px;
  /* hairline edges only, so the rim stays quiet over dark images too */
  border: 0.5px solid rgb(255 255 255 / 0.35);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.62);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow:
    inset 0 0.5px 0 rgb(255 255 255 / 0.6),
    0 0 0 0.5px rgb(0 0 0 / 0.1),
    0 8px 24px rgb(0 0 0 / 0.18);
  user-select: none;
  -webkit-user-select: none;
}

/* Chromium: real refraction + hue distortion (see src/glass.js); a light tint keeps it visible */
.reader__bar.is-refracting {
  background: rgb(255 255 255 / 0.16);
  backdrop-filter: var(--glass-filter);
  -webkit-backdrop-filter: var(--glass-filter);
}
/* a soft halo keeps the name readable whatever is refracted behind it */
.reader__bar.is-refracting .reader__window-title {
  text-shadow: 0 0 2px rgb(255 255 255 / 0.9), 0 0 10px rgb(255 255 255 / 0.85);
}

.reader__window-title {
  position: absolute;
  left: 50%;
  max-width: calc(100% - 240px);
  overflow: hidden;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--win-strong);
  pointer-events: none;
}

.reader__actions,
.reader__pager {
  position: relative;
  display: flex;
  gap: 4px;
}

.reader__actions [hidden] { display: none; }

/* glass buttons: close, previous / next, download */
.reader__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.55);
  color: var(--win-strong);
  box-shadow:
    inset 0 0.5px 0 rgb(255 255 255 / 0.7),
    0 0 0 0.5px rgb(0 0 0 / 0.08),
    0 1px 2px rgb(0 0 0 / 0.1);
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
.reader__btn:hover { background: rgb(255 255 255 / 0.85); }
.reader__btn:active { transform: scale(0.94); }
.reader__btn:focus-visible { outline: 2px solid var(--win-strong); outline-offset: 2px; }
.reader__btn svg { display: block; }

.reader__download {
  width: auto;
  gap: 7px;
  padding: 0 14px 0 11px;
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

/* scrolling content */
.reader__scroll {
  height: 100%;
  overflow-y: auto;
  container-type: size; /* lets sticky columns size to the visible area (100cqh) */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

/* ---------- Section index (case studies) ---------- */

.reader__index { display: none; }

.reader--with-index .reader__case {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
}
/* the intro spans the whole window; the index and the text sit below/beside it */
.reader--with-index .reader__intro { grid-column: 1 / -1; grid-row: 1; }
.reader--with-index .reader__main { grid-column: 2; grid-row: 2; }

/* sticks to the bottom-left corner of the window while the case study scrolls */
.reader--with-index .reader__index {
  --index-inset: 40px;
  /* spans both rows so it's in its corner from the start, layered over the intro's empty corner */
  grid-column: 1;
  grid-row: 1 / span 2;
  z-index: 1;
  pointer-events: none; /* only its buttons catch clicks */
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  align-items: flex-end;
  height: 100cqh;
  /* same gap from the window's bottom edge as from its left edge */
  padding: calc(var(--bar-top) + var(--bar-h)) 0 var(--index-inset) var(--index-inset);
  box-sizing: border-box;
}

.reader__index ol { pointer-events: auto; }
.reader__index ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reader__index button {
  padding: 0;
  border: 0;
  background: none;
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  color: var(--win-muted);
  cursor: pointer;
  transition: color 150ms ease;
}
.reader__index button:hover,
.reader__index button[aria-current] { color: var(--win-strong); }
.reader__index button:focus-visible { outline: 2px solid var(--win-strong); outline-offset: 3px; }

/* section jumps land below the glass bar */
.reader__body .reader__kicker,
.reader__body .reader__facts { scroll-margin-top: calc(var(--bar-top) + var(--bar-h) + 24px); }

/* not enough room for a side column: no index */
@media (max-width: 899.98px) {
  .reader--with-index .reader__case { display: block; }
  .reader--with-index .reader__index { display: none; }
}

/* intro: project name + title on the left, hero image on the right, across the whole window */
.reader__intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  /* title + headline start 32px below the glass bar */
  padding: calc(var(--bar-top) + var(--bar-h) + 32px) var(--bar-inset) 32px;
}
.reader__intro-text { align-self: start; }

.reader__logo {
  display: block;
  width: 110px;
  height: auto;
  margin-bottom: 16px;
}
.reader__logo[hidden],
.reader__label[hidden] { display: none; }

.reader__label {
  margin: 0 0 8px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: clamp(38px, 6vw, 52px);
  font-weight: 100;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--win-strong);
}

.reader__hero { margin: 0; }
.reader__hero img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.reader__content {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 32px 56px;
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

.reader__title {
  margin: 0;
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 300;
  line-height: 1.3;
  color: var(--win-strong);
}
/* no label or logo (placeholder projects): full-width hero across the top, title below it */
.reader__intro--plain {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
}
.reader__intro--plain .reader__hero {
  order: -1;
  border-bottom: 1px solid var(--win-rule);
}
.reader__intro--plain .reader__hero img {
  aspect-ratio: 16 / 9;
  max-height: none;
  object-fit: cover;
}
.reader__intro--plain .reader__intro-text {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 32px 0;
  box-sizing: border-box;
}
.reader__intro--plain .reader__title {
  font-size: clamp(32px, 6vw, 44px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.reader__body > :first-child { margin-top: 0; }

.reader__lede {
  font-size: 20px;
  line-height: 1.55;
  color: var(--win-strong);
}

.reader__body h2 {
  margin: 48px 0 12px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--win-strong);
}
.reader__body h3 {
  margin: 32px 0 8px;
  font-size: 18px;
  font-weight: 500;
  color: var(--win-strong);
}
.reader__body p,
.reader__body ul,
.reader__body ol { margin: 0 0 16px; }
.reader__body li + li { margin-top: 6px; }
.reader__body a { color: var(--win-strong); text-underline-offset: 3px; }

.reader__body hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--win-rule);
}

.reader__body figure { margin: 32px 0; }
.reader__body figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.reader__body figcaption {
  margin-top: 8px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--win-muted);
}

.reader__body blockquote {
  margin: 32px 0;
  padding-left: 16px;
  border-left: 2px solid var(--win-strong);
  font-size: 22px;
  line-height: 1.4;
  color: var(--win-strong);
}

.reader__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 24px 0 0;
}
.reader__facts dt {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--win-muted);
}
.reader__facts dd { margin: 2px 0 0; font-size: 15px; }

/* small lowercase section marker above a group of headings ("research & discovery") */
.reader__kicker {
  margin: 56px 0 8px !important;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--win-muted);
}
.reader__kicker + h2 { margin-top: 0; }

/* two short blocks side by side (goals, findings, metrics) */
.reader__pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 32px;
  margin: 24px 0;
}
.reader__pair h3 { margin-top: 0; }
.reader__pair p { font-size: 16px; }

/* small specimen image next to its note */
.reader__guidelines { display: grid; gap: 16px; margin: 24px 0; }
.reader__guidelines > div { display: flex; align-items: center; gap: 20px; }
.reader__guidelines img { flex-shrink: 0; width: 84px; height: auto; }
.reader__guidelines p { margin: 0; font-size: 16px; }

/* feature: mockup beside its solution / value / KPI */
.reader__feature {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 28px;
  margin: 32px 0;
}
.reader__feature > img,
.reader__feature > video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
/* scales media up 10% and clips the edges (hides encoding artefacts like a dark edge line) */
.reader__media-crop {
  overflow: hidden;
  border-radius: 6px;
}
.reader__media-crop > video,
.reader__media-crop > img {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1.1);
}
/* feature media with a caption under it */
.reader__body .reader__feature > figure { margin: 0; }
.reader__feature > figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.reader__feature h3 { margin-top: 0; }
.reader__feature dl { margin: 0; font-size: 15px; line-height: 1.55; }
.reader__feature dt {
  margin-top: 12px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--win-muted);
}
.reader__feature dd { margin: 2px 0 0; }
.reader__kpi {
  display: inline-block;
  margin: 14px 0 0 !important;
  padding: 4px 10px;
  border: 1px solid var(--win-rule);
  border-radius: 999px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--win-strong);
}

.reader__body video { max-width: 100%; }

/* ---------- report building blocks (Beyond the Screen) ---------- */

/* three headline numbers with their sources */
.reader__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin: 32px 0;
  padding: 24px 0;
  border-top: 1px solid var(--win-rule);
  border-bottom: 1px solid var(--win-rule);
}
.reader__stats > div { display: flex; flex-direction: column; gap: 6px; }
.reader__stats strong {
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--win-strong);
}
.reader__stats span { font-size: 15px; line-height: 1.45; }
.reader__stats small {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--win-muted);
}

/* survey results as bars, with honest counts ("6 of 7") */
.reader__bars ul { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.reader__bars li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px 16px;
  font-size: 15px;
}
.reader__bars li b {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--win-strong);
  white-space: nowrap;
}
.reader__bars li::after {
  content: "";
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(var(--win-strong), var(--win-strong)) 0 0 / calc(var(--share, 0) * 100%) 100% no-repeat,
    var(--win-rule);
}

/* participant quotes as quiet cards */
.reader__quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}
.reader__body .reader__quotes blockquote {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--win-rule);
  border-left: 1px solid var(--win-rule);
  border-radius: 12px;
  font-size: 17px;
  line-height: 1.45;
}
.reader__quotes blockquote p { margin: 0 0 10px; }
.reader__quotes cite {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  font-style: normal;
  color: var(--win-muted);
}

/* signals → trends → drivers table */
.reader__matrix {
  margin: 24px 0 32px;
  border-top: 1px solid var(--win-rule);
  font-size: 14px;
  line-height: 1.45;
}
.reader__matrix-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr 1.2fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--win-rule);
}
.reader__matrix-head {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--win-muted);
}
.reader__matrix [role="rowheader"] { font-weight: 500; color: var(--win-strong); }

/* numbered behaviour shifts */
.reader__body .reader__shifts {
  margin: 24px 0 32px;
  padding: 0;
  list-style: none;
  counter-reset: shift;
}
.reader__shifts > li {
  position: relative;
  margin: 0;
  padding: 24px 0 8px 56px;
  border-top: 1px solid var(--win-rule);
  counter-increment: shift;
}
.reader__shifts > li::before {
  content: counter(shift, decimal-leading-zero);
  position: absolute;
  top: 26px;
  left: 0;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--win-muted);
}
.reader__shifts h3 { margin: 0 0 4px; }
.reader__body .reader__shift-from {
  margin: 0 0 12px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--win-muted);
}

/* manifesto principles */
.reader__body .reader__principles {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.5;
}
.reader__principles b { font-weight: 600; color: var(--win-strong); }
.reader__link {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--win-strong);
  border-radius: 999px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  text-decoration: none;
}
.reader__link:hover { background: var(--win-strong); color: var(--win-bg) !important; }

/* ---------- Arx building blocks ---------- */

/* two-column variant of the matrix (tool → how it uses AI, rule → what it meant) */
.reader__matrix--2 .reader__matrix-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.reader__matrix-row--us,
.reader__matrix .reader__matrix-row--us [role="cell"] { color: var(--win-strong); font-weight: 500; }

/* the one problem statement, set large */
.reader__body .reader__statement {
  margin: 8px 0 24px;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--win-strong);
}

/* small print under a block (sign-in note, artist credits) */
.reader__body .reader__note {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--win-muted);
}

/* facts only Pedro can supply: loud on purpose, so they can't ship unnoticed */
.reader__ph {
  padding: 0 4px;
  border-radius: 3px;
  background: #ffe866;
  color: #4d3b00;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* an asset that isn't made yet: an empty, labelled box at the size it will take */
.reader__slot {
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1.5px dashed #d4b800;
  border-radius: 6px;
  background: #fffbe0;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  color: #4d3b00;
}

/* dev only: how many placeholders are left in the open case study */
.reader__ph-count {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffe866;
  color: #4d3b00;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  pointer-events: none;
}

@media (max-width: 767.98px) {
  .reader__matrix-row { grid-template-columns: 1fr; gap: 4px; }
  .reader__matrix-head { display: none; }
  .reader__shifts > li { padding-left: 40px; }
}

@media (max-width: 767.98px) {
  .reader__feature { grid-template-columns: 1fr; gap: 16px; }
  .reader__feature > img,
  .reader__feature > video,
  .reader__feature > .reader__media-crop,
  .reader__body .reader__feature > figure { width: 100%; max-width: 360px; margin: 0 auto; }
}

.reader__soon {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--win-muted);
}

.reader__footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 40px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--win-rule);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
}
.reader__back,
.reader__next {
  padding: 0;
  border: 0;
  background: none;
  color: var(--win-strong);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* both stay on one line: "Back" keeps its width, the next project's title shortens with "…" */
.reader__back { flex-shrink: 0; white-space: nowrap; }
.reader__next {
  display: flex;
  min-width: 0;
  white-space: pre; /* keeps the spaces around the title */
}
.reader__next-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reader__content :focus-visible { outline: 2px solid #6b6b6b; outline-offset: 2px; }

/* ---------- CV window ---------- */



.cv {
  --cv-gap: 40px;
  display: grid;
  grid-template-columns: minmax(200px, 30%) 1fr;
  column-gap: var(--cv-gap);
  padding: 0 var(--cv-gap);
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--win-text);
}

.cv a { color: inherit; text-decoration: none; }
.cv a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* sidebar: stays put while the main column scrolls */
.cv__aside {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100cqh;
  overflow-y: auto;
  scrollbar-width: none;
  padding: calc(var(--bar-top) + var(--bar-h) + 32px) 0 32px;
}
.cv__aside::-webkit-scrollbar { display: none; }

.cv__marks { display: flex; gap: 8px; margin-bottom: 14px; }
.cv__mark {
  width: 26px;
  height: 26px;
  background: var(--win-strong);
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.cv__mark--asterisk { -webkit-mask-image: url("assets/seal-asterisk.svg"); mask-image: url("assets/seal-asterisk.svg"); }
.cv__mark--spiral   { -webkit-mask-image: url("assets/seal-spiral.svg");   mask-image: url("assets/seal-spiral.svg"); }

.cv__name {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--win-strong);
}

.cv__intro { margin: 0 0 24px; font-size: 13px; color: var(--win-muted); }

.cv__contact {
  display: grid;
  gap: 10px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--win-strong);
  overflow-wrap: anywhere;
}

.cv__label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--win-muted);
}

.cv__skills .cv__label::after { content: none; }

.cv__skill-list { display: grid; gap: 12px; margin: 0; font-size: 13px; }
.cv__skill-list dt { display: inline; font-weight: 600; color: var(--win-strong); }
.cv__skill-list dd { display: inline; margin: 0; color: var(--win-muted); }

/* main column */
.cv__main { padding: calc(var(--bar-top) + var(--bar-h) + 32px) 0 56px; min-width: 0; }

.cv__section + .cv__section { margin-top: 36px; }
.cv__main .cv__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--win-rule);
}

.cv__main p { margin: 0; }

.cv__entry + .cv__entry { margin-top: 20px; }
.cv__entry h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--win-strong);
}
.cv__entry h3 span { color: #b0b0b0; font-weight: 400; }
.cv__entry--compact h3 + h3 { margin-top: 4px; }

.cv__sub { font-style: italic; }

.cv__entry ul { margin: 6px 0 0; padding-left: 18px; }
.cv__entry li + li { margin-top: 4px; }
.cv__entry li::marker { color: #9a9a9a; }
.cv__entry > p:not(.cv__sub) { margin-top: 4px; }

/* Short windows (laptops): tighten the sidebar and give it a little more width, so it fits the
   sheet's height. Anything still left over is handled by fitCv() in reader.js, which zooms the
   sidebar down just enough (never below 80%). */
@media (min-width: 768px) {
  @container (max-height: 820px) {
    .cv { grid-template-columns: minmax(200px, 36%) 1fr; }
    .cv__aside { padding-bottom: 20px; }
    .cv__marks { margin-bottom: 10px; }
    .cv__name { font-size: 26px; margin-bottom: 8px; }
    .cv__intro { margin-bottom: 16px; }
    .cv__contact { gap: 6px; margin-bottom: 20px; }
    .cv__skill-list { gap: 8px; }
  }
}

/* mobile: one column; name + contact, then the content, skills last */
@media (max-width: 767.98px) {
  .cv {
    display: flex;
    flex-direction: column;
    padding: calc(var(--bar-top) + var(--bar-h) + 24px) 20px 40px;
    font-size: 15px;
  }
  .cv__aside { display: contents; }
  .cv__id { order: 0; }
  .cv__main { order: 1; padding: 0; }
  .cv__skills {
    order: 2;
    margin-top: 36px;
  }
  .cv__skills .cv__label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--win-rule);
  }
  .cv__name { font-size: 32px; }
  .cv__intro { font-size: 15px; }
  .cv__contact { gap: 8px; margin-bottom: 36px; font-size: 14px; }
  .cv__skill-list { font-size: 14px; }
  .cv__entry h3 { font-size: 15px; }
}

/* Tablet + desktop: no dim or blur, the sheet just floats on the board with its shadow */
@media (min-width: 768px) {
  .reader::backdrop {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 767.98px) {
  .reader {
    padding: 12px 8px;
    --win-radius: 18px;
    --bar-inset: 12px;
    --bar-top: 12px;
  }
  .reader__window-title { max-width: calc(100% - 170px); }
  .reader__content { padding: 28px 20px 40px; font-size: 16px; }
  .reader__intro {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: calc(var(--bar-top) + var(--bar-h) + 20px) 20px 24px;
  }
  .reader__hero img { max-height: 340px; }
  .reader__intro--plain { padding: 0; }
  .reader__intro--plain .reader__intro-text { padding: 28px 20px 0; }
  .reader__lede { font-size: 18px; }
}

/* small phones: the download button keeps its icon, drops its label */
@media (max-width: 479.98px) {
  .reader__download { width: 32px; padding: 0; }
  .reader__download span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reader::backdrop,
  .reader[open] .reader__sheet,
  .reader.is-closing .reader__sheet,
  .reader.is-closing::backdrop { animation: none; }
  .reader__btn { transition: none; }
  .ambient { transition: none; }
}
