:root {
  --bg: #050302;
  --panel: #0d0905;
  --line: #2a2012;
  --text: #f1e2c2;
  --muted: #a08a64;
  --accent: #f0c46a;
  --blue: #35b6ff;
  --green: #3dff7a;
  --violet: #c060ff;
  --fire: #ff6a2a;
  --purple: #c04bff;
  /* The inbox on the phone: a light mail app. */
  --mail-bg: #ffffff;
  --mail-text: #1b1d22;
  --mail-muted: #6b7280;
  --mail-line: #eceef2;
  --mail-unread: #1a73e8;
  --mail-fresh: #fff4e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
}

.app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

/* Side panel */

.panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  align-self: start;
}

.brand__eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand__name {
  margin: 6px 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 44px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(255, 176, 64, 0.4);
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tab:hover {
  border-color: #6b5530;
}

.tab[aria-selected="true"] {
  border-color: var(--accent);
  background: #1a130a;
}

.tab__name {
  font-weight: 500;
}

.tab__hint {
  font-size: 12px;
  color: var(--muted);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

.controls[hidden] {
  display: none;
}

.actions,
.astras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #6b5530;
  border-radius: 999px;
  background: #1a130a;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.astra--blue {
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
}
.astra--blue:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.astra--green {
  border-color: color-mix(in srgb, var(--green) 55%, transparent);
}
.astra--green:hover {
  border-color: var(--green);
  color: var(--green);
}
.astra--violet {
  border-color: color-mix(in srgb, var(--violet) 55%, transparent);
}
.astra--violet:hover {
  border-color: var(--violet);
  color: var(--violet);
}

.astra--fire {
  border-color: color-mix(in srgb, var(--fire) 55%, transparent);
}
.astra--fire:hover {
  border-color: var(--fire);
  color: var(--fire);
}

.astra--purple {
  border-color: color-mix(in srgb, var(--purple) 55%, transparent);
}
.astra--purple:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.action--fire {
  border-color: var(--accent);
  color: var(--accent);
}

.step {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.note {
  margin: 0;
  font-size: 12px;
}

.cycle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cycle li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.cycle li.is-next {
  border-color: var(--accent);
  color: var(--accent);
}

.slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider output {
  color: var(--text);
}

.slider input {
  accent-color: var(--accent);
}

/* Stage: square for the bow, 16:9 for the Astra. */

.stage {
  position: relative;
  justify-self: center;
  align-self: start;
  width: min(100%, calc((100vh - 48px) * var(--aspect)));
  aspect-ratio: var(--aspect);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  --aspect: 1;
}

.stage[data-scene="astra"] {
  --aspect: 16 / 9;
}

/* The use case: the stage is a phone (a 390x844 screen in a bezel). */
.stage[data-scene="usecase"] {
  --aspect: 414 / 868;
  border-radius: 56px;
  overflow: visible;
  box-shadow: none;
}

.stage[data-scene="usecase"] #scene,
.stage:not([data-scene="usecase"]) .phone {
  display: none;
}

.phone {
  position: absolute;
  inset: 0;
  padding: 2.8%;
  border-radius: 56px;
  background: linear-gradient(145deg, #2a2a2e, #0e0e10);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), inset 0 0 0 2px #3a3a40;
}

.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  background: var(--mail-bg);
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.phone__screen:active {
  cursor: grabbing;
}

/* The Rive takeover: invisible at rest, it fades in as you pull. */
#phone-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

#phone-scene.is-live {
  transition: none;
}

.mail {
  height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--mail-text);
  font-family: "DM Sans", system-ui, sans-serif;
}

.mail__status {
  display: flex;
  justify-content: space-between;
  padding: 14px 30px 4px;
  font-size: 14px;
  font-weight: 500;
}

.mail__icons {
  font-size: 9px;
  letter-spacing: 3px;
}

.mail__header {
  padding: 10px 20px 12px;
}

.mail__account {
  margin: 0;
  font-size: 12px;
  color: var(--mail-muted);
}

.mail__title {
  margin: 2px 0 12px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mail__search {
  padding: 9px 14px;
  border-radius: 12px;
  background: #f1f3f6;
  color: var(--mail-muted);
  font-size: 14px;
}

.mail__list {
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.mail__list.is-live {
  transition: none;
}

.mail__item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 2px 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--mail-line);
  transition: background-color 1.6s ease;
}

.mail__item.is-fresh {
  background: var(--mail-fresh);
  animation: mail-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}

@keyframes mail-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
}

.mail__avatar {
  grid-row: span 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.mail__from {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail__time {
  font-size: 12px;
  color: var(--mail-muted);
}

.mail__item.is-unread .mail__time {
  color: var(--mail-unread);
  font-weight: 600;
}

.mail__subject,
.mail__preview {
  grid-column: 2 / 4;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail__item:not(.is-unread) .mail__from,
.mail__item:not(.is-unread) .mail__subject {
  font-weight: 400;
}

.mail__preview {
  color: var(--mail-muted);
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.status {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
}

.status[hidden] {
  display: none;
}

/* Phone: the panel sits above the stage. */

@media (max-width: 820px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
    gap: 16px;
  }

  .panel {
    align-self: stretch;
  }

  .tabs {
    flex-direction: row;
  }

  .tab {
    flex: 1;
  }

  .stage {
    width: 100%;
    order: -1;
  }
}
