/* BLEC — an architectural portfolio, made to be explored. */
.card-index, .card-discover { display: none; }
.portfolio-page .catalog { padding-top: clamp(46px, 7vw, 96px); }
.portfolio-page .section-head { grid-template-columns: 1.5fr 1fr; gap: 7%; margin-bottom: 48px; }
.portfolio-page .section-head h1 { font-size: clamp(52px, 6.5vw, 100px); line-height: .96; }
.portfolio-page .section-head h1 span, .portfolio-page .section-head h1 em { display: block; }
.portfolio-page .section-head h1 em { color: #9b4c04; font-weight: 400; }
.portfolio-page .section-head > p { max-width: 350px; justify-self: end; padding-bottom: 5px; }
.portfolio-page .portfolio-toolbar { margin-bottom: 38px; padding-block: 17px; }
.portfolio-page .project-grid { grid-template-columns: 1.15fr 1fr; gap: 64px 38px; align-items: start; }
.portfolio-page .project-card:nth-child(n) { grid-column: auto; border: 0; background: transparent; border-radius: 0; overflow: visible; box-shadow: none; }
.portfolio-page .project-card:nth-child(even) { margin-top: 90px; }
.portfolio-page .project-card .card-media { height: auto; aspect-ratio: 1.3; border-radius: 2px; width: 100%; }
.portfolio-page .project-card:nth-child(3n+2) .card-media { aspect-ratio: 1; }
.portfolio-page .project-card:nth-child(3n) .card-media { aspect-ratio: 1.55; }
.portfolio-page .card-media img { transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.portfolio-page .project-card:hover .card-media img { transform: scale(1.045); }
.portfolio-page .card-caption { padding: 20px 0 0; align-items: start; gap: 13px; width: 100%; }
.portfolio-page .card-title { flex: 1; }
.portfolio-page .project-name { font-size: clamp(29px, 3.1vw, 46px); }
.portfolio-page .card-detail { margin-top: 8px; }
.portfolio-page .card-index { display: block; font-size: 11px; color: #9b4c04; padding-top: 7px; font-variant-numeric: tabular-nums; }
.portfolio-page .card-arrow { width: 44px; height: 44px; flex-basis: 44px; }
.portfolio-page .card-type { top: 16px; left: 16px; font-weight: 500; border-radius: 0; background: #10263de8; color: white; padding: 8px 12px; }
.portfolio-page .card-discover { position: absolute; display: flex; gap: 22px; align-items: center; bottom: 20px; right: 20px; padding: 15px 18px; background: var(--paper); color: var(--navy); font-size: 12px; opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; }
.portfolio-page .project-card:hover .card-discover, .portfolio-page .project-card:focus-visible .card-discover { opacity: 1; transform: none; }
.portfolio-page .catalog-references { margin-top: 90px; border-top: 1px solid var(--line); padding-top: 36px; }
.portfolio-page .reference-grid li { background: none; border: 0; border-bottom: 1px solid var(--line); padding: 17px 0; border-radius: 0; }


@media (max-width: 640px) {
  .portfolio-page .section-head { grid-template-columns: 1fr; gap: 25px; margin-bottom: 30px; }
  .portfolio-page .section-head h1 { font-size: clamp(48px, 11vw, 68px); }
  .portfolio-page .section-head > p { justify-self: start; font-size: 15px; }
  .portfolio-page .portfolio-toolbar { margin-bottom: 28px; padding-block: 10px; }
  .portfolio-page .project-grid { grid-template-columns: 1fr; gap: 36px; }
  .portfolio-page .project-card:nth-child(n) { margin-top: 0; grid-column: 1; }
  .portfolio-page .project-card:nth-child(n) .card-media { aspect-ratio: 1.3; }
  .portfolio-page .project-card:nth-child(3n+2) .card-media { aspect-ratio: 1.15; }
  .portfolio-page .project-card:nth-child(n) .project-name { font-size: 33px; }
  .portfolio-page .card-caption { padding-top: 15px; }
  .portfolio-page .project-card:nth-child(n) .card-arrow { display: grid; }
  .portfolio-page .card-detail { font-size: 12px; }
  .portfolio-page .catalog-references { margin-top: 60px; }
}

/* Light gallery: a full-width project canvas with a compact project masthead. */
body.gallery-open { position: fixed; width: 100%; overflow: hidden; }
.exhibition {
  --gallery-ink: #142e44; --gallery-line: #dce3e7; --gallery-muted: #596b78;
  --gallery-paper: #faf9f5; --gallery-accent: #a94e04;
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; overflow: auto; overscroll-behavior: contain;
  background: var(--gallery-paper); color: var(--gallery-ink); color-scheme: light; isolation: isolate;
  scrollbar-width: thin; scrollbar-color: #a4b4c0 var(--gallery-paper);
}
.exhibition::backdrop { background: #faf9f5; }
/* Decorative layers sit behind every photograph and control, and never intercept input. */
.exhibition::before, .exhibition::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
.exhibition::before {
  background:
    url('/assets/gallery-architecture.svg') center top / cover no-repeat,
    radial-gradient(ellipse at 92% 8%, #e8cda952 0%, #f1dec22b 24%, transparent 52%),
    radial-gradient(ellipse at 0% 75%, #bdcedb42 0%, transparent 46%),
    radial-gradient(ellipse at 40% 32%, #ffffffed 0%, #ffffff50 38%, transparent 65%),
    linear-gradient(135deg, #f8f7f2, #faf9f6 48%, #f1f4f5);
}
.exhibition::after {
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cpath fill='%23000' filter='url(%23n)' opacity='.15' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
@media (max-width: 640px) {
  .exhibition::before {
    background-size: auto 720px, auto, auto, auto, auto;
    background-position: 78% top, center, center, center, center;
  }
  .exhibition::after { opacity: .12; }
}
.exhibition[open] { animation: exhibition-enter .35s ease-out both; }
.exhibition button, .exhibition a { -webkit-tap-highlight-color: transparent; }
.exhibition button { color: inherit; }
.exhibition svg { width: 21px; height: 21px; flex-shrink: 0; }
.exhibition-shell { min-height: 100%; display: flex; flex-direction: column; min-width: 0; }
.exhibition-top {
  position: sticky; top: 0; z-index: 3; background: #ffffffed; backdrop-filter: blur(16px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
  min-height: 76px; border-bottom: 1px solid var(--gallery-line); padding: 10px clamp(18px, 3vw, 48px);
}
.exhibition-brand { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.exhibition-brand img { width: 34px; height: 34px; }
.exhibition-modes { display: flex; padding: 4px; gap: 3px; border-radius: 40px; background: #edf2f5; }
.exhibition-modes button { background: transparent; border: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 10px 18px; border-radius: 28px; min-height: 40px; }
.exhibition-modes button svg { width: 16px; height: 16px; }
.exhibition-modes button[aria-pressed="true"] { background: var(--gallery-ink); color: white; box-shadow: 0 2px 6px #142e441a; }
.exhibition-icon { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; border: 1px solid #cbd6de; background: white; border-radius: 50%; transition: background .2s, color .2s, border-color .2s; }
.exhibition-icon:hover { background: #fff0de; border-color: #f68712; }
.exhibition-close { justify-self: end; }
.exhibition-layout { width: min(1480px, 100%); min-width: 0; margin-inline: auto; flex: 1; }
.exhibition-story {
  display: grid; grid-template-columns: 76px minmax(0,1fr) minmax(210px,270px); gap: 26px;
  padding: 34px clamp(18px,3vw,48px) 22px; align-items: start; min-width: 0;
}
.exhibition-project-index {
  position: relative; display: grid; place-content: center; gap: 7px; text-align: center;
  width: 70px; height: 70px; border-radius: 22px; background: #fff0dd; border: 1px solid #f4d4b2;
  font-size: 10px; font-weight: 700; color: #8d470c; letter-spacing: .08em; font-variant-numeric: tabular-nums;
}
.exhibition-rule { width: 24px; height: 2px; margin: auto; background: #f68712; }
.exhibition-heading { min-width: 0; }
#exhibition-location { display: flex; align-items: center; gap: 8px; color: var(--gallery-muted); font-size: 12px; line-height: 1.5; margin: 0 0 8px; }
#exhibition-location::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #f68712; flex-shrink: 0; }
.exhibition-heading h2 { font-family: var(--sans); font-size: clamp(32px,4.1vw,62px); font-weight: 650; line-height: 1.05; letter-spacing: -.055em; overflow-wrap: break-word; }
.exhibition-quote { color: var(--gallery-muted); font-size: 13px; line-height: 1.6; margin: 12px 0 0; }
.exhibition-filters { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; grid-row: 2; padding-top: 2px; }
.exhibition-filters button { display: flex; gap: 12px; align-items: center; border: 1px solid #cbd6de; border-radius: 30px; background: #fff; padding: 9px 16px; min-height: 44px; font-size: 12px; color: var(--gallery-muted); }
.exhibition-filters button:hover { border-color: #f68712; }
.exhibition-filters button[aria-pressed="true"] { color: #783a05; background: #fff0de; border-color: #d88c45; }
.exhibition-filters small { display: grid; place-items: center; min-width: 23px; min-height: 23px; padding: 2px 5px; font-size: 10px; background: #edf2f5; color: var(--gallery-ink); border-radius: 50%; font-variant-numeric: tabular-nums; }
.exhibition-filters button[aria-pressed="true"] small { background: #f68712; color: #10263d; }
.exhibition-story-bottom { grid-column: 3; grid-row: 1; display: grid; gap: 14px; justify-items: stretch; }
.exhibition-contact { display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #edb56e; border-radius: 12px; background: #ffce8e; color: #142e44; text-decoration: none; font-size: 12px; line-height: 1.4; min-height: 46px; padding: 12px 16px; font-weight: 650; }
.exhibition-contact:hover { background: #ffbf69; }
.exhibition-next-project { display: grid; grid-template-columns: 1fr auto; gap: 5px 15px; border: 0; padding: 0 3px; background: none; width: 100%; text-align: left; }
.exhibition-next-project > span:first-child { font-size: 10px; color: var(--gallery-muted); grid-column: 1; }
.exhibition-next-project strong { font-family: var(--sans); font-size: 16px; font-weight: 650; grid-column: 1; }
.exhibition-next-project > span:last-child { grid-column: 2; grid-row: 1 / 3; font-size: 17px; color: #a94e04; align-self: center; }
.exhibition-canvas { min-width: 0; padding: 0 clamp(18px,3vw,48px) 32px; }
.exhibition-mosaic { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); grid-auto-rows: clamp(150px,17vw,240px); gap: 16px; padding: 0 0 12px; }
.exhibition-tile { position: relative; display: grid; grid-template-rows: minmax(0,1fr) 40px; grid-column: span 3; min-width: 0; border: 1px solid #e0e6e9; border-radius: 16px; padding: 0; background: white; overflow: hidden; box-shadow: 0 4px 16px #142e4405; transition: transform .25s, box-shadow .25s; }
.exhibition-tile:nth-child(5n+1) { grid-column: span 6; grid-row: span 2; }
.exhibition-tile img { width: 100%; height: 100%; min-height: 0; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.exhibition-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 25px #142e4417; }
.exhibition-tile:hover img { transform: scale(1.035); }
.exhibition-tile-caption { position: relative; display: flex; height: 40px; justify-content: space-between; align-items: center; padding: 0 14px; background: white; font-size: 11px; color: var(--gallery-ink); border-top: 1px solid #edf1f3; }
.exhibition-tile-label { display: flex; align-items: center; gap: 10px; }
.exhibition-tile-number { color: var(--gallery-accent); font-size: 10px; font-variant-numeric: tabular-nums; }
.exhibition-tile-caption > .arrow { font-size: 13px; }
.exhibition-tour { display: flex; flex-direction: column; min-width: 0; }
.exhibition-stage { position: relative; isolation: isolate; min-height: 240px; height: max(320px,calc(100dvh - 400px)); max-height: 900px; overflow: hidden; display: grid; place-items: center; background: #e5ecef; border: 1px solid #dce3e7; border-radius: 18px; touch-action: pan-y pinch-zoom; }
.exhibition-ambience { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(40px); opacity: .14; z-index: -1; transform: scale(1.1); }
#exhibition-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; user-select: none; }
#exhibition-image:not([src]) { visibility: hidden; }
.exhibition-kind { position: absolute; top: 17px; left: 17px; background: #fffffff0; border: 1px solid #dce3e7; border-radius: 30px; padding: 9px 13px; color: #142e44; font-size: 11px; pointer-events: none; box-shadow: 0 2px 8px #142e4414; }
.exhibition-expand { position: absolute; top: 14px; right: 14px; background: #fffffff2; }
.exhibition-controls { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding-block: 12px; }
.exhibition-count { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.exhibition-count strong { font-family: var(--sans); font-size: 27px; letter-spacing: -.06em; font-weight: 600; }
.exhibition-count > span { color: var(--gallery-muted); font-size: 11px; }
.exhibition-hint { margin: 0; font-size: 11px; color: var(--gallery-muted); }
.touch-hint { display: none; }
.exhibition-navigation { display: flex; align-items: center; gap: 8px; }
.exhibition-play { display: flex; align-items: center; gap: 7px; padding: 10px; min-height: 44px; border: 0; background: transparent; font-size: 12px; }
.exhibition-play svg { width: 16px; height: 16px; }
.exhibition-play[aria-pressed="true"] { color: #9a4601; }
.exhibition-filmstrip { position: relative; display: flex; gap: 9px; overflow-x: auto; overscroll-behavior-x: contain; padding: 5px 3px 9px; scrollbar-width: thin; scrollbar-color: #9dafbb transparent; }
.exhibition-filmstrip button { position: relative; flex: 0 0 88px; padding: 0; height: 60px; border: 1px solid transparent; border-radius: 7px; background: #e5ecef; opacity: .6; transition: opacity .25s; }
.exhibition-filmstrip button:hover { opacity: 1; }
.exhibition-filmstrip button[aria-current="true"] { opacity: 1; outline: 2px solid #e57c0d; outline-offset: 2px; }
.exhibition-filmstrip img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.exhibition-filmstrip button span { position: absolute; left: 4px; bottom: 3px; background: #ffffffed; padding: 2px 4px; color: #142e44; border-radius: 2px; font-size: 8px; }
.exhibition-mobile-bottom { display: none; }
.exhibition-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px clamp(18px,3vw,48px); border-top: 1px solid var(--gallery-line); font-size: 9px; color: var(--gallery-muted); letter-spacing: .1em; text-transform: uppercase; }
.exhibition-error { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; background: #e5ecef; padding: 30px; text-align: center; font-size: 14px; }
.exhibition-error button { padding: 12px 18px; min-height: 44px; border: 1px solid #a4b4c0; background: white; border-radius: 10px; }
.exhibition-loader { display: none; position: absolute; bottom: 20px; left: 20px; background: #ffffffed; color: #142e44; padding: 8px 12px; font-size: 11px; border-radius: 20px; }
.exhibition-stage[aria-busy="true"] .exhibition-loader { display: block; }
.exhibition-timer { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: #e57c0d; transform: scaleX(0); transform-origin: left; }
.timing .exhibition-timer { animation: exhibition-progress 6s linear forwards; }
.exhibition[data-view="tour"] .exhibition-project-index, .exhibition[data-view="tour"] .exhibition-quote { display: none; }
.exhibition[data-view="tour"] .exhibition-story { grid-template-columns: minmax(0,1fr) auto; gap: 16px; padding-top: 24px; }
.exhibition[data-view="tour"] .exhibition-heading h2 { font-size: clamp(30px,3vw,44px); }
.exhibition[data-view="tour"] .exhibition-story-bottom { grid-column: 2; }
.exhibition[data-view="tour"] .exhibition-story-bottom .exhibition-next-project { display: none; }
.is-expanded .exhibition-stage { position: fixed; inset: 0; height: 100dvh; max-height: none; z-index: 5; border-radius: 0; }
.is-expanded .exhibition-kind { top: 24px; left: 24px; }
.is-expanded .exhibition-expand { top: max(20px,env(safe-area-inset-top)); right: 20px; }
.is-expanded .exhibition-controls { position: fixed; z-index: 6; bottom: max(14px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #fffffff2; border: 1px solid #cbd6de; box-shadow: 0 8px 30px #142e4420; border-radius: 40px; padding: 6px 12px 6px 24px; }
.is-expanded .exhibition-hint, .is-expanded .exhibition-play { display: none; }
.is-expanded .exhibition-count { min-width: 75px; }
@keyframes exhibition-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes exhibition-progress { to { transform: scaleX(1); } }
@media (max-width: 1000px) {
  .exhibition-story { grid-template-columns: minmax(0,1fr) 230px; gap: 20px; }
  .exhibition-project-index { display: none; }
  .exhibition-story-bottom { grid-column: 2; }
  .exhibition-mosaic { gap: 12px; grid-auto-rows: clamp(150px,21vw,210px); }
  .exhibition-tile { grid-column: span 4; }
  .exhibition-tile:nth-child(5n+1) { grid-column: span 8; }
  .exhibition-hint { display: none; }
}
@media (max-width: 640px) {
  .exhibition-top { min-height: 66px; padding: 9px 12px; gap: 8px; grid-template-columns: auto 1fr auto; }
  .exhibition-brand span { display: none; }
  .exhibition-brand img { width: 29px; height: 29px; }
  .exhibition-modes { justify-self: center; padding: 3px; }
  .exhibition-modes button { min-height: 40px; padding: 9px 12px; gap: 6px; font-size: 11px; }
  .exhibition-close { width: 40px; height: 40px; min-width: 40px; }
  .exhibition-story, .exhibition[data-view="tour"] .exhibition-story { display: flex; flex-direction: column; gap: 17px; padding: 24px 16px 18px; }
  .exhibition-heading h2, .exhibition[data-view="tour"] .exhibition-heading h2 { font-size: clamp(30px,8vw,42px); letter-spacing: -.055em; }
  #exhibition-location { font-size: 11px; margin-bottom: 8px; }
  .exhibition-quote { margin-top: 9px; font-size: 12px; }
  .exhibition-story-bottom { display: none; }
  .exhibition-filters { gap: 6px; padding: 0; flex-wrap: nowrap; width: 100%; }
  .exhibition-filters button { padding: 7px 10px; font-size: 11px; gap: 7px; min-height: 42px; }
  .exhibition-filters small { min-width: 20px; min-height: 20px; font-size: 9px; padding: 2px 4px; }
  .exhibition-canvas { padding: 0 12px 24px; }
  .exhibition-mosaic { grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: auto; gap: 10px; }
  .exhibition-tile:nth-child(n) { grid-column: span 1; grid-row: span 1; grid-template-rows: minmax(0,1fr) 34px; aspect-ratio: .95; border-radius: 13px; }
  .exhibition-tile:nth-child(5n+1) { grid-column: 1 / -1; aspect-ratio: 1.35; }
  .exhibition-tile-caption { padding: 0 10px; font-size: 10px; height: 34px; }
  .exhibition-tile-label { gap: 7px; }
  .exhibition-tile-number { font-size: 9px; }
  .exhibition-stage { height: clamp(230px,38dvh,430px); border-radius: 14px; }
  .exhibition-kind { top: 10px; left: 10px; font-size: 10px; padding: 7px 10px; }
  .exhibition-expand { top: 8px; right: 8px; }
  .exhibition-controls { gap: 8px; padding: 10px 3px; }
  .exhibition-count strong { font-size: 26px; }
  .exhibition-play { padding: 9px 6px; font-size: 11px; }
  .exhibition-navigation { gap: 7px; }
  .exhibition-filmstrip button { flex-basis: 72px; height: 52px; }
  .exhibition-mobile-bottom { display: flex; gap: 20px; align-items: center; justify-content: space-between; border-top: 1px solid var(--gallery-line); margin-top: 20px; padding-top: 18px; }
  .exhibition-mobile-bottom .exhibition-next-project { max-width: 260px; }
  .exhibition-mobile-bottom .exhibition-contact { padding: 10px 14px; border-radius: 30px; font-size: 11px; white-space: nowrap; }
  .exhibition-bottom { padding: 14px 16px max(14px,env(safe-area-inset-bottom)); font-size: 8px; letter-spacing: .04em; }
  .exhibition-bottom > span:nth-child(2) { display: none; }
}
@media (max-width: 350px) {
  .exhibition-filters { gap: 4px; }
  .exhibition-filters button { padding: 7px 7px; gap: 4px; font-size: 10px; }
  .exhibition-modes button { padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .exhibition, .exhibition *, .portfolio-page * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
