@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2eff1;
  --ink: #1d1a22;
  --muted: #5b5563;
  --rule: #d6d0d6;
  --accent: #a8426a;
  --btn-bg: #1d1a22;
  --btn-ink: #ffffff;
  --band: #e2dce2;
  --frame: #17151b;
  --head: rgba(242, 239, 241, 0.82);
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Theme story page colours (light) */
  --sakura-bg: #fbf1f4;
  --sakura-ink: #2b2233;
  --neko-bg: #f4eee0;
  --neko-ink: #1f2a17;
  --yoru-bg: #141b33;
  --yoru-ink: #f5f1ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151318;
    --ink: #f2eef4;
    --muted: #b3acbb;
    --rule: #34303a;
    --accent: #f2a3c0;
    --btn-bg: #f2eef4;
    --btn-ink: #151318;
    --band: #221f27;
    --frame: #0b0a0d;
    --head: rgba(21, 19, 24, 0.82);
    --sakura-bg: #26191f;
    --sakura-ink: #f8e8ee;
    --neko-bg: #1e2019;
    --neko-ink: #eef0e3;
    --yoru-bg: #0d1327;
  }
}

:root[data-theme="dark"] {
  --bg: #151318;
  --ink: #f2eef4;
  --muted: #b3acbb;
  --rule: #34303a;
  --accent: #f2a3c0;
  --btn-bg: #f2eef4;
  --btn-ink: #151318;
  --band: #221f27;
  --frame: #0b0a0d;
  --head: rgba(21, 19, 24, 0.82);
  --sakura-bg: #26191f;
  --sakura-ink: #f8e8ee;
  --neko-bg: #1e2019;
  --neko-ink: #eef0e3;
  --yoru-bg: #0d1327;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--head);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.top.scrolled {
  border-bottom-color: var(--rule);
}

.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.mark img {
  display: block;
}

/* Buttons */
.pill {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--btn-bg);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.25s var(--ease);
}

a.pill:hover {
  transform: translateY(-2px);
}

.pill-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.pill-soon {
  cursor: default;
}

/* Hero */
.hero {
  overflow-x: clip;
  padding-top: clamp(36px, 7vw, 88px);
}

.hero-title {
  font-size: clamp(2.7rem, 8.4vw, 6.6rem);
  max-width: 12.5ch;
}

.hero-title span {
  display: inline-block;
}

.hero-sub {
  max-width: 46ch;
  margin: 26px 0 28px;
  color: var(--muted);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stage {
  --p: 0;
  margin-top: clamp(48px, 8vw, 96px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.ph-wrap {
  flex: 0 0 auto;
  width: clamp(170px, 25vw, 300px);
}

.ph-wrap + .ph-wrap {
  margin-left: -4%;
}

.ph-wrap .phone {
  transform: translateY(calc(var(--y) - var(--p) * var(--dy))) rotate(calc(var(--r) * (1 + var(--p) * 0.9)));
}

.w1 { --r: -8deg; --y: 24px; --dy: -40px; }
.w2 { --r: 0deg;  --y: -14px; --dy: 90px; position: relative; z-index: 2; }
.w3 { --r: 8deg;  --y: 24px; --dy: -40px; }

.note {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Phone */
.phone {
  position: relative;
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  border: 7px solid var(--frame);
  border-radius: 14% / 6.6%;
  background: var(--frame);
  overflow: hidden;
  box-shadow: 0 30px 50px -28px rgba(23, 21, 27, 0.6);
}

.phone::after {
  content: "";
  position: absolute;
  z-index: 5;
  top: 2.4%;
  left: 50%;
  width: 28%;
  height: 3.2%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--frame);
}

.scr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 16cqw 6.5cqw 7cqw;
  gap: 4.5cqw;
  background: var(--wall) center top / cover no-repeat, var(--page);
  color: var(--ink2);
  font-size: 4.4cqw;
  line-height: 1.3;
}

.t-sakura {
  --wall: url("/img/wall-sakura.webp");
  --page: #fbf1f4;
  --card: rgba(255, 255, 255, 0.94);
  --ink2: #2b2233;
  --sub2: #6e6274;
  --acc: #c73a63;
  --line2: #f1dde4;
  --topink: #2b2233;
}

.t-neko {
  --wall: url("/img/wall-neko.webp");
  --page: #f4eee0;
  --card: #faf6eb;
  --ink2: #1f2a17;
  --sub2: #55584a;
  --acc: #55743c;
  --line2: #e6dfcb;
  --topink: #1f2a17;
}

.t-yoru {
  --wall: url("/img/wall-yoru.webp");
  --page: #141b33;
  --card: #f1ece1;
  --ink2: #14213f;
  --sub2: #5b606c;
  --acc: #1d4272;
  --line2: #e2dbcc;
  --topink: #f5f1ff;
}

.scr-top {
  color: var(--topink);
  display: flex;
  flex-direction: column;
}

.scr-top span {
  font-size: 3.8cqw;
  opacity: 0.8;
}

.scr-top b {
  font-size: 10cqw;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.scr-total,
.scr-list,
.scr-bill {
  background: var(--card);
  border-radius: 6cqw;
  box-shadow: 0 2cqw 6cqw -3cqw rgba(20, 16, 30, 0.35);
}

.scr-total {
  position: relative;
  margin-top: 18cqw;
  padding: 5cqw 6cqw;
  display: flex;
  flex-direction: column;
}

.scr-total small {
  color: var(--sub2);
  font-size: 3.8cqw;
}

.scr-total strong {
  font-size: 11cqw;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--acc);
  line-height: 1.1;
}

.cat {
  position: absolute;
  pointer-events: none;
}

.cat-neko {
  width: 60cqw;
  right: 3cqw;
  bottom: calc(100% - 1.2cqw);
}

.cat-yoru {
  width: 58cqw;
  right: -3cqw;
  bottom: calc(100% - 7cqw);
}

.scr-list {
  margin: 0;
  padding: 1.5cqw 6cqw;
  list-style: none;
}

.scr-list li {
  display: flex;
  justify-content: space-between;
  padding: 3cqw 0;
  border-bottom: 1px solid var(--line2);
}

.scr-list li:last-child {
  border-bottom: 0;
}

.scr-list b,
.scr-bill b {
  font-weight: 600;
}

.scr-bill {
  margin-top: auto;
  padding: 4cqw 6cqw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 2.2cqw solid var(--acc);
}

.scr-bill small {
  display: block;
  color: var(--sub2);
  font-size: 3.6cqw;
}

/* Sections */
.section {
  padding-top: clamp(96px, 14vw, 180px);
}

.section h2 {
  font-size: clamp(2.1rem, 5.4vw, 4rem);
}

.read {
  margin: 28px 0 0;
  max-width: 24ch;
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.16;
}

.read .w {
  transition: opacity 0.2s linear;
}

/* Theme story */
.story {
  --sbg: var(--sakura-bg);
  --sink: var(--sakura-ink);
  position: relative;
  overflow: clip;
  margin-top: clamp(96px, 14vw, 180px);
  background: var(--sbg);
  color: var(--sink);
  transition: background-color 0.9s var(--ease), color 0.9s var(--ease);
}

.story[data-theme="neko"] {
  --sbg: var(--neko-bg);
  --sink: var(--neko-ink);
}

.story[data-theme="yoru"] {
  --sbg: var(--yoru-bg);
  --sink: var(--yoru-ink);
}

.story-fx {
  position: sticky;
  top: 0;
  height: 100vh;
  margin-bottom: -100vh;
  overflow: hidden;
  pointer-events: none;
}

.fx-petals,
.fx-flies {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s;
}

.story[data-theme="sakura"] .fx-petals,
.story[data-theme="neko"] .fx-petals,
.story[data-theme="yoru"] .fx-flies {
  opacity: 1;
}

.petal {
  position: absolute;
  top: -5%;
  left: var(--x);
  width: calc(14px * var(--s));
  height: calc(10px * var(--s));
  background: #f5a9be;
  border-radius: 80% 0 80% 0;
  opacity: 0.85;
  animation: fall 13s linear var(--d) infinite;
}

.fly {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffc86b;
  box-shadow: 0 0 12px 4px rgba(255, 200, 107, 0.55);
  animation: glow 4.5s ease-in-out var(--d) infinite;
}

@keyframes fall {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(40px, 55vh) rotate(200deg); }
  100% { transform: translate(-20px, 112vh) rotate(380deg); }
}

@keyframes glow {
  0%, 100% { opacity: 0.15; transform: translate(0, 0); }
  50% { opacity: 1; transform: translate(14px, -18px); }
}

.story-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  padding-top: clamp(72px, 10vw, 120px);
  padding-bottom: clamp(48px, 8vw, 96px);
}

.story-title {
  font-size: clamp(2.1rem, 5.4vw, 4rem);
}

.story-stage {
  position: sticky;
  top: 84px;
  z-index: 2;
  justify-self: center;
  width: min(44vw, 230px);
  margin-top: 32px;
}

.story-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 0.8125rem;
}

.story-dots span {
  opacity: 0.45;
  transition: opacity 0.4s;
}

.story[data-theme="sakura"] [data-for="sakura"],
.story[data-theme="neko"] [data-for="neko"],
.story[data-theme="yoru"] [data-for="yoru"] {
  opacity: 1;
  font-weight: 600;
}

.layer {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease);
}

.story[data-theme="sakura"] .layer.t-sakura,
.story[data-theme="neko"] .layer.t-neko,
.story[data-theme="yoru"] .layer.t-yoru {
  opacity: 1;
  transform: none;
}

.layer .cat {
  transform: translateY(14%);
  opacity: 0;
  transition: transform 0.8s var(--ease) 0.25s, opacity 0.6s 0.25s;
}

.story[data-theme="neko"] .layer.t-neko .cat,
.story[data-theme="yoru"] .layer.t-yoru .cat {
  transform: none;
  opacity: 1;
}

.panel {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 8vh;
}

.panel h3 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}

.panel p {
  margin: 14px 0 0;
  max-width: 30ch;
  font-size: clamp(1.0625rem, 2vw, 1.3rem);
  opacity: 0.82;
}

/* Features */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

.lede {
  margin: 20px 0 26px;
  color: var(--muted);
  max-width: 40ch;
}

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.rows li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.rows strong {
  font-weight: 500;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.rows span {
  color: var(--muted);
}

.hello a {
  display: inline-block;
  margin-top: 18px;
  font-size: clamp(1.5rem, 4.6vw, 2.8rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration-thickness: 1.5px;
}

/* Wordmark band */
.band {
  --p: 1;
  margin-top: clamp(96px, 14vw, 180px);
  margin-bottom: 22px;
  height: clamp(60px, 15vw, 190px);
  overflow: hidden;
  user-select: none;
}

.band .word {
  display: flex;
  font-size: clamp(5rem, 24vw, 19rem);
  line-height: 0.9;
  font-weight: 600;
  letter-spacing: -0.06em;
  color: var(--band);
  white-space: nowrap;
  margin-left: -0.04em;
}

.band i {
  font-style: normal;
  display: block;
  transform: translateY(calc((1 - clamp(0, var(--p) * 1.7 - var(--i) * 0.1, 1)) * 105%));
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 36px;
  color: var(--muted);
  font-size: 0.9375rem;
  border-top: 1px solid var(--rule);
}

.foot nav {
  display: flex;
  gap: 20px;
}

/* Legal pages */
.doc {
  max-width: 46rem;
  padding-top: clamp(28px, 6vw, 72px);
}

.doc h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
}

.doc .stamp {
  color: var(--muted);
  margin: 18px 0 40px;
}

.doc h2 {
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  margin: 48px 0 12px;
  letter-spacing: -0.025em;
  font-weight: 400;
}

.doc p,
.doc li {
  max-width: 64ch;
}

.doc ul {
  padding-left: 1.2rem;
}

.doc li + li {
  margin-top: 8px;
}

.lost {
  padding-top: clamp(56px, 12vw, 140px);
  padding-bottom: 80px;
}

.lost h1 {
  font-size: clamp(4rem, 16vw, 11rem);
  font-weight: 200;
}

/* Wider screens */
@media (min-width: 860px) {
  .split {
    grid-template-columns: 5fr 6fr;
    gap: 72px;
  }

  .rows li {
    grid-template-columns: 8rem 1fr;
  }

  .story-grid {
    grid-template-columns: 6fr 5fr;
    column-gap: 64px;
  }

  .story-title {
    grid-column: 1 / -1;
  }

  .story-stage {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    --pw: min(25vw, 280px, calc((100vh - 170px) / 2.2));
    top: calc(50vh - var(--pw) * 1.08 + 10px);
    width: var(--pw);
    margin-top: 0;
  }

  .story-text {
    grid-column: 1;
    grid-row: 2;
  }

  .panel {
    min-height: 92vh;
    justify-content: center;
    padding-bottom: 0;
  }
}

@media (max-width: 700px) {
  .ph-wrap {
    width: min(36vw, 200px);
  }

  .ph-wrap + .ph-wrap {
    margin-left: -7%;
  }

  .story-stage {
    width: min(38vw, 190px);
  }

  .cap {
    position: relative;
    z-index: 3;
    padding: 18px 20px 20px;
    border-radius: 22px;
    background: var(--sbg);
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.45);
    transition: background-color 0.9s var(--ease);
  }

  .panel {
    min-height: 76vh;
    padding-bottom: 5vh;
  }
}

/* Motion. Everything is visible without scripts; with scripts we choreograph it. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-title span {
    animation: rise 0.9s var(--ease) both;
  }

  .js .hero-title span + span {
    animation-delay: 0.1s;
  }

  .js .hero-sub,
  .js .actions {
    animation: rise 0.9s var(--ease) 0.2s both;
  }

  .js .ph-wrap {
    animation: deal 1.1s var(--ease) both;
  }

  .js .w1 { animation-delay: 0.35s; }
  .js .w2 { animation-delay: 0.45s; }
  .js .w3 { animation-delay: 0.55s; }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  }

  .js .rows [data-reveal]:nth-child(2) { transition-delay: 0.06s; }
  .js .rows [data-reveal]:nth-child(3) { transition-delay: 0.12s; }
  .js .rows [data-reveal]:nth-child(4) { transition-delay: 0.18s; }
  .js .rows [data-reveal]:nth-child(5) { transition-delay: 0.24s; }

  .js [data-reveal].in {
    opacity: 1;
    transform: none;
  }

  .js .panel h3,
  .js .panel p {
    opacity: 0.25;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }

  .js .panel.on h3,
  .js .panel.on p {
    opacity: 1;
    transform: none;
  }

  .js .panel.on p {
    opacity: 0.82;
  }
}

@media (prefers-reduced-motion: reduce) {
  .petal,
  .fly {
    animation: none;
  }

  .band i,
  .ph-wrap .phone {
    transform: none;
  }

  .ph-wrap .phone {
    rotate: var(--r);
  }

  .layer,
  .layer .cat {
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
}

@keyframes deal {
  from {
    opacity: 0;
    transform: translateY(120px) rotate(0deg) scale(0.92);
  }
}
