.portfolio-page {
  --ink: #101014;
  --line: #a0c7e333;
  --mist: #aab9c9;
  --accent: #83d7fb;
  min-height: 100svh;
  background: var(--ink);
}

.portfolio-shell { width: min(1280px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }

.portfolio-header { position: relative; z-index: 1; border-bottom: 1px solid var(--line); background: #101014; }
.portfolio-header-inner, .portfolio-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 40px); }
.portfolio-header-inner { min-height: 76px; justify-content: space-between; }
.portfolio-brand { display: inline-flex; min-height: 44px; align-items: center; }
.portfolio-brand img { display: block; width: clamp(124px, 16vw, 174px); height: auto; }
.portfolio-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #d2dce7; font-size: 13px; white-space: nowrap; }
.portfolio-nav a:hover { color: var(--accent); }
.portfolio-home .icon { width: 17px; height: 17px; transform: rotate(180deg); }

.portfolio-hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at 83% 90%, #111e2d, #101014 67%);
}

.portfolio-wave {
  position: absolute;
  inset: -18px;
  z-index: -1;
  pointer-events: none;
  background: url('assets/revit-tools/05-tools-wave-background-v1.webp') center 68% / cover;
  opacity: .38;
  mask-image: linear-gradient(180deg, transparent 5%, #000 60%, #000 94%, transparent);
  transform: translate3d(var(--wave-x, 0px), var(--wave-y, 0px), 0);
  transition: transform .48s cubic-bezier(.2,.7,.25,1);
}

.portfolio-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.3fr);
  align-items: center;
  gap: clamp(30px, 4.2vw, 74px);
  padding-block: clamp(46px, 5.3vw, 86px);
}

.portfolio-eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.portfolio-intro h1 {
  margin: 0;
  color: #f4f8fc;
  font-size: clamp(48px, 6vw, 88px);
  font-weight: 600;
  letter-spacing: -.062em;
  line-height: .98;
}

.portfolio-lede { max-width: 32ch; margin: 22px 0 26px; color: #c2cedc; font-size: 17px; line-height: 1.65; }

.portfolio-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid #83d7fb67;
  border-radius: 5px;
  background: #1833488a;
  color: #e2f4ff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  transition: background .2s, border-color .2s;
}

.portfolio-action:hover { border-color: var(--accent); background: #214b64; }
.portfolio-action .icon { width: 18px; height: 18px; color: var(--accent); }

.portfolio-feature {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 355px;
  aspect-ratio: 1.7;
  overflow: hidden;
  padding: 0;
  border: 1px solid #a1c8e65c;
  border-radius: 14px;
  background: #17242f;
  text-align: left;
  box-shadow: 0 30px 65px -35px #000;
}

.portfolio-feature-image, .portfolio-feature::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.portfolio-feature-image { object-fit: cover; object-position: 58% 50%; transition: transform .45s ease; }
.portfolio-feature::after { content: ''; background: linear-gradient(0deg, #060910ee, #06091072 22%, transparent 58%); pointer-events: none; }
.portfolio-feature:hover .portfolio-feature-image { transform: scale(1.025); }

.portfolio-feature-tag {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 16px;
  padding: 7px 9px;
  border: 1px solid #b1dfff55;
  border-radius: 4px;
  background: #101a26e6;
  color: #c2ebff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.portfolio-feature-caption {
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 22px;
}

.portfolio-feature-caption strong { display: block; font-size: clamp(19px, 2vw, 27px); font-weight: 600; line-height: 1.1; }
.portfolio-feature-caption > span:first-child > span { display: block; margin-top: 7px; color: #c0cfdd; font-size: 13px; }

.portfolio-arrow {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #a8d6f150;
  border-radius: 5px;
  background: #16222f;
  color: #a9e6ff;
  transition: background .2s, border-color .2s;
}

.portfolio-arrow .icon { width: 18px; height: 18px; }
button.portfolio-arrow:hover:not(:disabled), .project-open:hover .portfolio-arrow, .portfolio-feature:hover .portfolio-arrow { border-color: #a3e2ffad; background: #25475c; }
button.portfolio-arrow:disabled { opacity: .4; }

.portfolio-projects { padding-block: clamp(48px, 6vw, 88px); scroll-margin-top: 18px; }
.portfolio-index-header, .portfolio-index-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.portfolio-index-header h2, .portfolio-contact h2 { margin: 0; font-size: clamp(32px, 4vw, 50px); font-weight: 600; letter-spacing: -.042em; line-height: 1.1; }

.portfolio-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: min(100%, 264px);
  color: var(--mist);
}

.portfolio-search .icon { position: absolute; left: 14px; width: 17px; height: 17px; pointer-events: none; }
.portfolio-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171c24;
  color: #f5f7fa;
  font-size: 14px;
}

.portfolio-search input::placeholder { color: #aab9c9; }
.portfolio-index-controls { align-items: center; margin: 24px 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.portfolio-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.portfolio-filters button, .portfolio-empty button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #9fbfe333;
  border-radius: 5px;
  background: #161b23;
  color: #c9d4e0;
  font-size: 13px;
}

.portfolio-filters button:hover, .portfolio-empty button:hover { color: #e9f7ff; border-color: #7cc9f27d; }
.portfolio-filters [aria-pressed='true'] { border-color: #7cc9f28d; background: #203547; color: #dff5ff; }
.portfolio-count { color: var(--mist); font-size: 13px; white-space: nowrap; }
.portfolio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project-card { min-width: 0; }

.project-open {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #171b22;
  text-align: left;
  transition: border-color .2s;
}

.project-open:hover { border-color: #7cc9f28d; }
.project-cover { display: block; width: 100%; aspect-ratio: 1.66; overflow: hidden; background: linear-gradient(145deg, #d5e0e9, #8295a7); }
.project-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.project-cover img.is-cutout { object-fit: contain; object-position: bottom center; }
.project-card--film .project-cover{display:grid;place-items:center;background:#101a28 url('assets/revit-tools/05-tools-wave-background-v1.webp') center/cover}
.project-card--film .project-cover img{width:60%;height:auto;object-fit:contain;object-position:center}
.project-open:hover .project-cover img { transform: scale(1.035); }
.project-card-copy { position: relative; display: flex; flex: 1; flex-direction: column; gap: 7px; width: 100%; padding: 17px 61px 20px 17px; }
.project-tag { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .09em; line-height: 1.45; text-transform: uppercase; }
.project-name { color: #eef5fc; font-size: 18px; font-weight: 600; line-height: 1.3; }
.project-meta { color: var(--mist); font-size: 12px; line-height: 1.45; }
.project-card-copy .portfolio-arrow { position: absolute; right: 14px; top: 18px; width: 34px; height: 34px; }
.portfolio-empty { padding: 32px 0; color: var(--mist); }
.portfolio-empty p { margin-top: 0; }

.portfolio-contact { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(110deg, #1a2b3b, #161b23); }
.portfolio-contact h2 { font-size: clamp(24px, 3vw, 36px); }
.portfolio-contact .portfolio-eyebrow { margin-bottom: 7px; }
.portfolio-footer { margin-top: 64px; padding: 20px 0 28px; border-top: 1px solid var(--line); color: var(--mist); font-size: 12px; }

html.project-dialog-open { overflow: hidden; }
.project-dialog {
  width: min(1120px, calc(100% - 44px));
  max-width: none;
  max-height: calc(100dvh - 44px);
  padding: 0;
  overflow: auto;
  border-color: #b3d6f056;
  background: #151b24;
}

.project-dialog::backdrop { background: #070b13cf; backdrop-filter: blur(15px); }
.project-dialog-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); align-items: stretch; }
.project-gallery { display: flex; flex-direction: column; justify-content: center; min-width: 0; background: #0c121b; }
.project-gallery-stage { display: grid; place-items: center; min-height: 300px; background: linear-gradient(145deg, #202b37, #101821); }
.project-gallery-stage img { display: block; width: 100%; height: min(55vh, 470px); object-fit: contain; }
.project-gallery-stage img.is-cutout { background: linear-gradient(145deg, #d5e0e9, #8295a7); }
.project-gallery-controls { display: flex; align-items: center; justify-content: center; gap: 15px; min-height: 58px; padding: 8px; color: var(--mist); font-size: 13px; font-variant-numeric: tabular-nums; }
.gallery-prev { transform: rotate(180deg); }
.project-detail { align-self: center; padding: 56px 30px 32px; }
.project-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 42px; height: 42px; }
.project-detail h2 { margin: 0; color: #f1f7ff; font-size: clamp(23px, 3vw, 38px); font-weight: 600; letter-spacing: -.033em; line-height: 1.15; }
.project-detail-meta { margin: 12px 0 0; color: #a0dfff; font-size: 13px; }
.project-detail-summary { margin: 18px 0 24px; color: #c6d3e1; font-size: 15px; line-height: 1.7; }
.project-video-link{margin:0 10px 12px 0}
.project-dialog.is-film .project-gallery-stage{background:#101a28 url('assets/revit-tools/05-tools-wave-background-v1.webp') center/cover}
.project-dialog.is-film .project-gallery-stage img{width:62%;height:auto;max-height:200px;object-fit:contain;background:transparent}

@media (max-width: 980px) {
  .portfolio-hero-inner { grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: 26px; }
  .portfolio-feature { min-height: 290px; }
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .portfolio-header-inner { min-height: 64px; }
  .portfolio-hero-inner { grid-template-columns: minmax(0, 1fr); padding-block: 42px 36px; }
  .portfolio-intro h1 { font-size: clamp(47px, 10.6vw, 66px); }
  .portfolio-lede { margin-block: 16px 20px; font-size: 16px; }
  .portfolio-feature { min-height: 0; aspect-ratio: 1.45; }
  .portfolio-feature-caption { padding: 14px; }
  .portfolio-feature-tag { top: 11px; left: 11px; }
  .portfolio-index-header { flex-wrap: wrap; align-items: flex-start; }
  .portfolio-index-controls { align-items: flex-start; flex-direction: column; gap: 12px; }
  .portfolio-search { width: 100%; }
  .portfolio-contact { align-items: flex-start; flex-direction: column; padding: 22px; }
  .project-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .project-dialog-inner { grid-template-columns: minmax(0, 1fr); }
  .project-gallery-stage { min-height: 0; max-height: min(42dvh, 350px); aspect-ratio: 1.55; }
  .project-gallery-stage img { min-height: 0; height: 100%; max-height: min(42dvh, 350px); }
  .project-detail { padding: 23px 18px 24px; }
}

@media (max-width: 520px) {
  .portfolio-nav .portfolio-nav-work { display: none; }
  .portfolio-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .portfolio-wave { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-feature:hover .portfolio-feature-image, .project-open:hover .project-cover img { transform: none; }
}
