/* ════════════════════════════════════════════════════════════
   NEXUS — 03 · Archive, threshold, closing, footer, dialogs
   ════════════════════════════════════════════════════════════ */

/* ── D · The archive ────────────────────────────────────────── */
.archive {
  background: var(--c-ink);
}

.archive::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 185, 138, 0.3), transparent);
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 9vw, 132px);
}

.work {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.work__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: #050505;
}

.work__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 1.5s var(--ease-out),
    filter 0.8s linear;
}

.work:hover .work__media > img {
  transform: scale(1.025);
}

.work__title {
  display: block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: var(--fs-title);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.015em;
}

.work__cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(216, 185, 138, 0.38);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: border-color 0.3s linear, gap 0.4s var(--ease-out);
}

.work:hover .work__cta {
  border-color: var(--accent);
  gap: 14px;
}

.work__desc {
  display: block;
  max-width: 38ch;
  color: var(--fg-muted);
  font-size: 0.96rem;
  line-height: 1.72;
}

.work__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: rgba(242, 237, 228, 0.7);
  font-size: 0.88rem;
}

.work__facts > span {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.work__facts .mono {
  color: rgba(242, 237, 228, 0.38);
  font-size: 10px;
}

.work__badge {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(242, 237, 228, 0.4);
  border-radius: 50%;
  background: rgba(7, 8, 9, 0.35);
  color: var(--ivory, #f2ede4);
  font-size: 10px;
  backdrop-filter: blur(6px);
}

/* Room 01 — full bleed */
.work--full {
  min-height: clamp(440px, 60vw, 740px);
}

.work--full .work__media {
  position: absolute;
  inset: 0;
}

.work--full .work__media > img {
  position: absolute;
  inset: 0;
}

.work--full .work__wash {
  background:
    linear-gradient(180deg, rgba(7, 8, 9, 0.5), transparent 34%, rgba(7, 8, 9, 0.82) 100%),
    radial-gradient(110% 90% at 80% 20%, rgba(216, 185, 138, 0.1), transparent 58%);
}

.work__top {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 30px;
  color: rgba(242, 237, 228, 0.72);
}

.work__bottom {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 0 32px 34px;
}

.work__titles {
  display: block;
}

.work__titles > .mono {
  color: rgba(242, 237, 228, 0.55);
}

.work--full .work__title {
  margin-top: 8px;
  font-size: clamp(2.6rem, 5.6vw, 5.6rem);
}

/* Room 02 — split, light */
.work--split {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  border-color: rgba(18, 16, 13, 0.24);
  background: var(--c-parchment);
  color: var(--ink-on-light);
}

.work__panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: clamp(32px, 5vw, 76px);
}

.work--split .mono,
.work--split .work__facts .mono {
  color: rgba(18, 16, 13, 0.52);
}

.work--split .work__title {
  margin-top: 2px;
  font-size: clamp(2.4rem, 4.6vw, 4.6rem);
  letter-spacing: -0.022em;
  transition: transform 0.6s var(--ease-out);
}

.work--split:hover .work__title {
  transform: translateX(6px);
}

.work--split .work__desc {
  color: rgba(18, 16, 13, 0.7);
}

.work--split .work__facts {
  border-top-color: rgba(18, 16, 13, 0.18);
  color: rgba(18, 16, 13, 0.78);
}

.work--split .work__cta {
  margin-top: auto;
  border-color: rgba(122, 74, 30, 0.42);
  color: #7a4a1e;
}

.work--split:hover .work__cta {
  border-color: #7a4a1e;
}

.work__media--tall {
  position: relative;
  min-height: 540px;
}

.work__media--tall > img {
  position: absolute;
  inset: 0;
}

/* Room 03 — staggered, dark */
.work--stagger {
  display: grid;
  grid-template-columns: 7fr 5fr;
}

.work--stagger .work__media {
  aspect-ratio: 4 / 3;
  border-right: 1px solid var(--line);
}

.work__plan {
  position: absolute;
  top: 8%;
  left: 8%;
  z-index: 2;
  width: 84%;
  height: 84%;
  color: rgba(216, 185, 138, 0.6);
  opacity: 0.5;
  transition: opacity 0.6s linear;
}

.work__plan circle,
.work__plan path {
  stroke-dasharray: 640;
  stroke-dashoffset: 640;
  transition: stroke-dashoffset 1.6s var(--ease-out);
}

.work--stagger:hover .work__plan {
  opacity: 0.95;
}

.work--stagger:hover .work__plan circle,
.work--stagger:hover .work__plan path {
  stroke-dashoffset: 0;
}

.work__side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(32px, 5vw, 76px);
}

.work__number {
  position: absolute;
  top: -0.08em;
  right: 18px;
  color: transparent;
  font-family: var(--font-display);
  font-size: clamp(5rem, 10vw, 9rem);
  line-height: 1;
  pointer-events: none;
  -webkit-text-stroke: 1px rgba(216, 185, 138, 0.22);
}

.work--stagger .work__title {
  font-size: clamp(2rem, 3.4vw, 3.5rem);
}

.work--stagger .work__side > .mono {
  color: rgba(242, 237, 228, 0.42);
}

/* Room 04 — portrait */
.work--portrait {
  display: grid;
  grid-template-columns: 5fr 6fr;
}

.work--portrait .work__media {
  min-height: 660px;
  margin: clamp(18px, 3vw, 42px) 0 clamp(18px, 3vw, 42px) clamp(18px, 3vw, 42px);
}

.work--portrait .work__media > img {
  position: absolute;
  inset: 0;
}

.work--portrait .work__media::after {
  content: "";
  position: absolute;
  inset: 14px;
  z-index: 2;
  border: 1px solid rgba(216, 185, 138, 0.38);
  pointer-events: none;
  transition: inset 0.9s var(--ease-out);
}

.work--portrait:hover .work__media::after {
  inset: 26px;
}

.work--portrait .work__side > .mono {
  color: rgba(242, 237, 228, 0.42);
}

.work--portrait .work__title {
  font-size: clamp(2.6rem, 5vw, 5rem);
}

/* ── E · The threshold ──────────────────────────────────────── */
.threshold {
  --p: 0;
  position: relative;
  height: 240vh;
  background: var(--c-obsidian);
}

.threshold__sticky {
  position: sticky;
  top: 0;
  display: grid;
  place-items: center;
  height: 100svh;
  overflow: hidden;
}

.threshold__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  clip-path: inset(
    calc((1 - var(--p)) * 26%) calc((1 - var(--p)) * 42%) round 2px
  );
  will-change: clip-path;
}

.threshold__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.88) brightness(calc(0.42 + var(--p) * 0.58));
  transform: scale(calc(1.24 - var(--p) * 0.24));
  will-change: transform, filter;
}

.threshold__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 51%;
  background: var(--c-obsidian);
  pointer-events: none;
}

.threshold__panel--l {
  left: 0;
  transform: translateX(calc(var(--p) * -100%));
}

.threshold__panel--r {
  right: 0;
  transform: translateX(calc(var(--p) * 100%));
}

.threshold__panel--l::after,
.threshold__panel--r::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(7, 8, 9, 0.55));
  pointer-events: none;
}

.threshold__panel--l::after {
  left: 100%;
}

.threshold__panel--r::after {
  right: 100%;
  transform: scaleX(-1);
}

.threshold__frame {
  position: absolute;
  inset: calc(18px + (1 - var(--p)) * 0px);
  z-index: 3;
  border: 1px solid rgba(242, 237, 228, calc(0.08 + var(--p) * 0.14));
  pointer-events: none;
}

.threshold__eyebrow {
  position: absolute;
  top: clamp(96px, 13vh, 132px);
  left: 50%;
  z-index: 4;
  color: var(--accent);
  opacity: calc(0.45 + var(--p) * 0.55);
  transform: translateX(-50%);
}

.threshold__title {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 0;
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 11vw, 11rem);
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: -0.035em;
  text-align: center;
  text-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
  opacity: calc(1 - var(--p) * 0.32);
}

.threshold__title span {
  display: block;
  will-change: transform;
}

.threshold__title span:first-child {
  transform: translateX(calc(var(--p) * -9vw));
}

.threshold__title span:last-child {
  color: var(--c-champagne);
  font-style: italic;
  transform: translateX(calc(var(--p) * 9vw));
}

.threshold__hint {
  position: absolute;
  bottom: clamp(40px, 7vh, 64px);
  left: 50%;
  z-index: 4;
  color: rgba(242, 237, 228, 0.44);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  opacity: calc(1 - var(--p) * 2.4);
  transform: translateX(-50%);
}

.threshold__arrive {
  position: absolute;
  bottom: 12%;
  left: 50%;
  z-index: 4;
  color: var(--c-ivory);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-style: italic;
  opacity: clamp(0, calc((var(--p) - 0.68) * 3.2), 1);
  transform: translateX(-50%);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.7);
}

/* ── F · Closing statement ──────────────────────────────────── */
.manifesto {
  position: relative;
  padding-block: clamp(128px, 16vw, 230px);
  overflow: clip;
  background: var(--c-obsidian);
}

.manifesto__glow {
  position: absolute;
  top: 8%;
  left: 50%;
  width: min(88vw, 1180px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 115, 51, 0.2), transparent 66%);
  filter: blur(40px);
  pointer-events: none;
  transform: translateX(-50%);
}

.manifesto__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.manifesto__inner::before {
  content: "";
  width: 1px;
  height: clamp(48px, 7vw, 86px);
  margin-bottom: clamp(26px, 4vw, 44px);
  background: linear-gradient(180deg, transparent, rgba(216, 185, 138, 0.6));
}

.manifesto__title {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 7.4vw, 8rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.028em;
}

.manifesto__title em {
  color: var(--accent);
  font-style: italic;
}

.manifesto__lead {
  max-width: 50ch;
  margin-top: 30px;
  color: var(--fg-muted);
  font-size: 1.02rem;
  line-height: 1.78;
}

.manifesto__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 40px;
}

.manifesto__small {
  margin-top: 30px;
  color: rgba(242, 237, 228, 0.36);
  font-size: 10px;
}

.manifesto__transmission {
  position: relative;
  z-index: 1;
  margin-top: clamp(84px, 11vw, 154px);
  color: rgba(242, 237, 228, 0.3);
  font-size: 10px;
  text-align: center;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  position: relative;
  padding-top: clamp(56px, 7vw, 96px);
  overflow: clip;
  border-top: 1px solid var(--line);
  background: var(--c-obsidian);
}

.footer__top {
  display: flex;
  justify-content: space-between;
  gap: clamp(40px, 6vw, 90px);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  color: var(--c-copper);
}

.footer__brand p {
  color: rgba(242, 237, 228, 0.35);
}

.footer__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: clamp(28px, 4vw, 66px);
}

.footer__label {
  margin-bottom: 18px;
  color: rgba(242, 237, 228, 0.34);
  font-size: 10px;
}

.footer__nav a,
.footer__nav button {
  display: block;
  margin: 0 0 11px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.5;
  text-align: left;
  transition: color 0.3s linear;
}

.footer__nav a:hover,
.footer__nav button:hover {
  color: var(--c-ivory);
}

.footer__word {
  margin: clamp(48px, 7vw, 104px) 0 clamp(24px, 3.6vw, 52px);
  color: transparent;
  font-family: var(--font-display);
  font-size: clamp(5rem, 20vw, 19rem);
  font-weight: 400;
  line-height: 0.72;
  letter-spacing: 0.02em;
  text-align: center;
  user-select: none;
  -webkit-text-stroke: 1px rgba(216, 185, 138, 0.24);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: rgba(242, 237, 228, 0.4);
  font-size: 10px;
}

.footer__clock {
  color: rgba(216, 185, 138, 0.62);
}

.footer__top-link {
  color: rgba(242, 237, 228, 0.62);
  transition: color 0.3s linear;
}

.footer__top-link:hover {
  color: var(--accent);
}

/* ── Dialogs ────────────────────────────────────────────────── */
dialog {
  color: var(--fg);
}

dialog::backdrop {
  background: rgba(3, 4, 5, 0.84);
  backdrop-filter: blur(10px);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(242, 237, 228, 0.22);
  border-radius: 50%;
  background: rgba(7, 8, 9, 0.55);
  color: var(--fg);
  backdrop-filter: blur(8px);
  transition:
    border-color 0.3s linear,
    transform 0.45s var(--ease-out);
}

.dialog-close:hover {
  border-color: var(--accent);
  transform: rotate(90deg);
}

.work-dialog {
  width: min(1120px, calc(100vw - 40px));
  max-width: none;
  max-height: 88svh;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--c-ink);
}

.work-dialog[open] {
  animation: dialogIn 0.5s var(--ease-out) both;
}

.work-dialog__inner {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  max-height: 88svh;
}

.work-dialog__media {
  position: relative;
  min-height: 540px;
  background: #050505;
}

.work-dialog__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-dialog__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(7, 8, 9, 0.4));
  pointer-events: none;
}

.work-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(30px, 4vw, 56px);
  overflow-y: auto;
}

.work-dialog__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: rgba(242, 237, 228, 0.4);
  font-size: 10px;
}

.work-dialog__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.6vw, 3.6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.work-dialog__desc {
  color: var(--fg-muted);
  font-size: 0.96rem;
  line-height: 1.75;
}

.work-dialog__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.work-dialog__facts div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.work-dialog__facts dt {
  color: rgba(242, 237, 228, 0.34);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.work-dialog__facts dd {
  color: rgba(242, 237, 228, 0.82);
  font-size: 0.9rem;
}

.work-dialog__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.work-dialog__nav button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(242, 237, 228, 0.62);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.3s linear;
}

.work-dialog__nav button:hover {
  color: var(--accent);
}

.work-dialog__nav span {
  color: rgba(242, 237, 228, 0.32);
  font-size: 10px;
}

.work-dialog__note {
  color: rgba(242, 237, 228, 0.3);
  font-size: 10px;
}

.work-dialog__note a {
  color: rgba(216, 185, 138, 0.65);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.invite-dialog {
  width: min(620px, calc(100vw - 40px));
  max-width: none;
  max-height: 90svh;
  margin: auto;
  padding: clamp(30px, 5vw, 64px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  background:
    radial-gradient(110% 90% at 82% 0%, #1d150d, transparent 58%),
    var(--c-ink);
}

.invite-dialog[open] {
  animation: dialogIn 0.5s var(--ease-out) both;
}

.invite-dialog__title {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.4vw, 3.7rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.invite-dialog__title em {
  color: var(--accent);
  font-style: italic;
}

.invite-dialog__copy {
  margin-top: 22px;
  color: var(--fg-muted);
  font-size: 0.96rem;
  line-height: 1.75;
}

.invite-dialog__coords {
  margin-top: 26px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(7, 8, 9, 0.45);
  color: var(--accent);
  letter-spacing: 0.2em;
}

.invite-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.invite-dialog__note {
  margin-top: 24px;
  color: rgba(242, 237, 228, 0.32);
  font-size: 10px;
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
