/* Four real sites. Ordinary cards are the no-JS and reduced-motion baseline. */
.flow-section[data-flow-key="projects"],
.flow-section[data-flow-key="projects"] > .flow-art-container {
  min-height: 0 !important;
  height: auto;
  overflow: visible;
  transform: none !important;
  will-change: auto !important;
}
.projects > .section-heading {
  max-width: 1100px;
  margin: 0 auto clamp(36px, 6vw, 76px);
  text-align: center;
}
.projects > .section-heading h2 {
  max-width: 1000px;
  margin: 0 auto;
  color: #fff;
  font-size: clamp(38px, 4.5vw, 68px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.12;
  text-wrap: balance;
}
.portfolio-stories {
  --portfolio-frame-height: min(72svh, 660px);
  --portfolio-panel-height: max(580px, 86svh);
  --portfolio-sticky-top: max(32px, calc((100svh - var(--portfolio-frame-height)) / 2));
  position: relative;
  color: #fff;
}
.portfolio-story-list { display: grid; gap: 68px; }
.portfolio-story {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  min-width: 0;
}
.portfolio-story-copy { min-width: 0; padding-block: 28px; }

/* Add only the verified official mark, without filters, tracing or restyling. */
.portfolio-brand-mark {
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 70px;
  margin: 0 0 24px;
  align-items: center;
}
.portfolio-brand-mark img {
  display: block;
  max-width: 96px;
  max-height: 96px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.portfolio-brand-mark--light { background: #fff; padding: 14px 18px; border-radius: 12px; }
.portfolio-brand-mark--dark { background: #08090a; padding: 14px 18px; border-radius: 12px; }
.portfolio-story h3 {
  margin: 0 0 26px;
  max-width: 520px;
  color: #fff;
  font-size: clamp(32px, 3.8vw, 54px);
  font-weight: 550;
  letter-spacing: -.045em;
  line-height: 1.12;
  text-wrap: balance;
}
.portfolio-visit {
  display: inline-flex;
  max-width: 100%;
  min-height: 48px;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #8dbbad;
  color: #e8fff6;
  font-size: 18px;
  line-height: 1.35;
  transition: color 180ms ease, border-color 180ms ease;
}
.portfolio-visit span { overflow-wrap: anywhere; }
.portfolio-visit svg { flex: 0 0 20px; width: 20px; height: 20px; }
.portfolio-visit:hover { color: #38f0af; border-color: #38f0af; }
.portfolio-visit:focus-visible { outline: 3px solid #38f0af; outline-offset: 8px; border-radius: 3px; }
.portfolio-media {
  display: flex;
  position: relative;
  min-width: 0;
  height: min(74svh, 660px);
  margin: 0;
  padding: clamp(16px, 2vw, 30px);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #ffffff25;
  border-radius: 24px;
  background: #efeee9;
}
.portfolio-media--aldea { background: #eee7d9; }
.portfolio-media--chosru { background: #181b1a; }
.portfolio-media--vergonias { background: #302029; }
.portfolio-media--la-flor { background: #e7ded4; }
.portfolio-media > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 3px;
  transform-origin: center;
}
.portfolio-stage { display: none; }
.projects > .projects-note {
  margin: 48px auto 0;
  max-width: 770px;
  color: #e2d7ea;
  text-align: center;
  line-height: 1.65;
}
/* These header rules lived in the retired stream stylesheet. Preserve navigation. */
.header nav > a.projects-shortcut { border-bottom: 2px solid #171b23; padding-block: 5px; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .portfolio-stories[data-portfolio-motion="on"] {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: clamp(40px, 6vw, 90px);
    align-items: start;
  }
  [data-portfolio-motion="on"] .portfolio-story-list { display: block; }
  [data-portfolio-motion="on"] .portfolio-story {
    display: flex;
    min-height: var(--portfolio-panel-height);
    align-items: center;
    padding-right: 4px;
  }
  [data-portfolio-motion="on"] .portfolio-stage {
    display: block;
    position: sticky;
    top: var(--portfolio-sticky-top);
    height: var(--portfolio-frame-height);
    overflow: hidden;
    border-radius: 24px;
    isolation: isolate;
  }
  [data-portfolio-motion="on"] .portfolio-stage > .portfolio-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 24px;
  }
}
@media (max-width: 760px) {
  .projects > .section-heading { margin-bottom: 40px; text-align: left; }
  .projects > .section-heading h2 { font-size: clamp(36px, 9.5vw, 52px); }
  .portfolio-story-list { gap: 52px; }
  .portfolio-story { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .portfolio-story-copy { padding: 0; }
  .portfolio-brand-mark { min-height: 54px; margin-bottom: 20px; }
  .portfolio-brand-mark img { max-width: 80px; max-height: 80px; }
  .portfolio-story h3 { font-size: 36px; margin-bottom: 18px; }
  .portfolio-visit { font-size: 17px; }
  .portfolio-media { height: auto; aspect-ratio: 3 / 4; padding: 18px; border-radius: 18px; }
  .portfolio-media > img { position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px); }
  .projects > .projects-note { margin-top: 40px; text-align: left; }
  .header nav { gap: 12px; }
  .header nav > a.projects-shortcut { display: inline-flex; font-size: 13px; }
  .header .brand small { font-size: 10px; }
  .header .brand { gap: 7px; }
  .header .brand-mark, .header .brand-mark img { width: 34px; height: 34px; }
  .header { padding-inline: 14px; }
  .header .nav-cta { font-size: 12px; padding: 9px; }
}
@media (max-width: 380px) {
  .header .brand > span:last-child { font-size: 13px; }
  .header .brand small { display: none; }
  .header nav { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .portfolio-visit { transition: none; }
  .portfolio-story-copy, .portfolio-media, .portfolio-media > img { transform: none !important; opacity: 1 !important; clip-path: none !important; }
}
@media print {
  .portfolio-stories[data-portfolio-motion] { display: block !important; }
  .portfolio-stage { display: none !important; }
  .portfolio-story { min-height: 0 !important; break-inside: avoid; margin-bottom: 28px; }
  .portfolio-story-copy { transform: none !important; opacity: 1 !important; }
  .portfolio-story h3, .portfolio-visit { color: #171b23; }
}

.footer-contact .portfolio-reference-note { max-width: 320px; font-size: 12px; line-height: 1.65; }

/* Phone: one compact sticky scene; the section supplies ordinary scroll distance. */
@media (max-width: 760px) and (min-height: 480px) and (prefers-reduced-motion: no-preference) {
  .portfolio-stories[data-portfolio-motion="phone"] {
    --portfolio-phone-height: min(620px, calc(100svh - 32px));
    --portfolio-phone-step: max(280px, 62svh);
    height: calc(var(--portfolio-phone-height) + 3 * var(--portfolio-phone-step));
  }
  [data-portfolio-motion="phone"] > .portfolio-story-list { display: none; }
  [data-portfolio-motion="phone"] > .portfolio-stage {
    display: block;
    position: sticky;
    top: max(16px, calc((100svh - var(--portfolio-phone-height)) / 2));
    height: var(--portfolio-phone-height);
    width: 100%;
    isolation: isolate;
  }
  [data-portfolio-motion="phone"] .portfolio-story {
    position: absolute;
    inset: 0 0 50px;
    display: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    gap: 16px;
    min-height: 0;
    margin: 0;
  }
  [data-portfolio-motion="phone"] .portfolio-story-copy {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 0 15px;
    align-items: center;
    min-height: 92px;
    padding: 0;
  }
  [data-portfolio-motion="phone"] .portfolio-brand-mark {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 64px;
    min-height: 0;
    height: 64px;
    margin: 0;
    padding: 0;
    justify-content: center;
  }
  [data-portfolio-motion="phone"] .portfolio-brand-mark img { max-width: 64px; max-height: 64px; }
  [data-portfolio-motion="phone"] .portfolio-brand-mark--light { padding: 3px; border-radius: 9px; }
  [data-portfolio-motion="phone"] .portfolio-story h3 {
    grid-column: 2;
    margin: 0;
    font-size: clamp(23px, 6.5vw, 29px);
    line-height: 1.12;
  }
  [data-portfolio-motion="phone"] .portfolio-visit {
    grid-column: 2;
    justify-self: start;
    min-height: 44px;
    gap: 10px;
    padding-block: 8px;
    font-size: 14px;
  }
  [data-portfolio-motion="phone"] .portfolio-visit svg { flex-basis: 16px; width: 16px; height: 16px; }
  [data-portfolio-motion="phone"] .portfolio-media {
    min-height: 0;
    height: 100%;
    aspect-ratio: auto;
    padding: 12px;
    border-radius: 18px;
  }
  [data-portfolio-motion="phone"] .portfolio-media > img {
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
    object-fit: contain;
  }
  .portfolio-switches {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    justify-content: center;
    gap: 18px;
  }
  .portfolio-switches button {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 10px;
    place-items: center;
    border: 1px solid #ffffff66;
    border-radius: 50%;
    background: #171b23;
    color: #fff;
  }
  .portfolio-switches svg { width: 22px; height: 22px; }
  .portfolio-switches button[aria-disabled="true"] { opacity: .4; cursor: default; }
  .portfolio-switches button:focus-visible { outline: 3px solid #38f0af; outline-offset: 3px; }
}
