/* =========================================================
   RVM Portfolio — minimal, mobile-first, two-column on desktop
   ========================================================= */
:root {
  --ink: #111111;
  --ink-2: #1a1a1a;
  --muted: #777777;
  --line: #d9d9d9;
  --line-2: #ececec;
  --bg: #ffffff;
  --bg-elev: #fafafa;
  --accent: #e23a2e;
  --red: #e23a2e;
  --font-stack: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --col-gutter: clamp(24px, 4vw, 64px);
  --row-pad: clamp(18px, 2.2vw, 28px);
  --line-w: 1px;
  --frame-pad: clamp(28px, 5vh, 56px);
  --navtabs-h: 50px;
}
@media (min-width: 900px) {
  :root { --navtabs-h: 64px; }
}

[data-theme="dark"] {
  --ink: #f4f3ef;
  --ink-2: #ffffff;
  --muted: #8a8a85;
  --line: #2a2a28;
  --line-2: #1f1f1d;
  --bg: #141414;
  --bg-elev: #1c1c1c;
  --red: #ff5a4d;
}

html { background: var(--bg); transition: background-color 220ms ease, color 220ms ease; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--red); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ----------- LAYOUT ----------- */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  border-top: var(--line-w) solid var(--ink);
  border-bottom: var(--line-w) solid var(--ink);
  margin: var(--frame-pad) 0;
}

/* mobile: single column stacking */
.left {
  padding: 36px var(--col-gutter) 24px;
  border-bottom: var(--line-w) solid var(--ink);
}
.left__inner { max-width: 520px; margin: 0 auto; }

.right {
  padding: 0 var(--col-gutter);
}
.right__inner { max-width: 720px; margin: 0 auto; }

/* desktop: two columns, left fixed full-height, right scrolls */
@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: minmax(340px, 38%) 1fr;
    height: calc(100vh - var(--frame-pad) * 2);
    height: calc(100dvh - var(--frame-pad) * 2);
    min-height: 0;
  }
  .left {
    position: sticky;
    top: 0;
    height: calc(100vh - var(--frame-pad) * 2);
    height: calc(100dvh - var(--frame-pad) * 2);
    padding: 56px var(--col-gutter);
    border-bottom: none;
    border-right: var(--line-w) solid var(--ink);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .left__inner {
    max-width: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
  }
  .right {
    height: calc(100vh - var(--frame-pad) * 2);
    height: calc(100dvh - var(--frame-pad) * 2);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 var(--col-gutter);
    scrollbar-width: thin;
    scroll-behavior: smooth;
    position: relative;
  }
  .right__inner {
    max-width: 880px;
    padding: 0 0 25vh;
    scroll-padding-top: 0;
  }
  .right[data-view="projects"] .right__inner {
    padding-top: 25vh;
  }
  .right[data-view="work"] .right__inner {
    max-width: none;
  }
  .right .projects {
    padding-top: 25vh;
    margin-top: -25vh;
  }
}

/* ----------- NAV TABS ----------- */
.navtabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 0;
  padding: 22px 0 20px;
  background: var(--bg);
  margin: 0 calc(var(--col-gutter) * -1);
  padding-left: var(--col-gutter);
  padding-right: var(--col-gutter);
  max-width: none;
}
@media (min-width: 900px) {
  .navtabs {
    max-width: calc(880px + var(--col-gutter) * 2);
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
  }
}
.navtabs__btn {
  font-family: var(--font-stack);
  font-size: 16px;
  letter-spacing: 0.06em;
  font-weight: 400;
  color: var(--ink);
  padding: 4px 2px;
  transition: color 140ms ease;
}
.navtabs__btn:hover:not(.is-active) {
  color: var(--muted);
}
.navtabs__btn.is-active {
  color: #e23a2e;
  font-style: italic;
}
.navtabs__sep {
  color: var(--line);
  font-size: 16px;
  font-weight: 300;
  user-select: none;
}
@media (max-width: 899px) {
  .navtabs {
    gap: clamp(16px, 5vw, 32px);
    padding: 14px var(--col-gutter);
    justify-content: center;
  }
  .navtabs__btn,
  .navtabs__sep { font-size: 14px; }
}

/* ----------- LEFT COLUMN ----------- */
.bio__name {
  font-size: clamp(40px, 5.6vw, 66px);
  line-height: 0.88;
  font-weight: 800;
  letter-spacing: -0.045em;
  margin: 0 0 18px;
  text-wrap: balance;
  white-space: nowrap;
}
.bio__role {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}
.bio__tagline {
  margin: 2px 0 0;
  color: var(--red);
  font-size: 14px;
  font-style: normal;
}

.bio__about {
  margin: 28px 0 0;
  max-width: 38ch;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.65;
}
.bio__about { font-size: 13.5px; }
.bio__about p { margin: 0 0 12px; text-wrap: pretty; }
.bio__about p:last-child { margin-bottom: 0; }
.bio__headline {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 14px !important;
}
.bio__headline span {
  display: inline-block;
  margin: 0 6px;
  color: var(--red);
}

@media (min-width: 900px) {
  .bio__about { font-size: 14px; }
}

.left__footer {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding-top: 16px;
  border-top: var(--line-w) solid var(--line-2);
  margin-top: 24px;
}
.left__footer a { color: var(--ink); }
.left__footer .dot { color: var(--line); }

/* ----------- PROJECTS ----------- */
.projects {
  display: flex;
  flex-direction: column;
}

.project__header {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 16px;
  padding: var(--row-pad) 0;
  text-align: left;
  transition: color 180ms ease;
  position: sticky;
  top: var(--navtabs-h);
  background: var(--bg);
  z-index: 2;
  border-top: 1px solid var(--ink);
}
.project:first-child .project__header {
  border-top: 1px solid var(--ink);
}
.projects:not([data-show-numbers="true"]) .project__num {
  display: none;
}
.project__num {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  min-width: 2.2em;
}
.project__name {
  font-size: clamp(15px, 1.4vw, 18px);
  letter-spacing: 0.02em;
  font-weight: 400;
  color: var(--ink);
}
.project__year {
  font-size: clamp(15px, 1.4vw, 18px);
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.project__header:hover .project__name,
.project__header:hover .project__year {
  color: var(--ink);
  opacity: 0.6;
}

.project.is-open .project__header {
  padding-bottom: 4px;
}

.project__collapse {
  height: 0;
  overflow: hidden;
  transition: height 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project__body {
  padding: 4px 0 calc(var(--row-pad) + 8px);
  opacity: 0;
  transform: translateY(14px);
  filter: blur(2px);
  transition:
    opacity 360ms ease 80ms,
    transform 480ms cubic-bezier(0.22, 1, 0.36, 1) 80ms,
    filter 360ms ease 80ms;
}
.project.is-open .project__body {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.project__body > .project__meta,
.project__body > .project__content {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 320ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}
.project.is-open .project__body > .project__meta {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 160ms;
}
.project.is-open .project__body > .project__content {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 240ms;
}

@media (prefers-reduced-motion: reduce) {
  .project__collapse,
  .project__body,
  .project__body > .project__meta,
  .project__body > .project__content { transition: none; }
  .project__body,
  .project__body > .project__meta,
  .project__body > .project__content {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.project__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: var(--line-w) solid var(--line-2);
}
@media (min-width: 720px) {
  .project__meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }
  .meta-block--wide { grid-column: span 1; }
}
.meta-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meta-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta-value { font-size: 13px; color: var(--ink); text-wrap: pretty; }

.projects__intro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.projects__intro {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
  max-width: none;
  text-wrap: pretty;
}
.projects__download,
.projects__more { flex-shrink: 0; }

.project__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 720px) {
  .project__content {
    grid-template-columns: 1fr;
    gap: 36px;
    align-items: start;
  }
  .project__content--split {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.project__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.project__media { align-self: start; }
.project__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.project__summary {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  text-wrap: pretty;
  max-width: none;
}
.project__bullets {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project__bullets li {
  font-size: 13px;
  color: var(--ink);
  padding-left: 16px;
  position: relative;
}
.project__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 1px;
  background: var(--ink);
}
.project__cta {
  display: inline-block;
  margin-top: 4px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 160ms ease, color 160ms ease;
}
.project__cta:hover {
  background: var(--ink);
  color: var(--bg);
}

/* mockup */
.mockup {
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  overflow: hidden;
  position: relative;
}
.mockup svg { width: 100%; height: 100%; display: block; }
.mockup svg [fill="#ffffff"] { fill: var(--bg-elev); }
.mockup img { display: block; width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

/* ----------- HIGHLIGHT ----------- */
.hl {
  background: var(--accent);
  color: var(--ink);
  padding: 0.05em 0.25em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ----------- CV BUTTON ----------- */
.cv-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  transition: background 140ms ease, color 140ms ease;
  white-space: nowrap;
}
.cv-btn:hover {
  background: var(--ink);
  color: var(--bg);
}
@media (max-width: 599px) {
  .cv-btn { display: none; }
}

/* ----------- ABOUT VIEW ----------- */
.about-view {
  max-width: 62ch;
  margin: 0 auto;
  padding: clamp(40px, 10vh, 96px) 0;
}
.about-view__headline {
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 40px;
}
.about-view__headline span {
  color: var(--red);
  margin: 0 0.05em;
}
.about-view__body p {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  text-wrap: pretty;
}
.about-view__lead {
  font-size: 20px !important;
  line-height: 1.45 !important;
  margin-bottom: 28px !important;
  color: var(--ink);
}

/* ----------- WORK VIEW ----------- */
.work-view {
  padding: clamp(40px, 10vh, 96px) 0;
}
.work-view__title {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 32px;
  display: none;
}
.work-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 6vw, 80px);
}
@media (min-width: 900px) {
  .work-cols { grid-template-columns: 1fr 1fr; gap: clamp(48px, 8vw, 120px); }
}
@media (max-width: 899px) {
  .work-cols > .work-list:nth-child(2) { display: none; }
}
.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.work-list--cols {
  display: block;
  columns: 1;
  column-gap: clamp(48px, 8vw, 120px);
}
.work-list--cols .work-item {
  break-inside: avoid;
  margin-bottom: 36px;
}
.work-list--cols .work-item:last-child { margin-bottom: 0; }
@media (min-width: 900px) {
  .work-list--cols { columns: 2; }
}
.work-item {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 2fr;
  align-items: baseline;
  gap: clamp(24px, 6vw, 80px);
}
.work-item__years {
  color: var(--red);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.work-item__role {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  justify-self: end;
}
.work-item__title {
  color: var(--ink);
  font-size: 16px;
}
.work-item__company {
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 899px) {
  .work-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .work-item__role { text-align: left; justify-self: start; }
}

/* ----------- END FOOTER ----------- */
.end {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 64px;
  padding: 20px 0;
  border-top: var(--line-w) solid var(--ink);
  font-size: 12px;
  color: var(--muted);
}

/* scrollbar styling for desktop right column */
.right::-webkit-scrollbar { width: 6px; }
.right::-webkit-scrollbar-track { background: transparent; }
.right::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.right::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* selection */
::selection { background: var(--accent); color: var(--ink); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .project__collapse { transition: none; }
}

/* =========================================================
   V3 OVERRIDES — menu in left column, photo in About,
   CV button at the end of Work.
   ========================================================= */

.left .navtabs {
  position: static;
  display: inline-flex;
  width: auto;
  max-width: none;
  justify-content: flex-start;
  align-items: baseline;
  gap: 12px;
  margin: 14px 0 4px;
  padding: 0;
  background: transparent;
  z-index: auto;
}
.left .navtabs__btn {
  font-family: var(--font-stack);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 400;
  color: var(--ink);
  padding: 0;
}
.left .navtabs__btn.is-active {
  color: #e23a2e;
  font-style: italic;
}
.left .navtabs__sep {
  font-size: 13px;
  color: var(--line);
  margin: 0 2px;
}
.left .bio__role { margin-top: 4px; font-size: 13.5px; }
.left .bio__tagline { margin-top: 2px; font-size: 13.5px; }

@media (min-width: 900px) {
  .right[data-view="about"] .right__inner { padding: 0 !important; max-width: none; height: 100%; }
  .right[data-view="about"] { padding: 0; overflow: hidden; }
}

/* ABOUT VIEW — text + full-bleed portrait */
.about-view {
  max-width: none;
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 0;
}
.about-view__text {
  flex: 1 1 50%;
  min-width: 0;
  align-self: flex-start;
  padding: clamp(40px, 7vh, 96px) clamp(28px, 3vw, 56px) clamp(40px, 7vh, 96px) clamp(24px, 4vw, 56px);
  max-width: none;
}
.about-view__photo {
  flex: 0 0 50%;
  min-width: 0;
  align-self: stretch;
  position: relative;
  overflow: hidden;
  background: var(--bg-elev);
}
.about-view__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.about-view__headline {
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1;
  margin: 0 0 clamp(28px, 4vh, 48px);
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.hl-complex { display: inline-block; }
.hl-complex > span {
  display: inline-block;
  transform-origin: baseline;
}
.hl-arrow {
  color: var(--ink);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  margin: 0 0.08em;
}
.hl-clear {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  color: var(--ink);
}
.about-view__body p {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  text-wrap: pretty;
}
.about-view__greet { font-size: 15px !important; margin-bottom: 22px !important; }
.about-view__body p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .about-view { flex-direction: column !important; }
  .about-view__text { flex: 0 0 auto; align-self: auto; padding: 24px var(--col-gutter) 32px; }
  .about-view__photo {
    flex: 0 0 auto;
    align-self: stretch;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-left: 0;
    border-top: var(--line-w) solid var(--ink);
  }
  .about-view__photo img { object-position: 66% center; }
}

/* ----------- CONTACT MODAL ----------- */
.modal-veil {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(7px) saturate(105%);
  backdrop-filter: blur(7px) saturate(105%);
  animation: modalVeilIn 180ms ease both;
}
@keyframes modalVeilIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--bg);
  border: var(--line-w) solid var(--ink);
  color: var(--ink);
  animation: modalIn 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.modal form { display: flex; flex-direction: column; }

.modal__body-area { padding: 16px; }
.modal__title {
  margin: 0 0 22px;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.modal__copy p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  text-wrap: pretty;
}
.modal__copy p:last-child { margin-bottom: 0; }
.modal__copy em { font-style: italic; }

.modal__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: var(--line-w) solid var(--ink);
}
.modal__field {
  display: block;
  position: relative;
  padding: 16px;
}
.modal__field + .modal__field { border-left: var(--line-w) solid var(--ink); }
.modal__field-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.modal__field input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 0;
  outline: none;
}
.modal__field.is-error .modal__field-label { color: var(--red); }
.modal__field.is-error input { color: var(--red); }
.modal__error {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--red);
}

.modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding: clamp(20px, 3vw, 28px) clamp(20px, 3vw, 32px);
  border-top: var(--line-w) solid var(--ink);
}
.modal__fields--single { grid-template-columns: 1fr; }
.modal__textarea {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 0;
  outline: none;
  resize: vertical;
  min-height: 44px;
}
.modal__sent { margin-right: auto; font-size: 15px; color: var(--ink); }
.modal__sent--err { color: var(--red); }
.modal__send:disabled,
.modal__cancel:disabled { opacity: 0.5; cursor: default; }
.modal__cancel {
  font-size: 16px;
  color: var(--ink);
  padding: 10px 4px;
  transition: color 140ms ease;
}
.modal__cancel:hover { color: var(--red); }
.modal__send {
  font-size: 16px;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 28px;
  border: var(--line-w) solid var(--ink);
  transition: opacity 140ms ease;
}
.modal__send:hover { opacity: 0.85; }

/* WORK VIEW — bottom-right CV button */
.work-view__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: clamp(40px, 8vh, 80px);
  padding-top: 24px;
}
.work-view__footer .cv-btn {
  display: inline-flex !important;
  height: auto;
  padding: 12px 20px;
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 400;
}
@media (max-width: 599px) {
  .work-view__footer .cv-btn { padding: 10px 16px; font-size: 12px; }
}

/* Open project keeps its header sticky to the top of the scroll area. */
.project__header { position: static; top: auto; }
.project.is-open .project__header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg);
}

/* Mobile floating action button: "I want to know more", on every section */
.fab-more { display: none; }
@media (max-width: 599px) {
  .projects__more.cv-btn { display: none; }
  .fab-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 60;
    padding: 14px 20px;
    background: var(--ink);
    color: var(--bg);
    border: 1px solid var(--ink);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    font-size: 12px;
    letter-spacing: 0.04em;
    cursor: pointer;
  }
}

/* ----------- PROYECTO ABIERTO (maquetación del PDF, estilo de la web) -----------
   Metadatos con .project__meta; debajo, texto a la izquierda e imágenes a
   la derecha con .project__content--split. */
.project__section + .project__section { margin-top: 22px; }
.project__section-title {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}
.project__section p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  text-wrap: pretty;
}
.project__section p:last-child,
.project__section .project__bullets:last-child { margin-bottom: 0; }
.project__media {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ----------- INDICADOR DE SCROLL (como pasmotor.com) -----------
   Oculta las barras nativas; ScrollIndicator.jsx dibuja una línea de 1 px
   que recorre el área desplazable y se ensancha a 8 px con el ratón. */
html, .right, .about-view__text {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
.right::-webkit-scrollbar,
.about-view__text::-webkit-scrollbar { display: none; }

.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: 8px;
  height: 36.8px;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  will-change: transform;
}
.scroll-indicator::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  background: var(--ink);
  transition: width .25s ease, background-color .25s ease;
}
/* Solo con ratón: en táctil no hay hover y el scroll nativo basta. */
@media (hover: hover) and (pointer: fine) {
  .scroll-indicator { pointer-events: auto; cursor: grab; }
  .scroll-indicator:hover::after,
  .scroll-indicator.is-dragging::after { width: 8px; }
  .scroll-indicator.is-dragging { cursor: grabbing; }
  .scroll-indicator.is-visible { opacity: 1; }
}


/* ----------- ABOUT: principios y proceso ----------- */
@media (min-width: 761px) {
  .about-view__text {
    align-self: stretch;
    overflow-y: auto;
  }
}
.about-view__block {
  margin-top: clamp(28px, 4vh, 40px);
  padding-top: 18px;
  border-top: var(--line-w) solid var(--line-2);
}

/* =========================================================
   PROYECTO ABIERTO (.app.is-focus)
   La columna izquierda se pliega a un carril (RVM · A/P/W · iconos)
   y el proyecto se expande a todo el ancho con la maquetación del PDF.
   ========================================================= */
:root { --focus-ease: cubic-bezier(0.22, 1, 0.36, 1); --focus-dur: 650ms; }

.left__rail { display: none; }
.minimap { display: none; }

@media (min-width: 900px) {
  .app {
    grid-template-columns: 38% 1fr;
    transition: grid-template-columns var(--focus-dur) var(--focus-ease);
  }
  .app.is-focus { grid-template-columns: 192px 1fr; }

  .left { position: sticky; transition: padding var(--focus-dur) var(--focus-ease); }
  .app.is-focus .left { padding-left: 0; padding-right: 0; }
  /* El bloque interior conserva su ancho mientras la columna se estrecha:
     se recorta, encoge y se desvanece en lugar de recolocar el texto. */
  .left__inner {
    width: calc(38vw - var(--col-gutter) * 2);
    flex: none;
    transform-origin: left top;
    transition: opacity 320ms ease, transform var(--focus-dur) var(--focus-ease);
  }
  .app.is-focus .left__inner {
    opacity: 0;
    transform: scale(0.55);
    pointer-events: none;
  }

  .left__rail {
    display: flex;
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 40px 24px 36px;
    opacity: 0;
    transform: translateX(-12px);
    pointer-events: none;
    transition: opacity 280ms ease, transform 280ms ease;
  }
  .app.is-focus .left__rail {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition-delay: 320ms;
  }
  .rail__top { display: flex; flex-direction: column; align-items: flex-start; }
  .rail__mono {
    margin: 0;
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.08em;
    color: var(--ink);
  }
  /* Mismo tamaño y tipo que el menú de la columna abierta (.left .navtabs__btn). */
  .rail__nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 40px;
  }
  .rail__nav .navtabs__btn {
    font-family: var(--font-stack);
    font-size: 13px;
    letter-spacing: 0.04em;
    font-weight: 400;
    line-height: 1.4;
    padding: 0;
    color: var(--ink);
    white-space: nowrap;
  }
  .rail__nav .navtabs__btn.is-active { color: #e23a2e; font-style: italic; }
  /* Mismos textos y estilo que el pie de la columna abierta (.left__footer). */
  .rail__links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    padding-top: 16px;
    border-top: var(--line-w) solid var(--line-2);
    font-size: 12.5px;
    color: var(--muted);
  }
  .rail__links a { color: var(--ink); white-space: nowrap; }
  .rail__links a:hover { color: var(--red); }

  /* Más aire para el proyecto expandido. */
  .app.is-focus .right[data-view="projects"] .right__inner {
    max-width: 1360px;
    padding: 0 clamp(0px, 4vw, 72px) 25vh;
  }
  .app.is-focus .right .projects { padding-top: 0; margin-top: 0; }
}

/* Abierto un proyecto, se despliegan todos, uno debajo de otro. */
.app.is-focus .projects__item { animation: focusIn 520ms var(--focus-ease) both; }
.app.is-focus .project__collapse { height: auto !important; transition: none; }
/* La separación va como padding DENTRO del proyecto anterior: así su
   contenedor llega hasta el siguiente y la barra fija se mantiene hasta que
   el nuevo título la empuja hacia arriba. */
.app.is-focus .project { padding-bottom: clamp(72px, 12vh, 140px); }
.app.is-focus .projects__item {
  margin-top: 0;
  border-top: var(--line-w) solid var(--ink);
}
/* El primero empieza con su título alineado con RVM, sin línea encima.
   (La fila de la intro solo contiene el botón, que va fijo.) */
.app.is-focus .projects__intro-row { margin: 0; }
.app.is-focus .projects__intro-row + .projects__item {
  margin-top: 0;
  border-top: 0;
}
@keyframes focusIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.project { position: relative; }
.project__name,
.project__year {
  transition: font-size var(--focus-dur) var(--focus-ease), letter-spacing var(--focus-dur) var(--focus-ease), opacity 180ms ease;
}

/* Cabecera: la fila se convierte en el título grande del PDF. */
.app.is-focus .project.is-open .project__header {
  position: static;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 0 7em 0 0;
  border-top: 0;
  background: none;
}
.app.is-focus .project__num { display: none; }
.app.is-focus .project.is-open .project__name {
  font-size: 30px; /* igual que .rail__mono */
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.app.is-focus .project.is-open .project__year { font-size: 15px; color: var(--muted); }
.app.is-focus .project__header:hover .project__name,
.app.is-focus .project__header:hover .project__year { opacity: 1; }


/* Metadatos, texto e imágenes a escala de lectura. */
.app.is-focus .project__body { padding-top: 0; }
.app.is-focus .project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 48px;
  margin: 28px 0 34px;
  padding-bottom: 24px;
  border-bottom: var(--line-w) solid var(--ink);
}
.app.is-focus .meta-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.app.is-focus .meta-value { font-size: 15px; }
.app.is-focus .project__content--split { gap: clamp(36px, 5vw, 88px); }
.app.is-focus .project__section + .project__section { margin-top: 34px; }
.app.is-focus .project__section-title {
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
}
.app.is-focus .project__section p,
.app.is-focus .project__section .project__bullets li {
  font-size: 15.5px;
  line-height: 1.75;
}
@media (min-width: 900px) {
  .app.is-focus .project__media { position: sticky; top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .app, .left__inner, .left__rail, .project__name, .project__year { transition: none !important; }
  .app.is-focus .projects__item { animation: none; }
}

/* ----------- MINIMAPA (tipo Sublime Text) -----------
   Copia a escala de los proyectos abiertos, a la derecha de la columna,
   con un recuadro sobre la parte visible. Sustituye al indicador de scroll. */
@media (min-width: 900px) {
  .app.is-focus .minimap {
    display: block;
    position: fixed;
    top: calc(var(--frame-pad) + 72px);
    bottom: calc(var(--frame-pad) + 16px);
    right: 28px;
    width: 128px; /* igual que el botón; debe coincidir con ANCHO en Minimap.jsx */
    overflow: hidden;
    z-index: 40;
    cursor: pointer;
    background: var(--bg);
    animation: minimapIn 400ms 300ms var(--focus-ease) both;
  }
  @keyframes minimapIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: none; }
  }
  .minimap__track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
    pointer-events: none;
  }
  .minimap__track > * { transform-origin: 0 0; pointer-events: none; }
  .minimap__view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: var(--line-w) solid var(--accent);
    cursor: grab;
    transition: background-color 140ms ease;
  }
  .minimap:hover .minimap__view { background: color-mix(in srgb, var(--accent) 16%, transparent); }
  .minimap.is-dragging .minimap__view { cursor: grabbing; background: color-mix(in srgb, var(--accent) 22%, transparent); }

  /* Hueco para el minimapa y fuera la línea de scroll. */
  .app.is-focus .right[data-view="projects"] .right__inner { padding-right: 184px; }
  .app.is-focus .scroll-indicator { display: none; }
}

/* ----------- IMÁGENES DEL PROYECTO -----------
   ProjectRow.jsx reparte las imágenes en 1–3 columnas y fija su alto para
   que acaben a la altura del texto; aquí se recortan con cover. */
.project__media-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.project__media picture { display: block; min-width: 0; }
.project__media img { width: 100%; object-fit: cover; }
/* En móvil, una sola imagen por proyecto: la primera, que es la principal. */
@media (max-width: 899px) {
  .project__media > img + img,
  .project__media > picture + picture,
  .project__media > img + picture,
  .project__media > picture + img { display: none; }
}

/* Las columnas ocupan exactamente el interior del marco (.app), entre su
   línea superior y la inferior: ni tapan la línea ni dejan hueco. */
@media (min-width: 900px) {
  .app { grid-template-rows: minmax(0, 1fr); }
  .left,
  .right {
    height: auto;
    min-height: 0;
  }
}

/* ----------- BARRA DEL PROYECTO -----------
   En el modo expandido el título se queda arriba mientras se recorre el
   proyecto, a la altura de RVM (40px, como el padding del carril), con el
   mismo espacio por arriba que por abajo. */
.project__bar { display: contents; }
/* Los metadatos solo aparecen una vez: en la barra (escritorio) o en el
   acordeón (móvil). */
.project__bar .project__meta { display: none; }
@media (min-width: 900px) {
  .app.is-focus .project__bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 40px 0 0;
    background: var(--bg);
  }
  .app.is-focus .project__bar .project__meta { display: flex; margin: 28px 0 0; padding-bottom: 24px; }
  .app.is-focus .project__body > .project__meta { display: none; }
  /* 24px entre la línea de la cabecera y el primer apartado («Reto»). */
  .app.is-focus .project__content { padding-top: 24px; }
  /* Sin interlineado extra encima: las letras del encabezado empiezan a ras
     de la imagen de al lado. */
  .app.is-focus .project__section-title { line-height: 1; text-box: trim-start cap alphabetic; }
  .app.is-focus .project__meta { margin-top: 0; }
}

/* En el modo expandido, «Quiero saber más» va fijo encima del minimapa. */
@media (min-width: 900px) {
  .app.is-focus .projects__more {
    position: fixed;
    top: calc(var(--frame-pad) + 26px);
    right: 28px;
    z-index: 41;
  }
}

/* Botón de Google Play, al final del texto del proyecto. */
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 8px 16px 8px 12px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  transition: opacity 140ms ease;
}
.play-btn:hover { opacity: 0.85; color: var(--bg); }
.play-btn__logo { width: 20px; height: 20px; display: block; flex: none; }
.play-btn__text { display: flex; flex-direction: column; line-height: 1.15; }
.play-btn__pre { font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.play-btn__name { font-size: 15px; letter-spacing: -0.01em; }


/* Solo para lectores de pantalla y buscadores (jerarquía de encabezados). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }
