/* v0.1.35 (Oct 8, Isshaela's Claude): the four doors. Moon gates are on the home page (her choice).
   The constellation and Five Phases compass styles stay here for later use; their markup is in 02 Website > Shelved - Door openings (2026-10-08).html. */

.door-open { margin-top: 1.6rem; }
.door-open a { text-decoration: none; color: var(--ink); }
.door-open b { font-family: var(--display); font-weight: 400; font-size: 1.22rem; line-height: 1.2; color: var(--ink); transition: color 0.4s ease; }
.door-open .dw { display: block; font-size: 0.95rem; line-height: 1.4; color: var(--sage); }
.door-open a:focus-visible { outline: 1px solid var(--gold); outline-offset: 6px; border-radius: 4px; }

/* ---------- 1. Moon gates ---------- */
.gates ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
@media (min-width: 560px) { .gates ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gate { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem; }
.gate-ring { position: relative; width: min(132px, 100%); aspect-ratio: 1; display: block; margin-bottom: 0.4rem; }
.gate-glimpse { position: absolute; inset: 9%; width: 82%; height: 82%; border-radius: 50%; object-fit: cover;
  opacity: 0; transform: scale(1.12); filter: saturate(0.85) brightness(0.9);
  transition: opacity 0.9s ease, transform 1.4s cubic-bezier(.2,.7,.2,1); }
.gate-ring::after { content: ""; position: absolute; inset: 9%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(241,214,160,0.16), rgba(7,16,32,0.0) 60%, rgba(7,16,32,0.35) 100%);
  box-shadow: 0 0 0 rgba(241,200,120,0); transition: box-shadow 0.8s ease; }
.gate-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--gold); stroke-linecap: round; }
.gate-line .g-outer { stroke-width: 1.4; stroke-dasharray: 352; stroke-dashoffset: 352; }
.gate-line .g-inner { stroke-width: 0.8; stroke-opacity: 0.6; stroke-dasharray: 315; stroke-dashoffset: 315; }
.gate-line .g-wall { stroke-width: 1; stroke-opacity: 0.55; stroke-dasharray: 40; stroke-dashoffset: 40; }
.gate-line .g-bead { stroke: #f1d6a0; stroke-width: 2.4; stroke-dasharray: 5 347; stroke-dashoffset: 0; opacity: 0; filter: drop-shadow(0 0 3px rgba(241,214,160,0.9)); }
.gate-icon { position: absolute; left: 50%; top: 50%; width: 40%; height: 40%; transform: translate(-50%, -50%);
  fill: none; stroke: var(--gold); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 0.6s ease; }
.gate b, .gate .dw, .gate-go { opacity: 0; transform: translateY(8px); transition: opacity 0.8s ease, transform 0.8s ease, color 0.4s ease; }
.gate-go { font-family: var(--display); font-style: italic; font-size: 1rem; color: var(--gold); }
.gate-go::after { content: " \2192"; font-style: normal; }

.gates.in .g-outer { animation: gate-draw 1.6s cubic-bezier(.45,.1,.25,1) forwards; animation-delay: calc(var(--d) * 0.45s); }
.gates.in .g-inner { animation: gate-draw 1.3s ease forwards; animation-delay: calc(var(--d) * 0.45s + 0.7s); }
.gates.in .g-wall { animation: gate-draw 0.8s ease forwards; animation-delay: calc(var(--d) * 0.45s + 1.1s); }
.gates.in .gate-icon { opacity: 1; transition-delay: calc(var(--d) * 0.45s + 1.2s); }
.gates.in .gate b, .gates.in .gate .dw { opacity: 1; transform: none; transition-delay: calc(var(--d) * 0.45s + 1.3s); }
.gates.in .g-bead { opacity: 1; transition: opacity 1s ease calc(var(--d) * 0.45s + 2s); animation: gate-orbit 14s linear infinite; animation-delay: calc(var(--d) * -3.5s); }
.gates .gate-go { opacity: 0; }
@keyframes gate-draw { to { stroke-dashoffset: 0; } }
@keyframes gate-orbit { to { stroke-dashoffset: -352; } }

/* hover or keyboard focus: the gate opens onto its glimpse */
.gate:hover .gate-glimpse, .gate:focus-visible .gate-glimpse { opacity: 1; transform: scale(1); filter: none; }
.gate:hover .gate-ring::after, .gate:focus-visible .gate-ring::after { box-shadow: 0 0 34px rgba(241,200,120,0.35); }
.gate:hover .gate-icon, .gate:focus-visible .gate-icon { opacity: 0 !important; transition-delay: 0s !important; }
.gate:hover b, .gate:focus-visible b { color: var(--gold); }
.gates.in .gate:hover .gate-go, .gates.in .gate:focus-visible .gate-go { opacity: 1; transform: none; transition-delay: 0s; }
/* touch screens have no hover: once each gate is drawn, its icon gives way to its photo */
@media (hover: none) {
  .gates.in .gate-glimpse { opacity: 1; transform: scale(1); filter: none; transition-delay: calc(var(--d) * 0.45s + 2.2s); }
  .gates.in .gate-icon { opacity: 0; transition: opacity 0.9s ease calc(var(--d) * 0.45s + 2.2s); }
  .gates.in .gate-go { opacity: 1; transform: none; transition-delay: calc(var(--d) * 0.45s + 2.6s); }
}

/* ---------- 2. Constellation ---------- */
.sky-field { position: relative; width: 100%; aspect-ratio: 1 / 1.08; }
@media (min-width: 560px) { .sky-field { aspect-ratio: 16 / 10; } }
.sky-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sky-lines line { stroke: var(--gold); stroke-width: 0.22; stroke-opacity: 0.55; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-opacity 0.5s ease, stroke-width 0.5s ease; }
.sky.in .sky-lines line { animation: gate-draw 1.4s ease forwards; animation-delay: calc(var(--d) * 0.5s + 1.2s); }
.sky-lines .ln-x { stroke-opacity: 0.22; stroke-dasharray: 0.02 0.03; stroke-dashoffset: 0; opacity: 0; transition: opacity 1.2s ease 3.4s; animation: none !important; }
.sky.in .sky-lines .ln-x { opacity: 1; }
.star-door { position: absolute; transform: translate(-50%, -14px); display: flex; flex-direction: column; align-items: center; text-align: center; width: 9.5rem; max-width: 42%; }
.star { position: relative; width: 28px; height: 28px; margin-bottom: 0.5rem; opacity: 0; transform: scale(0.2); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.8,.2,1.2); transition-delay: calc(var(--d) * 0.4s); }
.star::before { content: ""; position: absolute; inset: 0; background: #f1d6a0;
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); filter: drop-shadow(0 0 6px rgba(241,214,160,0.9)); }
.star::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: radial-gradient(circle, rgba(241,214,160,0.75), rgba(241,214,160,0) 70%); }
.sky.in .star { opacity: 1; transform: scale(1); animation: star-twinkle 5s ease-in-out infinite; animation-delay: calc(var(--d) * 1.3s + 2s); }
.star-door b, .star-door .dw { text-shadow: 0 0 6px #08142b, 0 0 12px #08142b, 0 0 18px #08142b; }
.star-door b, .star-door .dw { opacity: 0; transition: opacity 0.8s ease, color 0.4s ease; transition-delay: calc(var(--d) * 0.4s + 0.5s); }
.sky.in .star-door b, .sky.in .star-door .dw { opacity: 1; }
.star-door:hover .star, .star-door:focus-visible .star { transform: scale(1.45) rotate(45deg); transition-delay: 0s; }
.star-door:hover b, .star-door:focus-visible b { color: var(--gold); }
.sky-core { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--gold); opacity: 0; box-shadow: 0 0 12px rgba(241,200,120,0.8); transition: opacity 1.2s ease 3.6s; }
.sky.in .sky-core { opacity: 0.9; }
@keyframes star-twinkle { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.5) drop-shadow(0 0 8px rgba(241,214,160,0.8)); } }
/* hovering a star lights the lines that touch it */
.sky:has(.star-door[data-k="writing"]:hover) .ln.writing,
.sky:has(.star-door[data-k="talks"]:hover) .ln.talks,
.sky:has(.star-door[data-k="qigong"]:hover) .ln.qigong,
.sky:has(.star-door[data-k="readings"]:hover) .ln.readings { stroke-opacity: 1; stroke-width: 0.4; }

/* ---------- 3. Five Phases compass (south at the top, as on a Chinese compass) ---------- */
.compass-field { position: relative; margin-bottom: 0; width: min(100%, 520px); aspect-ratio: 1 / 0.92; margin: 0 auto; }
.compass-dial { position: absolute; left: 27%; top: 25%; width: 46%; height: 46%; overflow: visible; fill: none; stroke: var(--gold); }
.compass-dial .c-ring { stroke-width: 1.2; stroke-opacity: 0.8; stroke-dasharray: 600; stroke-dashoffset: 600; }
.compass-dial .c-ring2 { stroke-width: 0.7; stroke-opacity: 0.45; }
.compass-dial .c-ticks { stroke-width: 0.8; stroke-opacity: 0.55; transform-origin: 100px 100px; opacity: 0; transition: opacity 1.2s ease 0.8s; }
.compass.in .c-ring { animation: gate-draw 1.8s ease forwards; }
.compass.in .c-ticks { opacity: 1; animation: c-turn 160s linear infinite; }
.compass-dial .c-needle { transform-origin: 100px 100px; transform: rotate(var(--angle, 0deg)); transition: transform 1.1s cubic-bezier(.3,.8,.25,1); }
.compass-dial .c-needle path { fill: var(--gold); stroke: none; opacity: 0; transition: opacity 1s ease 1.4s; }
.compass.in .c-needle path { opacity: 0.9; }
.compass.in:not(.pointing) .c-needle { animation: c-sway 9s ease-in-out infinite 2.4s; }
.compass-dial .c-earth { fill: #d8b25e; stroke: none; opacity: 0; transition: opacity 1s ease 1.6s; }
.compass.in .c-earth { opacity: 1; }
@keyframes c-turn { to { transform: rotate(360deg); } }
@keyframes c-sway { 0%, 100% { transform: rotate(-14deg); } 25% { transform: rotate(84deg); } 50% { transform: rotate(186deg); } 75% { transform: rotate(266deg); } }
.c-door { position: absolute; display: flex; flex-direction: column; align-items: center; text-align: center; width: 25%; transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 0.9s ease, transform 0.5s ease; transition-delay: calc(var(--d) * 0.35s + 0.9s); }
.compass.in .c-door { opacity: 1; }
.c-door[data-k="talks"] { left: 50%; top: 10%; }
.c-door[data-k="readings"] { left: 88%; top: 48%; }
.c-door[data-k="qigong"] { left: 50%; top: 86%; }
.c-door[data-k="writing"] { left: 12%; top: 48%; }
.c-phase { font-family: var(--display); font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--phase); margin-bottom: 0.15rem; white-space: nowrap; }
.c-phase::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--phase); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 8px var(--phase); }
.c-door .dw { font-size: 0.88rem; }
.c-door:hover b, .c-door:focus-visible b { color: var(--phase); }
.c-centre { margin: 0.4rem 0 0; text-align: center; font-family: var(--display); font-style: italic; font-size: 0.9rem; color: var(--silver); opacity: 0; transition: opacity 1s ease 2s; pointer-events: none; }
.compass.in .c-centre { opacity: 0.85; }
@media (max-width: 480px) { .compass-dial { left: 30%; width: 40%; top: 28%; height: auto; aspect-ratio: 1; } .c-door { width: 29%; } .c-door[data-k="writing"] { left: 15%; } .c-door[data-k="readings"] { left: 85%; } .c-door b { font-size: 1.02rem; } .c-door .dw { display: none; } .c-phase { font-size: 0.64rem; letter-spacing: 0.12em; } }

/* no motion for people who turn it off: everything shows in its finished state */
@media (prefers-reduced-motion: reduce) {
  .door-open *, .door-open *::before, .door-open *::after { animation: none !important; transition: none !important; }
  .door-open .g-outer, .door-open .g-inner, .door-open .g-wall, .door-open .sky-lines line, .door-open .c-ring { stroke-dashoffset: 0; }
  .door-open .gate-icon, .door-open .gate b, .door-open .gate .dw, .door-open .star, .door-open .star-door b, .door-open .star-door .dw,
  .door-open .c-door, .door-open .c-ticks, .door-open .c-needle path, .door-open .c-earth, .door-open .c-centre, .door-open .sky-core, .door-open .sky-lines .ln-x { opacity: 1; transform: none; }
  .door-open .c-door { transform: translate(-50%, -50%); }
  .door-open .g-bead { display: none; }
}

/* v0.1.35: small moon gates at the end of each door's section, leading to the other three */
.next-gates { margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid rgba(194,149,96,0.3); }
.next-gates .ng-title { margin: 0 0 1.1rem; text-align: center; font-family: var(--display); font-style: italic; font-size: 1.1rem; color: var(--silver); }
.next-gates ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .next-gates ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.next-gates .gate-ring { width: min(84px, 100%); margin-bottom: 0.2rem; }
.next-gates b { font-size: 1.05rem; }
.next-gates .gate-go { display: none; }
.next-gates.in .g-outer, .next-gates.in .g-inner { animation-duration: 1.1s; }

/* v0.1.36: the other doors as one quiet line at the end of each section (replaces the small gates) */
.other-doors { margin: 2.2rem 0 0; font-family: var(--display); font-style: italic; font-size: 1.02rem; color: var(--mute); }
.other-doors a { color: var(--silver); text-decoration: none; white-space: nowrap; }
.other-doors a:hover, .other-doors a:focus-visible { color: var(--gold); }
.other-doors i { display: inline-block; width: 0.62em; height: 0.62em; margin-right: 0.35em; border: 1px solid var(--gold); border-radius: 50%; vertical-align: 0.02em; }
.other-doors span[aria-hidden] { margin: 0 0.35em; color: var(--mute); }

/* v0.1.36: section ends show the small gates (Isshaela's choice for now); ?ends=line shows the quiet line instead, for Mat to compare */
html:not([data-ends="line"]) .other-doors { display: none; }
html[data-ends="line"] .next-gates { display: none; }

/* v0.1.36: a glowing bronze thread links the four gates at the top, with lights travelling along it */
.top-gates { position: relative; }
.top-gates ul { position: relative; z-index: 1; }
.gate-thread { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
.gt-line { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-opacity: 0.8; stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 5px rgba(241,200,120,0.85)); }
.top-gates.in .gt-line { animation: gate-draw 1.2s ease forwards calc(var(--i) * 0.35s + 1.9s), gt-breathe 6s ease-in-out infinite calc(var(--i) * 0.8s + 3.4s); }
@keyframes gt-breathe { 0%, 100% { stroke-opacity: 0.55; } 50% { stroke-opacity: 1; } }
.gt-light { fill: #fbe8c0; filter: drop-shadow(0 0 6px rgba(246,223,174,1)); visibility: hidden; }
.top-gates.in .gt-light { visibility: visible; }
@media (prefers-reduced-motion: reduce) { .gt-line { stroke-dashoffset: 0; animation: none !important; } .gt-light { display: none; } }

/* v0.1.36: Sky + Soul, joined to the gates as a collaboration (a small moon below, and a line under Talks) */
.top-gates li { display: flex; flex-direction: column; align-items: center; }
.ss-with { display: inline-flex; align-items: center; gap: 0.4em; margin-top: 0.45rem; font-family: var(--display); font-style: italic; font-size: 0.98rem; color: var(--silver); text-decoration: none;
  opacity: 0; transition: opacity 0.8s ease 1.9s, color 0.4s ease; }
.ss-with img { width: 14px; height: auto; opacity: 0.9; }
.ss-with:hover, .ss-with:focus-visible { color: var(--gold); }
.gates.in .ss-with { opacity: 1; }
.ss-moon { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.3rem; width: max-content; max-width: 100%; margin: 2.6rem auto 0; text-decoration: none;
  opacity: 0; transform: translateY(8px); transition: opacity 1s ease 2.8s, transform 1s ease 2.8s; }
.gates.in .ss-moon { opacity: 1; transform: none; }
.ssm-ring { position: relative; display: block; width: 78px; height: 78px; border-radius: 50%; overflow: hidden; border: 1px solid var(--gold);
  background: radial-gradient(circle at 50% 40%, #17345f, #08142b 70%); box-shadow: 0 0 18px rgba(241,200,120,0.28); transition: box-shadow 0.6s ease; }
.ssm-logo { position: absolute; left: 18%; top: 12%; width: 64%; height: 76%; object-fit: contain; transition: opacity 0.6s ease; }
.ssm-glimpse { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s ease; }
.ss-moon:hover .ssm-glimpse, .ss-moon:focus-visible .ssm-glimpse { opacity: 1; }
.ss-moon:hover .ssm-logo, .ss-moon:focus-visible .ssm-logo { opacity: 0; }
.ss-moon:hover .ssm-ring, .ss-moon:focus-visible .ssm-ring { box-shadow: 0 0 30px rgba(241,200,120,0.45); }
.ss-moon b { font-family: var(--display); font-weight: 400; font-size: 1.1rem; color: var(--ink); transition: color 0.4s ease; }
.ss-moon:hover b { color: var(--gold); }
.ss-moon .dw { font-style: italic; }
@media (prefers-reduced-motion: reduce) { .ss-with, .ss-moon { opacity: 1; transform: none; transition: none; } }

/* v0.1.36: Qigong's icon is now the taiji (Isshaela, Oct 9); its small dot is filled in bronze */
.gate-icon { color: var(--gold); }
