/* Estate Atelier V2 — homepage motion, entry gate and door drawing.
   Loaded by the homepage only; the Guild pages use styles.css + guilds.css. */

/* ==========================================================================
   FX layer — v5 draft
   Motion is opt-in: html.fx-on is set by a head script and removed again if
   the motion libraries do not load. Nothing here is required to read the page.
   ========================================================================== */

html.lenis,
html.lenis body,
html.lenis-on,
html.lenis-on body {
  scroll-behavior: auto;
}

html.lenis-on.lenis-stopped {
  overflow: hidden;
}

/* --- pre-states (only while the motion layer is live) --- */
html.fx-on .hero-copy,
html.fx-on [data-reveal],
html.fx-on .chapter-card,
html.fx-on .intent-card,
html.fx-on .guild-home-list a,
html.fx-on .fx-head {
  opacity: 0;
}

html.fx-on .hero-meta,
html.fx-on .hero-foot {
  opacity: 0;
}

html.fx-on .datum {
  transform: scaleX(0);
  transform-origin: left;
}

/* The doorway reveal: a picture parts from the centre, the way the door does. */
html.fx-on .founder-identity img {
  clip-path: inset(0 50% 0 50%);
  filter: grayscale(.9) sepia(.14) brightness(.95);
}

/* The courtyard starts as a small window in a dark wall. */
html.fx-on .courtyard-image {
  clip-path: inset(17% 26% 17% 26%);
}

html.fx-on .courtyard-caption {
  opacity: 0;
}

/* The contact room starts slightly inset, like a lit doorway at the end of a hall. */
html.fx-on .contact {
  clip-path: inset(9% 4% 0% 4% round 28px);
}

/* The GSAP parallax owns this image once the motion layer is live. */
html.fx-on.motion-enabled .courtyard-image img {
  transform: none;
}

.ln-mask {
  display: block;
  overflow: hidden;
}

.ln-mask > span {
  display: block;
}

/* --- courtyard light: warm motes drifting through the hero --- */
.motes {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* --- link and row detailing --- */
.contact-links a,
.guild-home-list a,
.text-link {
  position: relative;
}

.contact-links a::after,
.guild-home-list a::after,
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 700ms cubic-bezier(.2, .7, .2, 1);
}

.contact-links a:hover::after,
.contact-links a:focus-visible::after,
.guild-home-list a:hover::after,
.guild-home-list a:focus-visible::after,
.text-link:hover::after,
.text-link:focus-visible::after {
  transform: scaleX(1);
}

.site-header nav a:not(:last-child) {
  position: relative;
}

.site-header nav a:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 520ms cubic-bezier(.2, .7, .2, 1);
}

.site-header nav a:not(:last-child):hover::after,
.site-header nav a:not(:last-child):focus-visible::after {
  transform: scaleX(1);
}

/* ==========================================================================
   The circle — one relationship at the centre, the perspectives around it
   ========================================================================== */

.circle {
  padding: clamp(96px, 10vw, 170px) var(--page-gutter) clamp(110px, 11vw, 190px);
  background: var(--paper);
  border-top: 1px solid var(--rule);
}

.circle-stage {
  display: grid;
  gap: clamp(38px, 5vw, 70px);
  align-content: center;
  width: min(1180px, 100%);
  margin-inline: auto;
}

.circle-head {
  display: grid;
  gap: 18px;
  max-width: 44ch;
}

.circle-head h2 {
  margin: 0;
  font-size: clamp(38px, 4vw, 62px);
  line-height: 1.04;
  letter-spacing: -.04em;
}

.circle-head h2 em {
  color: var(--forest);
}

.circle-head p {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 16px;
}

.circle-stage {
  position: relative;
}

.circle-wash {
  position: absolute;
  inset: -6% -4%;
  background: radial-gradient(circle at 50% 54%, rgba(195, 163, 103, .13), rgba(195, 163, 103, 0) 68%);
  opacity: 0;
  transition: opacity 1200ms ease;
  pointer-events: none;
}

.circle-figure.awake .circle-wash {
  opacity: 1;
}

.circle-figure {
  position: relative;
  width: min(760px, 100%);
  margin-inline: auto;
}

.circle-figure svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.circle-ring {
  fill: none;
  stroke: rgba(55, 58, 54, .22);
  stroke-width: 1;
}

.circle-ring--draw {
  stroke: var(--brass);
}

.circle-core text {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .2em;
  fill: var(--muted);
}

.circle-core .core-name {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -.01em;
  fill: var(--ink);
}

.seat-line {
  stroke: var(--brass);
  stroke-width: 1;
  opacity: .34;
  stroke-dashoffset: var(--len, 60);
  stroke-dasharray: var(--len, 60);
  transition: stroke-dashoffset 760ms cubic-bezier(.2, .7, .2, 1);
}

.seat-dot {
  fill: var(--paper);
  stroke: rgba(55, 58, 54, .3);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 600ms ease, stroke 600ms ease, transform 620ms cubic-bezier(.2, .7, .2, 1), filter 620ms ease;
}

.seat-label {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: .17em;
  text-transform: uppercase;
  fill: rgba(95, 98, 90, .55);
  transition: fill 600ms ease, opacity 600ms ease;
}

.seat.lit .seat-dot {
  fill: var(--brass);
  stroke: var(--brass);
  transform: scale(1.22);
  filter: drop-shadow(0 0 5px rgba(195, 163, 103, .55));
}

.seat.lit .seat-label {
  fill: var(--ink);
}

.seat.lit .seat-line {
  stroke-dashoffset: 0;
}

/* On phones the ring stays, but the labels read better as a list under it. */
.circle-legend {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.circle-legend li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(55, 58, 54, .12);
  font-size: 12.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(95, 98, 90, .6);
  transition: color 600ms ease;
}

.circle-legend li::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(55, 58, 54, .3);
  background: var(--paper);
  transition: background-color 600ms ease, border-color 600ms ease, transform 600ms cubic-bezier(.2, .7, .2, 1);
}

.circle-legend li.lit {
  color: var(--ink);
}

.circle-legend li.lit::before {
  background: var(--brass);
  border-color: var(--brass);
  transform: scale(1.2);
}

.circle-caption {
  margin: 0;
  max-width: 54ch;
  margin-inline: auto;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.circle-skip {
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translate(-50%, -140%);
  padding: 9px 14px;
  background: var(--forest-deep);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}

.circle-skip:focus-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.circle-cue {
  display: grid;
  justify-items: center;
  justify-self: center;
  gap: 9px;
  min-height: 46px;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity 500ms ease, transform 500ms ease;
  pointer-events: none;
}

.circle-cue.show {
  opacity: 1;
  transform: none;
}

.circle-cue span:first-child {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, var(--brass), transparent);
  transform-origin: top;
  animation: circle-cue-drop 1.9s cubic-bezier(.2, .7, .2, 1) infinite;
}

.circle-cue span:last-child {
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}

@keyframes circle-cue-drop {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* One screen, one idea: the pinned stage has to fit the viewport. */
@media (min-width: 1000px) and (min-height: 700px) {
  .circle {
    padding-block: 0;
  }

  .circle-stage {
    min-height: 100svh;
    align-content: center;
    gap: clamp(26px, 3.6vh, 48px);
    padding-block: clamp(40px, 6vh, 90px);
  }

  .circle-figure svg {
    width: 100%;
    height: min(44svh, 400px);
  }
}

@media (max-width: 760px) {
  .circle {
    padding-inline: 24px;
  }

  .circle-figure {
    width: 100%;
  }

  .seat-label {
    display: none;
  }

  .circle-legend {
    display: grid;
    width: min(320px, 100%);
    margin-inline: auto;
  }

  .circle-core .core-name {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .circle-cue { display: none; }
  .seat { opacity: 1; }
  .seat-dot { fill: var(--brass); stroke: var(--brass); }
  .seat-label { fill: var(--ink); }
}


/* ==========================================================================
   Round 2 — immersive, intimate
   ========================================================================== */

/* Lamplight: a warm pool that follows the pointer through the dark rooms */
.contact {
  position: relative;
  isolation: isolate;
}

.contact-panel {
  position: relative;
  z-index: 1;
}

.lamplight {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  width: 64vmax;
  height: 64vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 219, 160, .17) 0%, rgba(255, 214, 150, .07) 32%, rgba(255, 214, 150, 0) 64%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease;
  will-change: transform;
}

.contact .lamplight {
  z-index: 0;
}

.lamplight.on {
  opacity: 1;
}

/* Film grain: the faint tooth of a printed photograph */
html.fx-on body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 900;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5  0 0 0 0 .45  0 0 0 0 .38  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .055;
  pointer-events: none;
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  17% { transform: translate(-3%, 2%); }
  33% { transform: translate(2%, -4%); }
  50% { transform: translate(-4%, -2%); }
  67% { transform: translate(3%, 3%); }
  83% { transform: translate(-1%, 4%); }
  100% { transform: translate(0, 0); }
}

@media (hover: none), (pointer: coarse) {
  html.fx-on body::after {
    animation: none;
  }
}

/* Read to you: words waiting to be spoken */
.ink-word {
  will-change: opacity;
}

/* Guild rows: the place steps forward, its number warms to brass */
html.fx-on .guild-home-list a:hover .guild-home-name,
html.fx-on .guild-home-list a:focus-visible .guild-home-name {
  text-decoration: none;
}

.guild-home-list .guild-home-name,
.guild-home-list a > .eyebrow {
  transition: transform 700ms cubic-bezier(.2, .7, .2, 1), color 500ms ease;
}

.guild-home-list a:hover .guild-home-name,
.guild-home-list a:focus-visible .guild-home-name {
  transform: translateX(12px);
}

.guild-home-list a:hover > .eyebrow,
.guild-home-list a:focus-visible > .eyebrow {
  color: var(--brass);
}

@media (prefers-reduced-motion: reduce) {
  .lamplight { display: none; }
  .guild-home-list a:hover .guild-home-name,
  .guild-home-list a:focus-visible .guild-home-name { transform: none; }
}

/* ==========================================================================
   Round 3 — the unlock gate
   Closed double doors; the mark is the lock. ENTER turns it like a dial,
   it clicks, and the doors swing open onto the courtyard.
   ========================================================================== */

html.has-gate .intro {
  perspective: 1800px;
  cursor: pointer;
}

html.has-gate .intro-leaf {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 1350ms cubic-bezier(.7, 0, .2, 1) 80ms;
}

html.has-gate .intro-leaf--left { transform-origin: left center; }
html.has-gate .intro-leaf--right { transform-origin: right center; }

/* the brass seam where the two doors meet */
html.has-gate .intro-leaf::after {
  opacity: .5;
  box-shadow: none;
}

html.has-gate.gate-unlocked .intro-leaf::after {
  opacity: 1;
  box-shadow: 0 0 14px 1px rgba(236, 206, 140, .55);
  transition: opacity 260ms ease, box-shadow 400ms ease;
}

/* shading as each door turns away from you */
.intro-leaf::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 16, 12, 0), rgba(10, 16, 12, .5));
  opacity: 0;
  transition: opacity 1300ms ease 120ms;
}

.intro-leaf--right::before {
  background: linear-gradient(270deg, rgba(10, 16, 12, 0), rgba(10, 16, 12, .5));
}

html.has-gate.intro-exit .intro-leaf--left {
  transform: rotateY(-98deg);
}

html.has-gate.intro-exit .intro-leaf--right {
  transform: rotateY(98deg);
}

html.has-gate.intro-exit .intro-leaf::before {
  opacity: 1;
}

/* recessed door panels */
.leaf-panel {
  display: none;
  position: absolute;
  left: 18%;
  right: 13%;
  top: 11%;
  height: 43%;
  border: 1px solid rgba(195, 163, 103, .2);
  box-shadow: inset 0 0 0 9px rgba(0, 0, 0, .05), inset 0 0 0 10px rgba(195, 163, 103, .08);
}

.leaf-panel--low {
  top: 60%;
  height: 29%;
}

.intro-leaf--right .leaf-panel {
  left: 13%;
  right: 18%;
}

html.has-gate .leaf-panel {
  display: block;
}

/* the lock: the mark, and a fine dial around it */
.intro-lock {
  position: relative;
  width: 100%;
}

.intro-turn {
  display: block;
  transform-origin: 50% 46%;
}

.intro-dial {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: 50% 46%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease 700ms;
}

.intro-dial line {
  stroke: #c7a568;
  stroke-width: .6;
  stroke-linecap: round;
  opacity: .55;
}

.intro-dial .major {
  stroke-width: .9;
  opacity: .9;
}

html.has-gate .intro-dial {
  opacity: 1;
}

html.gate-unlocking .intro-turn {
  animation: gate-spin 980ms cubic-bezier(.62, 0, .3, 1) forwards;
}

html.gate-unlocking .intro-dial {
  animation: gate-dial 980ms cubic-bezier(.62, 0, .3, 1) forwards;
}

html.gate-unlocked .intro-lock {
  animation: gate-click 300ms cubic-bezier(.2, .7, .2, 1);
}

@keyframes gate-spin {
  0% { transform: rotate(0deg); }
  80% { transform: rotate(372deg); }
  100% { transform: rotate(360deg); }
}

@keyframes gate-dial {
  0% { transform: rotate(0deg); }
  80% { transform: rotate(-138deg); }
  100% { transform: rotate(-130deg); }
}

@keyframes gate-click {
  0% { transform: scale(1); }
  40% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

/* the ENTER button */
.intro-enter {
  display: none;
}

html.has-gate .intro-enter {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  justify-self: center;
  min-height: 48px;
  padding: 0 30px 0 24px;
  border: 1px solid rgba(195, 163, 103, .7);
  border-radius: 999px;
  background: rgba(40, 55, 46, .35);
  color: #f2efe9;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.2, .7, .2, 1), background-color 400ms ease, border-color 400ms ease;
}

html.gate-ready .intro-enter {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

html.gate-ready .intro-enter:hover {
  background: rgba(195, 163, 103, .16);
  border-color: #e2c78c;
}

html.has-gate .intro-enter:focus-visible {
  outline: 2px solid #e2c78c;
  outline-offset: 5px;
}

.intro-enter svg {
  width: 14px;
  height: 18px;
  fill: none;
  stroke: #c7a568;
  stroke-width: 1.3;
}

html.gate-nudge .intro-enter {
  animation: gate-breathe 2.6s ease-in-out infinite;
}

@keyframes gate-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(195, 163, 103, 0); }
  50% { box-shadow: 0 0 0 7px rgba(195, 163, 103, .12); }
}

html.gate-unlocking .intro-enter {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  animation: none;
  transition-duration: 300ms;
}

html.has-gate .intro-line {
  animation-delay: 380ms;
}

/* ==========================================================================
   Round 3 — the elevation: an architect's drawing of a doorway
   Architecture draws the wall and arch, history the stone, land the ground
   and the olive tree, design the door and its fanlight — then the door opens
   onto your priorities.
   ========================================================================== */

.elev svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.elev .draw * {
  fill: none;
  stroke: rgba(55, 58, 54, .66);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: stroke 700ms ease;
}

.elev .draw .fine {
  stroke: rgba(55, 58, 54, .3);
}

.elev .draw .ground {
  stroke-width: 1.5;
}

.elev .draw .dim {
  stroke: rgba(55, 58, 54, .4);
}

.elev .draw .key {
  stroke: #b8964f;
}

.elev [data-stage].now .draw * {
  stroke: #b8964f;
}

.elev [data-stage].now .draw .fine {
  stroke: rgba(184, 150, 79, .55);
}

.elev .leader {
  stroke: rgba(55, 58, 54, .42) !important;
}

.elev .note-dot {
  fill: #c3a367;
}

.elev .note-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  fill: #b8964f;
}

.elev .note-name {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: .18em;
  fill: var(--ink);
}

.elev .leaf-fill {
  fill: rgba(106, 74, 46, .1);
}

.elev .pull {
  fill: #c3a367;
}

.elev .occlude {
  fill: #f2efe9;
  stroke: none;
}

.elev .door-leaf {
  transform-box: fill-box;
  transform-origin: left center;
  transform: scaleX(.17);
  transition: transform 1700ms cubic-bezier(.7, 0, .2, 1);
}

.elev .door-light,
.elev .door-words {
  opacity: 1;
  transition: opacity 1300ms ease 350ms;
}

.elev .door-words .core-name {
  font-family: var(--serif);
  font-size: 21px;
  fill: var(--ink);
}

.elev .door-words .core-sub {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .22em;
  fill: var(--muted);
}

.elev .fan-glass {
  fill: rgba(242, 214, 150, .28);
  transition: fill 1200ms ease;
}

/* Live: the drawing starts blank and is drawn stage by stage. */
.elev.is-live .draw * {
  transition: stroke-dashoffset 1250ms cubic-bezier(.65, 0, .35, 1) var(--dl, 0ms), stroke 700ms ease;
}

.elev.is-live [data-stage].on .draw * {
  stroke-dashoffset: 0 !important;
}

.elev.is-live [data-stage] .note-text,
.elev.is-live [data-stage] .note-dot,
.elev.is-live [data-stage] .leaf-fill,
.elev.is-live [data-stage] .occlude,
.elev.is-live [data-stage] .pull {
  opacity: 0;
  transition: opacity 700ms ease 450ms;
}

.elev.is-live [data-stage].on .note-text,
.elev.is-live [data-stage].on .note-dot,
.elev.is-live [data-stage].on .leaf-fill,
.elev.is-live [data-stage].on .occlude,
.elev.is-live [data-stage].on .pull {
  opacity: 1;
}

.elev.is-live .door-leaf {
  transform: scaleX(1);
}

.elev.is-live.open .door-leaf {
  transform: scaleX(.17);
}

.elev.is-live .door-light,
.elev.is-live .door-words {
  opacity: 0;
}

.elev.is-live.open .door-light,
.elev.is-live.open .door-words {
  opacity: 1;
}

.elev.is-live .fan-glass {
  fill: rgba(242, 214, 150, 0);
}

.elev.is-live.open .fan-glass {
  fill: rgba(242, 214, 150, .28);
}

.circle-legend li b {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: #b8964f;
  text-transform: none;
  margin-right: 2px;
}

.circle-legend li::before {
  display: none;
}

@media (max-width: 760px) {
  .elev {
    overflow: hidden;
  }

  .elev .note {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .elev .door-leaf { transition: none; }
}

/* Desktop: the words on the left, the drawing large on the right, the whole stage inside one screen. */
@media (min-width: 1000px) and (min-height: 700px) {
  .circle .circle-stage {
    grid-template-columns: minmax(300px, .72fr) minmax(0, 1.5fr);
    grid-template-areas:
      ".    fig"
      "head fig"
      "cap  fig"
      "cue  fig"
      ".    fig";
    grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: clamp(40px, 5vw, 90px);
    row-gap: 26px;
    align-items: start;
    width: min(1320px, 100%);
  }

  .circle .circle-head {
    grid-area: head;
    align-self: end;
  }

  .circle .circle-caption {
    grid-area: cap;
    margin: 0;
    text-align: left;
    max-width: 36ch;
  }

  .circle .circle-figure {
    grid-area: fig;
    align-self: center;
    width: 100%;
  }

  .circle .circle-figure.elev svg {
    height: min(66svh, 600px);
  }

  .circle .circle-cue {
    grid-area: cue;
    justify-self: start;
    align-self: start;
  }
}

/* The unlock gate uses its own root class, so V2's original intro controller in
   script.js (kept byte-identical to V1) stays asleep while the gate runs. */
html.has-gate {
  overflow: hidden;
}

html.has-gate .intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--forest-deep);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* ==========================================================================
   Balance pass — motion-specific parts (September 25)
   ========================================================================== */

/* 1. The lamplight is clipped to its own room, so it can never widen the page. */
.lamp-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-stage > .lamp-clip {
  z-index: -1;
}

.contact > .lamp-clip {
  z-index: 0;
}

.lamp-clip > .lamplight {
  mix-blend-mode: normal;
  z-index: auto;
}

/* 4. The drawing's last line. Desktop: larger lettering inside the doorway.
      Tablets and phones: the message moves to a caption under the drawing. */
.elev .door-words .core-name {
  font-size: 23px;
}

.elev .door-words .core-sub {
  font-size: 13px;
  letter-spacing: .16em;
}

.elev-final {
  display: none;
}

@media (max-width: 999px), (max-height: 699px) {
  .elev .door-words {
    display: none;
  }

  .elev-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 18px 0 0;
    text-align: center;
    transition: opacity 1200ms ease 450ms, transform 1200ms cubic-bezier(.2, .7, .2, 1) 450ms;
  }

  .elev-final span {
    font-family: var(--serif);
    font-size: 24px;
    line-height: 1.1;
    color: var(--ink);
  }

  .elev-final small {
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .elev.is-live .elev-final {
    opacity: 0;
    transform: translateY(8px);
  }

  .elev.is-live.open .elev-final {
    opacity: 1;
    transform: none;
  }
}

/* Small desktops: the drawing sits in a narrower column, so its lettering steps up. */
@media (min-width: 1000px) and (max-width: 1279px) and (min-height: 700px) {
  .elev .note-name { font-size: 15px; letter-spacing: .16em; }
  .elev .note-num { font-size: 19px; }
  .elev .door-words .core-name { font-size: 25px; }
  .elev .door-words .core-sub { font-size: 17px; letter-spacing: .13em; }
}


/* 8. Line masks never crop letterforms. The headings use cap-height trim, so a
      plain overflow mask would cut descenders and ascenders (a "p" read as "b").
      The mask clips a little beyond the trimmed box while a line rises, and
      stops clipping entirely once it has settled. Layout is unchanged. */
.ln-mask,
.ea-mask-ln-mask {
  overflow: visible !important;
  clip-path: inset(-.24em -.6em -.36em -.6em);
}

.ln-mask.is-settled,
.ea-mask-ln-mask.is-settled {
  clip-path: none;
}

/* After the gate hands focus to the page, the main region itself shows no ring. */
#main:focus { outline: none; }
