/* Single opening shot. The background rests in its final pose independently of the card runway. */
.mode-runway {
  position: relative;
  overflow-x: clip;
}
.bosi-opening {
  position: relative;
  isolation: isolate;
}
.hero-depth {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
  user-select: none;
  color: var(--signal);
  --depth-time: 2.1s;
  mask-image: linear-gradient(to bottom, #000b, #000 12%, #000 84%, transparent);
}
.hero-depth svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-depth-plane {
  transform-box: view-box;
  transform-origin: 0 0;
  transform: translateY(var(--landing)) scale(var(--near));
  opacity: var(--density);
}
.depth-far {
  --far: 0.4;
  --near: 0.94;
  --turn: -9deg;
  --landing: -20px;
  --density: 0.57;
}
.depth-mid {
  --far: 0.28;
  --near: 1.1;
  --turn: -12deg;
  --landing: 0px;
  --density: 0.76;
}
.depth-near {
  --far: 0.22;
  --near: 1.26;
  --turn: -15deg;
  --landing: 30px;
  --density: 0.84;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-depth-plane {
    animation: hero-depth-arrive var(--depth-time) cubic-bezier(0.38, 0.06, 0.2, 1) 1 backwards;
  }
  @keyframes hero-depth-arrive {
    from {
      transform: translateY(-44px) rotate(var(--turn)) scale(var(--far));
    }
    to {
      transform: translateY(var(--landing)) rotate(0deg) scale(var(--near));
    }
  }
}
@media (max-width: 800px) {
  .hero-depth {
    mask-image: linear-gradient(to bottom, #000b, #000 16%, #000 78%, transparent);
  }
}
/* Let the contour remain full-strength outside the reading area. The soft edge follows the copy on mobile too. */
.bosi-opening .hero-copy::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -20% -5% -16% -12%;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 43% 48%,
    var(--paper) 12%,
    color-mix(in srgb, var(--paper) 90%, transparent) 40%,
    transparent 74%
  );
}
/* The middle card and its workspace are one element throughout the reveal. */
.mode-runway {
  --travel: clamp(400px, 76svh, 780px);
  overflow-anchor: none;
}
.mode-stack {
  --gap: 12px;
  --inset: clamp(16px, 2vw, 28px);
  --rim: #393d37;
  --card: #121412;
  --quiet: #a9afa5;
  --accent: var(--signal);
  --panel-size: clamp(300px, 46svh, 432px);
  --open: 0;
  display: grid;
  gap: var(--gap);
  min-width: 0;
  align-content: center;
}
.mode-card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--rim);
  border-radius: 12px;
  color: #f4f5f0;
}
.mode-face {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 1.6vw, 24px);
  min-height: clamp(76px, 10svh, 100px);
  margin: 0;
  padding: 12px var(--inset);
  width: 100%;
  text-align: left;
}
.mode-count,
.mode-name small,
.mode-compose label small {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.09em;
}
.mode-count {
  color: var(--quiet);
  align-self: center;
  font-variant-numeric: tabular-nums;
}
.mode-name {
  display: grid;
  gap: 4px;
}
.mode-name small {
  display: block;
  color: var(--quiet);
  letter-spacing: 0.14em;
}
.mode-face .mode-name :is(h2, b) {
  font: 550 clamp(20px, 1.7vw, 27px)/1.25 var(--sans);
  letter-spacing: 0.015em;
  margin: 0;
}
.mode-drawing {
  width: clamp(56px, 6vw, 88px);
  height: auto;
  fill: none;
  stroke: #889382;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mode-desktop {
  background: #1e251c;
  border-color: #738568;
  box-shadow: 0 8px 24px #0003;
}
.mode-desktop > h2 {
  margin: 0;
  font: inherit;
}
.mode-trigger {
  appearance: none;
  cursor: pointer;
  border: none;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
}
.mode-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}
.mode-trigger .mode-count,
.mode-trigger small {
  color: var(--accent);
}
.mode-fold {
  --od-icon-size: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.6;
  transform: rotate(calc(-180deg * var(--open)));
}
.mode-disclosure {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font: 550 14px/1.4 var(--sans);
  white-space: nowrap;
}
.mode-disclosure .mode-fold {
  --od-icon-size: 18px;
}
.mode-trigger[aria-expanded='false'] .mode-close-label,
.mode-trigger[aria-expanded='true'] .mode-open-label {
  display: none;
}
@media (hover: hover) {
  .mode-trigger:hover {
    background: rgb(207 237 152 / 0.045);
  }
}
.mode-reveal {
  height: calc(var(--panel-size) * var(--open));
  overflow: hidden;
  overflow: clip;
}
.mode-reveal[data-collapsed] {
  height: 0;
  visibility: hidden;
}
.mode-clip {
  height: var(--panel-size);
  padding: 0 8px 8px;
}
.mode-stack .mode-room {
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}
.mode-stack .mode-room::before,
.mode-stack .mode-room::after {
  display: none;
}
.mode-room .workspace {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.mode-room .sidebar {
  flex: none;
}
.mode-room .stage {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.mode-history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #515b4f transparent;
}
.mode-history:focus-visible {
  outline: 1px solid var(--signal);
  outline-offset: -2px;
}
.mode-stack .mode-history .num {
  font-size: clamp(36px, 3.5vw, 56px);
}
.mode-room .tiny-footer {
  gap: 8px;
}
.mode-compose {
  flex: none;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--rim);
  background: #191d18;
}
.mode-compose label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 4px;
  color: #dbe2d7;
  font: 550 12px/1.5 var(--sans);
}
.mode-compose label small {
  color: var(--quiet);
  letter-spacing: 0.03em;
}
.mode-field {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 12px;
  border: 1px solid #4b5348;
  border-radius: 8px;
  background: #10130f;
}
.mode-field:focus-within {
  border-color: var(--accent);
}
.mode-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  color: #f0f4eb;
  background: transparent;
  font: 400 16px/1.5 var(--sans);
}
.mode-field input::placeholder {
  color: #a4ada1;
}
.mode-send {
  margin: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #1e271b;
  cursor: pointer;
}
.mode-send:disabled {
  background: transparent;
  color: #819078;
  cursor: default;
}
.mode-send .od-icon {
  --od-icon-size: 20px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}
.mode-messages:not(:empty) {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.mode-msg {
  max-width: 92%;
  display: grid;
  gap: 4px;
  justify-self: start;
}
.mode-msg small {
  color: var(--quiet);
  font: 500 12px/1.4 var(--sans);
}
.mode-msg p {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #242b24;
  color: #f0f3ec;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 400 15px/1.55 var(--sans);
}
.mode-msg.mine {
  justify-self: end;
}
.mode-msg.mine small {
  text-align: right;
}
.mode-msg.mine p {
  background: #354331;
}
@media (min-width: 801px) and (min-height: 640px) and (prefers-reduced-motion: no-preference) {
  .mode-runway.has-motion {
    height: calc(100svh - var(--home-nav-height) + var(--travel));
  }
  .mode-runway.has-motion .bosi-opening {
    position: sticky;
    top: var(--home-nav-height);
    height: calc(100svh - var(--home-nav-height));
    min-height: 0;
    padding-block: 8px;
  }
  .mode-runway.has-motion .mode-stack {
    --panel-size: clamp(
      256px,
      calc(100svh - var(--home-nav-height) - 3 * clamp(76px, 10svh, 100px) - 64px),
      432px
    );
  }
}
@media (max-width: 800px) {
  .mode-stack {
    --gap: 8px;
    --panel-size: clamp(320px, 58svh, 440px);
  }
  .mode-face {
    min-height: 76px;
  }
  .mode-drawing {
    width: 64px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mode-fold {
    transform: none;
  }
  .mode-trigger[aria-expanded='true'] .mode-fold {
    transform: rotate(180deg);
  }
}
