/* first visit intro */

.veil {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: background-color 0.55s ease 0.1s, opacity 0.4s ease;
}

.veil svg {
  width: clamp(110px, 16vw, 180px);
  height: auto;
  overflow: visible;
  color: var(--ink);
  transform-origin: 0 0;
  transition: transform 0.78s cubic-bezier(0.7, 0, 0.2, 1), color 0.2s ease 0.55s;
}

.veil path,
.veil circle {
  fill: currentColor;
  fill-opacity: 0;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.6, 0, 0.3, 1), fill-opacity 0.35s ease 0.85s;
}

.veil.draw path,
.veil.draw circle {
  fill-opacity: 1;
}

.veil.fly {
  background: transparent;
  pointer-events: none;
}

.veil.fly svg {
  color: #fff;
}

.veil.gone {
  opacity: 0;
  pointer-events: none;
}

.veil.fly.gone {
  transition: opacity 0.12s ease;
}

html.intro:not(.intro-fly) .island {
  opacity: 0;
}

/* the flying mark becomes the nav's mark, so the real one waits until it lands */
html.intro .island-mark {
  opacity: 0;
  transition: none;
}

html.intro .hero [data-reveal].in,
html.intro .cs-head [data-reveal].in,
html.intro .post-head [data-reveal].in {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
}

html.intro .cs-head [data-words].in .w {
  opacity: 0;
  transform: translateY(0.45em);
  filter: blur(8px);
}

/* hero */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 140px;
  padding-bottom: clamp(56px, 10vh, 112px);
}

.hero-inner {
  transform-origin: 0 100%;
  will-change: transform, opacity;
}

.hero-title {
  font-size: clamp(42px, min(6.6vw, 11.5vh), 106px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 450;
  max-width: 16.5ch;
}

.hero-title .soft {
  color: var(--ink-4);
}

/* portrait tablets have height to spare, so the headline sizes off the width instead */
@media (min-width: 600px) and (max-aspect-ratio: 4/5) {
  .hero-title {
    font-size: min(10vw, 96px);
  }
}

.chunk {
  white-space: nowrap;
}

.js .tok {
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.35s ease, filter 0.5s var(--ease);
}

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

.hero-sub {
  margin-top: 36px;
  max-width: 33rem;
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.55;
  color: var(--ink-2);
}

.hero-sub a {
  color: var(--ink);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease);
}

.hero-sub a:hover {
  background-size: 0% 1px;
  background-position: 100% 100%;
}

.hero .row {
  margin-top: 32px;
}

/* the temperature number you can drag */

.temp {
  margin-top: 36px;
  max-width: 33rem;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.55;
  color: var(--ink-3);
}

.knob {
  --scrib: var(--ink-3);
  padding: 0 0.12em;
  border-radius: 6px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.2s ease, color 0.3s ease;
}

/* the number is tiny, so the grab area reaches past it for thumbs */
.knob::after {
  content: "";
  position: absolute;
  inset: -14px -16px;
}

.knob:hover,
.knob.held {
  background: var(--surface);
}

.knob.hot {
  --scrib: var(--accent);
  color: var(--accent);
}

.knob:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* a word the temperature just swapped goes orange for a moment */
.tok.re {
  animation: swapped 1.2s ease;
}

@keyframes swapped {
  from {
    color: var(--accent);
  }
}

/* statement */

.statement {
  padding-top: clamp(80px, 16vh, 180px);
  padding-bottom: clamp(80px, 20vh, 220px);
}

.statement .scrub {
  font-size: clamp(30px, 4.6vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.045em;
  font-weight: 450;
  max-width: 21ch;
}

/* what i work on */

.areas {
  padding-top: clamp(40px, 7vh, 72px);
  padding-bottom: clamp(40px, 8vh, 96px);
}

.area-list {
  margin-top: 40px;
}

.area-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr) auto;
  gap: 32px;
  align-items: baseline;
  padding: 26px 0;
}

.area-name {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  transition: transform 0.6s var(--ease);
}

.area-row:hover .area-name {
  transform: translateX(10px);
}

.area-text {
  max-width: 36rem;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
}

.area-link {
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.25s ease;
}

.area-row:hover .area-link {
  color: var(--ink);
}

@media (max-width: 760px) {
  .area-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 20px 0;
  }

  .area-link {
    display: none;
  }
}

/* work */

.section-head {
  display: grid;
  gap: 18px;
  max-width: 44rem;
}

.work {
  padding-top: clamp(40px, 8vh, 96px);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 64px;
}

.card {
  --r: 40px;
  border-radius: var(--r);
  position: sticky;
  top: calc(84px + var(--i) * 14px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(28px, 4vw, 56px);
  min-height: min(640px, calc(100vh - 130px));
  min-height: min(640px, calc(100svh - 130px));
  padding: clamp(24px, 3.4vw, 44px);
  background: var(--surface);
  transform-origin: 50% 0;
  will-change: transform;
  transition: background-color 0.4s ease;
}

.card:hover {
  background: #efefec;
}

/* every other card puts its picture first so the stack doesn't read like a template */
@media (min-width: 901px) {
  .card:nth-child(even) {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  }

  .card:nth-child(even) .card-vis {
    order: -1;
  }
}

.card-shade {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.card-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-width: 0;
}

.card-title {
  font-size: clamp(46px, 6.4vw, 92px);
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 450;
  width: fit-content;
}

/* the whole card is the link, the extra buttons sit above it */
.stretch::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}

.card .row .btn {
  position: relative;
  z-index: 3;
  background: var(--bg);
}

.card .row .btn:hover {
  background: #fafafa;
}

.card-desc {
  margin-top: 22px;
  max-width: 27rem;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}

.card-wrong {
  max-width: 27rem;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}

.card-wrong span {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--ink-3);
}

.card-go {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  background: var(--ink);
  color: var(--bg);
  transition: background-color 0.3s ease, translate 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.card:hover .card-go,
.card:focus-within .card-go {
  background: #2e2e2e;
}

.card-vis {
  --r: 28px;
  border-radius: var(--r);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(22px, 3vw, 40px);
  background: var(--bg);
  overflow: hidden;
}

@media (max-width: 900px) {
  .card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .card-vis {
    min-height: 300px;
  }
}

/* on phones a card is taller than the screen, so stacking would hide half of it */
@media (max-width: 900px), (max-height: 600px) {
  .card {
    position: relative;
    top: 0;
  }
}

/* bars on the lilbase card */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--ink-2);
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 7px;
  vertical-align: -1px;
}

.hbars {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.hbar-group > span {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.hbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 18px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.hbar b {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 0 4px 4px 0;
  transition: width 1.2s var(--ease);
  transition-delay: calc(var(--k) * 90ms + 150ms);
}

.live .hbar b,
html:not(.js) .hbar b {
  width: var(--w);
}

.hbar em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.4s ease;
  transition-delay: calc(var(--k) * 90ms + 150ms);
}

.live .hbar em,
html:not(.js) .hbar em {
  opacity: 1;
}

/* chat on the lilchat card */

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  line-height: 1.45;
}

.bubble {
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 20px;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transform-origin: 0 100%;
  transition: opacity 0.4s ease, transform 0.6s var(--ease);
}

.bubble.on,
html:not(.js) .bubble {
  opacity: 1;
  transform: none;
}

.bubble.you {
  align-self: flex-end;
  background: var(--ink);
  color: #fff;
  border-bottom-right-radius: 6px;
  transform-origin: 100% 100%;
}

.bubble.bot {
  align-self: flex-start;
  background: var(--surface);
  border-bottom-left-radius: 6px;
}

.bubble .dots3 {
  display: inline-flex;
  gap: 4px;
  padding: 6px 0;
}

.dots3 i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: hop 1s ease-in-out infinite;
}

.dots3 i:nth-child(2) {
  animation-delay: 0.15s;
}

.dots3 i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes hop {
  0%,
  60%,
  100% {
    transform: none;
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.chat-note {
  align-self: flex-start;
  margin-top: 2px;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.chat-note.on,
html:not(.js) .chat-note {
  opacity: 1;
}

/* paper chart */

.chart {
  position: relative;
  width: 100%;
}

.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart text {
  font-family: var(--sans);
  font-size: 12px;
  fill: var(--ink-3);
}

.chart .ln {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset 1.6s var(--ease);
}

.live .chart .ln,
.chart.in .ln {
  stroke-dashoffset: 0;
}

.chart .pt {
  stroke: var(--bg);
  stroke-width: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.live .chart .pt,
.chart.in .pt {
  opacity: 1;
  transition-delay: calc(var(--k) * 180ms + 400ms);
}

.chart .gap {
  opacity: 0;
  transition: opacity 1s ease 1s;
}

.live .chart .gap,
.chart.in .gap {
  opacity: 1;
}

.chart .endlabel {
  fill: var(--ink-2);
  font-size: 12.5px;
}

.tip {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #0f0f0f;
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 0.2s ease;
  font-variant-numeric: tabular-nums;
}

.tip.on {
  opacity: 1;
}

.tip span {
  color: #9a9a9a;
}

/* playground card */

.mini {
  display: grid;
  gap: 8px;
}

.mini-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  font-size: 14px;
}

.mini-row .track {
  height: 4px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}

.mini-row .track b {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: var(--ink);
  transition: width var(--t) cubic-bezier(0.3, 0.1, 0.3, 1);
  transition-delay: calc(var(--k) * 250ms + 200ms);
}

.live .mini-row .track b,
html:not(.js) .mini-row .track b {
  width: var(--w, 100%);
}

.mini-row .size {
  text-align: right;
  color: var(--ink-3);
  font-size: 13px;
}

.mini-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px;
}

.mini-input span:first-child {
  color: var(--ink);
}

.mini-input .btn {
  --h: 30px;
  padding: 0 14px;
  font-size: 13px;
}

.mini-note {
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 13px;
}

/* sprout card */

.train {
  display: grid;
  gap: 16px;
}

.train-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--ink-2);
}

.train-num {
  font-size: clamp(40px, 4.6vw, 64px);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.train-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.train-track b {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 1.8s var(--ease) 0.2s;
}

.train-track i {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--ink);
}

.live .train-track b,
html:not(.js) .train-track b {
  width: 100%;
}

.train-ticks {
  position: relative;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-3);
}

.train-ticks .mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--ink);
  white-space: nowrap;
}

.mixmini {
  margin-top: 18px;
}

.mixmini-bar {
  display: flex;
  gap: 2px;
  height: 8px;
}

.mixmini-bar b {
  width: var(--w);
  background: var(--c);
}

.mixmini-bar b:first-child {
  border-radius: 4px 0 0 4px;
}

.mixmini-bar b:last-child {
  border-radius: 0 4px 4px 0;
}

.mixmini-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.mixmini-key i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 2px;
}

/* writing */

.writing {
  padding-top: clamp(96px, 16vh, 180px);
}

.posts {
  margin-top: 44px;
}

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  font-size: clamp(19px, 2.1vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

/* the rules between rows draw across as each row arrives */
.area-row::before,
.post-row::before,
.area-row:last-child::after,
.post-row:last-child::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--line);
  transform-origin: 0 50%;
  transition: transform 1.3s var(--ease) calc(var(--d, 0s) + 0.1s);
}

.area-row:last-child::after,
.post-row:last-child::after {
  top: auto;
  bottom: 0;
  transition-delay: calc(var(--d, 0s) + 0.25s);
}

.js .area-row:not(.in)::before,
.js .post-row:not(.in)::before,
.js .area-row:not(.in)::after,
.js .post-row:not(.in)::after {
  transform: scaleX(0);
}

.post-row .t {
  transition: transform 0.6s var(--ease);
}

.post-row:hover .t {
  transform: translateX(10px);
}

.post-row .cap {
  color: var(--ink-3);
}

.rss {
  margin-top: 24px;
  color: var(--ink-3);
}

.rss a {
  color: var(--ink);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
}

@media (max-width: 640px) {
  .post-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 18px 0;
  }

  .post-row .kind {
    display: none;
  }
}

.peek {
  position: fixed;
  z-index: 40;
  left: 0;
  top: 0;
  width: 290px;
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: #0f0f0f;
  pointer-events: none;
  opacity: 0;
  scale: 0.92;
  transform-origin: 0 0;
  transition: opacity 0.25s ease, scale 0.35s var(--ease);
}

.peek.on {
  opacity: 1;
  scale: 1;
}

.peek span {
  display: block;
  color: #9a9a9a;
  font-size: 11.5px;
}

.peek p {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.5;
  color: #e6e6e6;
}

/* playground call out */

.play {
  padding-top: clamp(96px, 16vh, 180px);
}

.play-card {
  --r: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
  padding: clamp(28px, 5vw, 64px);
  background: var(--surface);
}



.play-card .soft {
  margin-top: 20px;
  max-width: 28rem;
}

.play-card .soft + .soft {
  margin-top: 12px;
}

.play-card .soft a {
  color: var(--ink);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease);
}

.play-card .soft a:hover {
  background-size: 0% 1px;
  background-position: 100% 100%;
}

.ask {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  border: 0;
}

.chips label {
  position: relative;
  cursor: pointer;
}

.chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chips span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink-2);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.chips span small {
  font-size: 12px;
  color: var(--ink-3);
  transition: color 0.3s ease;
}

.chips input:checked + span {
  background: var(--ink);
  color: #fff;
}

.chips input:checked + span small {
  color: #8a8a8a;
}

.chips input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  background: var(--bg);
  transition: box-shadow 0.3s ease;
}

.field:focus-within {
  box-shadow: inset 0 0 0 1px var(--ink-3);
}

.field input {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.field input::placeholder {
  color: var(--ink-3);
}

.ask .cap {
  color: var(--ink-3);
}

@media (max-width: 900px) {
  .play-card {
    grid-template-columns: 1fr;
  }
}

@media print {
  .card {
    position: relative;
    top: auto;
    height: auto;
  }
}

/* on phones the models are a row you flick through sideways, with the next one peeking in */
@media (max-width: 700px) {
  .stack {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .stack::-webkit-scrollbar {
    display: none;
  }

  .stack .card {
    position: relative;
    top: auto;
    flex: 0 0 86%;
    scroll-snap-align: start;
  }
}
