.portfolio-page { overflow-x: clip; }
.portfolio-hero {
  min-height: min(86svh, 900px);
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(8,8,7,.92) 0%, rgba(8,8,7,.64) 48%, rgba(8,8,7,.24) 78%),
    linear-gradient(to top, rgba(8,8,7,.84), transparent 58%),
    url("images/portfolio/finish/curved-driveway-finish-1440.webp") center 54% / cover no-repeat;
}
.portfolio-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 28%, transparent, rgba(0,0,0,.14));
  pointer-events: none;
}
.portfolio-hero-inner { position: relative; z-index: 1; padding-block: 190px 86px; }
.portfolio-hero h1 { font-size: clamp(5.5rem, 18vw, 14rem); line-height: .74; letter-spacing: -.075em; }
.portfolio-hero .hero-copy { max-width: 650px; font-size: clamp(1.1rem, 2vw, 1.45rem); }
.portfolio-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.portfolio-intro { background: var(--paper); }
.portfolio-intro .intro-grid { align-items: end; }
.portfolio-intro-copy { max-width: 730px; }
.portfolio-source-note { margin: 24px 0 0; padding-left: 18px; border-left: 3px solid var(--accent); color: var(--muted); font-weight: 700; }

.visualize-section { overflow: hidden; }
.visualize-layout { display: grid; grid-template-columns: minmax(0,.94fr) minmax(420px,1.06fr); gap: clamp(44px,7vw,92px); align-items: center; }
.visualize-copy .display { font-size: clamp(3.2rem, 6vw, 6.4rem); }
.visualize-benefits { display: grid; gap: 12px; margin-top: 34px; }
.visualize-benefits > div { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.18); }
.visualize-benefits strong { color: #e3bb6b; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.visualize-benefits span { color: rgba(255,255,255,.74); }
.visualize-disclaimer { margin: 24px 0 0; color: rgba(255,255,255,.55); font-size: .88rem; }
.planning-board { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 14px; min-height: 610px; padding: 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 30px; background: rgba(255,255,255,.055); box-shadow: 0 34px 100px rgba(0,0,0,.34); }
.planning-photo, .concept-plan { position: relative; overflow: hidden; border-radius: 20px; }
.planning-photo img { width: 100%; height: 100%; object-fit: cover; }
.planning-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 54%, rgba(0,0,0,.78)); }
.planning-photo > span { position: absolute; z-index: 1; left: 22px; bottom: 20px; color: white; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; }
.concept-plan { display: flex; flex-direction: column; justify-content: space-between; padding: 22px; color: #27231c; background: #efe7d8; }
.plan-label { font-weight: 950; text-transform: uppercase; letter-spacing: .13em; font-size: .72rem; }
.concept-plan svg { width: 100%; height: auto; color: #8a6327; font: 800 18px Inter, sans-serif; }
.plan-legend { display: flex; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid rgba(39,35,28,.18); color: #635b4d; font-size: .8rem; font-weight: 750; }

.portfolio-work { background: #eee7db; }
.portfolio-filter { position: sticky; z-index: 20; top: 86px; display: flex; gap: 8px; overflow-x: auto; margin: 0 0 66px; padding: 12px; border: 1px solid rgba(16,16,15,.12); border-radius: 18px; background: rgba(243,239,230,.93); box-shadow: 0 18px 45px rgba(16,16,15,.08); backdrop-filter: blur(18px); scrollbar-width: thin; }
.portfolio-filter button { flex: 0 0 auto; min-height: 44px; padding: 9px 16px; border: 1px solid transparent; border-radius: 999px; background: transparent; cursor: pointer; font-weight: 850; }
.portfolio-filter button:hover, .portfolio-filter button:focus-visible { border-color: var(--ink); }
.portfolio-filter button.active { color: white; background: var(--ink); }
.portfolio-phases { display: grid; gap: 104px; }
.portfolio-phase[hidden] { display: none !important; }
.phase-heading { display: grid; grid-template-columns: 100px minmax(0,760px); gap: 26px; align-items: start; margin-bottom: 32px; }
.phase-number { color: var(--accent-dark); font-family: Georgia, serif; font-size: 2rem; font-weight: 700; }
.phase-heading h3 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.5rem,5vw,5.2rem); line-height: .92; letter-spacing: -.05em; }
.phase-heading p { margin: 16px 0 0; color: var(--muted); font-size: 1.05rem; }
.portfolio-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); grid-auto-flow: dense; gap: 18px; }
.portfolio-grid-single { max-width: 900px; }
.portfolio-card { position: relative; grid-column: span 4; min-height: 390px; overflow: hidden; padding: 0; border: 0; border-radius: 22px; color: white; background: #bbb3a6; text-align: left; cursor: zoom-in; box-shadow: 0 14px 38px rgba(16,16,15,.11); isolation: isolate; }
.portfolio-card-wide { grid-column: span 8; }
.portfolio-card-tall { min-height: 520px; }
.portfolio-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s ease, filter .25s ease; }
.portfolio-card::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(transparent 48%, rgba(7,7,6,.9)); pointer-events: none; }
.portfolio-card:hover img { transform: scale(1.035); filter: saturate(1.04); }
.portfolio-card:focus-visible { outline: 4px solid var(--accent); outline-offset: 4px; }
.portfolio-caption { position: absolute; z-index: 2; inset: auto 0 0; padding: 80px 24px 24px; }
.portfolio-caption span { display: block; color: #eacb8e; font-size: .7rem; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.portfolio-caption strong { display: block; max-width: 680px; margin-top: 7px; font-size: clamp(1.15rem,2vw,1.65rem); line-height: 1.14; }
.portfolio-card-video { cursor: pointer; }
.portfolio-card-video::after { content: "▶"; position: absolute; z-index: 3; top: 20px; left: 20px; display: grid; place-items: center; width: 54px; height: 54px; padding-left: 3px; border-radius: 50%; color: #17150f; background: var(--accent); box-shadow: 0 12px 34px rgba(0,0,0,.32); }
.portfolio-card.asset-error::after { content: attr(data-error-label); position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; padding: 24px; color: #4c4841; background: #ded8cc; text-align: center; font-weight: 850; }

.portfolio-cta { background: var(--paper); }

.portfolio-lightbox { width: min(1160px,calc(100% - 28px)); max-width: none; padding: 0; border: 0; background: transparent; }
.portfolio-lightbox::backdrop { background: rgba(0,0,0,.9); backdrop-filter: blur(6px); }
.portfolio-lightbox-inner { position: relative; overflow: hidden; border-radius: 22px; color: white; background: #090908; box-shadow: 0 34px 120px rgba(0,0,0,.58); }
.portfolio-lightbox img, .portfolio-lightbox video { width: 100%; max-height: 82vh; object-fit: contain; background: #090908; }
.portfolio-lightbox video { min-height: min(70vh,650px); }
.portfolio-lightbox-close { position: absolute; z-index: 5; top: 12px; right: 12px; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: white; background: rgba(0,0,0,.74); cursor: pointer; font-size: 1.55rem; }
#portfolio-lightbox-caption { margin: 0; padding: 17px 22px 20px; font-weight: 800; }

.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .65s ease, transform .65s ease; }
.js .reveal.in, .js.reveal-fallback .reveal { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .visualize-layout { grid-template-columns: 1fr; }
  .planning-board { min-height: 560px; }
  .portfolio-filter { top: 76px; }
  .portfolio-card, .portfolio-card-wide { grid-column: span 6; }
  .portfolio-grid-single .portfolio-card { grid-column: span 12; }
}

@media (max-width: 680px) {
  .portfolio-page .nav { min-height: 68px; }
  .portfolio-page .brand { display: flex; align-items: center; max-width: 112px; }
  .portfolio-page .brand img { width: 104px; max-height: 54px; object-fit: contain; }
  .portfolio-page .menu-btn { width: 48px; height: 48px; display: grid; place-items: center; }
  .portfolio-hero { min-height: 78svh; background-position: 61% center; }
  .portfolio-hero-inner { padding: 126px 0 64px; }
  .portfolio-hero h1 { font-size: clamp(5.2rem,30vw,8.3rem); line-height: .76; }
  .portfolio-hero-actions { display: grid; }
  .portfolio-hero-actions .btn { width: 100%; }
  .visualize-benefits > div { grid-template-columns: 1fr; gap: 5px; }
  .planning-board { grid-template-columns: 1fr; min-height: 720px; }
  .planning-photo { min-height: 330px; }
  .concept-plan { min-height: 340px; }
  .portfolio-filter { top: 70px; margin-inline: -14px; border-radius: 0; border-inline: 0; }
  .portfolio-phases { gap: 82px; }
  .phase-heading { grid-template-columns: 52px 1fr; gap: 12px; }
  .phase-number { font-size: 1.3rem; }
  .phase-heading h3 { font-size: clamp(2.65rem,14vw,4.2rem); }
  .portfolio-grid { grid-template-columns: 1fr; gap: 14px; }
  .portfolio-card, .portfolio-card-wide { grid-column: auto; min-height: 390px; }
  .portfolio-card-tall { min-height: 500px; }
  .portfolio-card-video { min-height: 480px; }
  .portfolio-lightbox video { min-height: 0; max-height: 76vh; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .portfolio-card img { transition: none; }
}


/* Project stories with sound */
.project-stories { position: relative; overflow: hidden; }
.project-stories::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 15% 20%, rgba(212,166,78,.13), transparent 34%), radial-gradient(circle at 88% 80%, rgba(255,255,255,.06), transparent 30%); }
.project-stories > .shell { position: relative; z-index: 1; }
.project-stories .section-head { margin-bottom: 38px; }
.project-stories .lead { max-width: 760px; }
.project-story-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.55fr); gap: 20px; align-items: stretch; }
.project-story-card { grid-column: auto; width: 100%; min-height: 500px; }
.project-story-card-horizontal img { object-position: center; }
.project-story-card-vertical { max-width: 430px; min-height: 620px; justify-self: center; }
.project-story-sound { position: absolute; z-index: 4; top: 22px; right: 22px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.42); border-radius: 999px; color: white; background: rgba(0,0,0,.68); font-size: .72rem; font-weight: 950; letter-spacing: .11em; text-transform: uppercase; backdrop-filter: blur(12px); }
.project-story-note { margin: 22px 0 0; color: rgba(255,255,255,.62); font-size: .9rem; }

@media (max-width: 980px) {
  .project-story-grid { grid-template-columns: minmax(0,1fr) minmax(240px,.58fr); }
  .project-story-card { min-height: 440px; }
  .project-story-card-vertical { min-height: 560px; }
}

@media (max-width: 680px) {
  .project-story-grid { grid-template-columns: 1fr; }
  .project-story-card, .project-story-card-horizontal { min-height: 360px; }
  .project-story-card-vertical { max-width: none; min-height: 610px; }
  .project-story-sound { top: 18px; right: 18px; }
}
