:root {
  color: #f4f1f4;
  background: #020107;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 620px;
  margin: 0;
  overflow: hidden;
  background: #020107;
}

button,
a,
summary { font: inherit; }

.prototype-shell {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
  overflow: hidden;
  background: #020107;
}

#fluid-canvas {
  position: absolute;
  z-index: -4;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.atmosphere {
  position: absolute;
  z-index: -3;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 1, 7, .46) 0%, rgba(2, 1, 7, .12) 52%, rgba(2, 1, 7, .18) 100%),
    radial-gradient(circle at 72% 43%, transparent 0 17%, rgba(2, 1, 7, .2) 37%, rgba(2, 1, 7, .52) 72%);
}

.masthead { display: contents; }

.wordmark {
  position: absolute;
  z-index: 1;
  top: 10.8vh;
  left: 8.3vw;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: #f0eef0;
  font-family: Didot, "Bodoni MT", "Times New Roman", serif;
  font-size: clamp(132px, 17.3vw, 332px);
  font-weight: 400;
  line-height: .77;
  letter-spacing: -.085em;
  text-shadow: 0 4px 32px rgba(0, 0, 0, .34);
  pointer-events: none;
}

.wordmark span {
  width: max-content;
  color: transparent;
  background: linear-gradient(112deg, #fff 6%, #e6faff 34%, #cda8ff 62%, #ff87dc 88%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 4px 22px rgba(0, 0, 0, .28));
}

.wordmark span:last-child { margin-left: 6.5vw; }

body[data-aura="prism"] .wordmark span {
  background-image: linear-gradient(112deg, #fff 4%, #d9fbff 32%, #c8a4ff 60%, #ff8adf 86%, #f6f1ff);
}

body[data-aura="filaments"] .wordmark span {
  background-image: linear-gradient(180deg, #f8f5ff 0%, #f6b5ff 40%, #9d70ff 67%, #72e6ff 100%);
}

body[data-aura="particles"] .wordmark span {
  background-image: radial-gradient(circle at 28% 35%, #fff 0 5%, #bdf4ff 18%, #ba8cff 48%, #ff76c8 72%, #f7efff 100%);
}

body[data-aura="combined"] .wordmark span {
  background-image:
    radial-gradient(circle at 76% 26%, #fff 0 1.5%, rgba(169, 239, 255, .82) 2.5%, transparent 10%),
    linear-gradient(118deg, #fff 3%, #c9f7ff 29%, #a98cff 53%, #ff76cb 76%, #dbf7ff 100%);
}

.portal-stage {
  position: absolute;
  z-index: -1;
  top: 13.3vh;
  right: 13.2vw;
  width: clamp(270px, 28.8vw, 555px);
  aspect-ratio: .82;
}

.portal-link {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  color: inherit;
  text-decoration: none;
}

.portal-link:focus-visible {
  outline: 2px solid #bdefff;
  outline-offset: 9px;
}

.portal-link:hover .portal,
.portal-link:focus-visible .portal {
  border-color: rgba(244, 200, 255, .82);
  box-shadow:
    0 0 0 2px rgba(118, 224, 255, .2),
    0 0 48px rgba(201, 38, 255, .28),
    0 0 112px rgba(20, 108, 255, .2);
}

.portal-aura {
  position: absolute;
  z-index: 0;
  inset: -18%;
  width: 136%;
  height: 136%;
  display: block;
  opacity: .94;
  pointer-events: none;
  mix-blend-mode: screen;
}

.portal {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(234, 154, 255, .54);
  border-radius: 50%;
  background: #110818;
  box-shadow:
    0 0 0 2px rgba(59, 186, 255, .14),
    0 0 38px rgba(201, 38, 255, .22),
    0 0 90px rgba(20, 108, 255, .15);
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

body[data-aura="prism"] .portal {
  box-shadow: 0 0 0 1px rgba(116, 224, 255, .28), 0 0 44px rgba(195, 73, 255, .22), 0 0 96px rgba(39, 125, 255, .12);
}

body[data-aura="filaments"] .portal {
  box-shadow: 0 0 0 1px rgba(249, 170, 255, .28), 0 0 34px rgba(224, 71, 255, .18), 0 0 84px rgba(48, 203, 255, .13);
}

body[data-aura="particles"] .portal {
  box-shadow: 0 0 0 1px rgba(179, 217, 255, .3), 0 0 30px rgba(118, 79, 255, .2), 0 0 92px rgba(245, 65, 215, .12);
}

body[data-aura="combined"] .portal {
  box-shadow: 0 0 0 1px rgba(196, 232, 255, .34), 0 0 38px rgba(205, 74, 255, .2), 0 0 96px rgba(42, 156, 255, .14);
}

.portal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 34px rgba(255, 50, 230, .38), inset 0 0 8px rgba(79, 225, 255, .9);
  pointer-events: none;
}

.portal-scenes {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: #09040f;
}

.portal-scenes::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 56% 44%, color-mix(in srgb, var(--portal-accent) 24%, transparent), transparent 42%),
    linear-gradient(104deg, transparent 30%, rgba(232, 244, 255, .16) 49%, transparent 67%);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.portal-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  scale: 1.055;
  filter: saturate(.88) brightness(.68) contrast(1.1) blur(1.5px);
  transition:
    opacity 620ms cubic-bezier(.22, .75, .2, 1),
    scale 760ms cubic-bezier(.22, .75, .2, 1),
    filter 540ms ease;
}

body[data-portal-destination="solitaire"] .portal-scene[data-portal-scene="solitaire"],
body[data-portal-destination="routine"] .portal-scene[data-portal-scene="routine"],
body[data-portal-destination="task"] .portal-scene[data-portal-scene="task"],
body[data-portal-destination="days-logs"] .portal-scene[data-portal-scene="days-logs"],
body[data-portal-destination="guess"] .portal-scene[data-portal-scene="guess"],
body[data-portal-destination="imgen"] .portal-scene[data-portal-scene="imgen"] {
  opacity: var(--portal-scene-opacity, .7);
  scale: 1;
  filter: var(--portal-scene-filter, saturate(.9) brightness(.58) contrast(1.12));
}

.portal-matter,
.portal-copy {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.portal-matter { inset: 0; }
.portal-copy { margin: 0; }
.portal-copy span,
.portal-copy strong { display: block; }

.portal-index,
.portal-kicker {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(8px, .62vw, 12px);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.portal-verb {
  font-family: Didot, "Bodoni MT", "Times New Roman", serif;
  font-weight: 400;
}

.portal-note,
.portal-cta { font-size: clamp(10px, .8vw, 15px); }

.portal-note { color: rgba(255, 255, 255, .78); }

body[data-portal-destination="solitaire"] .portal { --portal-accent: #ff8bd8; }
body[data-portal-destination="routine"] .portal { --portal-accent: #72f0d2; }
body[data-portal-destination="task"] .portal { --portal-accent: #71dfff; }
body[data-portal-destination="days-logs"] .portal { --portal-accent: #ffc078; }
body[data-portal-destination="guess"] .portal { --portal-accent: #c8ff6a; }
body[data-portal-destination="imgen"] .portal { --portal-accent: #ff8fba; }

body[data-portal="diary"] .portal {
  --portal-scene-opacity: .9;
  --portal-scene-filter: saturate(1.12) brightness(.88) contrast(1.06);
}

body[data-portal="diary"] .portal-matter {
  background:
    linear-gradient(112deg, rgba(4, 2, 10, .05) 14%, rgba(4, 2, 10, .24) 58%, rgba(4, 2, 10, .54) 92%),
    radial-gradient(circle at 54% 38%, rgba(206, 239, 255, .16), transparent 48%),
    radial-gradient(circle at 28% 30%, color-mix(in srgb, var(--portal-accent) 38%, transparent), transparent 48%);
}

body[data-portal="diary"] .portal-copy {
  inset: 16% 14% 16% 18%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

body[data-portal="diary"] .portal-index { color: var(--portal-accent); }
body[data-portal="diary"] .portal-kicker { margin-top: 7px; color: rgba(255, 255, 255, .58); }
body[data-portal="diary"] .portal-verb {
  max-width: 88%;
  margin-top: auto;
  color: #fff;
  font-size: clamp(36px, 4vw, 76px);
  line-height: .88;
  letter-spacing: -.045em;
  text-shadow: 0 4px 22px #000;
}
body[data-portal="diary"] .portal-note {
  max-width: 86%;
  margin-top: 10px;
  line-height: 1.35;
  text-shadow: 0 2px 14px #000;
}
body[data-portal="diary"] .portal-cta {
  width: max-content;
  margin-top: 17px;
  padding: 7px 0 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--portal-accent) 72%, white);
  color: #fff;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(8px, .62vw, 12px);
  letter-spacing: .08em;
  text-transform: uppercase;
}

body[data-portal="diary"] .portal-cta span { display: inline; }

body[data-portal="constellation"] .portal {
  --portal-scene-opacity: .3;
  --portal-scene-filter: saturate(1.18) brightness(.4) contrast(1.22) blur(.7px);
}

body[data-portal="constellation"] .portal-matter {
  background:
    radial-gradient(circle at 28% 24%, var(--portal-accent) 0 1px, transparent 2px),
    radial-gradient(circle at 73% 32%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 67% 76%, var(--portal-accent) 0 1.5px, transparent 3px),
    radial-gradient(circle at 35% 70%, #fff 0 1px, transparent 2px),
    radial-gradient(ellipse, color-mix(in srgb, var(--portal-accent) 18%, transparent), rgba(2, 1, 7, .8) 68%);
}

body[data-portal="constellation"] .portal-copy {
  inset: 15% 16% 12%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto auto;
  align-items: start;
  text-align: center;
}
body[data-portal="constellation"] .portal-index { color: var(--portal-accent); text-align: left; }
body[data-portal="constellation"] .portal-kicker { color: rgba(255, 255, 255, .58); text-align: right; }
body[data-portal="constellation"] .portal-verb { display: none; }
body[data-portal="constellation"] .portal-title { grid-column: 1 / -1; grid-row: 3; color: #fff; font-size: clamp(13px, 1.15vw, 22px); }
body[data-portal="constellation"] .portal-note { grid-column: 1 / -1; grid-row: 4; margin-top: 7px; }
body[data-portal="constellation"] .portal-orbit {
  top: 50%;
  left: 50%;
  width: 54%;
  aspect-ratio: 1;
  translate: -50% -54%;
  border: 1px solid color-mix(in srgb, var(--portal-accent) 48%, transparent);
  border-radius: 50%;
  color: transparent;
  background: linear-gradient(118deg, #fff, var(--portal-accent));
  background-clip: text;
  -webkit-background-clip: text;
  box-shadow: inset 0 0 30px color-mix(in srgb, var(--portal-accent) 12%, transparent), 0 0 28px color-mix(in srgb, var(--portal-accent) 14%, transparent);
  font-family: Didot, "Bodoni MT", serif;
  font-size: clamp(76px, 8vw, 150px);
}
body[data-portal="constellation"] .portal-orbit::before,
body[data-portal="constellation"] .portal-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--portal-accent) 36%, transparent);
  border-radius: 50%;
}
body[data-portal="constellation"] .portal-orbit::before { inset: -18% 7%; rotate: 32deg; }
body[data-portal="constellation"] .portal-orbit::after { inset: 8% -20%; rotate: -26deg; }

body[data-portal="cabinet"] .portal {
  --portal-scene-opacity: .86;
  --portal-scene-filter: saturate(.84) brightness(.6) contrast(1.14);
}

body[data-portal="cabinet"] .portal-matter {
  background: linear-gradient(180deg, transparent 28%, rgba(3, 1, 9, .22) 52%, rgba(3, 1, 9, .94) 88%);
}

body[data-portal="cabinet"] .portal-copy {
  right: 14%;
  bottom: 11%;
  left: 14%;
  padding: 15px 16px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  border-top: 1px solid color-mix(in srgb, var(--portal-accent) 72%, white);
  background: rgba(5, 3, 12, .68);
  backdrop-filter: blur(12px);
}
body[data-portal="cabinet"] .portal-index { grid-row: 1 / 4; color: var(--portal-accent); }
body[data-portal="cabinet"] .portal-kicker { color: rgba(255, 255, 255, .58); }
body[data-portal="cabinet"] .portal-verb { font-size: clamp(24px, 2.2vw, 42px); line-height: .92; }
body[data-portal="cabinet"] .portal-title { display: none; }
body[data-portal="cabinet"] .portal-note { margin-top: 4px; }
body[data-portal="cabinet"] .portal-orbit {
  top: 11%;
  right: 10%;
  width: 50px;
  height: 50px;
  border-top: 1px solid var(--portal-accent);
  border-right: 1px solid var(--portal-accent);
  color: #fff;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 13px;
}

.portal.is-changing .portal-copy,
.portal.is-changing .portal-matter { animation: portal-reveal 360ms cubic-bezier(.2, .8, .2, 1); }

.portal.is-changing .portal-scenes::after { animation: portal-veil 620ms cubic-bezier(.22, .75, .2, 1); }

@keyframes portal-reveal {
  from { opacity: .42; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes portal-veil {
  0%, 100% { opacity: 0; translate: -7% 0; }
  42% { opacity: .72; }
  70% { opacity: .18; translate: 7% 0; }
}

.destination-rail {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  height: 13.5vh;
  min-height: 92px;
  padding: 0 5.7vw;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(180deg, rgba(3, 2, 9, .02), rgba(3, 2, 9, .5));
}

.destination-rail a {
  position: relative;
  z-index: 2;
  padding: 18px 10px;
  color: rgba(247, 243, 248, .9);
  font-size: clamp(15px, 1.17vw, 23px);
  letter-spacing: -.025em;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 2px 18px #000;
  transition: color 160ms ease, text-shadow 220ms ease, filter 180ms ease;
}

.rail-name {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.destination-rail a:nth-of-type(1) { --rail-accent: #9feeff; }
.destination-rail a:nth-of-type(2) { --rail-accent: #b9adff; }
.destination-rail a:nth-of-type(3) { --rail-accent: #f18ee8; }
.destination-rail a:nth-of-type(4) { --rail-accent: #a790ff; }
.destination-rail a:nth-of-type(5) { --rail-accent: #75dcff; }
.destination-rail a:nth-of-type(6) { --rail-accent: #f4a6db; }

body[data-rail="hybrid"] .destination-rail a {
  font-family: Didot, "Bodoni MT", "Times New Roman", serif;
  font-size: clamp(18px, 1.34vw, 26px);
  letter-spacing: -.005em;
}

body[data-rail="hybrid"] .rail-name {
  padding: 12px 16px 1px 0;
  color: transparent;
  background: linear-gradient(112deg, #fff 0 60%, var(--rail-accent) 89%, #f8efff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .82));
}

body[data-rail="hybrid"] .rail-name::before {
  content: attr(data-index);
  position: absolute;
  top: -2px;
  left: .1em;
  color: var(--rail-accent);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 7px;
  font-weight: 550;
  letter-spacing: .13em;
  text-shadow: 0 0 9px color-mix(in srgb, var(--rail-accent) 58%, transparent);
}

body[data-rail="hybrid"] .rail-name::after {
  content: "";
  position: absolute;
  top: 2px;
  right: .12em;
  left: 22px;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--rail-accent) 72%, white), transparent 78%);
  opacity: .68;
}

body[data-rail="editorial"] .destination-rail a {
  font-family: Didot, "Bodoni MT", "Times New Roman", serif;
  font-size: clamp(19px, 1.48vw, 29px);
  letter-spacing: -.018em;
}

body[data-rail="editorial"] .rail-name {
  padding-top: 7px;
  color: transparent;
  background: linear-gradient(112deg, #fff 0 58%, var(--rail-accent) 88%, #f8efff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .8));
}

body[data-rail="editorial"] .rail-name::before {
  content: "";
  position: absolute;
  top: 1px;
  left: .05em;
  width: .72em;
  height: 1px;
  background: linear-gradient(90deg, var(--rail-accent), transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--rail-accent) 56%, transparent);
}

body[data-rail="indexed"] .destination-rail a {
  font-size: clamp(12px, .94vw, 18px);
  font-weight: 520;
  letter-spacing: .15em;
  text-transform: uppercase;
}

body[data-rail="indexed"] .rail-name {
  padding: 12px 15px 0 0;
}

body[data-rail="indexed"] .rail-name::before {
  content: attr(data-index);
  position: absolute;
  top: -5px;
  left: 1px;
  color: var(--rail-accent);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .12em;
  opacity: .86;
  text-shadow: 0 0 9px color-mix(in srgb, var(--rail-accent) 55%, transparent);
}

body[data-rail="indexed"] .rail-name::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: .18em;
  width: 6px;
  height: 6px;
  border-top: 1px solid color-mix(in srgb, var(--rail-accent) 72%, white);
  border-right: 1px solid color-mix(in srgb, var(--rail-accent) 72%, white);
  opacity: .62;
}

body[data-rail="spectral"] .destination-rail a {
  font-size: clamp(15px, 1.16vw, 22px);
  font-weight: 430;
  letter-spacing: .045em;
}

body[data-rail="spectral"] .rail-name {
  color: transparent;
  background:
    repeating-linear-gradient(108deg, rgba(255, 255, 255, .96) 0 2px, var(--rail-accent) 3px 5px, rgba(244, 232, 255, .92) 6px 9px);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-stroke: .35px rgba(255, 255, 255, .52);
  filter: drop-shadow(0 2px 11px #000);
}

body[data-rail="spectral"] .rail-name::before {
  content: attr(data-label);
  position: absolute;
  z-index: -1;
  inset: 0;
  translate: 1px 1px;
  color: transparent;
  -webkit-text-stroke: .65px var(--rail-accent);
  filter: blur(.65px);
  opacity: .54;
}

.destination-rail a:first-child { text-align: left; }
.destination-rail a:last-child { text-align: right; }
.destination-rail a:focus-visible { outline: none; }

.destination-rail a::before,
.destination-rail a::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

body[data-hover="css"] .destination-rail a::before {
  right: 18%;
  bottom: 11px;
  left: 18%;
  height: 1px;
  opacity: 0;
  scale: .25 1;
  background: linear-gradient(90deg, transparent, #7ce9ff 22%, #f08cff 54%, #8d66ff 78%, transparent);
  box-shadow: 0 0 9px rgba(108, 221, 255, .72), 0 0 18px rgba(226, 71, 255, .42);
  transition: opacity 110ms ease, scale 190ms cubic-bezier(.2, .8, .2, 1);
}

body[data-hover="css"] .destination-rail a::after {
  inset: 8px 6%;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 72%, rgba(64, 214, 255, .13), rgba(215, 58, 255, .08) 36%, transparent 70%);
  filter: blur(5px);
  transition: opacity 170ms ease;
}

body[data-hover="css"] .destination-rail a[data-active="true"] {
  color: #fff;
  text-shadow: 0 0 10px rgba(231, 187, 255, .24), 0 2px 18px #000;
  filter: brightness(1.15) saturate(1.12);
}

body[data-hover="css"] .destination-rail a[data-active="true"]::before {
  opacity: 1;
  scale: 1 1;
}

body[data-hover="css"] .destination-rail a[data-active="true"]::after { opacity: 1; }

/* Sélecteurs persistants : leur géométrie ne change jamais au survol. */
.destination-rail button {
  position: relative;
  z-index: 2;
  min-width: 0;
  height: calc(100% - 20px);
  margin: 10px 4px;
  padding: 0;
  display: grid;
  place-items: center;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 18px;
  color: rgba(247, 243, 248, .88);
  background: transparent;
  font-family: Didot, "Bodoni MT", "Times New Roman", serif;
  font-size: clamp(17px, 1.25vw, 24px);
  letter-spacing: -.005em;
  text-align: center;
  text-shadow: 0 2px 18px #000;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.destination-rail button:nth-of-type(1) { --rail-accent: #ff8bd8; }
.destination-rail button:nth-of-type(2) { --rail-accent: #72f0d2; }
.destination-rail button:nth-of-type(3) { --rail-accent: #71dfff; }
.destination-rail button:nth-of-type(4) { --rail-accent: #ffc078; }
.destination-rail button:nth-of-type(5) { --rail-accent: #c8ff6a; }
.destination-rail button:nth-of-type(6) { --rail-accent: #ff8fba; }

body[data-rail="hybrid"] .destination-rail button .rail-name {
  padding: 18px 8px 0;
  color: transparent;
  background: linear-gradient(112deg, #fff 0 64%, var(--rail-accent) 92%, #f8efff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .82));
}

body[data-rail="hybrid"] .destination-rail button .rail-name::before {
  top: 0;
  left: 50%;
  translate: -50% 0;
  color: var(--rail-accent);
  font-size: 7px;
}

body[data-rail="hybrid"] .destination-rail button .rail-name::after {
  top: 11px;
  right: auto;
  left: 50%;
  width: 28px;
  translate: -50% 0;
  background: linear-gradient(90deg, transparent, var(--rail-accent), transparent);
  opacity: .64;
}

.destination-rail button:hover,
.destination-rail button[data-active="true"] {
  color: #fff;
  border-color: color-mix(in srgb, var(--rail-accent) 30%, transparent);
  background: radial-gradient(circle at 50% 78%, color-mix(in srgb, var(--rail-accent) 14%, transparent), transparent 68%);
}

.destination-rail button[data-active="true"] {
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--rail-accent) 72%, transparent), 0 0 24px color-mix(in srgb, var(--rail-accent) 8%, transparent);
}

.destination-rail button:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--rail-accent) 72%, white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .36), 0 0 20px color-mix(in srgb, var(--rail-accent) 18%, transparent);
}

.liquid-chrome {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 0;
  width: 190px;
  height: 62px;
  opacity: 0;
  translate: var(--chrome-x, -240px) -50%;
  overflow: hidden;
  border-radius: 50%;
  filter: saturate(.84) brightness(.72);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  pointer-events: none;
  transition: translate 230ms cubic-bezier(.22, .75, .2, 1), opacity 140ms ease;
}

.liquid-chrome::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse, transparent 28%, rgba(2, 1, 7, .42) 76%, rgba(2, 1, 7, .9));
}

.liquid-chrome canvas { width: 100%; height: 100%; display: block; }
body[data-hover="chrome"] .liquid-chrome[data-active="true"] { opacity: .78; }
body[data-hover="chrome"] .destination-rail a:hover,
body[data-hover="chrome"] .destination-rail a:focus-visible {
  color: #fff;
  text-shadow: 0 0 12px rgba(220, 164, 255, .5), 0 2px 18px #000;
}

body[data-hover="fluid"] .destination-rail a::before {
  right: 24%;
  bottom: 11px;
  left: 24%;
  height: 1px;
  opacity: 0;
  background: rgba(218, 227, 255, .9);
  box-shadow: 0 0 11px rgba(90, 204, 255, .8);
  transition: opacity 120ms ease;
}

body[data-hover="fluid"] .destination-rail a:hover,
body[data-hover="fluid"] .destination-rail a:focus-visible {
  color: #fff;
  text-shadow: 0 0 11px rgba(94, 203, 255, .32), 0 2px 18px #000;
}

body[data-hover="fluid"] .destination-rail a:hover::before,
body[data-hover="fluid"] .destination-rail a:focus-visible::before { opacity: .86; }

.prototype-state {
  position: fixed;
  z-index: 5;
  top: 20px;
  left: 20px;
  width: 270px;
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
}

.prototype-state summary {
  width: max-content;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(7, 5, 13, .78);
  cursor: pointer;
  backdrop-filter: blur(16px);
}

.prototype-state dl {
  margin: 8px 0 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  background: rgba(7, 5, 13, .88);
  backdrop-filter: blur(16px);
}

.prototype-state dt,
.prototype-state dd { margin: 0; }
.prototype-state dd { color: #fff; font-variant-numeric: tabular-nums; }

.motion-state {
  position: fixed;
  z-index: 5;
  top: 20px;
  left: 50%;
  margin: 0;
  padding: 8px 12px;
  translate: -50% 0;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(7, 5, 13, .82);
  font-size: 12px;
}

.prototype-switcher {
  position: fixed;
  z-index: 6;
  bottom: calc(13.5vh + 14px);
  left: 50%;
  min-width: 310px;
  padding: 5px;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  translate: -50% 0;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(7, 5, 13, .88);
  box-shadow: 0 14px 50px rgba(0, 0, 0, .38);
  backdrop-filter: blur(18px);
}

.prototype-switcher button {
  width: 38px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
}

.prototype-switcher button:hover,
.prototype-switcher button:focus-visible { background: rgba(164, 74, 255, .34); outline: 1px solid rgba(255, 255, 255, .42); }
.prototype-switcher span { padding: 0 10px; font-size: 12px; text-align: center; }

body[data-capture="true"] .prototype-switcher,
body[data-capture="true"] .prototype-state { display: none; }

@media (min-width: 961px) and (max-width: 1400px) {
  body[data-portal="diary"] .portal-verb {
    max-width: 90%;
    font-size: clamp(38px, 4vw, 54px);
  }
}

@media (min-width: 701px) and (max-width: 960px) {
  .wordmark {
    top: 10vh;
    left: 5vw;
    font-size: clamp(112px, 20vw, 190px);
  }

  .wordmark span:last-child { margin-left: 8vw; }

  .explorer {
    top: 6vh;
    right: 5vw;
    font-size: 14px;
  }

  .portal-stage {
    top: 16vh;
    right: 5vw;
    width: min(38vw, 380px);
  }

  body[data-portal="diary"] .portal-copy { inset: 16% 12% 14% 16%; }
  body[data-portal="diary"] .portal-verb { font-size: clamp(34px, 5vw, 48px); }

  .destination-rail {
    height: 14vh;
    padding: 0 3vw;
  }

  body[data-rail="hybrid"] .destination-rail a { font-size: clamp(15px, 2vw, 19px); }
  body[data-rail="hybrid"] .rail-name { padding-right: 10px; }
}

@media (max-width: 700px) {
  html,
  body {
    height: 100svh;
    min-height: 560px;
  }

  .wordmark {
    top: 4svh;
    left: 6vw;
    font-size: clamp(76px, 22vw, 96px);
    line-height: .74;
  }

  .wordmark span:last-child { margin-left: 10vw; }

  .portal-stage {
    top: 26svh;
    right: auto;
    left: 50%;
    width: min(74vw, 300px);
    translate: -50% 0;
  }

  body[data-portal="diary"] .portal-copy { inset: 15% 12% 11% 15%; }
  body[data-portal="diary"] .portal-verb {
    max-width: 92%;
    font-size: clamp(30px, 9vw, 39px);
  }
  body[data-portal="diary"] .portal-note {
    max-width: 94%;
    margin-top: 8px;
    font-size: 10px;
  }
  body[data-portal="diary"] .portal-cta {
    margin-top: 12px;
    font-size: 8px;
  }

  .destination-rail {
    height: clamp(104px, 15svh, 128px);
    min-height: 0;
    padding: 13px 5vw 18px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-padding-inline: 5vw;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    background: linear-gradient(180deg, rgba(3, 2, 9, .28), rgba(3, 2, 9, .94));
  }

  .destination-rail::-webkit-scrollbar { display: none; }

  .destination-rail button {
    flex: 0 0 124px;
    height: 68px;
    margin: 0;
    scroll-snap-align: center;
    border-color: rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .025);
    font-size: 17px;
  }

  body[data-rail="hybrid"] .destination-rail button .rail-name { padding: 17px 8px 0; }

  .motion-state {
    top: 12px;
    font-size: 10px;
  }
}

@media (max-height: 620px) {
  html,
  body { min-height: 360px; }

  .wordmark {
    top: 5vh;
    left: 5vw;
    font-size: clamp(76px, 14vw, 150px);
  }

  .portal-stage {
    top: 7vh;
    right: 10vw;
    width: min(28.8vw, calc(58vh * .82), 555px);
  }

  .explorer { display: none; }

  body[data-portal="diary"] .portal-verb { font-size: clamp(24px, 4vw, 40px); }

  .destination-rail {
    height: 25vh;
    min-height: 96px;
  }
}

@media (min-width: 701px) and (max-width: 960px) and (max-height: 620px) {
  .portal-stage { width: min(38vw, calc(58vh * .82), 380px); }
}

@media (max-width: 700px) and (max-height: 620px) {
  .portal-stage {
    top: 24svh;
    right: auto;
    left: 50%;
    width: min(58vw, calc(52svh * .82), 240px);
    translate: -50% 0;
  }

  .destination-rail {
    height: max(104px, 18svh);
    min-height: 104px;
    padding-block: 12px 16px;
  }

  .destination-rail button {
    flex-basis: 112px;
    height: 62px;
    font-size: 15px;
  }

  body[data-portal="diary"] .portal-note { display: none; }
  body[data-portal="diary"] .portal-cta { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  body[data-hover="css"] .destination-rail a[data-active="true"]::before { scale: 1 1; }

  .liquid-chrome { transition: none; }
}

body[data-reduced="true"] *,
body[data-reduced="true"] *::before,
body[data-reduced="true"] *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

body[data-reduced="true"][data-hover="css"] .destination-rail a[data-active="true"]::before { scale: 1 1; }
