/* The live product window: ten Pen frames as layers of one 1320 x 720 window.
   Inside, the frames keep their own 1440 px layout and are scaled to fit, so type stays vector-sharp.
   Motion follows the site's rules: a highlight arrives at once and leaves in 150 ms, a press is
   scale(.97), nothing lifts, a change of view is instant. */

.aw-page {
  margin: 0;
  background: #fff;
  font-family: Geist, system-ui, sans-serif;
  min-width: 1400px;
}

.aw-stage {
  display: flex;
  justify-content: center;
  padding: 48px 0 0;
}

.aw-window {
  --aw-scale: 0.916667;
  position: relative;
  width: 1320px;
  height: 720px;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: #f6f6f6;
  /* the window fades out at its foot, into the chapters below */
  -webkit-mask-image: linear-gradient(#000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 44px), transparent);
  flex: none;
  user-select: none;
  -webkit-user-select: none;
  color: #171717;
  font: 400 13px/1.4 Geist, system-ui, sans-serif;
  letter-spacing: 0;
  text-align: left;
  /* the app's titles are drawn at one optical size; the site's headline font would vary it */
  font-optical-sizing: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  contain: layout paint;
}

/* The frames keep their 1440 px layout and are zoomed to fit. Zoom, not a transform: the browser
   then lays text out and draws hairlines at the final size, as it does for the rest of the page,
   so nothing is resampled. */
/* The window's outline. It is drawn inside the window and above everything in it: a shadow
   outside would be cut off by the fade's mask, and a drawer would cover a line drawn beneath it. */
.aw-window::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #e2e2e2;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  pointer-events: none;
  z-index: 50;
}

.aw-scale {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1440px;
  height: 785.5px;
  zoom: var(--aw-scale);
}

.aw-window *,
.aw-window *::before,
.aw-window *::after {
  box-sizing: border-box;
}

.aw-window [hidden] {
  display: none !important;
}

/* A screen: the frame fills the window, its long pane scrolls inside it. */
.aw-screen {
  position: absolute;
  inset: 0;
}

.aw-screen > div {
  height: 100% !important;
}

.aw-screen [data-pencil-name="Main"],
.aw-screen [data-pencil-name="Body"] {
  min-height: 0;
}

.aw-screen [data-pencil-name="Body"] {
  height: 100%;
}

/* The main panel's outline and the header's rule are drawn half a pixel into the areas beside
   them; the scrolling body paints over both, so they are drawn again on top. */
.aw-screen [data-pencil-name="Main"] {
  position: relative;
}

.aw-screen [data-pencil-name="Main"]::after {
  content: "";
  position: absolute;
  inset: -0.5px;
  border: 1px solid #e5e5e5;
  border-radius: 12.5px;
  pointer-events: none;
  z-index: 5;
}

.aw-screen [data-pencil-name="Main"] > [data-pencil-name="Header"] {
  position: relative;
  z-index: 2;
}

.aw-screen [data-pencil-name="Topic list"] {
  box-sizing: border-box !important;
  width: 248px !important;
  height: 100% !important;
}

/* Only the demo scrolls these; a visitor's wheel always scrolls the page. */
.aw-screen [data-pencil-name="Pane"],
.aw-screen [data-pencil-name="Panel · Prompt"],
.aw-full > div {
  overflow-y: hidden !important;
  scrollbar-width: none;
}

.aw-screen [data-pencil-name="Pane"]::-webkit-scrollbar,
.aw-screen [data-pencil-name="Panel · Prompt"]::-webkit-scrollbar,
.aw-full > div::-webkit-scrollbar {
  display: none;
}

.aw-screen [data-pencil-name="Panel · Prompt"] {
  box-sizing: border-box !important;
  width: 480px !important;
  height: 100% !important;
}

/* The full answer takes the prompt panel's place. */
.aw-full {
  flex: none;
  width: 480px;
  height: 100%;
  margin-left: -0.5px;
}

.aw-full > div {
  box-sizing: border-box !important;
  height: 100% !important;
  width: 480px !important;
}

.aw-answer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  font-size: 13px;
  line-height: 20px;
  color: #262626;
}

.aw-answer p,
.aw-answer h3 {
  margin: 0;
  font-family: inherit;
  letter-spacing: 0;
}

.aw-answer h3 {
  padding-top: 8px;
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  color: #171717;
}

.aw-answer b {
  font-weight: 600;
  color: #171717;
}

.aw-answer mark {
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

.aw-name {
  background: #fdf0c4;
  color: #171717;
}

.aw-you {
  background: #e9e3f5;
  color: #6b3fa0;
}

.aw-cite {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #f2f2f2;
  color: #525252;
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
  vertical-align: 1px;
}

.aw-li {
  display: flex;
  gap: 4px;
}

.aw-li > span {
  flex: none;
  width: 14px;
  color: #737373;
}

/* Things that respond. */
.aw-click {
  cursor: pointer;
  transition: background-color 0.15s, opacity 0.15s, transform 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  -webkit-tap-highlight-color: transparent;
}

.aw-click:hover {
  transition-duration: 0s, 0s, 0.1s;
}

.aw-click:focus-visible {
  outline: 2px solid #171717 !important;
  outline-offset: 2px !important;
}

.aw-fill:hover {
  background-color: rgba(0, 0, 0, 0.045) !important;
}

.aw-fill.aw-on,
.aw-fill.aw-on:hover {
  background-color: #ececec !important;
}

.aw-solid:hover {
  opacity: 0.86;
}

.aw-solid:active,
.aw-ghost:active {
  transform: scale(0.97);
}

.aw-ghost:hover {
  background-color: #f5f5f5 !important;
}

.aw-link:hover {
  opacity: 0.62;
}

.aw-row:hover {
  background-color: #fafafa !important;
}

.aw-row.aw-on,
.aw-row.aw-on:hover {
  background-color: #f5f5f5 !important;
}

.aw-icon {
  border-radius: 6px;
}

.aw-icon:hover {
  background-color: rgba(0, 0, 0, 0.06) !important;
}

/* A choice chip and a tick box. */
.aw-chip.aw-on {
  background-color: #171717 !important;
  outline-color: #171717 !important;
}

.aw-chip.aw-on > * {
  color: #fff !important;
}

.aw-check {
  transition: background-color 0.1s, outline-color 0.1s;
}

.aw-check svg {
  transition: transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.1s;
}

.aw-check:not(.aw-on) {
  background-color: transparent !important;
  outline: 1px solid #d4d4d4;
  outline-offset: -0.5px;
}

.aw-check:not(.aw-on) svg {
  opacity: 0;
  transform: scale(0.5);
}

.aw-check.aw-on {
  background-color: #171717 !important;
  outline: none !important;
}

.aw-field[contenteditable] {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  outline: none;
}

.aw-field-box:focus-within {
  outline: 1.5px solid #171717 !important;
}

/* A side drawer slides over a scrim. */
.aw-scrim {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.22);
  opacity: 0;
  transition: opacity 0.2s ease-out;
  z-index: 20;
}

.aw-scrim.aw-in {
  opacity: 1;
}

.aw-sheet {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 440px;
  transform: translateX(104%);
  transition: transform 0.32s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 21;
}

.aw-sheet.aw-in {
  transform: none;
}

.aw-sheet.aw-out {
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

/* A drawer's buttons sit at its foot, where the window fades: the drawer stops short of the fade
   and its white carries on beneath it. */
.aw-sheet {
  background: #fff;
  box-shadow: -1px 0 0 #ececec, -8px 0 24px rgba(0, 0, 0, 0.1);
}

.aw-sheet > div {
  height: calc(100% - 48px) !important;
  width: 440px !important;
  box-shadow: none !important; /* the wrapper carries it, or it would fall across the white below */
}

/* no room left for the note about the prompt that is already answered; its row says "Answered" */
.aw-sheet [data-pencil-name="Warning"] {
  display: none !important;
}

.aw-sheet [data-pencil-name="Sheet body"],
.aw-sheet [data-pencil-name="Body"] {
  min-height: 0;
  overflow: hidden;
}

/* Between loops the window dips out and back, so the reset is not seen. */
.aw-scale {
  transition: opacity 0.22s ease-out;
}

.aw-scale.aw-dip {
  opacity: 0;
}

/* The bell's panel. */
.aw-screen [data-pencil-name="Notifications panel"] {
  transform-origin: 24px 0;
  transition: opacity 0.15s ease-out, transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 10;
}

.aw-screen [data-pencil-name="Notifications panel"].aw-shut {
  opacity: 0;
  transform: scale(0.97) translateY(-4px);
  pointer-events: none;
}

.aw-badge {
  animation: aw-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes aw-pop {
  from { transform: scale(0); }
}

/* A confirmation. */
.aw-toast {
  position: absolute;
  left: 50%;
  bottom: 72px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 12px;
  border-radius: 9px;
  background: #171717;
  color: #fff;
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  transform: translate(-50%, 10px);
  opacity: 0;
  transition: opacity 0.2s ease-out, transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
  pointer-events: none;
}

.aw-toast.aw-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

.aw-toast svg {
  flex: none;
}

/* Content arriving. */
.aw-rise {
  animation: aw-rise 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) backwards;
  animation-delay: var(--d, 0ms);
}

@keyframes aw-rise {
  from { opacity: 0; transform: translateY(8px); }
}

.aw-fade {
  animation: aw-fade 0.3s ease-out backwards;
  animation-delay: var(--d, 0ms);
}

@keyframes aw-fade {
  from { opacity: 0; }
}

.aw-grow {
  animation: aw-draw 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) backwards;
  animation-delay: var(--d, 0ms);
}

/* Held back until it scrolls into view. */
.aw-wait.aw-f {
  opacity: 0;
}

.aw-draw {
  animation: aw-draw 1s cubic-bezier(0.455, 0.03, 0.515, 0.955) backwards;
  animation-delay: var(--d, 0ms);
}

@keyframes aw-draw {
  from { clip-path: inset(-8px 100% -8px 0); }
  to { clip-path: inset(-8px -8px -8px 0); }
}

.aw-slide {
  animation: aw-slide 0.28s cubic-bezier(0.165, 0.84, 0.44, 1) backwards;
}

@keyframes aw-slide {
  from { opacity: 0; transform: translateX(16px); }
}

.aw-new {
  animation: aw-new 0.45s cubic-bezier(0.165, 0.84, 0.44, 1) backwards;
}

@keyframes aw-new {
  from { opacity: 0; transform: translateY(-6px); background-color: #e9e3f5; }
}

@media (prefers-reduced-motion: reduce) {
  .aw-rise,
  .aw-fade,
  .aw-grow,
  .aw-draw,
  .aw-slide,
  .aw-new,
  .aw-badge {
    animation: none;
  }

  .aw-sheet,
  .aw-scrim,
  .aw-toast {
    transition-duration: 0.01s;
  }
}

/* The demo's cursor, and the hover it brings with it. */
.aw-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 40;
  margin: -3px 0 0 -5px;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.45, 0, 0.2, 1);
  will-change: transform;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.aw-cursor svg {
  display: block;
  transform-origin: 5px 3px;
  transition: transform 0.1s;
}

.aw-cursor.aw-down svg {
  transform: scale(0.84);
}

.aw-fill.aw-h { background-color: rgba(0, 0, 0, 0.045) !important; }
.aw-solid.aw-h { opacity: 0.86; }
.aw-ghost.aw-h { background-color: #f5f5f5 !important; }
.aw-link.aw-h { opacity: 0.62; }
.aw-row.aw-h { background-color: #fafafa !important; }
.aw-icon.aw-h { background-color: rgba(0, 0, 0, 0.06) !important; }
.aw-field-box.aw-h { outline: 1.5px solid #171717 !important; }

.aw-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* A select's menu. */
.aw-menu {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px #ececec, 0 8px 24px rgba(0, 0, 0, 0.08);
  transform-origin: 50% 0;
  transition: opacity 0.15s ease-out, transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.aw-menu.aw-shut {
  opacity: 0;
  transform: scale(0.98) translateY(-4px);
  pointer-events: none;
}

.aw-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  color: #171717;
}

.aw-opt i {
  display: flex;
}

/* Typing, and prompts being written. */
.aw-typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 15px;
  margin-left: 1px;
  background: #171717;
  vertical-align: -2px;
  animation: aw-blink 1s steps(1) infinite;
}

@keyframes aw-blink {
  50% { opacity: 0; }
}

.aw-skel {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 3px 0;
}

.aw-skel i {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 3px;
  background: #f1f1f1;
}

.aw-skel div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 5px 0 6px;
}

.aw-skel b {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f1f1f1 0%, #f9f9f9 40%, #f1f1f1 80%);
  background-size: 200% 100%;
  animation: aw-shimmer 1.2s linear infinite;
}

@keyframes aw-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* The chapters under the window: the act that is playing is a labelled pill that fills as it runs,
   the others are dots that open on hover. Sizes and timings follow the reference (40 px high,
   radius 12, width 0.32 s, fill 0.24 s). */
.aw-chapters {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 44px;
  margin: 22px auto 30px;
  padding: 0 2px;
}

.aw-ch {
  position: relative;
  flex: none;
  width: 20px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  font: 400 13px/16px Geist, system-ui, sans-serif;
  color: rgba(23, 23, 23, 0.72);
  transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.aw-ch::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  background: rgba(23, 23, 23, 0.07);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  opacity: 0;
}

.aw-ch::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: rgba(23, 23, 23, 0.1);
  transition: opacity 0.18s ease-out, background-color 0.15s;
}

.aw-ch:hover::after {
  background: rgba(23, 23, 23, 0.2);
}

.aw-ch-g {
  position: absolute;
  left: 16px;
  top: 15px;
  width: 10px;
  height: 10px;
  opacity: 0;
  transition: opacity 0.18s ease-out;
}

.aw-ch-g svg {
  position: absolute;
  inset: 0;
  fill: currentColor;
  transition: opacity 0.12s ease-out;
}

.aw-ch-t {
  position: absolute;
  left: 34px;
  top: 12px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}

.aw-ch.is-open::after,
.aw-ch.is-on::after {
  opacity: 0;
}

.aw-ch.is-open .aw-ch-t,
.aw-ch.is-on .aw-ch-t {
  opacity: 1;
  transition-delay: 0.14s, 0s;
}

.aw-ch.is-open .aw-ch-g,
.aw-ch.is-on .aw-ch-g {
  opacity: 0.32;
}

.aw-ch.is-on:hover .aw-ch-g,
.aw-ch.is-open:hover .aw-ch-g {
  opacity: 0.6;
}

.aw-ch.is-on {
  background: rgba(23, 23, 23, 0.06);
  color: #171717;
}

.aw-ch.is-on::before {
  opacity: 1;
}

/* playing shows pause (press to pause); anything else shows play */
.aw-ch .aw-i-pause {
  opacity: 0;
}

.aw-ch.is-on:not(.is-paused) .aw-i-pause {
  opacity: 1;
}

.aw-ch.is-on:not(.is-paused) .aw-i-play {
  opacity: 0;
}

.aw-ch:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .aw-chapters {
    display: none;
  }
}

/* Review rail: for the review page only. */
.aw-review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 1320px;
  margin: 0 auto 14px;
  font-size: 12px;
  color: #737373;
}

.aw-review p {
  margin: 0 6px 0 0;
}

.aw-review span {
  flex: 1;
}

.aw-review button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #e5e5e5;
  border-radius: 7px;
  background: #fff;
  color: #262626;
  font: 500 12px/1 Geist, system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 0.15s;
}

.aw-review button:hover {
  background: #f5f5f5;
  transition-duration: 0s;
}

.aw-review button:active {
  transform: scale(0.97);
}

.aw-review button[aria-current="true"] {
  background: #171717;
  border-color: #171717;
  color: #fff;
}

.aw-review i {
  width: 1px;
  height: 16px;
  margin: 0 10px;
  background: #e5e5e5;
}

.aw-review:last-of-type {
  margin-bottom: 64px;
}
