/* Cinematic finishing pass */
:root {
  --paper: #eee7d8;
  --ink: #24352b;
  --gold: #cfb66b;
  --ash: #686761;
}

::selection { background: #53664a; color: #f4f0e4; }

.statement > .section-number,
.works-header .section-number {
  font-size: clamp(11px, 1.1vw, 13.5px);
  letter-spacing: .17em;
}

.film-intro {
  background:
    radial-gradient(ellipse at 78% 42%, rgba(199, 166, 86, .22), transparent 39%),
    linear-gradient(115deg, #101a16 0%, #263a31 52%, #111a16 100%);
  background-size: 150% 150%, 100% 100%;
  animation:
    filmLeave 1.5s cubic-bezier(.76, 0, .24, 1) 10.5s forwards,
    introLightDrift 18s ease-in-out infinite alternate;
}

.film-intro::before {
  inset: clamp(12px, 2vw, 26px);
  border-color: rgba(245, 241, 231, .22);
  box-shadow: inset 0 0 70px rgba(208, 180, 101, .025), 0 0 30px rgba(208, 180, 101, .025);
  animation: introFramePulse 7s ease-in-out infinite alternate;
}

.film-intro {
  isolation: isolate;
  overflow: hidden;
}

.film-intro::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -5%;
  background: url("assets/sripada.png") center / auto min(88vh, 880px) no-repeat;
  opacity: 0;
  mix-blend-mode: screen;
  filter: drop-shadow(0 12px 64px rgba(220, 184, 45, .24));
  transform: scale(1.13) translateY(2%);
  animation:
    introMountainReveal 2200ms cubic-bezier(.2, .75, .25, 1) 180ms forwards,
    introMountainDrift 16s ease-in-out 2.4s infinite alternate;
  pointer-events: none;
}

.intro-frame,
.intro-progress {
  position: relative;
  z-index: 1;
}

@keyframes introMountainReveal {
  0% { opacity: 0; filter: blur(12px) drop-shadow(0 12px 64px rgba(220, 184, 45, .12)); transform: scale(1.13) translateY(2%); }
  42% { opacity: .36; filter: blur(2px) drop-shadow(0 12px 64px rgba(220, 184, 45, .2)); }
  100% { opacity: .27; filter: blur(0) drop-shadow(0 12px 64px rgba(220, 184, 45, .24)); transform: scale(1.02) translateY(0); }
}

.intro-stanza p {
  opacity: 0;
  transform: translateY(12px);
  animation: introVerseLine 900ms cubic-bezier(.22, 1, .36, 1) both;
}

.intro-stanza p:nth-child(1) { animation-delay: 2.1s; }
.intro-stanza p:nth-child(2) { animation-delay: 2.9s; }
.intro-stanza p:nth-child(3) { animation-delay: 3.7s; }
.intro-stanza p:nth-child(4) { animation-delay: 4.5s; }

.intro-caption {
  animation-delay: 5.6s;
}

@keyframes introVerseLine {
  from { opacity: 0; transform: translateY(12px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes introLightDrift {
  from { background-position: 0% 40%, center; }
  to { background-position: 100% 60%, center; }
}

@keyframes introFramePulse {
  from { border-color: rgba(245, 241, 231, .15); }
  to { border-color: rgba(245, 241, 231, .32); }
}

@keyframes introMountainDrift {
  from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.07) translateY(-1.5%); }
}

.statement {
  background:
    linear-gradient(90deg, rgba(247, 241, 225, .97) 0%, rgba(239, 232, 216, .93) 60%, rgba(226, 228, 210, .78) 100%),
    var(--cream);
}

.statement::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: url("assets/sripada.png") right 3vw center / min(78vw, 1024px) auto no-repeat;
  opacity: .22;
  mix-blend-mode: multiply;
  transform-origin: 72% 50%;
  animation: sripadaBackgroundZoom 12s cubic-bezier(.4, 0, .2, 1) infinite alternate;
  will-change: transform;
  pointer-events: none;
}

@keyframes sripadaBackgroundZoom {
  from { transform: scale(1); }
  to { transform: scale(1.075); }
}

.statement-butterfly {
  position: absolute;
  z-index: 1;
  top: 10%;
  left: 51%;
  width: clamp(32px, 3.2vw, 42px);
  height: auto;
  fill: rgba(207, 182, 107, .24);
  stroke: rgba(145, 116, 51, .82);
  stroke-width: .7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 1px 4px rgba(116, 92, 41, .18));
  animation: statementButterflyFlight 22s ease-in-out 1.5s infinite;
}

.statement-butterfly .butterfly-wing {
  transform-box: fill-box;
  animation: statementButterflyFlap 620ms ease-in-out infinite alternate;
}

.statement-butterfly .wing-left { transform-origin: 100% 55%; }
.statement-butterfly .wing-right { transform-origin: 0% 55%; }
.statement-butterfly .butterfly-body { fill: none; stroke-width: 1.05; }

@keyframes statementButterflyFlight {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-9deg) scale(.82); }
  8% { opacity: .84; transform: translate3d(0, 0, 0) rotate(-9deg) scale(.82); }
  27% { opacity: .84; transform: translate3d(4vw, -2vh, 0) rotate(7deg) scale(1); }
  52% { opacity: .84; transform: translate3d(8vw, 2vh, 0) rotate(-5deg) scale(.92); }
  77% { opacity: .84; transform: translate3d(12vw, -2vh, 0) rotate(8deg) scale(1.04); }
  92% { opacity: .84; transform: translate3d(14vw, 0, 0) rotate(-5deg) scale(.86); }
  100% { opacity: 0; transform: translate3d(14vw, 0, 0) rotate(-5deg) scale(.86); }
}

@keyframes statementButterflyFlap {
  from { transform: scaleX(1); }
  to { transform: scaleX(.38); }
}

@media (max-width: 600px) {
  .statement-butterfly { top: 6%; left: 58%; width: 27px; }
}

.statement-note { position: relative; }
.statement-note::after {
  content: "A QUIET STUDY IN LIGHT";
  position: absolute;
  right: -30px;
  bottom: 24px;
  writing-mode: vertical-rl;
  color: rgba(244, 240, 228, .86);
  font: 8px "Noto Sans Sinhala", sans-serif;
  letter-spacing: .2em;
  text-shadow: 0 1px 12px rgba(0,0,0,.45);
}

.mini-portrait img { transition: transform 1.2s cubic-bezier(.22, 1, .36, 1), filter 1.2s ease; }
.mini-portrait:hover img { transform: scale(1.045); filter: grayscale(0) saturate(1.08) contrast(1.04); }

.about-publication {
  max-width: 620px;
  margin: 28px 0 24px;
  padding-top: 14px;
  border-top: 1px solid rgba(36, 53, 43, .22);
}
.about-publication > p {
  margin: 0 0 8px;
  color: rgba(36, 53, 43, .62);
  font: 9px "Noto Sans Sinhala", sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.about-publication a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink);
  font: 500 clamp(19px, 2vw, 25px)/1.15 "Cormorant Garamond", serif;
  text-decoration: none;
}
.publication-link-label {
  flex: 0 0 auto;
  color: #53664a;
  font: 9px "Noto Sans Sinhala", sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.about-publication a:hover .publication-link-label { color: #a87948; }
.about-publication a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
@media (max-width: 600px) {
  .about-publication a { flex-direction: column; align-items: flex-start; gap: 8px; }
}

.works-stage { isolation: isolate; }
.works-stage::after {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.image-slide.is-active img { will-change: transform; }
.image-slide::after {
  background: linear-gradient(180deg, rgba(13, 21, 17, .02) 34%, rgba(13, 21, 17, .18) 56%, rgba(13, 21, 17, .82) 100%);
}
.slide-story {
  position: absolute;
  z-index: 6;
  left: clamp(72px, 10vw, 148px);
  bottom: clamp(40px, 7vh, 84px);
  max-width: min(650px, calc(100% - 144px));
  color: #f4f0e4;
  text-align: left;
}
.slide-kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font: 9px "Noto Sans Sinhala", sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.slide-story h2,
.project-dialog-copy h2 {
  margin: 0;
  font: 500 clamp(34px, 5.3vw, 68px)/.98 "Cormorant Garamond", serif;
  letter-spacing: -.025em;
}
.slide-story > p:not(.slide-kicker) {
  max-width: 420px;
  margin: 12px 0 20px;
  color: rgba(244, 240, 228, .82);
  font: 13px/1.7 "Noto Sans Sinhala", sans-serif;
}
.view-project {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(207, 182, 107, .72);
  background: transparent;
  color: #f4f0e4;
  font: 10px "Noto Sans Sinhala", sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
  cursor: pointer;
}
.view-project span { color: var(--gold); font-size: 14px; }
.slide-arrow {
  position: absolute;
  z-index: 8;
  top: 50%;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(244, 240, 228, .5);
  border-radius: 50%;
  background: rgba(17, 26, 22, .28);
  color: #f4f0e4;
  font-size: 22px;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.slide-arrow:hover { border-color: var(--gold); background: rgba(17, 26, 22, .72); }
.slide-arrow-previous { left: clamp(14px, 3vw, 38px); }
.slide-arrow-next { right: clamp(14px, 3vw, 38px); }
.slide-arrow:focus-visible,
.view-project:focus-visible,
.project-dialog-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.slide-controls { justify-content: flex-end; }
.slide-controls button[data-slide-toggle] { font-size: 12px; }
.project-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(920px, calc(100vw - 32px));
  max-width: none;
  max-height: min(90dvh, 900px);
  padding: 0;
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(207, 182, 107, .44);
  background: #18261f;
  color: #f4f0e4;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .45);
}
.project-dialog::backdrop { background: rgba(10, 15, 12, .78); backdrop-filter: blur(5px); }
.project-dialog-image { display: block; width: 100%; max-height: 62vh; object-fit: cover; }
.project-dialog-copy { padding: clamp(24px, 5vw, 48px); }
.project-dialog-copy h2 { font-size: clamp(38px, 6vw, 66px); }
.project-dialog-copy > p:last-child {
  max-width: 620px;
  margin: 16px 0 0;
  color: rgba(244, 240, 228, .78);
  font: 14px/1.8 "Noto Sans Sinhala", sans-serif;
}
.project-dialog-close {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(244, 240, 228, .55);
  border-radius: 50%;
  background: rgba(17, 26, 22, .7);
  color: #f4f0e4;
  font-size: 28px;
  cursor: pointer;
}
.slide-controls button:focus-visible,
.menu-button:focus-visible,
.menu-panel a:focus-visible,
.email-link:focus-visible,
.social-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.closing { position: relative; overflow: hidden; }
.closing::before { bottom: 230px; filter: saturate(.68) contrast(1.08); }
.closing > .end-credits {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 2fr);
  grid-template-rows: auto auto auto;
  align-content: start;
  align-items: start;
  gap: 6px 36px;
  min-height: 230px;
  padding: 48px 5vw 24px;
  border-top: 1px solid rgba(244, 240, 228, .22);
  background: linear-gradient(180deg, rgba(19, 31, 25, .18), rgba(19, 31, 25, .48));
}
.end-credits > p:first-child { grid-column: 1; grid-row: 1; margin: 0; }
.end-credits > .footer-copyright { grid-column: 1; grid-row: 3; }
.end-credits > a { grid-column: 1; grid-row: 2; justify-self: start; font-size: 10px; }
.closing-sinhala {
  position: absolute;
  right: 5vw;
  bottom: 48px;
  width: min(70%, 850px);
  margin: 0;
  color: rgba(244, 240, 228, .88);
  font: 400 clamp(38px, 4.3vw, 64px)/1.02 "UN Alakamanda", sans-serif;
  text-align: right;
  text-shadow: 0 2px 18px rgba(7, 14, 11, .36);
  pointer-events: none;
}
.end-credits > a:hover,
.end-credits > a:focus-visible { color: var(--gold); }
.end-credits > .closing-sinhala { font: 400 clamp(38px, 4.3vw, 64px)/1.02 "UN Alakamanda", sans-serif; }
.closing-sinhala i { color: var(--rose); }

.closing-message {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 48px));
  margin: clamp(38px, 8vh, 92px) auto clamp(28px, 5vh, 52px);
  text-align: center;
}
.closing-message h2 {
  margin: 0;
  color: #f4f0e4;
  font: 400 clamp(34px, 6vw, 76px)/1.02 "Cormorant Garamond", serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.closing-message > p {
  max-width: 540px;
  margin: clamp(20px, 3vh, 32px) auto 0;
  color: rgba(244, 240, 228, .78);
  font: 13px/1.8 "Noto Sans Sinhala", sans-serif;
  text-wrap: balance;
}
.closing > .closing-socials {
  grid-column: 1 / -1;
  justify-content: center;
  margin: 18px 0 230px;
}
.end-credits > .footer-copyright {
  grid-column: 1;
  grid-row: 3;
  margin: 0;
  color: rgba(244, 240, 228, .64);
  font: 12px/1.6 "Noto Sans Sinhala", sans-serif;
  font-style: normal;
  letter-spacing: .04em;
  text-align: left;
}
.end-credits > a { grid-column: 1; grid-row: 2; justify-self: start; font-size: 10px; }
@media (max-width: 600px) {
  .closing::before { bottom: 270px; }
  .closing > .end-credits {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px;
    min-height: 270px;
    padding: 44px 5vw 20px;
  }
  .end-credits > p:first-child { grid-column: 1; grid-row: 1; }
  .end-credits > a { display: block; grid-column: 1; grid-row: 2; justify-self: start; }
  .closing-sinhala { right: 5vw; bottom: 44px; width: calc(100% - 10vw); font-size: 36px; }
  .end-credits > .closing-sinhala { font-size: 36px; }
  .closing-message { width: 100%; margin: 24px auto; }
  .closing-message h2 { font-size: clamp(34px, 10vw, 48px); }
  .closing > .closing-socials { grid-column: 1; margin: 12px 0 270px; }
  .end-credits > .footer-copyright { grid-column: 1; grid-row: 3; padding-bottom: 0; text-align: left; }
}

@media (max-width: 900px) {
  .menu-panel { left: 58px; }
}
@media (max-width: 600px) {
  .statement-note::after { right: -13px; }
  .film-intro::before { inset: 12px; }
  .slide-story { left: 54px; bottom: 30px; max-width: calc(100% - 108px); }
  .slide-story h2 { font-size: clamp(30px, 9vw, 42px); }
  .slide-story > p:not(.slide-kicker) { max-width: 280px; font-size: 11px; }
  .slide-arrow { width: 38px; height: 38px; font-size: 18px; }
  .slide-arrow-previous { left: 8px; }
  .slide-arrow-next { right: 8px; }
  .project-dialog-image { max-height: 48vh; }
}

/* Motion polish */
html {
  scrollbar-color: #53664a #e7e1d1;
  scrollbar-width: thin;
}

.cinema-progress {
  position: fixed;
  z-index: 95;
  top: 0;
  left: 74px;
  width: calc(100% - 74px);
  height: 2px;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #d2b75d, #f4efe3);
  pointer-events: none;
  box-shadow: 0 0 12px rgba(210, 183, 93, .28);
}

.film-intro {
  cursor: pointer;
}

.film-intro.is-skipping {
  animation: filmLeave .7s cubic-bezier(.76, 0, .24, 1) forwards;
}

.statement blockquote,
.slide-story > * {
  transition: transform 1s cubic-bezier(.22, 1, .36, 1), opacity 1s ease;
}

.statement blockquote .poem-quote-mark {
  color: #a87948;
  font-family: "Cormorant Garamond", serif;
  font-size: .82em;
  font-style: normal;
  text-shadow: 0 2px 18px rgba(168, 121, 72, .18);
}

.statement blockquote .poem-quote-mark:first-child {
  margin-right: .08em;
}

.statement blockquote i .poem-quote-mark {
  margin-left: .08em;
}

.statement.visible blockquote {
  animation: statementQuoteIn 1.25s cubic-bezier(.22, 1, .36, 1) both;
}

.statement.visible .statement-note {
  animation: portraitReveal 1.35s cubic-bezier(.22, 1, .36, 1) 160ms both;
}

.statement.visible .about-copy {
  animation: copyReveal 1.15s cubic-bezier(.22, 1, .36, 1) 100ms both;
}

.mini-portrait {
  transform: translate3d(var(--depth-x, 0), var(--depth-y, 0), 0);
  transition: transform 900ms cubic-bezier(.22, 1, .36, 1);
}

.statement-butterfly {
  transform: translate3d(var(--depth-x, 0), var(--depth-y, 0), 0);
  transition: transform 1.1s cubic-bezier(.22, 1, .36, 1);
}

@keyframes statementQuoteIn {
  from { opacity: 0; transform: translate3d(-28px, 20px, 0); filter: blur(8px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

@keyframes portraitReveal {
  from { opacity: 0; transform: translate3d(32px, 0, 0) scale(.96); clip-path: inset(0 0 100% 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); clip-path: inset(0); }
}

@keyframes copyReveal {
  from { opacity: 0; transform: translate3d(0, 24px, 0); filter: blur(5px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

.works-stage::before {
  transition: inset 900ms cubic-bezier(.22, 1, .36, 1), border-color 900ms ease;
}

.works-stage:hover::before {
  inset: 14px;
  border-color: rgba(207, 182, 107, .55);
}

.image-slide.is-active .slide-story > * {
  animation: slideStoryIn 1.05s cubic-bezier(.22, 1, .36, 1) both;
}

.image-slide.is-active .slide-story > :nth-child(2) { animation-delay: 100ms; }
.image-slide.is-active .slide-story > :nth-child(3) { animation-delay: 180ms; }
.image-slide.is-active .slide-story > :nth-child(4) { animation-delay: 260ms; }

.image-slide.is-leaving-next {
  z-index: 2;
  transform: translateX(-8%) scale(.96);
  opacity: 0;
  visibility: visible;
  transition-duration: 700ms;
}

.image-slide.is-leaving-previous {
  z-index: 2;
  transform: translateX(8%) scale(.96);
  opacity: 0;
  visibility: visible;
  transition-duration: 700ms;
}

.image-slide.is-entering-next {
  visibility: visible;
  opacity: 1;
  transform: translateX(7%) scale(1);
  animation: slideEnterNext 900ms cubic-bezier(.22, 1, .36, 1) forwards;
}

.image-slide.is-entering-previous {
  visibility: visible;
  opacity: 1;
  transform: translateX(-7%) scale(1);
  animation: slideEnterPrevious 900ms cubic-bezier(.22, 1, .36, 1) forwards;
}

@keyframes slideEnterNext {
  from { clip-path: inset(0 0 0 100%); transform: translateX(7%) scale(1.02); }
  to { clip-path: inset(0); transform: translateX(0) scale(1); }
}

@keyframes slideEnterPrevious {
  from { clip-path: inset(0 100% 0 0); transform: translateX(-7%) scale(1.02); }
  to { clip-path: inset(0); transform: translateX(0) scale(1); }
}

@keyframes slideStoryIn {
  from { opacity: 0; transform: translate3d(0, 28px, 0); filter: blur(7px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}

.project-dialog[open] {
  animation: dialogReveal 520ms cubic-bezier(.22, 1, .36, 1) both;
}

.project-dialog[open]::backdrop {
  animation: backdropReveal 420ms ease both;
}

@keyframes dialogReveal {
  from { opacity: 0; transform: translate(-50%, -47%) scale(.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes backdropReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.closing::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(105deg, rgba(10, 19, 15, .25), transparent 45%, rgba(210, 183, 93, .06));
  pointer-events: none;
  transition: transform 1.2s ease-out;
  transform: translate3d(var(--closing-x, 0), var(--closing-y, 0), 0);
}

.menu-panel {
  clip-path: inset(0 0 100% 0);
  transform: none;
  transition: clip-path 700ms cubic-bezier(.76, 0, .24, 1);
}

.menu-panel.open {
  clip-path: inset(0);
  transform: none;
}

.menu-panel.open a {
  animation: menuLinkRise 700ms cubic-bezier(.22, 1, .36, 1) both;
}

.menu-panel.open a:nth-child(2) { animation-delay: 90ms; }
.menu-panel.open a:nth-child(3) { animation-delay: 180ms; }

@keyframes menuLinkRise {
  from { opacity: 0; transform: translateY(48px); }
  to { opacity: 1; transform: translateY(0); }
}

.social-link:hover svg,
.about-social-link:hover svg {
  animation: iconTurn 700ms cubic-bezier(.22, 1, .36, 1);
}

@keyframes iconTurn {
  50% { transform: rotate(12deg) scale(1.08); }
  to { transform: rotate(0) scale(1); }
}

@media (pointer: coarse) {
  .cinema-progress { left: 58px; width: calc(100% - 58px); }
  .statement.visible blockquote,
  .statement.visible .statement-note,
  .statement.visible .about-copy { animation-duration: 900ms; }
}

@media (max-width: 600px) {
  .cinema-progress { left: 0; width: 100%; }
  .statement blockquote,
  .slide-story > * {
    transition-duration: 700ms;
  }
}

/* A final, slower-moving frame for the contact section */
.closing {
  min-height: clamp(700px, 100svh, 940px);
  isolation: isolate;
  padding-top: clamp(72px, 10vh, 120px);
  background:
    radial-gradient(ellipse at 50% 78%, rgba(205, 164, 88, .2), transparent 40%),
    linear-gradient(180deg, #17241e 0%, #24352b 55%, #111b16 100%);
}

.closing::before {
  inset: -4% -2% 170px;
  opacity: .42;
  background-image:
    linear-gradient(180deg, rgba(17, 27, 22, .2), rgba(17, 27, 22, .08) 42%, #17241e 100%),
    linear-gradient(90deg, rgba(14, 23, 18, .4), transparent 52%, rgba(14, 23, 18, .28)),
    url("assets/sripada-sunset.jpg");
  background-position: center, center, center 56%;
  background-size: cover;
  animation: closingLandscapeDrift 32s ease-in-out infinite alternate;
}

.closing::after {
  z-index: 0;
  inset: auto auto 150px 50%;
  content: "VIMANSA";
  width: max-content;
  color: transparent;
  font: 500 clamp(100px, 23vw, 320px)/.8 "Cormorant Garamond", serif;
  letter-spacing: .12em;
  white-space: nowrap;
  -webkit-text-stroke: 1px rgba(244, 240, 228, .1);
  text-shadow: 0 0 80px rgba(220, 184, 45, .08);
  transform: translate3d(calc(-50% + var(--closing-x, 0)), var(--closing-y, 0), 0);
  transition: transform 1.2s ease-out;
  pointer-events: none;
}

.closing .section-number {
  position: relative;
  padding-left: 46px;
  color: rgba(244, 240, 228, .68);
  letter-spacing: .2em;
}

.closing .section-number::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 32px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--gold), transparent);
}

.closing-message {
  margin-top: clamp(52px, 8vh, 92px);
  margin-bottom: clamp(30px, 5vh, 58px);
}

.closing-message h2 {
  max-width: 940px;
  margin-inline: auto;
  text-shadow: 0 4px 38px rgba(8, 14, 11, .26);
}

.closing-message > p {
  color: rgba(244, 240, 228, .72);
}

.closing-poem {
  position: relative;
  grid-column: 1 / -1;
  justify-self: center;
  display: grid;
  gap: 4px;
  margin: 0 auto 190px;
  color: rgba(244, 240, 228, .92);
  font: 400 clamp(29px, 4vw, 52px)/1.28 "UN Alakamanda", "Noto Sans Sinhala", sans-serif;
  text-align: center;
  text-shadow: 0 3px 24px rgba(8, 14, 11, .38);
}

.closing-poem::before {
  width: 42px;
  height: 1px;
  margin: 0 auto 13px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 14px rgba(207, 182, 107, .55);
}

.closing-poem i {
  color: #dec77f;
  font-style: normal;
}

.closing-poem .poem-quote-mark {
  color: #dec77f;
  font-family: "Cormorant Garamond", serif;
  font-size: .82em;
  text-shadow: 0 2px 18px rgba(207, 182, 107, .24);
}

.closing-poem > span .poem-quote-mark {
  margin-right: .08em;
}

.closing-poem i .poem-quote-mark {
  margin-left: .08em;
}

.closing > .closing-socials {
  position: relative;
  z-index: 2;
  gap: clamp(26px, 5vw, 72px);
  margin: 20px 0 22px;
}

.closing-socials .social-link {
  min-width: 78px;
  gap: 12px;
  letter-spacing: .17em;
}

.closing-socials .social-link svg {
  width: 48px;
  height: 48px;
  padding: 13px;
  border-color: rgba(244, 240, 228, .3);
  background: rgba(244, 240, 228, .035);
  backdrop-filter: blur(8px);
  transition: border-color 400ms ease, background 400ms ease, box-shadow 400ms ease, transform 500ms cubic-bezier(.22, 1, .36, 1);
}

.closing-socials .social-link:hover svg {
  background: rgba(207, 182, 107, .12);
  box-shadow: 0 0 34px rgba(207, 182, 107, .14);
  transform: translateY(-4px) scale(1.05);
}

.closing.visible .closing-message h2 {
  animation: closingTitleReveal 1.3s cubic-bezier(.22, 1, .36, 1) 120ms both;
}

.closing.visible .closing-message > p {
  animation: slideStoryIn 1s cubic-bezier(.22, 1, .36, 1) 260ms both;
}

.closing.visible .closing-poem {
  animation: closingPoemReveal 1.4s cubic-bezier(.22, 1, .36, 1) 750ms both;
}

.closing.visible .closing-socials .social-link {
  animation: closingSocialReveal 850ms cubic-bezier(.22, 1, .36, 1) both;
}

.closing.visible .closing-socials .social-link:nth-child(2) { animation-delay: 80ms; }
.closing.visible .closing-socials .social-link:nth-child(3) { animation-delay: 160ms; }
.closing.visible .closing-socials .social-link:nth-child(4) { animation-delay: 240ms; }

.closing > .end-credits {
  z-index: 2;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.7fr) auto;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 24px;
  min-height: 142px;
  padding: 28px 5.5%;
  border-top-color: rgba(244, 240, 228, .18);
  background:
    linear-gradient(90deg, rgba(13, 21, 17, .72), rgba(22, 34, 27, .58)),
    linear-gradient(180deg, transparent, rgba(8, 13, 10, .32));
  backdrop-filter: blur(10px);
}

.end-credits > p:first-child {
  grid-column: 1;
  grid-row: 1;
  color: #f4f0e4;
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -.03em;
}

.end-credits > .footer-copyright {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  max-width: 430px;
  color: rgba(244, 240, 228, .58);
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}

.end-credits > a {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(207, 182, 107, .42);
  color: rgba(244, 240, 228, .78);
  font-size: 9px;
  letter-spacing: .16em;
  transition: color 300ms ease, border-color 300ms ease, gap 300ms ease;
}

.end-credits > a:hover {
  gap: 15px;
  border-color: var(--gold);
  color: var(--gold);
}

@keyframes closingLandscapeDrift {
  from { transform: scale(1.01) translate3d(0, 0, 0); }
  to { transform: scale(1.09) translate3d(0, -1.5%, 0); }
}

@keyframes closingTitleReveal {
  from { opacity: 0; transform: translateY(28px); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes closingPoemReveal {
  from { opacity: 0; transform: translateY(24px); filter: blur(10px); letter-spacing: .08em; }
  to { opacity: 1; transform: translateY(0); filter: blur(0); letter-spacing: 0; }
}

@keyframes closingSocialReveal {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
  .closing {
    min-height: 760px;
    padding: 58px 24px 0;
  }

  .closing::before {
    inset: -2% -25% 260px;
    background-position: center, center, 55% center;
  }

  .closing::after {
    bottom: 230px;
    font-size: 28vw;
  }

  .closing .section-number { padding-left: 36px; }
  .closing .section-number::before { width: 24px; }
  .closing-message { margin: 46px auto 28px; }
  .closing-poem { margin-bottom: 235px; font-size: clamp(26px, 8vw, 36px); }
  .closing > .closing-socials { margin: 18px 0 20px; gap: 4px; }
  .closing-socials .social-link { min-width: 58px; gap: 9px; font-size: 7px; }
  .closing-socials .social-link svg { width: 42px; height: 42px; padding: 11px; }

  .closing > .end-credits {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px 16px;
    min-height: 170px;
    padding: 24px;
  }

  .end-credits > p:first-child { grid-column: 1; grid-row: 1; font-size: 28px; }
  .end-credits > .footer-copyright {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    width: 100%;
    max-width: 430px;
    font-size: 9px;
    text-align: center;
  }
  .end-credits > a { grid-column: 2; grid-row: 1; font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .closing::before { animation: none; }
  .mini-portrait img { transition: none; }
}

.statement {
  min-height: min(900px, 100svh);
  grid-template-columns: minmax(0, 1fr) minmax(250px, 31%);
  align-content: center;
  column-gap: clamp(40px, 8vw, 132px);
  padding: clamp(116px, 14vh, 160px) clamp(38px, 8vw, 120px) clamp(88px, 10vh, 120px);
  background:
    radial-gradient(ellipse at 85% 50%, rgba(176, 167, 125, .14), transparent 34%),
    linear-gradient(115deg, #f4efe3 0%, #ece5d6 58%, #e5e1d2 100%);
}

.statement::before {
  inset: -10% -18% -12% 32%;
  opacity: .2;
  background: repeating-radial-gradient(ellipse at 78% 52%, transparent 0 42px, rgba(83, 102, 74, .16) 43px 44px, transparent 45px 88px);
  mask-image: linear-gradient(90deg, transparent, #000 35%, #000);
}

.statement > .section-number {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: #7f867a;
}

.statement blockquote {
  max-width: 880px;
  margin-top: clamp(30px, 4vh, 52px);
  font-size: clamp(48px, 5vw, 76px);
  line-height: 1.12;
  text-wrap: pretty;
}

.statement blockquote i {
  color: #9d7151;
}

.about-copy {
  max-width: 650px;
  margin-top: clamp(28px, 4vh, 44px);
  color: #626b61;
  font-size: 14px;
  line-height: 2;
}

.statement-note {
  align-self: center;
  max-width: none;
  min-height: clamp(460px, 66vh, 680px);
  margin-top: 24px;
}

.mini-portrait {
  border: 1px solid rgba(36, 53, 43, .22);
  padding: 8px;
  background: rgba(244, 239, 227, .55);
  filter: none;
}

.mini-portrait img {
  filter: grayscale(1) contrast(1.04);
}

.works {
  position: relative;
  padding-top: 34px;
  background: #15211b;
  color: #f4f0e4;
}

.works-header {
  height: 104px;
  border-color: rgba(244, 240, 228, .16);
  padding-inline: clamp(30px, 7vw, 108px);
}

.works-header .section-number {
  color: rgba(244, 240, 228, .58);
}

.works-stage {
  height: min(86svh, 900px);
  min-height: 540px;
  border: 0;
  background: #15211b;
}

.works-stage::before {
  inset: 22px;
  border-color: rgba(244, 240, 228, .3);
}

.image-slide::before {
  filter: blur(24px);
  opacity: .56;
}

.image-slide img {
  padding: 0;
  object-fit: cover;
  filter: saturate(.76) contrast(1.06) brightness(.82);
  transform: scale(1.01);
}

.image-slide.is-active img {
  animation: imageDrift 20s ease-in-out infinite alternate;
}

.image-slide::after {
  background:
    linear-gradient(90deg, rgba(12, 19, 15, .42), transparent 58%),
    linear-gradient(180deg, rgba(12, 19, 15, .03) 30%, rgba(12, 19, 15, .74) 100%);
}

.slide-story {
  left: clamp(52px, 10vw, 160px);
  bottom: clamp(48px, 9vh, 110px);
  max-width: min(720px, calc(100% - 104px));
}

.slide-story h2 {
  max-width: 700px;
  font-size: clamp(42px, 6.2vw, 88px);
  line-height: .96;
  text-wrap: balance;
}

.slide-story > p:not(.slide-kicker) {
  max-width: 450px;
  font-size: 14px;
  line-height: 1.85;
}

.slide-controls {
  min-height: 92px;
  padding-inline: clamp(30px, 7vw, 108px);
  border-color: rgba(244, 240, 228, .16);
  background: #15211b;
}

.slide-count {
  color: rgba(244, 240, 228, .55);
}

.slide-count span {
  color: var(--gold);
}

.slide-controls button {
  border-color: rgba(244, 240, 228, .3);
  color: #f4f0e4;
}

.slide-controls button:hover {
  background: var(--gold);
  color: #15211b;
}

.closing {
  min-height: min(900px, 100svh);
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: center;
  padding: clamp(72px, 11vh, 120px) clamp(28px, 7vw, 100px) 260px;
  background:
    radial-gradient(ellipse at 50% 78%, rgba(191, 160, 88, .17), transparent 46%),
    linear-gradient(135deg, #1e3027, #111a16 75%);
}

.closing::before {
  background-position: center 48%;
  opacity: .3;
  filter: saturate(.68) contrast(1.1);
}

.closing .section-number {
  justify-self: start;
  width: min(100%, 1000px);
  margin: 0 auto;
  color: rgba(244, 240, 228, .58);
}

.closing-message {
  margin: clamp(54px, 9vh, 108px) auto 32px;
}

.closing-message h2 {
  max-width: 1000px;
  margin-inline: auto;
  font-size: clamp(42px, 7vw, 92px);
  line-height: .99;
}

.closing-message > p {
  max-width: 460px;
  margin-top: 28px;
  font-size: 14px;
}

.closing > .closing-socials {
  margin: 22px 0 0;
  gap: clamp(28px, 5vw, 68px);
}

.end-credits > .closing-sinhala {
  color: rgba(244, 240, 228, .82);
}

.menu-panel {
  inset: 82px clamp(20px, 5vw, 72px) auto auto;
  z-index: 120;
  display: flex;
  width: min(360px, calc(100vw - 32px));
  height: auto;
  padding: 12px 20px;
  flex-direction: column;
  align-items: stretch;
  background: var(--paper);
  background-image: none;
  border: 1px solid rgba(36, 53, 43, .16);
  box-shadow: 0 22px 64px rgba(36, 53, 43, .12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(.985);
  transition: opacity 220ms ease, transform 320ms cubic-bezier(.2, .75, .25, 1), visibility 320ms;
  pointer-events: none;
}

.menu-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
  pointer-events: auto;
}

.menu-panel a {
  position: relative;
  display: flex;
  width: 100%;
  height: auto;
  min-height: 64px;
  align-items: center;
  gap: 18px;
  padding: 16px 2px;
  border: 0;
  border-bottom: 1px solid rgba(36, 53, 43, .14);
  color: var(--ash);
  font-size: clamp(19px, 2vw, 23px);
  opacity: 1;
  transform: none;
  transition: color 180ms ease, border-color 180ms ease;
}

.menu-panel a:last-child { border-bottom: 0; }

.menu-panel a::before {
  counter-increment: menu-entry;
  content: "0" counter(menu-entry);
  color: var(--ash);
  font: 9px "Noto Sans Sinhala", sans-serif;
  letter-spacing: .16em;
}

.menu-panel { counter-reset: menu-entry; }

.menu-panel.open a:nth-child(2),
.menu-panel.open a:nth-child(3) { transition-delay: 0s; }

.menu-panel a:hover {
  background: transparent;
  color: var(--ash);
}

@media (max-width: 600px) {
  .menu-panel {
    inset: 78px 16px auto auto;
    width: min(340px, calc(100vw - 32px));
    padding: 8px 16px;
  }

  .menu-panel a { min-height: 58px; }
}

@media (max-width: 900px) {
  .statement {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 32%);
    column-gap: 5vw;
    padding-inline: 6vw;
  }

  .statement blockquote {
    font-size: clamp(42px, 6.5vw, 64px);
  }

  .statement-note {
    min-height: clamp(360px, 56vw, 520px);
  }

  .works-stage {
    height: min(78svh, 720px);
    min-height: 500px;
  }
}

@media (max-width: 600px) {
  .statement {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 106px 24px 64px;
  }

  .statement > .section-number { grid-column: 1; grid-row: 1; }
  .statement blockquote {
    margin-top: 36px;
    font-size: clamp(38px, 10vw, 58px);
    line-height: 1.08;
  }

  .about-copy {
    margin-top: 28px;
    font-size: 13px;
    line-height: 1.9;
  }

  .statement-note {
    min-height: 0;
    height: min(116vw, 500px);
    margin-top: 34px;
  }

  .mini-portrait { padding: 6px; }
  .works { padding-top: 20px; }
  .works-header { height: 88px; padding-inline: 24px; }
  .works-stage {
    height: min(76svh, 660px);
    min-height: 480px;
  }

  .works-stage::before { inset: 12px; }
  .image-slide img { object-position: center; }
  .slide-story {
    left: 42px;
    bottom: 48px;
    max-width: calc(100% - 84px);
  }

  .slide-story h2 { font-size: clamp(38px, 11vw, 58px); }
  .slide-story > p:not(.slide-kicker) { font-size: 12px; }
  .slide-arrow { top: 44%; }
  .slide-arrow-previous { left: 10px; }
  .slide-arrow-next { right: 10px; }
  .slide-controls { min-height: 76px; padding-inline: 24px; }

  .closing {
    min-height: 760px;
    padding: 84px 24px 340px;
  }

  .closing-message {
    width: 100%;
    margin: 48px auto 24px;
  }

  .closing-message h2 { font-size: clamp(42px, 11vw, 60px); }
  .closing-message > p { font-size: 12px; }
  .closing > .closing-socials { margin: 18px 0 0; }

  .closing > .end-credits {
    height: auto;
    min-height: 310px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 8px;
    padding: 28px 5vw 24px;
  }

  .end-credits > .footer-copyright {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    width: 100%;
    max-width: 430px;
    text-align: center;
  }

  .end-credits > a {
    grid-column: 1;
    grid-row: 3;
    justify-self: center;
  }

  .end-credits > .closing-sinhala {
    position: static;
    grid-column: 1;
    grid-row: 4;
    width: 100%;
    margin: 8px 0 0;
    font-size: clamp(30px, 8.5vw, 34px);
    line-height: 1.05;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mini-portrait img { transition: none; }
  .film-intro::after { animation: none; opacity: .27; filter: none; transform: none; }
  .statement::after { animation: none; transform: none; will-change: auto; }
  .statement-butterfly { animation: none; opacity: .84; transform: none; }
  .statement-butterfly .butterfly-wing { animation: none; }
}

.portfolio-empty-state {
  margin: 0;
  color: rgba(36, 53, 43, .64);
  font: italic 15px/1.7 "Cormorant Garamond", "Noto Sans Sinhala", serif;
  text-align: center;
}

.about-publications > .portfolio-empty-state {
  margin: 24px 0;
}

.about-socials > .portfolio-empty-state {
  align-self: center;
  font-size: 13px;
}

.closing-socials > .portfolio-empty-state {
  align-self: center;
  color: rgba(244, 240, 228, .68);
}

.works-empty-state {
  position: absolute;
  z-index: 6;
  top: 50%;
  left: 50%;
  width: min(80%, 520px);
  color: rgba(244, 240, 228, .78);
  font: 400 clamp(18px, 2vw, 24px)/1.6 "Noto Sans Sinhala", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.content-placeholder {
  color: rgba(36, 53, 43, .62);
  font: italic clamp(20px, 2vw, 26px)/1.5 "Cormorant Garamond", "Noto Sans Sinhala", serif !important;
  text-align: center;
}

.closing-poem.content-placeholder {
  color: rgba(244, 240, 228, .72);
}

@media (pointer: coarse) {
  body::after,
  .works-stage::after { display: none; }

  .works-stage img,
  .mini-portrait img,
  .project-dialog img {
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .mini-portrait:active img {
    filter: grayscale(0) saturate(1.08) contrast(1.04);
  }

  .image-slide:active img {
    filter: saturate(1.02) contrast(1.06) brightness(.92);
  }
}

@media (pointer: coarse) and (max-width: 600px) {
  .image-slide::before { filter: blur(10px); }
  .project-dialog::backdrop { backdrop-filter: none; }
  .closing::before { animation-duration: 44s; }
}
