/* Size-matched stand-ins shown while the web fonts load, so text doesn't
   visibly shrink when Source Serif 4 / Source Sans 3 swap in. Values were
   measured against the real fonts (titles at 650, body at 400 and 600);
   re-measure if the fonts or title weight change.
   Source Serif 4 widens at small optical sizes, so big titles (~40-55px)
   and card-sized headings (~18-30px) each get their own serif stand-in. */
@font-face {
  font-family: "Source Serif 4 Fallback";
  src: local("Georgia Bold"), local("Georgia-Bold");
  font-weight: 500 700;
  size-adjust: 87%;
  ascent-override: 119.54%;
  descent-override: 39.08%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Serif 4 Display Fallback";
  src: local("Georgia Bold"), local("Georgia-Bold");
  font-weight: 500 700;
  size-adjust: 82%;
  ascent-override: 126.83%;
  descent-override: 41.46%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Sans 3 Fallback";
  src: local("Arial"), local("ArialMT");
  font-weight: 400;
  font-style: normal;
  size-adjust: 93.09%;
  ascent-override: 109.57%;
  descent-override: 42.97%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Sans 3 Fallback";
  src: local("Arial Italic"), local("Arial-ItalicMT");
  font-weight: 400;
  font-style: italic;
  size-adjust: 93.09%;
  ascent-override: 109.57%;
  descent-override: 42.97%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Sans 3 Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT");
  font-weight: 600 700;
  size-adjust: 88.96%;
  ascent-override: 114.66%;
  descent-override: 44.96%;
  line-gap-override: 0%;
}

:root {
  --abyss: #061e28;
  --deep: #0c3340;
  --mid: #1a4f5c;
  --mist: #e7f1f4;
  --shell: #f7fbfd;
  --ink: #0d2430;
  --muted: #4a6670;
  --link: #1f5f6e;
  --accent: #3d8a7a;
  --font-display: "Source Serif 4", "Source Serif 4 Fallback", Georgia,
    "Times New Roman", serif;
  --font-display-lg: "Source Serif 4", "Source Serif 4 Display Fallback",
    Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Source Sans 3 Fallback", "Segoe UI",
    system-ui, sans-serif;
  --radius: 1.1rem;
  --nav-h: 3.25rem;
}

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

html {
  scroll-behavior: smooth;
  /* Canvas color. A fixed background on body does not paint the
     rubber-band area, so overscroll would flash white. */
  background-color: #041820;
  background-image:
    radial-gradient(ellipse 95% 60% at 18% 5%, #143d4c 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 92% 88%, #0a3040 0%, transparent 50%),
    linear-gradient(165deg, #0e3544 0%, var(--abyss) 52%, #041820 100%);
  background-attachment: fixed;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: transparent;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

/* —— Sticky page nav —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--nav-h);
  padding: 0 clamp(1.25rem, 4vw, 2.75rem);
  background: rgba(6, 30, 40, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 221, 228, 0.08);
}

.site-nav a {
  color: rgba(244, 250, 251, 0.72);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  padding: 0.15rem 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover {
  color: #fff;
}

.site-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: rgba(244, 250, 251, 0.55);
}

.site-nav__copy {
  margin-left: auto;
  font-size: 0.8rem;
  color: rgba(244, 250, 251, 0.38);
  white-space: nowrap;
}

/* No room beside the links on phones */
@media (max-width: 640px) {
  .site-nav__copy {
    display: none;
  }
}

/* —— Brand + card shell —— */
.shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 3vw, 2.75rem) 3.5rem;
  box-sizing: border-box;
}

.brand {
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.35rem 0 0;
  animation: rise 0.9s ease both;
  min-width: 0;
}

.brand a {
  color: rgba(210, 232, 238, 0.92);
}

.brand a:hover {
  color: #fff;
}

.brand__intro {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.brand__name {
  margin: 0;
  font-family: var(--font-display-lg);
  font-size: clamp(2.35rem, 7vw, 3.4rem);
  font-weight: 650;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #fff;
}

.brand__tagline {
  margin: 0;
  max-width: 26rem;
  font-size: 1rem;
  line-height: 1.4;
  color: rgba(244, 250, 251, 0.82);
}

.portrait {
  margin: 0;
  width: 100%;
  height: 11.5rem;
  border-radius: 0.7rem;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(2, 21, 28, 0.35);
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
}

.brand-block {
  min-width: 0;
}

.brand-block__label {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(201, 221, 228, 0.65);
}

.brand-block__label a {
  margin-left: 0.45rem;
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.brand .now-playing {
  grid-template-columns: 2.75rem 1fr;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.brand .now-playing__art {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(244, 250, 251, 0.55);
  font-size: 0.7rem;
}

.brand .now-playing__status {
  color: rgba(201, 221, 228, 0.6);
  font-size: 0.68rem;
}

.brand .now-playing__status.is-live {
  color: #7dcfb6;
}

.brand .now-playing__title {
  font-size: 0.95rem;
  color: #fff;
}

.brand .now-playing__artist {
  color: rgba(201, 221, 228, 0.7) !important;
  font-size: 0.85rem;
}

.brand .suggest__row {
  gap: 0.4rem;
}

.brand .suggest input {
  border: 1px solid rgba(201, 221, 228, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
}

.brand .suggest input::placeholder {
  color: rgba(201, 221, 228, 0.45);
}

.brand .suggest input:focus {
  outline: 2px solid rgba(125, 207, 182, 0.4);
  border-color: rgba(125, 207, 182, 0.55);
}

.brand .suggest button {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.brand .suggest button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.brand .suggest__note {
  color: rgba(201, 221, 228, 0.55) !important;
  font-size: 0.8rem;
  margin-top: 0.35rem !important;
  min-height: 0;
}

.brand .contrib {
  overflow: hidden;
  width: 100%;
}

.brand .contrib__loading,
.brand .contrib__meta {
  color: rgba(201, 221, 228, 0.55) !important;
  font-size: 0.8rem;
}

.brand .contrib__meta {
  margin-top: 0.4rem !important;
}

.brand .contrib__grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--contrib-weeks, 53), minmax(0, 1fr));
  grid-template-rows: repeat(7, minmax(0, 1fr));
  grid-auto-flow: column;
  gap: 2px;
  aspect-ratio: var(--contrib-weeks, 53) / 7;
  height: auto;
}

.brand .contrib__cell {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.brand .contrib__cell[data-level="1"] {
  background: rgba(140, 190, 200, 0.35);
}
.brand .contrib__cell[data-level="2"] {
  background: rgba(120, 185, 195, 0.55);
}
.brand .contrib__cell[data-level="3"] {
  background: rgba(150, 215, 220, 0.75);
}
.brand .contrib__cell[data-level="4"] {
  background: rgba(210, 240, 245, 0.95);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.deck {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
}

/* Home reading column: a bit denser so cards clear the cape vignette */
.shell .deck {
  gap: 0.9rem;
  padding-bottom: clamp(5.75rem, 13vw, 7.75rem);
}

.card {
  background: var(--shell);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.15rem) clamp(1.4rem, 3vw, 2.35rem);
  box-shadow: 0 16px 44px rgba(2, 21, 28, 0.28);
  animation: rise 0.8s ease both;
}

.shell .card {
  padding: clamp(1.2rem, 2.2vw, 1.65rem) clamp(1.25rem, 2.6vw, 1.95rem);
  border-radius: 1rem;
  box-shadow: 0 14px 36px rgba(2, 21, 28, 0.26);
}

.card:nth-of-type(2) {
  animation-delay: 0.05s;
}
.card:nth-of-type(3) {
  animation-delay: 0.1s;
}
.card:nth-of-type(4) {
  animation-delay: 0.15s;
}
.card:nth-of-type(5) {
  animation-delay: 0.2s;
}
.card:nth-of-type(6) {
  animation-delay: 0.25s;
}

.card--mist {
  background: var(--mist);
}

.card--template {
  border: 1px dashed rgba(74, 102, 112, 0.35);
  box-shadow: none;
  opacity: 0.88;
}

/* Whole-card click target without wrapping copy in <a> (avoids underlines) */
.card--link {
  position: relative;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(2, 21, 28, 0.32);
}

.card__hit {
  color: inherit;
  text-decoration: none;
  text-decoration-thickness: 0;
}

.card__hit::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius);
}

.card--link:hover .card__hit,
.card--link:focus-within .card__hit {
  color: var(--link);
}

.card--link:focus-within {
  outline: 2px solid rgba(61, 138, 122, 0.65);
  outline-offset: 3px;
}

.card__label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 1.8rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.shell .card h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.28rem, 2.1vw, 1.55rem);
  line-height: 1.2;
}

.card p {
  margin: 0 0 0.85rem;
  color: #243943;
}

.shell .card p {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.55;
}

.card p:last-child {
  margin-bottom: 0;
}

.card__lede {
  margin-bottom: 1rem !important;
}

.now-playing {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.35rem;
}

.now-playing__art {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.55rem;
  overflow: hidden;
  background: linear-gradient(145deg, #d5e6ec, #b7ced6);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.now-playing__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.now-playing__art--empty {
  letter-spacing: 0.15em;
}

.now-playing__status {
  margin: 0 0 0.2rem !important;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.now-playing__status.is-live {
  color: var(--accent);
}

.now-playing[data-state="live"] .now-playing__status.is-live::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.05em;
  animation: pulse 1.6s ease-in-out infinite;
}

.now-playing__title {
  margin: 0 !important;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.now-playing__artist {
  margin: 0.15rem 0 0 !important;
  color: var(--muted) !important;
}

.suggest__label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.suggest__row {
  display: flex;
  gap: 0.5rem;
}

.suggest input {
  flex: 1;
  min-width: 0;
  border: 1px solid #c5d6dc;
  border-radius: 0.55rem;
  padding: 0.65rem 0.8rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.suggest input:focus {
  outline: 2px solid rgba(61, 138, 122, 0.45);
  outline-offset: 1px;
  border-color: var(--accent);
}

.suggest button {
  border: 0;
  border-radius: 0.55rem;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #f4fafb;
  background: var(--deep);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.suggest button:hover {
  background: var(--mid);
}

.suggest button:active {
  transform: translateY(1px);
}

.suggest__note {
  margin: 0.55rem 0 0 !important;
  min-height: 1.25em;
  font-size: 0.9rem;
  color: var(--muted) !important;
}

.contrib {
  overflow: hidden;
  width: 100%;
  padding-bottom: 0.15rem;
}

.contrib__loading {
  color: var(--muted);
  font-size: 0.95rem;
}

.contrib__grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--contrib-weeks, 53), minmax(0, 1fr));
  grid-template-rows: repeat(7, minmax(0, 1fr));
  grid-auto-flow: column;
  gap: 2px;
  aspect-ratio: var(--contrib-weeks, 53) / 7;
}

.contrib__cell {
  min-width: 0;
  min-height: 0;
  border-radius: 1px;
  background: #d5e4e9;
}

.contrib__cell[data-level="1"] {
  background: #a7c9d1;
}
.contrib__cell[data-level="2"] {
  background: #6f9eab;
}
.contrib__cell[data-level="3"] {
  background: #3d7584;
}
.contrib__cell[data-level="4"] {
  background: #1f4f5c;
}

.contrib__meta {
  margin: 0.75rem 0 0 !important;
  font-size: 0.9rem;
  color: var(--muted) !important;
}

/* Inner pages */
.page {
  width: 100%;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 3vw, 2.75rem) 3.5rem;
  box-sizing: border-box;
}

.page__header {
  margin-bottom: 1.5rem;
  max-width: 40rem;
}

.page__header h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display-lg);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: #fff;
}

.page__header p {
  margin: 0;
  font-size: 1.1rem;
  color: rgba(244, 250, 251, 0.82);
}

.deck--page {
  max-width: 44rem;
}

.page--contact {
  padding-top: 2.25rem;
  /* Clear the fixed cape vignette when the cards stack */
  padding-bottom: clamp(8rem, 18vw, 9rem);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  width: min(100%, 76rem);
  align-items: stretch;
}

.card--contact {
  width: auto;
}

.card--contact h1 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display-lg);
  font-size: clamp(1.85rem, 3.2vw, 2.4rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.card--contact > p {
  margin: 0 0 1.15rem;
  color: var(--muted);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 -0.55rem;
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.7rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.contact-links a:hover {
  background: var(--mist);
  color: var(--link);
}

.contact-links svg {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  color: var(--mid);
}

.contact-links a:hover svg {
  color: var(--link);
}

.contact-grid .card h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.85rem, 3.2vw, 2.4rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.deck--projects {
  max-width: min(100%, 68rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.deck--projects .card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.75rem;
  overflow: hidden;
  padding: 0.65rem 0.65rem 0.65rem 0.85rem;
}

.card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.2rem 0.15rem 0.2rem 0.25rem;
}

.card__body > :last-child {
  margin-bottom: 0;
}

/* Project list thumbs — slightly under 2× original, with a little breathing room */
.deck--projects .card__media {
  position: relative;
  flex: none;
  width: 16rem;
  min-height: 10.5rem;
  margin: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(13, 36, 48, 0.08);
  box-shadow: inset 0 0 0 1px rgba(13, 36, 48, 0.06);
}

.deck--projects .card__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.deck--projects .card:hover .card__media img {
  transform: scale(1.03);
}

/* Same media box as other cards; scale the whole image to fit */
.deck--projects .card__media--contain img {
  object-fit: contain;
}

.page--project {
  max-width: none;
  margin: 0.65rem;
  padding: 1.25rem clamp(1.25rem, 3vw, 2.5rem) 2.75rem;
  box-sizing: border-box;
  background: var(--shell);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(2, 21, 28, 0.35);
  color: var(--ink);
  min-height: calc(100vh - var(--nav-h) - 1.3rem);
  width: calc(100vw - 1.3rem);
}

.page--project .page__header {
  max-width: 48rem;
  margin-bottom: 1.75rem;
}

.page--project .page__header h1 {
  color: var(--ink);
}

.page--project .page__header p {
  color: var(--muted);
}

.page--project .back-link a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.page--project .back-link a:hover {
  color: var(--accent);
}

.page--project .card {
  background: #fff;
  box-shadow: 0 8px 28px rgba(2, 21, 28, 0.08);
}

.page--project .card--mist {
  background: rgba(231, 241, 244, 0.85);
}

.deck--project {
  --project-card-pad-y: clamp(1.75rem, 3.5vw, 2.6rem);
  --project-card-pad-x: clamp(1.6rem, 3.5vw, 2.85rem);
  max-width: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.deck--project .card {
  padding: var(--project-card-pad-y) var(--project-card-pad-x);
}

/* Two shots, stacked. On a wide layout the pair is taken out of flow so
   its intrinsic size can't stretch the row; the text card sets the height
   and the shots scale to fill that column. */
.deck--project .shot-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: min(100%, 28rem);
}

.deck--project .shot-stack figure {
  margin: 0;
}

.deck--project .shot-stack img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.65rem;
}

.deck--project .card h2 {
  font-size: clamp(1.55rem, 2.6vw, 2rem);
}

.back-link {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.back-link a {
  color: rgba(210, 232, 238, 0.88);
  text-decoration: none;
}

.back-link a:hover {
  color: #fff;
}

/* —— 404 —— */
.page--not-found .card {
  max-width: 36rem;
}

.project-links {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.project-links li {
  margin: 0;
  font-weight: 600;
}

.gallery__hint {
  margin-bottom: 1rem !important;
  font-size: 0.95rem;
  color: var(--muted) !important;
}

.gallery__hint code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  background: rgba(13, 36, 48, 0.06);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.deck--project .gallery {
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
}

.gallery__item {
  margin: 0;
  border-radius: 0.65rem;
  overflow: hidden;
  background: rgba(13, 36, 48, 0.06);
}

.gallery__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery__item--contain {
  grid-column: 1 / -1;
}

.gallery__item--contain img {
  aspect-ratio: auto;
  object-fit: unset;
  width: 100%;
  height: auto;
  background: #fff;
}

.gallery--posters {
  grid-template-columns: minmax(0, 28rem);
}

.gallery--posters .gallery__item img {
  aspect-ratio: auto;
  object-fit: unset;
  width: 100%;
  height: auto;
  background: #fff;
}

.slideshow {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 28rem;
}

.slideshow__frame {
  border-radius: 0.65rem;
  overflow: hidden;
  background: #fff;
}

.slideshow__slide {
  margin: 0;
}

.slideshow__slide img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(68vh, 34rem);
  object-fit: contain;
  background: #fff;
}

.slideshow__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.slideshow__controls button {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--link);
  background: transparent;
  border: 1px solid rgba(13, 36, 48, 0.14);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}

.slideshow__controls button:hover {
  color: var(--accent);
  border-color: rgba(61, 138, 122, 0.45);
}

.slideshow__count {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.slideshow--prints {
  max-width: none;
}

.slideshow--prints .slideshow__frame {
  overflow: visible;
  background: transparent;
}

.slideshow--prints .slideshow__photo {
  position: relative;
  border-radius: 0.65rem;
  overflow: hidden;
  background: #fff;
  aspect-ratio: 4 / 3;
}

.slideshow--prints .slideshow__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.slideshow--prints .slideshow__slide figcaption {
  min-height: 2.6rem;
  padding: 0.55rem 0.15rem 0;
  font-size: 0.85rem;
  text-align: center;
}

.slideshow__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.slideshow__dots button {
  width: 0.7rem;
  height: 0.7rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(13, 36, 48, 0.22);
  cursor: pointer;
  position: relative;
}

.slideshow__dots button::after {
  content: "";
  position: absolute;
  inset: -0.45rem;
}

.slideshow__dots button.is-active,
.slideshow__dots button[aria-current="true"] {
  background: var(--link);
}

.gallery__item figcaption {
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.gallery__item--empty {
  min-height: 8.5rem;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(74, 102, 112, 0.35);
  background:
    linear-gradient(145deg, rgba(231, 241, 244, 0.5), rgba(255, 255, 255, 0.35));
}

.deck--project .gallery__item--empty {
  min-height: 12rem;
  aspect-ratio: 4 / 3;
}

.gallery__item--empty figcaption {
  padding: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Workshop: master–detail (index left, full entries right).
   Page inset matches other pages; the two-column block stays left-aligned. */
.workshop {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  max-width: min(100%, 72rem);
}

.workshop__index {
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 0.85rem;
  background: rgba(8, 36, 46, 0.55);
  border: 1px solid rgba(201, 221, 228, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.workshop__label {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(210, 232, 238, 0.7);
}

.workshop__label + .workshop__todos,
.workshop__toc + .workshop__label {
  margin-top: 1.35rem;
}

.workshop__toc {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.workshop__toc-link {
  display: block;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  border-left: 2px solid transparent;
  color: rgba(244, 250, 251, 0.78);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 600;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.workshop__toc-link:hover {
  color: #fff;
  background: rgba(231, 241, 244, 0.08);
}

.workshop__toc-link.is-active {
  color: #fff;
  border-left-color: var(--accent);
  background: rgba(61, 138, 122, 0.16);
}

.workshop__todos {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.workshop__todos li {
  position: relative;
  margin: 0;
  padding-left: 0.95rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: rgba(244, 250, 251, 0.72);
}

.workshop__todos li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: rgba(61, 138, 122, 0.85);
}

.workshop__todos li.is-done {
  color: rgba(210, 232, 238, 0.42);
  text-decoration: line-through;
  text-decoration-thickness: 0.06em;
}

.workshop__todos li.is-done::before {
  background: rgba(210, 232, 238, 0.35);
}

.workshop__detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.workshop__entry {
  scroll-margin-top: calc(var(--nav-h) + 1rem);
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.workshop__entry.is-active {
  box-shadow:
    0 18px 42px rgba(2, 21, 28, 0.3),
    0 0 0 1px rgba(61, 138, 122, 0.28);
}

.workshop__entry h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.workshop__entry p {
  margin: 0 0 0.85rem;
  color: #243943;
}

.workshop__entry p:last-child {
  margin-bottom: 0;
}

.workshop__entry ul {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  color: #243943;
}

.workshop__entry li + li {
  margin-top: 0.3rem;
}

.todo-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.todo-list__item {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.7rem;
  align-items: start;
  margin: 0;
  color: #243943;
}

.todo-list__mark {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.28rem;
  border: 1.5px solid rgba(74, 102, 112, 0.55);
  border-radius: 0.3rem;
  background: #fff;
}

.todo-list__item.is-done {
  color: var(--muted);
}

.todo-list__item.is-done > span:last-child {
  text-decoration: line-through;
  text-decoration-thickness: 0.06em;
}

.todo-list__item.is-done .todo-list__mark {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #fff;
}

.card code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  background: rgba(13, 36, 48, 0.06);
}

/* Stub pages (legacy) */
.stub {
  width: min(100% - 2rem, 40rem);
  margin: 3rem auto 4rem;
  color: #fff;
}

.stub h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display-lg);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #fff;
}

.stub p {
  margin: 0;
  color: rgba(244, 250, 251, 0.82);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

/* Desktop: identity column left, reading cards right */
@media (min-width: 900px) {
  .shell {
    grid-template-columns: minmax(16rem, 0.85fr) minmax(0, 1.55fr);
    gap: clamp(1.75rem, 3.5vw, 3.5rem);
    align-items: start;
    padding-top: 1.5rem;
    min-height: calc(100vh - var(--nav-h));
  }

  .brand {
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
    gap: 0.75rem;
  }

  .brand__name {
    font-size: clamp(2.4rem, 3.4vw, 3.25rem);
  }

  .deck {
    padding-bottom: 1rem;
  }

  .deck--projects {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.15rem, 2.5vw, 1.75rem);
  }

  .workshop {
    grid-template-columns: minmax(14rem, 0.78fr) minmax(0, 1.55fr);
    gap: clamp(1.25rem, 2.5vw, 2rem);
  }

  .workshop__index {
    position: sticky;
    top: calc(var(--nav-h) + 1rem);
  }

  .deck--projects .card {
    height: 100%;
  }

  .deck--projects .card__media {
    width: 17rem;
  }

  .deck--project {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.35rem;
    align-items: stretch;
  }

  .deck--project .card {
    height: 100%;
  }

  .deck--project .gallery {
    grid-template-columns: 1fr;
  }

  .deck--project .gallery--posters {
    grid-template-columns: minmax(0, 28rem);
  }

  .deck--project .card--mist:has(.shot-stack) {
    position: relative;
  }

  .deck--project .shot-stack {
    position: absolute;
    inset: var(--project-card-pad-y) var(--project-card-pad-x);
    max-width: none;
  }

  .deck--project .shot-stack figure {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .deck--project .shot-stack img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
}

@media (max-width: 560px) {
  .page--project {
    width: calc(100vw - 0.8rem);
    margin: 0.4rem;
    min-height: calc(100vh - var(--nav-h) - 0.8rem);
  }

  .deck--projects .card {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem;
    gap: 0.65rem;
  }

  .deck--projects .card__body {
    padding: 0.15rem 0.2rem 0.35rem;
  }

  .deck--projects .card__media {
    width: 100%;
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 10;
    order: -1;
  }

  .now-playing {
    grid-template-columns: 3.75rem 1fr;
  }

  .now-playing__art {
    width: 3.75rem;
    height: 3.75rem;
  }

  .suggest__row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
