/* A human behind every yes. Palette follows the owner's original door-hero.jpg:
   warm sunlight, clear crystal, rich yellow gold and bronze shadows. */
#door.human-threshold {
  --edge: clamp(28px, 4.2vw, 88px);
  --hero-ink: #343a38;
  --hero-muted: #4d514a;
  --hero-gold: #805b22;
  --hero-air: #f4ecd9;
  display: block;
  padding: 0;
  color: var(--hero-ink);
  text-align: left;
  background: var(--hero-air);
  opacity: calc(1 - var(--dz, 0));
  isolation: isolate;
}
.human-threshold::before { display: none; }
.threshold-world {
  position: absolute; inset: 0; z-index: -2;
  background: var(--hero-air) url('../assets/human-intent-hero.webp?v=warm-gold-2') center / cover no-repeat;
  transform: scale(calc(1 + var(--dz, 0) * .035));
}
.threshold-world::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg,rgba(248,240,216,.68),rgba(248,240,216,.2) 38%,transparent 51%),
    linear-gradient(0deg,rgba(244,236,217,.98),rgba(244,236,217,.90) 13%,transparent 37%);
}
.human-threshold #door-ambient {
  object-position: center; object-fit: cover;
}
.threshold-header {
  position: absolute; top: 0; left: var(--edge); right: var(--edge);
  height: 108px; display: flex; align-items: center; justify-content: space-between;
  z-index: 2;
}
#door.human-threshold .door-mast {
  position: static; transform: none; text-indent: 0;
  font-size: 17px; letter-spacing: .25em; color: var(--ink);
  opacity: 1; animation: none;
}
.threshold-nav { display: flex; align-items: center; gap: 38px; }
.threshold-nav a, .threshold-nav button {
  display: inline-flex; align-items: center; gap: 24px;
  min-height: 44px; padding: 10px 0;
  border: 0; background: none; color: var(--hero-ink);
  font: 500 11px/1.4 'IBM Plex Mono', monospace;
  letter-spacing: .015em; text-decoration: none; cursor: pointer;
}
.threshold-nav button { border-bottom: 1px solid rgba(39,50,62,.35); }
.threshold-nav :is(a, button):hover { color: var(--hero-gold); }
.threshold-copy {
  position: absolute; top: 50%; left: var(--edge);
  width: min(40%, 610px); transform: translateY(-47%);
}
.threshold-kicker {
  display: flex; gap: 10px; align-items: center;
  margin: 0 0 clamp(22px, 3.5vh, 42px);
  color: var(--hero-muted); font: 500 9px/1.6 'IBM Plex Mono', monospace;
  letter-spacing: .1em;
}
.threshold-kicker > span { width: 5px; height: 5px; border-radius: 50%; background: #8d3339; }
.human-threshold #door-title {
  margin: 0; font: 500 clamp(50px, 5.6vw, 96px)/1.035 'Cinzel', serif;
  letter-spacing: -.035em; text-wrap: nowrap;
}
.human-threshold #door-title > span { display: block; }
.human-threshold #door-title em { font-style: normal; color: var(--hero-gold); }
.threshold-message { margin-top: clamp(22px, 3.8vh, 42px); max-width: 450px; }
.threshold-lead { margin: 0 0 12px; font: 500 clamp(13px,1.1vw,16px)/1.65 'IBM Plex Mono',monospace; letter-spacing: -.015em; }
.threshold-description { margin: 0; max-width: 43ch; color: var(--hero-muted); font: 400 clamp(12px,1vw,15px)/1.8 'IBM Plex Mono',monospace; letter-spacing: -.01em; }
.threshold-actions {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 15px 25px; margin-top: clamp(24px,3.6vh,40px);
}
.human-threshold #door-play {
  display: inline-flex; align-items: center; gap: 14px;
  margin: 0; min-height: 52px; padding: 0;
  border: 0; background: none; color: var(--hero-ink);
  backdrop-filter: none; box-shadow: none;
  opacity: 1; transform: none; animation: none; text-align: left;
}
.human-threshold #door-play::before { display: none; }
.human-threshold #door-play svg { width: 52px; height: 52px; flex: none; stroke: var(--hero-ink); stroke-width: .7; }
.human-threshold #door-play svg path { fill: var(--hero-ink); }
.human-threshold #door-play .play-copy { text-align: left; }
.human-threshold #door-play .play-copy b { font-size: 12px; letter-spacing: .015em; }
.human-threshold #door-play .play-copy i { margin-top: 8px; font-size: 7px; letter-spacing: .09em; color: var(--hero-muted); }
.human-threshold #door-play:hover svg { transform: scale(1.07); }
.human-threshold #door-play:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.threshold-story {
  display: inline-flex; align-items: center; gap: 14px; min-height: 44px;
  color: var(--hero-muted); font-size: 10px; text-decoration: none;
}
.threshold-story:hover { text-decoration: underline; text-underline-offset: 5px; }
.threshold-story > span { font-size: 16px; transition: transform .3s ease; }
.threshold-story:hover > span { transform: translate(2px,-2px); }
.threshold-proof {
  position: absolute; right: var(--edge); bottom: 116px;
  display: flex; align-items: center; gap: 20px;
  color: var(--hero-ink);
}
.proof-orbit { width: 48px; height: 48px; flex: none; }
.proof-orbit svg { width: 100%; height: 100%; fill: none; stroke: #807456; stroke-width: .65; }
.proof-orbit svg > circle:first-child { opacity: .35; }
.proof-orbit .proof-arc { stroke: var(--hero-gold); stroke-width: 1.3; stroke-dasharray: 24 76; transform-origin: center; animation: proof-time 12s linear infinite paused; }
.proof-orbit svg > path { stroke-width: .65; }
.threshold-proof p { margin: 0; }
.threshold-proof p > span { display: block; font-size: 8px; letter-spacing: .055em; }
.threshold-proof p > b { display: block; margin-top: 7px; font-size: 12px; font-weight: 400; }
.threshold-proof > a { display: grid; place-items: center; width: 44px; height: 44px; margin-left: 20px; color: inherit; text-decoration: none; font-size: 20px; }
.threshold-proof > a:hover { color: var(--gold); }
.threshold-footer {
  position: absolute; bottom: 0; left: var(--edge); right: var(--edge);
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  height: 83px; border-top: 1px solid rgba(55,70,88,.17);
}
.threshold-edition { font-size: 8px; color: var(--hero-muted); letter-spacing: .055em; }
.threshold-edition i { font-style: normal; margin-left: 18px; opacity: .85; }
.threshold-scroll { display: flex; align-items: center; gap: 12px; font-size: 8px; color: var(--hero-muted); letter-spacing: .065em; }
.threshold-scroll .scroll-stroke { height: 24px; }
.human-threshold #ambient-toggle { position: static; min-height: 44px; padding: 10px 0; font-size: 8px; color: var(--hero-muted); }
@keyframes proof-time { to { transform: rotate(360deg); } }
@keyframes threshold-arrive { from { opacity: .4; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
  .human-threshold #door-title { animation: threshold-arrive 1.35s cubic-bezier(.16,1,.3,1) both; }
  .threshold-message { animation: threshold-arrive 1.4s cubic-bezier(.16,1,.3,1) .1s both; }
}
.human-threshold.has-ambient:not(.motion-paused) .proof-arc { animation-play-state: running; }

/* Phone: the pair has a dedicated image row, never hidden behind the copy. */
@media (max-width: 760px), (max-width: 900px) and (orientation: portrait) {
  #door.human-threshold {
    --edge: 24px;
    display: grid; grid-template-columns: minmax(0,1fr);
    align-items: stretch; justify-items: stretch;
    grid-template-rows: 76px auto minmax(140px,1fr) auto auto 52px;
    height: 100svh; padding: 0 var(--edge); background: var(--hero-air);
  }
  .threshold-header { position: relative; top: auto; left: auto; right: auto; height: auto; grid-row: 1; }
  #door.human-threshold .door-mast { font-size: 13px; letter-spacing: .15em; }
  .threshold-nav { gap: 0; }
  .threshold-nav a { display: none; }
  .threshold-nav button { gap: 18px; font-size: 10px; }
  .threshold-copy { display: contents; }
  .threshold-kicker { display: none; }
  .human-threshold #door-title { grid-row: 2; margin: 10px 0 0; font-size: clamp(33px,8.5vw,62px); line-height: 1.09; letter-spacing: -.035em; text-wrap: balance; max-width: 15ch; }
  .human-threshold #door-title > span { display: inline; }
  .human-threshold #door-title > span:not(:last-child)::after { content: ' '; }
  .threshold-world {
    position: relative; inset: auto; grid-row: 3; z-index: -1;
    margin: 4px calc(var(--edge) * -1) 0;
    background-image: url('../assets/human-intent-portrait.webp?v=warm-gold-2');
    background-size: cover; background-position: center 26%;
    mask-image: linear-gradient(transparent, #000 8%, #000 82%, transparent);
  }
  .threshold-world::after { background: none; }
  .human-threshold #door-ambient { object-position: center 26%; }
  .threshold-message { grid-row: 4; margin: 0; max-width: 560px; }
  .threshold-lead { font-size: 14px; line-height: 1.65; margin-bottom: 9px; }
  .threshold-description { font-size: 12px; line-height: 1.8; max-width: 48ch; }
  .threshold-actions { grid-row: 5; flex-wrap: nowrap; justify-content: space-between; gap: 14px; margin: 22px 0 20px; }
  .human-threshold #door-play { gap: 11px; min-height: 44px; }
  .human-threshold #door-play svg { width: 42px; height: 42px; }
  .human-threshold #door-play .play-copy b { font-size: 11px; }
  .human-threshold #door-play .play-copy i { display: none; }
  .threshold-story { font-size: 9px; gap: 7px; }
  .threshold-story span { font-size: 14px; }
  .threshold-proof { display: none; }
  .threshold-footer { position: static; grid-row: 6; height: auto; gap: 8px; }
  .threshold-edition { display: none; }
  .threshold-scroll { font-size: 7px; gap: 9px; letter-spacing: .03em; }
  .threshold-scroll .scroll-stroke { height: 18px; }
  .human-threshold #ambient-toggle { font-size: 7px; }
}
@media (max-width: 760px) and (max-height: 720px) {
  #door.human-threshold { --edge: 22px; grid-template-rows: 60px auto minmax(100px,1fr) auto auto 44px; }
  .human-threshold #door-title { font-size: clamp(30px,8.5vw,42px); margin-top: 4px; max-width: 15ch; }
  .threshold-world { margin-top: 0; background-position: center top; }
  .human-threshold #door-ambient { object-position: center top; }
  .threshold-lead { font-size: 11px; line-height: 1.65; margin-bottom: 7px; }
  .threshold-description { font-size: 11px; line-height: 1.7; }
  .threshold-actions { margin: 14px 0 12px; gap: 9px; }
  .human-threshold #door-play svg { width: 38px; height: 38px; }
  .human-threshold #door-play .play-copy b { font-size: 10px; }
  .threshold-story { font-size: 8px; gap: 6px; }
}
@media (min-width: 761px) and (max-height: 740px) and (orientation: landscape) {
  .threshold-header { height: 80px; }
  .threshold-copy { transform: translateY(-43%); width: 43%; }
  .threshold-kicker { margin-bottom: 18px; font-size: 8px; }
  .human-threshold #door-title { font-size: clamp(42px,4.7vw,66px); }
  .threshold-message { margin-top: 20px; max-width: 390px; }
  .threshold-lead { font-size: 12px; margin-bottom: 8px; }
  .threshold-description { font-size: 10px; line-height: 1.8; }
  .threshold-actions { margin-top: 22px; gap: 16px; }
  .human-threshold #door-play svg { width: 42px; height: 42px; }
  .human-threshold #door-play .play-copy b { font-size: 11px; }
  .threshold-story { font-size: 9px; }
  .threshold-footer { height: 60px; }
  .threshold-proof { bottom: 85px; gap: 14px; }
  .threshold-proof > a { margin-left: 0; }
}
@media (min-width: 761px) and (max-height: 520px) and (orientation: landscape) {
  .threshold-header { height: 60px; }
  .threshold-world { inset: 40px 0 0; background-position: center top; mask-image: linear-gradient(transparent,#000 28px); }
  .human-threshold #door-ambient { object-position: center top; }
  .threshold-kicker { display: none; }
  .threshold-copy { top: 72px; transform: none; width: 43%; }
  .human-threshold #door-title { font-size: 32px; line-height: 1.03; text-wrap: balance; }
  .human-threshold #door-title > span { display: inline; }
  .human-threshold #door-title > span:not(:last-child)::after { content: ' '; }
  .threshold-message { margin-top: 12px; }
  .threshold-lead { font-size: 10px; margin-bottom: 5px; }
  .threshold-description { font-size: 9px; line-height: 1.7; }
  .threshold-actions { margin-top: 12px; }
  .human-threshold #door-play { min-height: 44px; }
  .human-threshold #door-play svg { width: 34px; height: 34px; }
  .human-threshold #door-play .play-copy i { display: none; }
  .threshold-story { font-size: 8px; }
  .threshold-footer { height: 44px; }
  .threshold-edition { font-size: 6px; }
  .threshold-edition i { margin-left: 10px; }
  .threshold-proof { bottom: 63px; }
  .threshold-proof p > span { font-size: 6px; }
  .threshold-proof p > b { font-size: 10px; }
}
@media (min-width: 761px) and (max-height: 360px) and (orientation: landscape) {
  .threshold-copy { top: 59px; }
  .human-threshold #door-title { font-size: 28px; }
  .threshold-lead { font-size: 9px; }
  .threshold-description { line-height: 1.5; }
  .threshold-actions { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .threshold-world { transform: none; }
  .proof-arc { animation: none; }
}
