/* ---------------------------------------------------------
   Posternak Mirelmann — Portfolio landing
   Tipografías: Satoshi (sans, vía Fontshare) + IBM Plex Mono
   (vía Google Fonts). Cargadas como <link> en el <head> de
   cada página.
--------------------------------------------------------- */

:root {
  --sans: "Satoshi", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;

  --black: #000000;
  --grey: #787878;
  --grey-light: #d9d9d9;
  --divider: #000000;
  --white: #ffffff;

  --page-max: 1512px;
  --pad-inline: 23px;

  --col-gap: 6px;
  --row-min-height: 314px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

:root[data-theme="dark"] {
  --black: #f2f2f0;
  --grey: #9a9a9a;
  --grey-light: #2a2a2a;
  --divider: #f2f2f0;
  --white: #0d0d0d;
}

* {
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  max-width: var(--page-max);
  margin-inline: auto;
  background: var(--white);
  color: var(--black);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
}

img {
  display: block;
  width: 100%;
  object-fit: cover;
}

/* ---------- Logo (used in header + footer) ---------- */

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

.logo-mark {
  display: block;
  height: 2.04em;
  width: auto;
  color: inherit;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 72px;
  display: flex;
  align-items: flex-start;
  padding-top: 17px;
  background: var(--white);
  padding-inline: var(--pad-inline);
}

.header-contact {
  margin-left: 151px;
  font-size: 18px;
  line-height: 17px;
}

.header-contact p + p {
  margin-top: 0;
}

.header-contact p:first-child {
  font-weight: 400;
}

.header-contact .muted {
  color: var(--grey);
  font-weight: 300;
}

.header-contact .muted a {
  color: inherit;
  transition: color 0.15s ease;
}

.header-contact .muted a:hover {
  color: #eb5e00;
}

.header-nav {
  margin-left: auto;
  margin-right: 3px;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 18px;
  line-height: 17px;
  font-weight: 400;
}

.header-nav a {
  transition: color 0.15s ease;
}

.header-nav a:hover {
  color: #eb5e00;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  margin-left: auto;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 20;
}

.menu-toggle-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--black);
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease, background-color 0.2s ease;
}

.menu-toggle-bar:nth-child(2) {
  width: 70%;
  align-self: flex-end;
}

.menu-toggle.is-open .menu-toggle-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.menu-toggle.is-open .menu-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.is-open .menu-toggle-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
  width: 100%;
}

.nav-backdrop {
  display: none;
}

.nav-toggles {
  display: none;
}

.site-header--projects {
  height: 90px;
  flex-direction: column;
  align-items: stretch;
  padding-top: 0;
}

.site-header--projects .header-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  flex: 0 0 72px;
  padding-top: 17px;
}

.projects-subbar {
  flex: 0 0 18px;
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--divider);
}

.projects-label {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 17px;
  letter-spacing: 0.03em;
  color: var(--black);
  margin: -5px 0 0;
}

/* ---------- Projects grid ---------- */

.projects-grid {
  padding-inline: var(--pad-inline);
  padding-top: 0;
  margin-bottom: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}

.grid-cell {
  position: relative;
  aspect-ratio: 480 / 610;
  overflow: hidden;
  /* Safari renders hairline gaps between CSS Grid tracks when their
     computed widths round to a fraction of a pixel; forcing each cell
     onto its own compositing layer makes Safari snap it to a whole
     pixel instead, closing the gap. Chrome is unaffected either way. */
  transform: translateZ(0);
}

.grid-cell img,
.grid-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grid-cell video {
  filter: grayscale(0);
  transition: filter 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .grid-cell:hover video {
    filter: grayscale(1);
  }
}

.grid-cell a {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.grid-cell-media {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(1);
  transition: transform 0.5s ease;
}

@media (hover: hover) and (pointer: fine) {
  .grid-cell:hover .grid-cell-media {
    transform: scale(1.06);
  }
}

.grid-cell-media img,
.grid-cell-media video {
  position: absolute;
  inset: 0;
}

.grid-cell-media .img-hover {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .grid-cell:hover .img-hover {
    opacity: 1;
  }
}

/* ---------- Project hover overlay (dark card + typewriter caption) ---------- */

.cell-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.46);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .grid-cell:hover .cell-overlay {
    opacity: 1;
  }
}

.cell-overlay-text {
  font-family: var(--mono);
  font-weight: 500;
}

.tw-row {
  text-align: center;
  line-height: 28px;
}

.tw-line {
  display: inline-block;
  font-size: 20px;
  line-height: 28px;
  letter-spacing: 1.2px;
  color: #ffffff;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
}

@media (hover: hover) and (pointer: fine) {
  .grid-cell:hover .tw-line {
    animation: tw-reveal var(--tw-dur, 0.3s) steps(var(--tw-chars, 1)) forwards;
    animation-delay: var(--tw-delay, 0s);
  }
}

@keyframes tw-reveal {
  to {
    clip-path: inset(0 0 0 0);
  }
}

.grid-cell--grey {
  background: var(--grey-light);
}

.grid-cell--black {
  background: #000000;
}

/* ---------- Projects page (projects.html) ---------- */

.projects {
  padding-inline: var(--pad-inline);
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  margin-bottom: 28px;
}

.project-row {
  padding-top: 10px;
  border-top: 1px solid var(--divider);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}

.project-list .project-row:first-child {
  border-top: none;
}

.project-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-list .project-row:nth-child(-n + 3) {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .project-row {
    transform: none;
    transition: opacity 400ms ease;
  }
}

.project-row-link {
  display: grid;
  grid-template-columns: 486fr repeat(5, 190fr);
  column-gap: var(--col-gap);
  align-items: start;
  min-height: var(--row-min-height);
  color: inherit;
  text-decoration: none;
}

.project-meta {
  display: block;
  grid-column: 1;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 16px;
  transition: color 0.15s ease;
}

.project-row-link:hover .project-meta {
  color: #eb5e00;
}

.project-meta .mono-num {
  font-weight: 500;
}

.project-media {
  display: contents;
}

.media-frame {
  display: block;
  width: 100%;
  overflow: hidden;
  transform-origin: top right;
  transition: transform 200ms ease;
  /* Safari hairline-gap fix — see .grid-cell for the full explanation.
     Combined with the hover transform below so the fix doesn't drop
     out whenever that rule's own `transform` takes over. */
  transform: translateZ(0);
}

@media (hover: hover) and (pointer: fine) {
  .project-row-link:hover .media-frame {
    transform: scale(1.02) translateZ(0);
  }
}

.media-frame--empty {
  background: var(--grey-light);
}

.media-frame--themed-bg {
  background: #000;
}

:root[data-theme="dark"] .media-frame--themed-bg {
  background: #d9d9d9;
}

.project-media img,
.project-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--grey-light);
  transform-origin: center;
  transition: transform 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .media-frame:hover img,
  .media-frame:hover video {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-media img,
  .project-media video,
  .media-frame {
    transition: none;
  }
}

/* ---------- Individual project page (e.g. glimm.html) ---------- */

.project {
  display: flex;
  flex-direction: column;
}

.project-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0px var(--pad-inline) 15px;
}

.project-title {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  margin: 0;
}

.project-date {
  font-family: var(--mono);
  font-weight: 300;
  font-size: 24px;
}

.proj-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.proj-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.proj-cell-img {
  overflow: hidden;
  /* Safari hairline-gap fix — see .grid-cell for the full explanation. */
  transform: translateZ(0);
}

.proj-cell-img img,
.proj-cell-img video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proj-cell-img--span2 {
  grid-column: span 2;
}

.proj-cell-text {
  padding: 19px var(--pad-inline) 0;
}

.proj-row--intro {
  padding-bottom: 48px;
}

.proj-row--intro .proj-cell-text {
  padding-top: 9px;
}

.proj-row--intro .proj-cell-text:last-child {
  padding-left: 0;
  padding-right: 0;
}

.project-heading {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  margin: 0;
  max-width: 480px;
}

.project-label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 20px;
  line-height: 23px;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.project-body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 19px;
  margin: 0;
  max-width: 467px;
}

.proj-row--intro .project-body {
  max-width: 480px;
}

a.project-body {
  display: block;
  transition: color 0.15s ease;
}

a.project-body:hover {
  color: #eb5e00;
}

.proj-panel {
  width: 100%;
}

.proj-panel--black {
  aspect-ratio: 1512 / 830;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proj-panel--black img {
  width: 75.5%;
  display: block;
}

.project .site-footer {
  margin-top: 26px;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-inline: var(--pad-inline);
  padding-bottom: 26px;
}

.footer-top,
.footer-bottom {
  display: grid;
  grid-template-columns: 1fr 229px 290px;
  column-gap: 18px;
  align-items: start;
}

.footer-top {
  padding-top: 40px;
}

.footer-top .logo {
  font-size: 20px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-col-title {
  font-family: var(--mono);
  font-weight: 300;
  font-size: 18px;
  line-height: 17px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 18px;
  line-height: 17px;
  font-weight: 400;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: #eb5e00;
}

.footer-bottom {
  margin-top: 28px;
}

.footer-toggles {
  grid-column: 3;
  display: flex;
  align-items: baseline;
  gap: 28px;
}

.theme-switch {
  font-family: var(--mono);
  font-size: 18px;
  line-height: 17px;
  color: var(--grey);
  text-transform: uppercase;
  white-space: nowrap;
}

.theme-btn,
.lang-btn {
  font: inherit;
  color: inherit;
  text-transform: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.theme-btn.is-active,
.lang-btn.is-active {
  color: #eb5e00;
  font-weight: 400;
}

.switch-sep {
  color: var(--grey);
}

.lang-switch {
  font-family: var(--mono);
  font-size: 18px;
  line-height: 17px;
  color: var(--grey);
  text-transform: uppercase;
  white-space: nowrap;
}


.muted {
  color: var(--grey);
}

.small {
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
}

/* ---------- About page ---------- */

.about {
  display: flex;
  flex-direction: column;
  gap: 64px;
  max-width: 973px;
  padding-inline: var(--pad-inline);
  padding-top: 0;
  padding-bottom: 103px;
}

.about-bio.proj-reveal {
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}

.about-main {
  display: flex;
  gap: 190px;
}

.about-photo {
  width: 305px;
  height: 418px;
  flex-shrink: 0;
  object-fit: cover;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 142px;
  max-width: 973px;
  padding-top: 0;
}

.about-bio {
  font-size: 32px;
  line-height: 30px;
  font-weight: 400;
  letter-spacing: -0.01em;
  max-width: 973px;
}

.mono-plain {
  font-family: var(--mono);
  font-size: 20px;
  line-height: 22px;
}

.experience-label {
  font-size: 16px;
  line-height: 17px;
  font-weight: 400;
}

.experience-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 723px;
  font-size: 16px;
  line-height: 17px;
  font-weight: 400;
}

.experience-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.experience-list .pipe {
  margin-inline: 10px;
}

.experience-list a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.experience-list a:hover {
  color: #eb5e00;
}

.pipe {
  justify-self: center;
}

.resume-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 723px;
  font-size: 16px;
  line-height: 17px;
  font-weight: 400;
}

.resume-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.resume-list .pipe {
  margin-inline: 10px;
}

.resume-value:last-child {
  flex: 1 1 300px;
  min-width: 200px;
}

.resume-row-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.resume-row-link:hover > * {
  color: #eb5e00;
  transition: color 0.15s ease;
}

.about-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  column-gap: 0;
}

.about-row-label {
  font-size: 16px;
  line-height: 17px;
  font-weight: 400;
}

/* ---------- About page: sticky image sidebar ----------
   The portrait photo sticks in place while the user scrolls through the
   bio/resume content next to it; it un-sticks and scrolls away once that
   content ends, same as any sticky sidebar. The footer below is the
   ordinary, full-width site footer — it isn't part of the sticky row, so
   it behaves exactly like on every other page. Mobile just stacks. */

.about-split {
  display: flex;
  align-items: flex-start;
  gap: 190px;
  padding-left: var(--pad-inline);
}

.about-split-media {
  flex: 0 0 305px;
  position: sticky;
  top: 72px;
}

.about-split-content {
  flex: 1;
  min-width: 0;
  padding-right: var(--pad-inline);
}

.about-split-content .about {
  padding-inline: 0;
}

.about-intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Pins Experience to the bottom of a box matching the photo's own
   height (418px), so its last line lines up with the photo's bottom
   edge at any viewport width — not just the one it was eyeballed at.
   Desktop/tablet only: the photo isn't sticky on mobile. */
@media (min-width: 681px) {
  .about-intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 418px;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  :root {
    --pad-inline: 18px;
  }

  .header-contact {
    display: none;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 200px;
  }

  .project-row {
    padding-bottom: 24px;
  }

  .project-row-link {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 10px;
    min-height: 0;
  }

  .project-meta {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }

  .about-main {
    gap: 60px;
  }

  .about-row {
    grid-template-columns: 170px 1fr;
  }

  .about-content {
    gap: 80px;
  }

  .about {
    padding-bottom: 64px;
  }

  .about-split {
    gap: 60px;
  }

  .about-split-content .about {
    gap: 48px;
  }
}

/* Tablet only: uniform 3:4 thumbnails for the projects listing. Scoped
   away from true mobile (<=680px), which instead shows each project's
   own varied image heights in a horizontal scroller — see below. */
@media (min-width: 681px) and (max-width: 1100px) {
  .project-media img,
  .project-media video {
    height: auto !important;
    aspect-ratio: 3 / 4;
  }
}

@media (max-width: 680px) {
  :root {
    --pad-inline: 16px;
  }

  /* ---- Header: hamburger menu ---- */
  .site-header {
    height: 60px;
  }

  .site-header--projects {
    height: 88px;
  }

  .site-header--projects .header-row {
    flex-basis: 64px;
  }

  .projects-subbar {
    flex-basis: 24px;
  }

  .logo {
    font-size: 16px;
  }

  .footer-top .logo {
    font-size: 16px;
  }

  .menu-toggle {
    display: flex;
    position: relative;
    z-index: 30;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 5;
  }

  .nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: auto;
    max-height: none;
    height: auto;
    overflow: visible;
    opacity: 0;
    pointer-events: none;
    background: var(--white);
    padding: 16px var(--pad-inline) 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-10px);
    transition: transform 0.3s var(--ease-out), opacity 0.25s ease;
    z-index: 9;
  }

  .header-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .header-nav a {
    padding: 22px 0;
    border-top: 1px solid var(--divider);
    font-size: 20px;
  }

  .nav-toggles {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 32px;
    padding-top: 22px;
    border-top: 1px solid var(--divider);
  }

  /* ---- Homepage grid: 2 columns instead of 1 ---- */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 60px;
  }

  /* The empty cells create deliberate gaps in the 3-column desktop
     mosaic; on mobile they'd just leave black holes, so drop them
     and let every project run back to back. */
  .grid-cell[aria-hidden="true"] {
    display: none;
  }

  .tw-line {
    font-size: 13px;
    line-height: 18px;
    letter-spacing: 0.6px;
  }

  .tw-row {
    line-height: 18px;
  }

  /* ---- Projects listing: each project's 5 images in one
     horizontally-scrollable, infinitely-looping row ---- */
  .project-row-link {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
  }

  .project-list .project-row {
    padding-bottom: 40px;
  }

  .project-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
  }

  .project-row-link {
    align-items: stretch;
  }

  .project-media {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-right: calc(-1 * var(--pad-inline));
  }

  .project-media::-webkit-scrollbar {
    display: none;
  }

  .media-frame {
    flex: 0 0 170px;
    width: 170px;
  }

  /* ---- Footer: logo full-width, Portfolio/Contact side by side.
     Contact gets the lion's share of the width so "Valentina
     Posternak Mirelmann" fits on one line. ---- */
  .footer-top {
    grid-template-columns: 108px 1fr;
    column-gap: 16px;
    row-gap: 20px;
    padding-top: 24px;
  }

  .footer-top .logo {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* Toggles above the legal line, not below it */
  .footer-toggles {
    order: -1;
  }

  .footer-col {
    gap: 18px;
  }

  .footer-col-title {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .footer-col a {
    font-size: 16px;
    display: inline-block;
    padding: 4px 0;
  }

  .footer-bottom {
    margin-top: 32px;
  }

  .footer-toggles {
    gap: 16px;
  }

  .theme-switch,
  .lang-switch {
    font-size: 13px;
  }

  .muted.small {
    font-size: 12px;
  }

  .site-footer {
    padding-bottom: 20px;
  }

  .project .site-footer {
    margin-top: 0;
  }

  /* ---- Individual project pages ---- */
  .project-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-bottom: 12px;
  }

  .project-title {
    font-size: 28px;
  }

  .project-date {
    font-size: 15px;
  }

  .proj-row-2,
  .proj-row-3 {
    grid-template-columns: 1fr;
  }

  .proj-cell-img--span2 {
    grid-column: span 1;
  }

  .proj-cell-img--offset-right {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .proj-cell-text {
    padding: 20px var(--pad-inline) 28px;
  }

  /* Empty cells exist only to create a blank middle column in the
     desktop 3-col grid; on a single mobile column they'd just leave
     an empty padded gap, so drop them. */
  .proj-cell-text:empty {
    display: none;
  }

  .proj-row--intro {
    padding-bottom: 0;
  }

  .proj-row--intro .proj-cell-text {
    padding-top: 20px;
  }

  .proj-row--intro .proj-cell-text:first-child {
    padding-bottom: 8px;
  }

  .proj-row--intro .proj-cell-text:last-child {
    padding: 0 var(--pad-inline) 28px;
  }

  .project-heading {
    font-size: 26px;
    max-width: none;
  }

  .project-label {
    font-size: 15px;
  }

  .project-body,
  .proj-row--intro .project-body {
    font-size: 15px;
    line-height: 20px;
    max-width: none;
  }

  /* ---- About page: no sticky sidebar on mobile, just a normal
     single-column stack with the site's usual side margins. ---- */
  .about-main {
    flex-direction: column;
    gap: 24px;
  }

  .about-photo {
    width: 100%;
    height: auto;
    aspect-ratio: 305 / 418;
  }

  .about-content {
    gap: 40px;
  }

  .about-bio {
    font-size: 20px;
    line-height: 24px;
  }

  .about-bio br {
    display: none;
  }

  .about-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .about-intro {
    gap: 40px;
  }

  .about {
    gap: 40px;
    padding-bottom: 48px;
    max-width: none;
  }

  .experience-label,
  .about-row-label {
    font-size: 15px;
  }

  .experience-list,
  .resume-list {
    font-size: 14px;
    line-height: 16px;
  }

  .experience-list li,
  .resume-list li {
    display: block;
  }

  .experience-list .pipe,
  .resume-list .pipe {
    margin-inline: 6px;
  }

  .about-split {
    display: block;
    align-items: unset;
    gap: 0;
    padding-left: 0;
  }

  .about-split-media {
    position: static;
    padding-inline: var(--pad-inline);
    margin-bottom: 32px;
  }

  .about-split-content {
    padding-right: 0;
  }

  .about-split-content .about {
    padding-inline: var(--pad-inline);
  }
}

/* Large screens (iMac, big monitors): scale the whole 1512px design up to
   fill the viewport instead of capping width and centering with side
   margins. zoom scales layout (unlike transform), so everything — grids,
   images, type — grows together keeping the exact Figma proportions. */
@media (min-width: 1512px) {
  body {
    max-width: none;
    width: 1512px;
    zoom: calc(100vw / 1512px);
  }
}

/* ---------- Glimm detail page: scroll reveal + typewriter ---------- */

.proj-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.proj-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.proj-typewriter {
  position: relative;
}

.proj-typewriter.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 2px;
  background: currentColor;
  vertical-align: text-bottom;
  animation: proj-caret 850ms step-end infinite;
}

@keyframes proj-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .proj-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .proj-typewriter.is-typing::after {
    animation: none;
    opacity: 0;
  }
}

.projects-subbar--reveal {
  position: relative;
  border-bottom-color: transparent;
}

.projects-subbar--reveal::after {
  content: "";
  position: absolute;
  left: calc(-1 * var(--pad-inline));
  right: calc(-1 * var(--pad-inline));
  bottom: -1px;
  height: 1px;
  background: var(--divider);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 650ms var(--ease-out);
}

.projects-subbar--reveal.is-revealed::after {
  transform: scaleX(1);
}

.projects-subbar--reveal .projects-label {
  opacity: 0;
  transition: opacity 500ms var(--ease-out) 150ms;
}

.projects-subbar--reveal.is-revealed .projects-label {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .projects-subbar--reveal::after {
    transition: none;
  }
  .projects-subbar--reveal .projects-label {
    transition: none;
  }
}
