/* the page is one narrow column, a little above the middle */

main {
  padding: max(16vh, 96px) 24px 96px;
}

.home,
.view {
  margin: 0 auto;
}

.home {
  max-width: 500px;
}

/* fit-content so the flying snapshot is the word, not a full width box */
.name {
  width: fit-content;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
  view-transition-name: name;
}

.name a {
  display: inline-flex;
}

.name span {
  display: inline-block;
}

.where {
  position: relative;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 15px;
}

.place {
  cursor: default;
  outline-offset: 2px;
  transition: color 0.25s ease;
}

.place:hover,
.place:focus-visible {
  color: var(--ink-2);
}

/* the local time slides out of the place name */
.clock {
  display: inline-block;
  margin-left: 6px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  filter: blur(4px);
  transform: translateX(-8px);
  pointer-events: none;
  transition: opacity 0.3s ease, filter 0.4s ease, transform 0.5s var(--spring);
}

.clock b {
  font-weight: 400;
  color: var(--ink-2);
}

.place:hover + .clock,
.place:focus-visible + .clock {
  opacity: 1;
  filter: none;
  transform: none;
}

.bio {
  margin-top: 28px;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* streamed in a token at a time on the first visit, like the models write */
.tok {
  opacity: 0;
  filter: blur(3px);
  transition: opacity 0.35s ease, filter 0.45s ease;
}

.tok.on {
  opacity: 1;
  filter: none;
}

/* the secret: a phrase that runs tale in your browser */

.secret {
  position: relative;
  display: inline;
  color: var(--ink-2);
  font: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.secret:hover,
.secret:focus-visible {
  color: var(--ink);
  text-decoration-color: var(--ink-4);
}

/* the download fills the words themselves */
.secret-fill {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  color: var(--accent);
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0);
  pointer-events: none;
  transition: clip-path 0.3s ease;
}

.secret.busy .secret-text {
  color: var(--ink-3);
}

.secret.done .secret-fill {
  opacity: 0;
  transition: opacity 0.8s ease 0.3s;
}

.story {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--spring);
}

.story.open {
  grid-template-rows: 1fr;
}

.story-inner {
  min-height: 0;
  overflow: hidden;
}

.story-text {
  margin-top: 20px;
  padding-left: 14px;
  border-left: 1.5px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  white-space: pre-wrap;
  opacity: 0;
  transition: opacity 0.4s ease 0.15s;
}

.story.open .story-text {
  opacity: 1;
}

.story-text .caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--accent);
  border-radius: 1px;
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.story-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 10px 0 2px 15px;
  font-size: 13px;
  color: var(--ink-3);
}

.story-foot button {
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.story-foot button:hover {
  color: var(--ink);
}

/* section links: the word you click becomes the page title */

.sections {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 40px;
}

.sections a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 19px;
  font-weight: 450;
  letter-spacing: -0.015em;
  transition: transform 0.4s var(--spring), opacity 0.3s ease;
}

.sections .label {
  position: relative;
  display: inline-block;
}

.sections .label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--spring);
}

.sections .count {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.45s var(--spring);
}

@media (hover: hover) {
  .sections:hover a:not(:hover) {
    opacity: 0.45;
  }

  .sections a:hover {
    transform: translateX(3px);
  }

  .sections a:hover .label::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  .sections a:hover .count {
    opacity: 1;
    transform: none;
  }
}

@media (hover: none) {
  .sections .count {
    opacity: 1;
    transform: none;
  }
}

.sections a:active {
  transform: scale(0.97);
}

/* first load: everything settles in, one after another */

.js .home [data-in] {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(8px);
}

.js .home.in [data-in] {
  opacity: 1;
  filter: none;
  transform: none;
  transition: opacity 0.7s ease, filter 0.8s ease, transform 0.9s var(--spring);
  transition-delay: calc(var(--i) * 70ms + var(--d0, 0ms));
}

.js .home.in .name span {
  animation: rise 0.9s var(--spring) both;
}

.js .home.in .name span:nth-child(2) {
  animation-delay: 60ms;
}

.js .home.in .name span:nth-child(3) {
  animation-delay: 120ms;
}

@keyframes rise {
  from {
    transform: translateY(0.45em);
    opacity: 0;
  }
}

/* views: work, writing, playground */

/* same left edge as the home column, the preview gets whatever room is on the right */
.view {
  max-width: 820px;
  margin-left: max(0px, min(calc((100% - 500px) / 2), calc(100% - 820px)));
}

.view-head {
  max-width: 500px;
}

.view-name {
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-3);
  view-transition-name: name;
  transition: color 0.2s ease, transform 0.4s var(--spring);
}

.view-name:hover {
  color: var(--ink);
  transform: translateX(-3px);
}

.view-title {
  width: fit-content;
  margin-top: 6px;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.15;
  outline: none;
  view-transition-name: title;
}

.view-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 500px) 1fr;
  gap: 48px;
  margin-top: 32px;
}

.view-body {
  min-width: 0;
}

.group + .group {
  margin-top: 28px;
}

.group h3 {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
}

.list li {
  opacity: 1;
}

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 7px 0;
  transition: opacity 0.3s ease, transform 0.45s var(--spring);
}

.row .t {
  min-width: 0;
  transition: color 0.2s ease;
}

.row .m {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

@media (hover: hover) {
  .view-body:has(.row:hover) .row:not(:hover) {
    opacity: 0.4;
  }

  .row:hover {
    transform: translateX(3px);
  }

  .row:hover .m {
    color: var(--ink-2);
  }
}

.row:active {
  transform: scale(0.985);
}

.aside {
  margin-top: 28px;
  font-size: 14px;
  color: var(--ink-3);
}

.aside a {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--ink-4);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.aside a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* rows arrive one after another when a view opens without a page transition */
.view.arriving .view-head,
.view.arriving .group h3,
.view.arriving .row,
.view.arriving .aside {
  animation: up 0.7s var(--spring) both;
  animation-delay: calc(var(--k, 0) * 35ms + 80ms);
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(4px);
  }
}

/* the preview panel slides along beside whatever row you're on */

.preview {
  position: relative;
}

.preview-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 280px;
  padding: 16px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(var(--y, 0px)) scale(0.94) rotate(-2deg);
  transform-origin: 0 20px;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.55s var(--spring);
}

.preview.on .preview-card {
  opacity: 1;
  transform: translateY(var(--y, 0px)) rotate(var(--r, 0deg));
}

.preview-card.swap > * {
  animation: swap 0.4s var(--spring) both;
}

@keyframes swap {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.pv-cap {
  font-size: 12px;
  color: var(--ink-3);
}

.pv-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

.pv-big {
  margin: 2px 0 8px;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.pv-big small {
  margin-left: 2px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-3);
}

.track {
  position: relative;
  height: 6px;
  margin-top: 4px;
  border-radius: 6px;
  background: var(--card-2);
}

.track b,
.mix b,
.bars b,
.dl b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  width: 0;
}

.play .track b,
.play .bars b,
.play .dl b {
  width: var(--w);
  transition: width 1.1s var(--spring) 0.1s;
}

.track i {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1.5px;
  background: var(--bg);
}

.pv-mark {
  margin: 4px 0 14px;
  padding-left: calc(var(--x) - 2px);
  white-space: nowrap;
}

.mix {
  display: flex;
  gap: 2px;
  height: 6px;
  margin-bottom: 6px;
  border-radius: 6px;
  overflow: hidden;
}

.mix b {
  border-radius: 0;
  flex: 0 0 auto;
  transition: width 0.9s var(--spring);
}

.play .mix b {
  width: var(--w);
}

.mix b:nth-child(2) {
  opacity: 0.6;
  transition-delay: 0.08s;
}

.mix b:nth-child(3) {
  opacity: 0.35;
  transition-delay: 0.16s;
}

.mix b:nth-child(4) {
  opacity: 0.18;
  transition-delay: 0.24s;
}

.bubbles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.bubbles span {
  max-width: 85%;
  padding: 7px 11px;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
}

.bubbles .you {
  align-self: flex-end;
  background: var(--ink);
  color: var(--bg);
  border-bottom-right-radius: 5px;
  transform-origin: right bottom;
}

.bubbles .bot {
  align-self: flex-start;
  background: var(--card-2);
  border-bottom-left-radius: 5px;
  transform-origin: left bottom;
}

.play .bubbles span {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s ease, transform 0.5s var(--spring);
}

.play .bubbles span:nth-child(2) {
  transition-delay: 0.45s;
}

.play .bubbles span:nth-child(3) {
  transition-delay: 0.9s;
}

.play .bubbles span:nth-child(4) {
  transition-delay: 1.45s;
}

.pv-late {
  margin-top: 8px;
  opacity: 0;
}

.play .pv-late {
  opacity: 1;
  transition: opacity 0.5s ease 2s;
}

.bars {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px 10px;
  margin: 10px 0;
  font-size: 12px;
  color: var(--ink-2);
}

.bars div {
  display: grid;
  gap: 3px;
}

.bars b {
  height: 5px;
  border-radius: 5px;
}

.bars b + b {
  background: var(--ink-4);
}

.bars em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.lines {
  width: 100%;
  margin: 8px 0;
  overflow: visible;
}

.lines polyline {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.lines .val {
  stroke: var(--ink);
}

.lines .train {
  stroke: var(--ink-4);
}

.lines .gap {
  fill: var(--ink);
  opacity: 0;
}

.lines text {
  font-size: 10px;
  fill: var(--ink-3);
}

.play .lines polyline {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.2s var(--soft) 0.1s;
}

.play .lines .train {
  transition-delay: 0.3s;
}

.play .lines .gap {
  opacity: 0.06;
  transition: opacity 0.6s ease 1s;
}

.dl {
  display: grid;
  grid-template-columns: 52px 1fr 48px;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-2);
}

.dl span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dl i {
  height: 5px;
  border-radius: 5px;
  background: var(--card-2);
}

.play .dl:nth-child(3) b {
  transition-delay: 0.2s;
}

.play .dl:nth-child(4) b {
  transition-delay: 0.3s;
}

.pv-pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  background: #8250df;
}

.pv-mono {
  margin: 10px 0 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
}

/* screenshots and figures */

.shot {
  overflow: hidden;
  border-radius: 10px;
  background: var(--card-2);
  aspect-ratio: 16 / 9;
}

.shot.dark {
  background: #111;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.shot img.ready {
  opacity: 1;
}

[data-for="airgpt"] .shot {
  margin-bottom: 10px;
}

/* writing previews: the first line on top, figures fanned out behind it */
.preview-card.is-stack {
  padding: 0;
  background: none;
  box-shadow: none;
  width: 300px;
}

.is-stack .pv > * {
  box-shadow: var(--shadow);
}

.is-stack .note {
  position: relative;
  z-index: 3;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

.is-stack .shot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% - 22px);
  border-radius: 12px;
  transform-origin: 50% 100%;
  transition: transform 0.6s var(--spring);
}

.is-stack .shot:nth-of-type(1) {
  z-index: 2;
  transform: translate(6px, 8px) rotate(2deg) scale(0.96);
}

.is-stack .shot:nth-of-type(2) {
  z-index: 1;
  transform: translate(-10px, 12px) rotate(-3deg) scale(0.92);
}

.is-stack .play .shot:nth-of-type(1) {
  transform: translate(10px, 0) rotate(3deg) scale(0.96);
}

.is-stack .play .shot:nth-of-type(2) {
  transform: translate(-18px, 6px) rotate(-5deg) scale(0.92);
}

.toks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
  margin-bottom: 12px;
  font-size: 14px;
}

.toks span {
  padding: 1px 5px;
  border-radius: 5px;
  white-space: pre;
  background: color-mix(in srgb, var(--ink) calc(6% + var(--n, 0) * 3%), transparent);
  opacity: 0;
  transform: translateY(4px);
}

.play .toks span {
  opacity: 1;
  transform: none;
  transition: opacity 0.25s ease, transform 0.4s var(--spring);
  transition-delay: calc(var(--n, 0) * 90ms);
}

.grid28 {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 2px;
  width: 112px;
  margin-bottom: 12px;
}

.grid28 i {
  aspect-ratio: 1;
  border-radius: 1.5px;
  background: var(--card-2);
  transition: background-color 0.2s ease;
}

.grid28 i.ink {
  background: var(--ink);
}

@media (max-width: 860px) {
  .view {
    max-width: 500px;
    margin-left: auto;
  }

  .view-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview {
    display: none;
  }
}

@media (max-width: 520px) {
  main {
    padding-top: 88px;
  }

  .name,
  .view-title {
    font-size: 28px;
  }

  .row .t {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .js .home [data-in] {
    filter: none;
    transform: none;
  }
}
