:root {
  --bg: #f7f7f6;
  --fg: #111111;
  --sub: #6b6b6b;
  --line: #dddddb;
  --card: #ededed;
  --col: 140px;
  --col-gap: 40px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.76, 0, .24, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f0f0f;
  --fg: #f2f2f0;
  --sub: #9a9a98;
  --line: #2a2a2a;
  --card: #1a1a1a;
  color-scheme: dark;
}

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

/* ---------- Rules ---------- */
@property --rule-a { syntax: '<number>'; inherits: true; initial-value: 1; }
:root {
  --rule-a: 1;
  --ui-line: color-mix(in srgb, var(--sub) 55%, var(--bg));
  transition: --rule-a .25s ease;
}
.rule-top,
.rule-bottom {
  background-image: linear-gradient(
    color-mix(in srgb, var(--line) calc(var(--rule-a) * 100%), transparent),
    color-mix(in srgb, var(--line) calc(var(--rule-a) * 100%), transparent));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-origin: border-box;
}
.rule-top    { border-top: 1px solid transparent;    background-position: 0 0; }
.rule-bottom { border-bottom: 1px solid transparent; background-position: 0 100%; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  font-family: 'Helvetica Neue', 'Instrument Sans', Helvetica, Arial, 'Yu Gothic Medium', '游ゴシック Medium', YuGothic, '游ゴシック体', 'Yu Gothic', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
  transition: background-color .3s, color .3s;
}

a { color: inherit; text-decoration: none; transition: opacity .2s; }
a:not(.has-roll):hover { opacity: .6; }

h1, h2, h3, p, dl, dd { margin: 0; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

.icon {
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  flex: none;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header ---------- */

:root { --header-h: 66px; }
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  max-width: 960px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header + .hero { margin-top: var(--header-h); }

.header-blur {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 128px;
  z-index: 9;
  pointer-events: none;
}
.header-blur > * {
  position: absolute;
  inset: 0;
}
.header-blur > i {
  -webkit-backdrop-filter: blur(var(--b));
  backdrop-filter: blur(var(--b));
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent var(--m));
  mask-image: linear-gradient(to bottom, #000, transparent var(--m));
}
.header-blur > i:nth-child(1) { --b: 1px;  --m: 100%; }
.header-blur > i:nth-child(2) { --b: 2px;  --m: 85%; }
.header-blur > i:nth-child(3) { --b: 4px;  --m: 70%; }
.header-blur > i:nth-child(4) { --b: 8px;  --m: 55%; }
.header-blur > i:nth-child(5) { --b: 16px; --m: 40%; }
.header-blur > b {
  background: var(--bg);
  opacity: .92;
  --fade: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.997) 6.25%, rgba(0,0,0,.983) 12.5%, rgba(0,0,0,.956) 18.75%, rgba(0,0,0,.914) 25%, rgba(0,0,0,.856) 31.25%, rgba(0,0,0,.783) 37.5%, rgba(0,0,0,.697) 43.75%, rgba(0,0,0,.601) 50%, rgba(0,0,0,.498) 56.25%, rgba(0,0,0,.393) 62.5%, rgba(0,0,0,.29) 68.75%, rgba(0,0,0,.196) 75%, rgba(0,0,0,.115) 81.25%, rgba(0,0,0,.053) 87.5%, rgba(0,0,0,.014) 93.75%, transparent 100%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .12 0 0 0 .9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-mask-image: var(--fade), var(--grain);
  mask-image: var(--fade), var(--grain);
  -webkit-mask-size: 100% 100%, 128px 128px;
  mask-size: 100% 100%, 128px 128px;
  -webkit-mask-repeat: no-repeat, repeat;
  mask-repeat: no-repeat, repeat;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  transition: background-color .3s;
}

.logo { display: block; color: var(--fg); }
.logo svg {
  display: block;
  width: 26px;
  height: 30px;
  fill: currentColor;
}

.controls {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  letter-spacing: .02em;
}

.lang { display: flex; align-items: center; gap: 6px; }
.lang-sep { color: color-mix(in srgb, var(--ui-line) calc(var(--rule-a) * 100%), transparent); }
.lang-btn {
  color: var(--sub);
  padding: 4px 2px;
  transition: color .2s;
}
.lang-btn:hover { color: var(--fg); }
.lang-btn[aria-pressed="true"] { color: var(--fg); font-weight: 500; }

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-track {
  position: relative;
  width: 40px;
  height: 22px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  transition: border-color .3s;
}
.theme-toggle:hover .theme-track { border-color: var(--fg); }

.theme-moon {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fg);
  overflow: hidden;
  transition: transform .6s var(--ease-out), background-color .3s;
}

.theme-moon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bg);
  transform: translate(110%, -110%);
  transition: transform .6s var(--ease-out) .08s, background-color .3s;
}

.theme-toggle[aria-checked="true"] .theme-moon { transform: translateX(18px) rotate(-20deg); }
.theme-toggle[aria-checked="true"] .theme-moon::after { transform: translate(38%, -18%); }

.theme-label { min-width: 2.6em; text-align: left; }

/* ---------- Hero ---------- */

.hero {
  padding: 112px 0 96px;
  text-align: center;
}

.hero-name {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(32px, 9vw, 104px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: .95;
  white-space: nowrap;
  position: relative;
  left: -.04em;
}

.mask {
  display: block;
  overflow: hidden;
  padding: .08em .04em .14em;
  margin: -.08em -.04em -.14em;
}
.mask-inner {
  display: block;
  transform: translateY(110%);
  animation: rise .7s var(--ease-out) .1s forwards;
}
.mask-inner--late { animation-delay: .17s; }

.avatar {
  display: block;
  flex: none;
  width: 0;
  height: 1.2em;
  margin: 0 .04em 0 .1em;
  animation: open-gap .55s var(--ease-inout) .6s forwards;
}
.avatar-face {
  display: block;
  width: 1.2em;
  height: 1.2em;
  margin-left: -.6em;
  position: relative;
  left: 50%;
  transform: scale(0);
  animation: pop .6s var(--ease-out) .85s forwards;
}
.avatar-spin {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
}
.avatar-spin img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-surprised { opacity: 0; }
.avatar.is-surprised .avatar-surprised { opacity: 1; }

.avatar {
  position: relative;
  z-index: 6;
  -webkit-tap-highlight-color: transparent;
  transition: transform .45s var(--ease-out);
}
.avatar.egg-ready { cursor: pointer; }
@media (hover: hover) {
  .avatar.egg-ready:hover { transform: scale(1.07); }
}

.emoji-burst {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.emoji-burst > span {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 1;
  will-change: transform, opacity;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.emoji-burst > span.is-grabbed { cursor: grabbing; }

@keyframes rise { to { transform: translateY(0); } }
@keyframes open-gap { to { width: 1.2em; } }
@keyframes pop { to { transform: scale(1); } }

.hero-role {
  margin-top: 28px;
  font-size: 14px;
  color: var(--sub);
  letter-spacing: .02em;
}

/* ---------- Intro ---------- */

:root.intro-center,
:root.intro-hide { overflow: hidden; }
html { scrollbar-gutter: stable; }

:root.intro-center .hero-name { transform: translateY(var(--intro-y, 0)); }
.hero-name.settling { transition: transform .8s var(--ease-inout); }

:root.intro-hide { --rule-a: 0; }

:root.intro-hide :is(.logo, .controls, .hero-role, .label, .about-text, .timeline dt, .timeline dd, .links, .request, .card, .footer span, .peek) {
  opacity: 0;
}

.ln {
  display: block;
  overflow: hidden;
  padding: .12em 0 .2em;
  margin: -.12em 0 -.2em;
}
.ln-i { display: block; white-space: nowrap; }
:root.reveal .ln-i {
  animation: line-rise .8s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes line-rise { from { transform: translateY(110%); } }

:root.reveal .r-rise {
  animation: mask-rise .8s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes mask-rise {
  from { transform: translateY(100%); clip-path: inset(-100% -8px 100% -8px); }
  to   { transform: translateY(0);    clip-path: inset(0 -8px 0 -8px); }
}

:root.reveal .r-fade {
  animation: soft-rise .9s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes soft-rise { from { transform: translateY(32px); opacity: 0; } }

/* ---------- Hover roll ---------- */

.roll {
  position: relative;
  display: inline-flex;
  vertical-align: top;
  overflow: hidden;
  padding: .04em 0;
  margin: -.04em 0;
}
.roll-track {
  position: relative;
  display: inline-flex;
}
.roll-a,
.roll-b { display: inline-flex; align-items: center; }
.roll-b {
  position: absolute;
  top: calc(100% + .06em);
  left: 0;
}
.is-rolling .roll-track { animation: roll .6s var(--ease-out); }
@keyframes roll { to { transform: translateY(calc(-100% - .06em)); } }

/* ---------- Sections ---------- */

.label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.about {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 40px var(--col-gap);
  padding: 72px 0;
}
.about .label { flex: 0 0 var(--col); }

.about-body {
  flex: 1 1 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.about-text { font-size: 16px; line-height: 2; text-wrap: pretty; }
:root[lang="en"] .about-text { line-height: 1.8; }

.timeline { font-size: 14px; }
.timeline-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 14px 0;
}
.timeline dt { color: var(--sub); }
:root[lang="ja"] .timeline-row { align-items: baseline; }

:root[lang="ja"] [data-i18n]:not(.hero-role) { letter-spacing: .04em; word-break: auto-phrase; }

.links { display: flex; align-items: center; gap: 28px; }

.sns {
  display: block;
  padding: 4px;
  margin: -4px;
}
.sns svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.sns[aria-label="note"] svg { width: 16px; height: 16px; margin: 2px; }

.cta.request {
  align-self: flex-start;
  background: none;
  color: var(--fg);
  border: 1px solid var(--fg);
  padding: 13px 19px 13px 23px;
}

.featured {
  padding: 72px 0;
  container-type: inline-size;
}
.featured .label { margin-bottom: 40px; }

.card {
  --pad: clamp(24px, 5vw, 56px);
  background: var(--card);
  border-radius: 24px;
  padding: var(--pad) var(--pad) 0;
  display: grid;
  grid-template-columns: fit-content(340px) minmax(0, 340px);
  justify-content: center;
  gap: clamp(40px, 6vw, 72px);
  overflow: hidden;
  transition: background-color .3s;
}

.card-head {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  padding-bottom: var(--pad);
}

.device {
  display: block;
  align-self: end;
  width: 100%;
  height: auto;
}

.app { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.app > div { display: contents; }
.app-icon {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.app-name {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1;
}
.app-desc { flex-basis: 100%; margin-top: 12px; font-size: 15px; line-height: 1.7; color: var(--sub); }

.cards {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.card-sm {
  grid-template-columns: fit-content(340px) minmax(0, 360px);
  padding-bottom: var(--pad);
}
.card-sm .card-head { padding-bottom: 0; }
.shot {
  display: block;
  align-self: center;
  width: 100%;
  height: auto;
}

.cta {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--fg);
  color: var(--bg);
  padding: 14px 20px 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Finale ---------- */

.finale {
  --rw: clamp(160px, 30vw, 340px);
  --rh: calc(var(--rw) * 663.04 / 578.68);
  position: relative;
  overflow: hidden;
}

.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding-top: 32px;
  padding-bottom: 32px;
  font-size: 12px;
  color: var(--sub);
  line-height: 1.6;
}
.footer span:last-child { text-align: right; }
.footer .sp { display: none; }

.peek {
  display: flex;
  justify-content: center;
  height: calc(var(--rh) * .62);
  margin-top: calc(var(--rw) * -.1);
}

.rabbit {
  display: block;
  flex: none;
  width: var(--rw);
  height: var(--rh);
  transform: translateY(calc((1 - var(--p, 1)) * 55%));
  will-change: transform;
}
.rabbit-line { fill: var(--fg); transition: fill .3s; }

@container (max-width: 740px) {
  .card { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: calc(var(--pad) + 20px); }
  .card-head { align-items: center; text-align: center; gap: 24px; padding-bottom: 0; }
  .app { justify-content: center; gap: 0 10px; }
  .app-icon { width: 32px; height: 32px; border-radius: 8px; }
  .device { justify-self: center; width: min(78%, 300px); }
}

@container (min-width: 741px) {
  .shot { height: 280px; object-fit: contain; }
  .shot-tall { height: 305px; margin-block: -12.5px; }
}

@container (max-width: 740px) {
  .shot { justify-self: center; width: min(100%, 420px); }
}

/* ---------- Squircle ---------- */

@supports (corner-shape: squircle) {
  .app-icon  { border-radius: 19px; corner-shape: squircle; }
  @container (max-width: 740px) { .app-icon { border-radius: 14px; } }
  .card      { border-radius: clamp(44px, 7vw, 54px); corner-shape: squircle; }
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .header { padding: 0 16px; }
  .header-blur { height: 96px; }
  .hero { padding: 88px 0 72px; }
  .hero-name { font-size: min(calc((100vw - 32px) / 8.2), 54px); }
  .hero-role { margin-top: 20px; font-size: 12px; }
  .controls { gap: 14px; }
  .timeline-row { grid-template-columns: 64px 1fr; }
  .about-text br { display: none; }
  .footer .sp { display: inline; }
  .rabbit { transform: translateY(45%); transition: transform 1s var(--ease-out); }
  .finale.is-visible .rabbit { transform: none; }
  :root[lang="ja"] .about-text { word-break: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .mask-inner, .avatar, .avatar-face { animation-duration: .01s; animation-delay: 0s; }
  .theme-moon, .theme-moon::after, .rabbit { transition-duration: .01s; }
  :root { transition-duration: .01s; }
}
