/* The Oasis front door: two doors, each about half the screen, over the Oasis Dusk sky. No framework, no 3D to wait for. */

@font-face { font-family: 'Cinzel'; src: url('fonts/cinzel-latin.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('fonts/space-grotesk-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/jetbrains-mono-latin.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

/* The turning light around each door's rim. */
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  --ink: #fff4e6;
  --soft: rgba(255, 238, 220, 0.8);
  --faint: rgba(255, 230, 210, 0.58);
  --gold: #f3c37a;
  --ember: #ff9a4a;
  --violet: #9b6bff;
  --edge: rgba(255, 196, 140, 0.3);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1b1020; color: var(--ink); }
body {
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  overflow-x: hidden;
}

/* ── The sky: the Oasis Dusk panorama, wrapping round slowly (it is a full circle, so it never ends). ── */
.sky {
  position: fixed; inset: 0; z-index: -3;
  background: #3a2140 url('sky-wide.webp') 0 100% / auto 100% repeat-x;
  animation: drift 240s linear infinite;
}
@keyframes drift { to { background-position: -322.58vh 100%; } }
.shade {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 70% at 50% 55%, rgba(18, 8, 22, 0) 0%, rgba(18, 8, 22, 0.5) 100%),
    linear-gradient(180deg, rgba(18, 8, 22, 0.55) 0%, rgba(18, 8, 22, 0) 22%, rgba(18, 8, 22, 0) 70%, rgba(18, 8, 22, 0.7) 100%);
}

/* Embers rising from the dunes. */
.embers { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.embers i {
  position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%;
  background: #ffd29a; box-shadow: 0 0 8px 2px rgba(255, 170, 90, 0.75);
  opacity: 0; animation: rise 12s linear infinite;
}
.embers i:nth-child(1) { left: 6%; animation-duration: 13s; animation-delay: -2s; }
.embers i:nth-child(2) { left: 14%; animation-duration: 10s; animation-delay: -7s; transform: scale(0.7); }
.embers i:nth-child(3) { left: 23%; animation-duration: 15s; animation-delay: -4s; }
.embers i:nth-child(4) { left: 31%; animation-duration: 11s; animation-delay: -9s; transform: scale(0.6); }
.embers i:nth-child(5) { left: 42%; animation-duration: 14s; animation-delay: -1s; }
.embers i:nth-child(6) { left: 51%; animation-duration: 12s; animation-delay: -6s; transform: scale(0.8); }
.embers i:nth-child(7) { left: 59%; animation-duration: 16s; animation-delay: -11s; }
.embers i:nth-child(8) { left: 67%; animation-duration: 10s; animation-delay: -3s; transform: scale(0.6); }
.embers i:nth-child(9) { left: 74%; animation-duration: 13s; animation-delay: -8s; }
.embers i:nth-child(10) { left: 82%; animation-duration: 11s; animation-delay: -5s; transform: scale(0.7); }
.embers i:nth-child(11) { left: 89%; animation-duration: 15s; animation-delay: -12s; }
.embers i:nth-child(12) { left: 96%; animation-duration: 12s; animation-delay: -10s; transform: scale(0.8); }
@keyframes rise {
  0% { translate: 0 0; opacity: 0; }
  10% { opacity: 0.9; }
  70% { opacity: 0.6; }
  100% { translate: 40px -105vh; opacity: 0; }
}

/* ── The top: the mark, the name, the menu. ── */
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) clamp(16px, 3vw, 40px) 0;
}
.mark { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700; letter-spacing: 0.14em; font-size: 14px; color: var(--gold); }
.title {
  margin: 0; font-family: 'Cinzel', Georgia, serif; font-weight: 700; letter-spacing: 0.08em;
  font-size: clamp(26px, 3.2vw, 44px); line-height: 1.1; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}
.menu { justify-self: end; display: flex; gap: 22px; }
.menu a { color: var(--soft); text-decoration: none; font-size: 14px; }
.menu a:hover, .menu a:focus-visible { color: var(--ink); text-decoration: underline; outline: none; }
.line {
  margin: 6px auto 0; padding: 0 16px; max-width: 980px; text-align: center;
  font-size: clamp(14px, 1.3vw, 17px); line-height: 1.4; color: var(--soft); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

/* ── The doors ── */
.doors {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2.2vw, 34px);
  padding: clamp(14px, 2.4vh, 28px) clamp(14px, 3vw, 44px) 0;
}
.door {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --px: 0; --py: 0; --lift: 0px; --s: 1;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 260px; padding: 24px; border-radius: 30px; border: 0;
  font: inherit; color: var(--ink); text-align: center; text-decoration: none; cursor: pointer;
  background: #1a0f22;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 210, 160, 0.16);
  transform: perspective(1200px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift)) scale(var(--s));
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  animation: arrive 0.9s var(--ease-out) both;
}
.door.install { animation-delay: 0.08s; }
@keyframes arrive { from { opacity: 0; translate: 0 26px; } }
.door.hot { --lift: -6px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), 0 0 60px rgba(255, 170, 90, 0.35), 0 0 0 1px rgba(255, 220, 170, 0.4); }
.door.install.hot { box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), 0 0 60px rgba(155, 107, 255, 0.4), 0 0 0 1px rgba(210, 190, 255, 0.45); }
.door.pressed { --s: 0.965; transition-duration: 0.12s; }
.door.nope { animation: nope 0.45s ease both; }
@keyframes nope { 20% { translate: -10px 0; } 40% { translate: 8px 0; } 60% { translate: -5px 0; } 80% { translate: 3px 0; } }
.door:focus-visible { outline: 3px solid rgba(255, 220, 170, 0.8); outline-offset: 4px; }

/* What is behind each door. Enter: the Oasis itself, a window into its sky, warm light at the far end. */
.door-view { position: absolute; inset: 0; z-index: -2; }
.enter .door-view {
  background: url('sky-wide.webp') calc(18% + var(--px) * 40px) calc(100% + var(--py) * 14px) / auto 118% repeat-x;
  transition: background-position 0.6s var(--ease-out);
  filter: saturate(1.15) brightness(1.04);
}
.enter .door-view::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 78%, rgba(255, 214, 150, 0.55), rgba(255, 170, 90, 0) 70%),
    linear-gradient(180deg, rgba(20, 8, 24, 0.15), rgba(20, 8, 24, 0.05) 50%, rgba(20, 8, 24, 0.45));
}
/* Install: the night of your own machine, a violet glow, and the line you will say, typed into it. */
.door.install .door-view {
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(155, 107, 255, 0.55), rgba(155, 107, 255, 0) 70%),
    radial-gradient(circle at calc(50% + var(--px) * 30px) calc(40% + var(--py) * 20px), rgba(255, 180, 120, 0.12), rgba(0, 0, 0, 0) 50%),
    radial-gradient(rgba(255, 230, 255, 0.16) 1px, transparent 1.5px) 0 0 / 26px 26px,
    linear-gradient(180deg, #21123a 0%, #120a1e 100%);
}
/* A slow violet aurora breathing in the Install door's night. */
.door.install .door-view::before {
  content: ''; position: absolute; inset: -30%;
  background:
    radial-gradient(ellipse 40% 30% at 30% 60%, rgba(170, 110, 255, 0.45), rgba(170, 110, 255, 0) 70%),
    radial-gradient(ellipse 35% 25% at 72% 42%, rgba(255, 120, 200, 0.28), rgba(255, 120, 200, 0) 70%),
    radial-gradient(ellipse 45% 22% at 55% 78%, rgba(90, 200, 255, 0.22), rgba(90, 200, 255, 0) 70%);
  filter: blur(18px); animation: aurora 14s ease-in-out infinite alternate;
}
@keyframes aurora { 0% { transform: translate(-6%, 3%) rotate(-4deg) scale(1); } 100% { transform: translate(6%, -4%) rotate(5deg) scale(1.12); } }
.door-type {
  position: absolute; left: 7%; right: 7%; top: 9%; text-align: left;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: clamp(12px, 1.05vw, 15px); line-height: 1.5;
  color: rgba(190, 255, 220, 0.62); white-space: pre-wrap; word-break: break-word;
}
.door-type::before { content: '> '; color: rgba(190, 255, 220, 0.4); }
.door-type::after { content: '▍'; animation: caret 1s steps(1) infinite; color: rgba(190, 255, 220, 0.7); }
@keyframes caret { 50% { opacity: 0; } }

/* The rim: a thin line of light turning round the door. */
.door-rim {
  position: absolute; inset: 0; z-index: 1; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--a), rgba(255, 226, 170, 0.95), rgba(255, 150, 80, 0.1) 22%, rgba(255, 150, 80, 0.1) 50%, rgba(255, 190, 120, 0.9) 62%, rgba(255, 150, 80, 0.1) 80%, rgba(255, 226, 170, 0.95));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: turn 7s linear infinite; opacity: 0.75; transition: opacity 0.3s;
}
.install .door-rim { background: conic-gradient(from var(--a), rgba(225, 205, 255, 0.95), rgba(155, 107, 255, 0.1) 22%, rgba(155, 107, 255, 0.1) 50%, rgba(205, 170, 255, 0.9) 62%, rgba(155, 107, 255, 0.1) 80%, rgba(225, 205, 255, 0.95)); animation-direction: reverse; }
.door.hot .door-rim { opacity: 1; animation-duration: 2.4s; }
@keyframes turn { to { --a: 360deg; } }

/* The light under the finger or the mouse. */
.door-light {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 0.35s;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 240, 215, 0.38), rgba(255, 240, 215, 0) 42%);
  mix-blend-mode: screen;
}
.door.hot .door-light { opacity: 1; }

/* The shine: a band of light across the door, now and then by itself, and every time it is touched. */
.door-sheen {
  position: absolute; inset: -20% -60%; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 42%, rgba(255, 250, 235, 0.38) 50%, rgba(255, 255, 255, 0) 58%);
  translate: -70% 0; animation: sheen 7s var(--ease-out) infinite 1.2s;
}
.door.install .door-sheen { animation-delay: 2.1s; }
.door.hot .door-sheen { animation: sheen-now 0.9s var(--ease-out) both; }
@keyframes sheen { 0% { translate: -70% 0; } 16%, 100% { translate: 70% 0; } }
@keyframes sheen-now { from { translate: -70% 0; } to { translate: 70% 0; } }

/* The words. */
.door-body { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1vh, 14px); pointer-events: none; }
.door-name {
  font-family: 'Cinzel', Georgia, serif; font-weight: 800; letter-spacing: 0.06em; line-height: 0.95;
  font-size: clamp(56px, 8.6vw, 168px);
  background: linear-gradient(180deg, #fffaf0 0%, #ffe3b0 45%, #f3b06a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 22px rgba(30, 10, 20, 0.6));
}
.install .door-name { background-image: linear-gradient(180deg, #ffffff 0%, #eadcff 45%, #b993ff 100%); }
.door-sub { font-size: clamp(14px, 1.25vw, 19px); color: var(--ink); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
.door-go {
  margin-top: 4px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 24px; color: #2a140c; background: linear-gradient(180deg, #ffe3b0, #f3a65e);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(255, 220, 170, 0.16);
  transition: transform 0.35s var(--ease-out);
}
.install .door-go { color: #1e1033; background: linear-gradient(180deg, #f1e8ff, #b993ff); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 6px rgba(200, 170, 255, 0.18); }
.enter.hot .door-go { transform: translateX(10px) scale(1.08); }
.install.hot .door-go { transform: translateY(8px) scale(1.08); }

/* A ring of light where the door is pressed. */
.burst {
  position: absolute; z-index: 4; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255, 236, 200, 0.95); box-shadow: 0 0 24px rgba(255, 200, 130, 0.9), inset 0 0 18px rgba(255, 220, 170, 0.6);
  animation: burst 0.7s var(--ease-out) forwards;
}
.install .burst { border-color: rgba(235, 220, 255, 0.95); box-shadow: 0 0 24px rgba(180, 140, 255, 0.9), inset 0 0 18px rgba(210, 190, 255, 0.6); }
@keyframes burst { to { transform: scale(14); opacity: 0; border-width: 1px; } }

.facts {
  margin: 0; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); text-align: center;
  font-size: 13px; color: var(--faint); letter-spacing: 0.03em; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* Entering: the light of the Oasis fills the screen from the door, then the Oasis opens. */
.flash {
  position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), #fff6e4 0%, #ffd49a 18%, #f08a52 42%, #2a1424 80%);
}
.flash.go { animation: through 0.6s var(--ease-in, cubic-bezier(0.5, 0, 0.75, 0)) forwards; }
@keyframes through { from { opacity: 0; clip-path: circle(0% at var(--fx, 50%) var(--fy, 50%)); } to { opacity: 1; clip-path: circle(150% at var(--fx, 50%) var(--fy, 50%)); } }

/* ── Install: glides up over the page with a shine ── */
.veil {
  position: fixed; inset: 0; z-index: 10; background: rgba(12, 6, 18, 0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.45s var(--ease-out);
}
.veil.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 11; left: 50%; bottom: max(5vh, 24px); width: min(700px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain;
  padding: 26px 26px 18px; border-radius: 24px; text-align: left; overflow-x: hidden;
  background: linear-gradient(180deg, rgba(44, 24, 62, 0.94), rgba(22, 12, 32, 0.96));
  border: 1px solid rgba(210, 180, 255, 0.35);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), 0 0 80px rgba(155, 107, 255, 0.25);
  opacity: 0; transform: translate(-50%, 70px) scale(0.94);
  transition: opacity 0.5s var(--ease-out), transform 0.65s var(--ease-out);
}
.sheet.open { opacity: 1; transform: translate(-50%, 0) scale(1); }
.sheet::after {
  content: ''; position: absolute; inset: -10% -60%; pointer-events: none;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 42%, rgba(255, 245, 255, 0.3) 50%, rgba(255, 255, 255, 0) 58%);
  translate: -70% 0;
}
.sheet.open::after { animation: sheen-now 1.1s var(--ease-out) 0.18s both; }
.sheet[hidden], .veil[hidden] { display: none; }
.close {
  position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  font: inherit; font-size: 16px; color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
}
.close:hover, .close:focus-visible { background: rgba(255, 255, 255, 0.16); outline: none; }
.install-title { margin: 0 40px 12px 0; font-family: 'Cinzel', Georgia, serif; font-size: clamp(20px, 2vw, 26px); font-weight: 700; color: #f1e8ff; }
.install-title span { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 0.62em; font-weight: 500; color: var(--soft); letter-spacing: 0.01em; }
.copy { display: flex; gap: 10px; align-items: stretch; margin-bottom: 14px; }
.copy code {
  flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 14px; line-height: 1.5;
  padding: 12px 14px; border-radius: 12px; background: rgba(6, 3, 10, 0.72); border: 1px solid rgba(190, 255, 220, 0.18);
  color: #c8ffe0;
}
.copy-button {
  flex: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 700;
  padding: 0 18px; border-radius: 12px; color: #1e1033; border: 0;
  background: linear-gradient(180deg, #f1e8ff, #b993ff); box-shadow: 0 6px 20px rgba(155, 107, 255, 0.35);
  transition: transform 0.2s var(--ease-out), filter 0.2s;
}
.copy-button:hover, .copy-button:focus-visible { filter: brightness(1.08); transform: translateY(-1px); outline: none; }
.copy-button:active { transform: scale(0.95); }
.copy-button.done { background: linear-gradient(180deg, #d9ffe9, #7fe3ac); }
.note, .need, .repo { margin: 0 0 9px; font-size: 14px; line-height: 1.5; color: var(--soft); }
.need strong { color: var(--ink); font-weight: 600; }
.repo a { color: #d7c2ff; text-decoration: none; }
.repo a:hover { text-decoration: underline; }

/* ── A phone, or any tall narrow screen: the doors one above the other, Enter on top. ── */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  .top { grid-template-columns: auto 1fr auto; gap: 10px; }
  .title { text-align: center; font-size: 24px; }
  .mark { font-size: 12px; }
  .menu { gap: 14px; }
  .menu a { font-size: 13px; }
  .line { font-size: 13.5px; margin-top: 6px; }
  .doors { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 12px; padding: 12px 12px 0; }
  .door { min-height: 0; border-radius: 24px; padding: 14px; }
  .door-name { font-size: clamp(54px, 17vw, 104px); }
  .door-sub { font-size: 14px; }
  .door-go { width: 44px; height: 44px; font-size: 20px; }
  .door-type { font-size: 11.5px; top: 7%; }
  .facts { padding-top: 8px; font-size: 12px; }
  .sheet {
    left: 0; right: 0; bottom: 0; width: 100%; transform: translateY(100%);
    max-height: 88dvh; border-radius: 24px 24px 0 0; padding: 22px 16px max(18px, env(safe-area-inset-bottom));
    border-bottom: 0;
  }
  .sheet.open { transform: translateY(0); }
  .copy { flex-direction: column; }
  .install-title span { display: block; margin-top: 4px; }
  .copy code { font-size: 13px; }
  .copy-button { padding: 12px; }
}
/* A short wide screen (a laptop with a small window): the doors keep their height. */
@media (max-height: 560px) and (min-aspect-ratio: 4/5) { .doors { min-height: 300px; } .line { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .sky, .embers i, .door-rim, .door-sheen, .door, .door-type::after, .door.install .door-view::before { animation: none !important; }
  .embers { display: none; }
  .door, .sheet, .veil { transition-duration: 0.01s !important; }
}
