/* The split panes card in "Not just an SSH terminal app.": a tablet in
   landscape opens on home, the nav pill on the rail's edge is dragged out
   into a split, each pane opens a terminal, one goes on to Files, and the
   divider's Duplicate lays a copy of that pane over the other. split.js
   plays it; with no script, or with reduced motion, the two terminals stand
   side by side.

   The panes are drawn as the apps draw a split: each its own rounded well
   with a hairline rim, and a strip of the frame between them carrying the
   grip. Home, the terminal and the fingertip borrow the pairing tour's parts
   (tour.css, tour-term.css) at the same scale; the divider, its menu and
   the preview are split-tools.css. */

.mini.split-view {
  --status-h: 0px;
  --cut: 50%;
  background: var(--base);
}

.split-view[data-single] {
  --cut: calc(100% + 2px);
}

/* Everything the split tilts and fades: the panes, the divider, the
   preview. Tilted back like a table while Duplicate waits for a pick. */
.sv-stage {
  position: absolute;
  inset: 4px;
  transform-origin: 50% 70%;
  transition: opacity 360ms var(--ease-out-soft), transform 620ms var(--spring-gentle);
}

.split-view[data-fading] .sv-stage {
  opacity: 0;
}

.split-view[data-tilted] .sv-stage {
  transform: perspective(700px) translateY(8px) rotateX(20deg) scale(0.8);
}

/* ----------------------------------------------------------------- panes --- */

.sv-pane {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 8px;
  background: var(--base);
  overflow: hidden;
  transition: left var(--spring-gentle-ms) var(--spring-gentle), width var(--spring-gentle-ms) var(--spring-gentle),
    opacity 260ms var(--ease-out-soft);
}

.sv-pane[data-pane="a"] {
  left: 0;
  width: calc(var(--cut) - 2px);
}

.sv-pane[data-pane="b"] {
  left: calc(var(--cut) + 2px);
  width: calc(100% - var(--cut) - 2px);
}

.split-view[data-single] .sv-pane[data-pane="b"] {
  opacity: 0;
}

/* The well's rim, drawn over its edge like the apps'; it carries the focus
   glow and the mark of the pane picked to copy. */
.sv-pane::after {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--hairline), inset 0 0 0 transparent;
  content: "";
  pointer-events: none;
  transition: box-shadow 220ms var(--ease-out-soft);
}

.sv-pane.is-glowing::after {
  animation: sv-glow 900ms ease-out;
}

.sv-pane.is-picked::after {
  box-shadow: inset 0 0 0 1.5px var(--tint), inset 0 0 18px var(--tint-fill);
}

@keyframes sv-glow {
  30% {
    box-shadow: inset 0 0 0 3px var(--tint), inset 0 0 22px var(--tint-fill);
  }
}

/* A copy of the picked pane, carried over and laid on the other. */
.sv-ghost {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  pointer-events: none;
}

.sv-ghost::after {
  display: none;
}

.tour-state.is-running i {
  border: 0;
  background: var(--green);
}

/* Files arrives from the right, over the terminal it was opened from. */
.tour-screen.sv-files {
  z-index: 3;
  box-shadow: -18px 0 30px -12px rgba(0, 0, 0, 0.5);
}

.tour-screen.sv-files[hidden] {
  opacity: 1;
  translate: 101% 0;
}

/* ------------------------------------------------------------------ home --- */

/* A pane half a tablet wide is taller than wide, so it draws home as the
   phone does: the header, the projects, the floating dock. */
.sv-home-head {
  position: relative;
  flex: none;
  padding: 28px 12px 8px;
}

.sv-home-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  left: 8px;
  display: flex;
  gap: 2px;
  align-items: center;
}

.sv-home .tour-host {
  font-size: 16px;
}

.sv-cards {
  display: grid;
  gap: 5px;
  margin: 0 8px;
}

.sv-cards .tour-card,
.sv-cards .tour-card + .tour-card {
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--highlight);
}

.sv-home .sv-nav {
  z-index: 2;
  right: 8px;
  bottom: 8px;
  left: 8px;
  height: 32px;
  padding: 3px;
}

/* The nav pill: on the bottom edge of a narrow page's header. */
.sv-navpill {
  position: absolute;
  top: 74px;
  left: 50%;
  width: 18px;
  height: 2.5px;
  border-radius: var(--r-pill);
  background: var(--label-3);
  translate: -50% 0;
}

/* Full width, home is the landscape layout: a rail holding the header and
   the nav, the projects in two columns beside it, and the nav pill upright
   on the rail's inner edge. */
.sv-home[data-wide],
.sv-home[data-wide][hidden] {
  display: grid !important;
  grid-template-columns: 128px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.sv-home[data-wide]::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 128px;
  background: var(--surface);
  box-shadow: 0.5px 0 0 var(--hairline);
  content: "";
}

.sv-home[data-wide] > * {
  position: relative;
}

.sv-home[data-wide] .sv-home-head {
  grid-area: 1 / 1;
}

.sv-home[data-wide] .tour-online {
  font-size: 6.5px;
  white-space: nowrap;
}

.sv-home[data-wide] .sv-nav {
  position: relative;
  inset: auto;
  display: grid;
  grid-area: 2 / 1;
  grid-template-columns: none;
  align-content: start;
  gap: 2px;
  height: auto;
  padding: 2px 8px;
  border-radius: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.sv-home[data-wide] .sv-nav span {
  display: flex;
  justify-content: start;
  gap: 6px;
  height: 20px;
  padding: 0 8px;
  font-size: 7.5px;
}

.sv-home[data-wide] .sv-nav svg {
  width: 9px;
  height: 9px;
}

.sv-home[data-wide] .sv-navpill {
  position: absolute;
  top: 50%;
  left: 128px;
  width: 2.5px;
  height: 22px;
  translate: -50% -50%;
}

.sv-home[data-wide] .sv-main {
  grid-area: 1 / 2 / 3 / 3;
  padding-top: 22px;
}

.sv-home[data-wide] .sv-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

/* Home's arrival: the header fades, the rest rises after it. */
.sv-home.is-entering > :not(.sv-nav, .sv-navpill) {
  animation: app-row-rise 640ms var(--ease-out-soft) 200ms backwards;
}

.sv-home.is-entering > .sv-home-head {
  animation-name: app-row-fade;
  animation-delay: 60ms;
}

/* ----------------------------------------------------------------- files --- */

.sv-search {
  display: flex;
  flex: none;
  gap: 4px;
  align-items: center;
  height: 16px;
  margin: 6px 8px 2px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--fill-2);
  color: var(--label-2);
  font-size: 7px;
}

.sv-search svg {
  width: 7px;
  height: 7px;
}

.sv-files .crumbs {
  flex: none;
  gap: 3px;
  padding: 4px 8px;
  font-size: 6.5px;
}

.sv-files .crumbs span,
.sv-files .crumbs b {
  padding: 1px 5px;
}

.sv-files .row {
  --row-text: 31px;
  gap: 6px;
  padding: 4px 8px;
}

.sv-files .thumb {
  width: 17px;
  height: 17px;
  border-radius: 5px;
}

.sv-files .thumb svg {
  width: 9px;
  height: 9px;
}

.sv-files .row-copy b {
  font-size: 7.5px;
}

.sv-files .row-copy small {
  font-size: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .sv-stage,
  .sv-pane {
    transition: none;
  }
}
