.site-header {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  gap: 1.3rem;
  padding: .6rem var(--gutter);
  overflow: hidden;
  overflow: clip;
}

.site-header::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
}

.site-header::after {
  background: linear-gradient(to bottom, #e8dccca6, #e8dccc64 53%, #e8dccc00 98%);
}

body[data-showcase-open="settled"] .site-header > * { visibility: hidden; }
.site-header:has(.more-menu:not([hidden])) { overflow: visible; }

.wordmark {
  justify-self: start;
  white-space: nowrap;
}

.wordmark,
.showcase-chrome h2 {
  font: 600 clamp(1.4rem, 2.2vw, 1.95rem)/.95 var(--display);
  letter-spacing: -.045em;
}
.wordmark span { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.65rem, 4.4vw, 4.75rem);
  font-size: .875rem;
  font-weight: 400;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.site-nav button {
  min-height: 2.75rem;
  padding: .6rem .15rem;
  border: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.site-nav button:hover { color: var(--accent); }
.site-nav > button:focus-visible,
.site-nav .more-toggle:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: .38em;
}

.header-more { position: relative; }
.more-toggle { display: flex; align-items: center; gap: .5rem; }
.more-toggle[aria-expanded="true"] { color: var(--accent); }
.more-indicator { position: relative; width: .55rem; height: .55rem; }
.more-indicator::before,
.more-indicator::after {
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: currentColor;
  content: "";
}
.more-indicator::after { transform: rotate(90deg); transition: transform .18s ease; }
.more-toggle[aria-expanded="true"] .more-indicator::after { transform: none; }

.more-menu {
  position: absolute;
  inset-block-start: calc(50% + var(--header-height) / 2 + .4rem);
  inset-inline-end: -.65rem;
  width: 13.25rem;
  padding: .35rem;
  border: 1px solid #d9dacd;
  border-radius: .6rem;
  background: #fdfbf5;
  box-shadow: 0 .8rem 2.2rem #20291c1f;
}
.more-menu::before {
  position: absolute;
  inset: -.27rem 1.55rem auto auto;
  width: .5rem;
  height: .5rem;
  border: solid #d9dacd;
  border-width: 1px 0 0 1px;
  background: inherit;
  transform: rotate(45deg);
  content: "";
}
.more-menu button,
.more-menu a {
  position: relative;
  display: block;
  width: 100%;
  padding: .6rem .8rem;
  border-radius: .28rem;
  font-size: .8125rem;
  text-align: start;
}
.more-menu button:hover, .more-menu button:focus-visible,
.more-menu a:hover, .more-menu a:focus-visible { background: #eeefe5; color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .more-menu:not([hidden]) { animation: more-appear .18s ease-out; }
}
@keyframes more-appear {
  from { opacity: 0; transform: translateY(-.3rem); }
  to { opacity: 1; transform: none; }
}

.menu-toggle {
  display: grid;
  place-items: center;
  justify-self: end;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.menu-toggle:is(:hover, :focus-visible, [aria-expanded="true"]) {
  background: var(--ink);
  color: var(--paper);
}
.menu-toggle:focus-visible { outline: none; }
.menu-icon {
  position: relative;
  width: 1.06rem;
  height: .77rem;
  border-block: 1px solid currentColor;
}
.menu-icon::after { position: absolute; inset: calc(50% - .5px) 0 auto; height: 1px; background: currentColor; content: ""; }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.hero-ribbon {
  position: fixed;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: calc(50% - var(--ribbon-width) / 2);
  width: var(--ribbon-width);
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.hero-ribbon-track {
  display: flex;
  flex-direction: column;
  animation: ribbon-stream 54s linear -12s infinite;
}

.hero-ribbon-set {
  display: flex;
  flex: none;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ribbon-paper);
}

.hero-ribbon-panel {
  position: relative;
  display: grid;
  flex: 1 0 auto;
  place-items: center;
  padding-block: clamp(.9rem, 2.2svh, 1.35rem);
}

.hero-ribbon-panel::after {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: #a37a50;
  transform: translateX(-50%) rotate(45deg);
  content: "";
}

.hero-ribbon-panel span {
  display: block;
  color: #654537;
  font: 600 clamp(.95rem, 1.55vw, 1.3rem)/1 var(--display);
  letter-spacing: .085em;
  text-orientation: sideways;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

@keyframes ribbon-stream { to { transform: translateY(-50%); } }

.hero-intro {
  position: relative;
  z-index: 1;
  padding: clamp(1.75rem, 4.5svh, 4rem) var(--gutter) clamp(1.35rem, 3.7svh, 3.5rem);
  text-align: center;
}
.hero-intro::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(ellipse 49% 44% at 50% 53%, #fffdf8be 37%, transparent 100%);
  content: "";
  pointer-events: none;
}
.hero-label {
  display: inline-flex;
  margin: 0 0 .57rem;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font: 600 clamp(3.6rem, 7.9vw, 7.85rem)/.94 var(--display);
  letter-spacing: -.059em;
  text-wrap: balance;
}
.hero h1 em { color: var(--accent); font-weight: inherit; }
.hero-description {
  margin: .95rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
}

.gallery-bar {
  position: absolute;
  z-index: 3;
  inset: auto 0 max(clamp(.7rem, 3.2svh, 2.75rem), env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: min(100%, 96rem);
  margin-inline: auto;
  padding-inline: var(--gutter);
  pointer-events: none;
}
.gallery-bar button {
  display: grid;
  place-items: center;
  min-height: 2.8rem;
  border: 1px solid #aeb8ac;
  border-radius: 100vmax;
  background: #fcfaf5eb;
  pointer-events: auto;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}
.gallery-bar button:hover {
  color: var(--paper);
  border-color: var(--ink);
  background: var(--ink);
}
.hero-controls { position: relative; display: flex; gap: .45rem; }
.hero-controls button { width: 2.8rem; flex: none; }
.hero-controls button[hidden] { display: none; }
.fullscreen-status {
  position: absolute;
  right: 0;
  bottom: 100%;
  width: max-content;
  max-width: min(75vw, 18rem);
  margin: 0 0 .45rem;
  padding: .4rem .6rem;
  border-radius: .3rem;
  color: var(--ink);
  background: var(--paper);
  font-size: .875rem;
}
.fullscreen-status:empty { visibility: hidden; }
.fullscreen-icon {
  width: .94rem;
  height: .94rem;
  border: 2px solid currentColor;
  mask-image: conic-gradient(at .26rem .26rem, #0000 75%, #000 0),
    conic-gradient(at calc(100% - .26rem) .26rem, #0000 0, #000 0 25%, #0000 0),
    conic-gradient(at calc(100% - .26rem) calc(100% - .26rem), #0000 25%, #000 0 50%, #0000 0),
    conic-gradient(at .26rem calc(100% - .26rem), #0000 50%, #000 0 75%, #0000 0);
}
.fullscreen-toggle[aria-pressed="true"] .fullscreen-icon {
  transform: rotate(45deg);
}
.motion-icon { width: .61rem; height: .69rem; border-inline: 2px solid currentColor; }
.motion-toggle[data-paused="true"] .motion-icon {
  width: 0;
  height: 0;
  margin-left: 2px;
  border: .35rem solid transparent;
  border-right: 0;
  border-left: .55rem solid currentColor;
}

.stage {
  --preferred-row-height: clamp(76px, min(7.6vw, 11.75svh), 132px);
  --row-height: min(var(--preferred-row-height), 23cqh);
  --tile-width: clamp(145px, 18.5vw, 296px);
  --row-gap: min(clamp(7px, .7vw, 12px), 2.1cqh);
  --wall-height: calc(3 * var(--row-height) + 2 * var(--row-gap));
  --hero-art-height: clamp(320px, min(46vw, 94cqh), 580px);
  position: relative;
  z-index: 1;
  min-height: 0;
  container-type: size;
  /* The hero clips the viewport while the artwork can rise slightly into the stage top edge. */
  overflow: visible;
  isolation: isolate;
}
.marquee-wall {
  position: absolute;
  inset: 0 0 auto;
  display: grid;
  gap: var(--row-gap);
  overflow: hidden;
  overflow: clip;
  mask-image: linear-gradient(to right, transparent, #000 4.75%, #000 95.25%, transparent);
}
.marquee-row {
  min-width: 0;
  height: var(--row-height);
  overflow: hidden;
  overflow: clip;
}
.marquee-track {
  display: flex;
  width: max-content;
  height: 100%;
  will-change: transform;
}
.marquee-set {
  display: flex;
  flex: none;
  gap: var(--row-gap);
  padding-right: var(--row-gap);
}
.marquee-card {
  position: relative;
  width: var(--tile-width);
  height: var(--row-height);
  flex: none;
  overflow: hidden;
  display: block;
  padding: 0;
  border: 0;
  border-radius: .33rem;
  background: #ddd9cb;
  cursor: pointer;
}
.marquee-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.86);
}
:is(.marquee-card, .showcase-photo) img { transition: transform .38s ease-out; }
.marquee-card span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.4rem .75rem .55rem;
  color: white;
  background: linear-gradient(transparent, #0d1d18bc);
  text-align: left;
  font-size: .875rem;
  opacity: 0;
  transition: opacity .2s ease;
}
@media (any-hover: hover) {
  .marquee-card:hover img,
  body[data-showcase-open="settled"] .project-showcase:not([data-project-view]) .showcase-card:hover .showcase-photo img {
    transform: scale(1.04);
  }
  .marquee-card:hover span { opacity: 1; }
}
.hero[data-paused="true"] .hero-ribbon-track { animation-play-state: paused; }

.scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.scene-art {
  position: absolute;
  inset: 0;
  transform: none;
  transform-origin: center bottom;
  transition: transform .52s ease-in-out;
}
.hero-art-box {
  --art-max-w: min(96vw, 760px);
  --art-h: min(var(--hero-art-height), calc(var(--art-max-w) * 1080 / 1378));
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin-inline: auto;
  height: var(--art-h);
  width: calc(var(--art-h) * 1378 / 1080);
  pointer-events: none;
}
.hero-art-box .hero-artwork {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  background: transparent;
  object-fit: contain;
  object-position: center bottom;
}
.hero-artwork--video[hidden],
.hero-artwork--img[hidden] {
  display: none;
}

@media (any-hover: hover) and (any-pointer: fine) {
  body:not([data-project-view], [data-showcase-open], :has(#portfolio-dialog[open])) .scene[data-portrait-hover] .scene-art {
    transform: scale(1.03);
  }
}

@media (max-width: 43rem) {
  :root { --header-height: 4.1rem; }
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .45rem;
    padding-inline: clamp(.65rem, 3.4vw, 1.35rem);
  }
  .wordmark { font-size: clamp(1.08rem, 4.3vw, 1.45rem); }
  .site-nav {
    justify-self: center;
    gap: clamp(.45rem, 2.5vw, 1.35rem);
    font-size: clamp(.65rem, 2.75vw, .8rem);
    letter-spacing: .04em;
  }
  .more-toggle { gap: .26rem; }
  .menu-toggle { width: 2.65rem; height: 2.65rem; }
  .hero-intro {
    padding: clamp(1.5rem, 5.5svh, 3.25rem) 1rem clamp(1.25rem, 4svh, 2.6rem);
  }
  .hero-intro::before {
    background: radial-gradient(ellipse 66% 44% at 50% 53%, #fffdf8c4 37%, transparent 100%);
  }
  .hero h1 { max-width: 10em; margin-inline: auto; }
  .stage {
    --preferred-row-height: clamp(75px, 10.2svh, 95px);
    --tile-width: clamp(104px, 32vw, 183px);
  }
  .hero-art-box {
    --art-max-w: min(96vw, 430px);
    --art-h: min(92cqh, calc(var(--art-max-w) * 1080 / 1378));
  }
}

@media (max-width: 30rem) {
  .site-nav > button[data-open-window="thu-vien-anh"] { display: none; }
  .hero h1 { font-size: clamp(3rem, 9.8vw, 4.4rem); }
  .hero-description { max-width: 21rem; margin-inline: auto; }
}

@media (max-width: 18rem) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
}

@media (min-width: 43.001rem) and (max-height: 51rem) {
  .hero-intro { padding-top: clamp(.9rem, 3.7svh, 1.8rem); padding-bottom: clamp(.85rem, 2.8svh, 1.5rem); }
  .hero h1 { font-size: clamp(4rem, 7.2vw, 6.25rem); }
  .stage { --preferred-row-height: clamp(62px, 11.15svh, 88px); }
}

@media (max-width: 43rem) and (max-height: 41rem) {
  .hero-intro { padding-top: 1.35rem; padding-bottom: 1rem; }
  .hero h1 { font-size: clamp(2.45rem, 10.5vw, 3.35rem); }
  .hero-description { margin-top: .55rem; }
  .stage {
    --preferred-row-height: clamp(52px, 10svh, 69px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
  .scene-art { transform: none; }
  .hero:not([data-paused="false"]) .hero-ribbon-track { animation-play-state: paused; }
}

@media (min-width: 43.001rem) {
  .stage { --tile-width: max(clamp(145px, 18.5vw, 296px), 18vw); }
}

body[data-showcase-open] .hero-ribbon-track,
body:has(.portfolio-dialog[open]) .hero-ribbon-track { animation-play-state: paused; }
