@font-face {
  font-family: 'Geist';
  src: url('public/fonts/Geist-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist';
  src: url('public/fonts/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Bloob';
  src: url('public/fonts/bloob-bungo.otf') format('opentype');
  font-display: swap;
}

:root {
  color-scheme: light;
  background: #242022;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Geist', Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

button {
  appearance: none;
}

/* ─── Shell ─────────────────────────────────────────────── */

.shell {
  --cream: #fff7d6;
  --yellow: #ebe72b;
  --pink: #fcbac6;
  --ink: #242022;
  --drawer-text: #453b3c;
  --button-fill: #fdf7d5;
  --stage-scale: calc(100vw / 1728px);
  background: var(--ink);
  color: var(--cream);
  min-height: 100svh;
  overflow: hidden;
  position: relative;
}

.shell::before {
  background: url('public/images/hero-desktop.png') center top / cover no-repeat;
  content: '';
  inset: 0;
  position: fixed;
  z-index: 0;
}

/* ─── Stage ─────────────────────────────────────────────── */

.stage {
  height: 990px;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%) scale(var(--stage-scale));
  transform-origin: top center;
  width: 1728px;
  z-index: 1;
}

/* ─── Background picture ─────────────────────────────────── */

.background {
  display: block;
  inset: 0;
  position: absolute;
  z-index: 0;
}

.background img {
  height: 100%;
  object-fit: cover;
  object-position: center top;
  width: 100%;
}

/* ─── Header ─────────────────────────────────────────────── */

.header {
  align-items: center;
  display: flex;
  gap: 72px;
  left: 95px;
  position: absolute;
  top: 55px;
  z-index: 5;
}

.logo {
  display: block;
  height: 32px;
  position: relative;
  transition: transform 280ms ease;
  width: 122px;
}

.logo:hover {
  transform: rotate(-2deg) scale(1.035);
}

.logo img,
.appStore img {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

/* ─── Nav buttons ────────────────────────────────────────── */

.nav {
  display: flex;
  gap: 8px;
}

.nav button,
.mobileMenu button,
.menuButton {
  cursor: pointer;
}

.nav button,
.mobileMenu button {
  background: transparent;
  border: 1px solid var(--cream);
  border-radius: 12px;
  color: var(--cream);
  font-size: 15px;
  font-weight: 600;
  height: 51px;
  line-height: 1.3;
  overflow: hidden;
  padding: 0 32px;
  position: relative;
  z-index: 0;
  transition:
    border-color 280ms ease,
    color 280ms ease,
    transform 280ms ease;
}

.getButton {
  align-items: center;
  background: var(--yellow);
  border-radius: 12px;
  color: #000;
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  height: 50px;
  justify-content: center;
  line-height: 1.3;
  min-width: 145px;
  overflow: hidden;
  padding: 0 32px;
  position: relative;
  text-decoration: none;
  transition:
    background-color 280ms ease,
    box-shadow 280ms ease,
    transform 280ms ease;
}

.nav button::before,
.mobileMenu button:not(.closeButton)::before,
.getButton::before {
  background: var(--button-fill);
  border-radius: inherit;
  content: '';
  inset: -1px;
  position: absolute;
  transform: translateY(105%) rotate(2deg);
  transform-origin: bottom center;
  transition: transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1);
  z-index: 0;
}

.getButton::before {
  background: var(--pink);
}

.nav button::after,
.mobileMenu button:not(.closeButton)::after,
.getButton::after {
  align-items: center;
  color: var(--ink);
  content: attr(data-label);
  display: flex;
  inset: 0;
  justify-content: center;
  position: absolute;
  transform: translateY(115%) rotateX(-72deg);
  transform-origin: center bottom;
  transition:
    opacity 320ms ease,
    transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1);
  z-index: 1;
}

.nav button span,
.mobileMenu button:not(.closeButton) span,
.getButton span {
  display: block;
  position: relative;
  transition:
    opacity 260ms ease,
    transform 340ms cubic-bezier(0.2, 0.9, 0.2, 1);
  z-index: 1;
}

.nav button:hover,
.mobileMenu button:not(.closeButton):hover,
.nav button:focus-visible,
.mobileMenu button:not(.closeButton):focus-visible {
  border-color: var(--button-fill);
  color: var(--ink);
  transform: translateY(-2px);
}

.nav button:hover::before,
.mobileMenu button:not(.closeButton):hover::before,
.nav button:focus-visible::before,
.mobileMenu button:not(.closeButton):focus-visible::before,
.getButton:hover::before,
.getButton:focus-visible::before {
  transform: translateY(0) rotate(0deg);
}

.nav button:hover span,
.mobileMenu button:not(.closeButton):hover span,
.nav button:focus-visible span,
.mobileMenu button:not(.closeButton):focus-visible span,
.getButton:hover span,
.getButton:focus-visible span {
  opacity: 0;
  transform: translateY(-115%) rotateX(72deg);
}

.nav button:hover::after,
.mobileMenu button:not(.closeButton):hover::after,
.nav button:focus-visible::after,
.mobileMenu button:not(.closeButton):focus-visible::after,
.getButton:hover::after,
.getButton:focus-visible::after {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

.getButton:hover,
.getButton:focus-visible {
  background-color: var(--pink);
  box-shadow: 0 12px 28px rgba(252, 186, 198, 0.26);
  transform: translateY(-2px);
}

.mobileActions {
  display: none;
}

/* ─── Hero ───────────────────────────────────────────────── */

.hero {
  left: 95px;
  position: absolute;
  top: 299px;
  z-index: 2;
}

.hero h1 {
  animation: heroPop 680ms cubic-bezier(0.18, 0.88, 0.28, 1.22) both;
  color: var(--cream);
  font-family: 'Bloob', sans-serif;
  font-size: 120px;
  font-weight: 400;
  line-height: 1;
  margin: 0;
  max-width: 749px;
}

.appStore {
  display: block;
  height: 80px;
  margin-top: 28px;
  position: relative;
  transition:
    filter 260ms ease,
    transform 260ms ease;
  width: 260px;
}

.appStore:hover,
.appStore:focus-visible {
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
  transform: translateY(-3px) rotate(-1deg);
}

/* ─── Chat bubble ────────────────────────────────────────── */

.chatBubble {
  animation: bubbleBob 5.4s ease-in-out infinite;
  color: var(--ink);
  display: flex;
  left: 795px;
  min-height: 56.89px;
  position: absolute;
  top: 659px;
  width: 229px;
  z-index: 3;
}

.chatBubbleLeaving {
  animation: bubbleTextOut 520ms ease both;
}

.bubbleText {
  animation: bubbleTextIn 360ms ease both;
  align-items: center;
  background: var(--pink);
  color: var(--ink);
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  font-size: 16.12px;
  font-weight: 500;
  letter-spacing: -0.08px;
  line-height: 1.083;
  margin: 0 -1px;
  min-height: 56.89px;
  min-width: 0;
  padding: 10px 1px;
  transition: min-height 260ms ease;
}

.bubbleTextValue {
  display: block;
  min-width: 0;
  width: 100%;
}

.typeCursor {
  animation: cursorBlink 900ms steps(2, end) infinite;
  background: currentColor;
  display: inline-block;
  height: 1em;
  margin-left: 2px;
  transform: translateY(0.14em);
  width: 2px;
}

.bubbleSide {
  align-self: stretch;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-height: 56.89px;
}

.bubblePlain {
  background: var(--pink);
  width: 19.65px;
}

.bubbleTail {
  width: 27.93px;
}

.bubbleSide span {
  background: var(--pink);
  flex: 0 0 auto;
  width: 19.65px;
}

.bubbleSide span:first-child,
.bubbleSide span:last-child,
.bubbleTail img {
  height: 28.445px;
}

.bubbleSide span:nth-child(2) {
  flex: 1 1 auto;
  min-height: 0;
}

.bubblePlain span {
  display: none;
}

.bubblePlainLeft {
  border-bottom-left-radius: 51.72px;
  border-top-left-radius: 51.72px;
}

.bubblePlainRight {
  border-bottom-right-radius: 51.72px;
  border-top-right-radius: 51.72px;
}

.bubbleTail span:first-child {
  height: 28.445px;
}

.bubbleTail span:nth-child(2) {
  display: block;
  flex: 1 1 auto;
}

.bubbleTailLeft span {
  margin-left: 8.28px;
}

.bubbleTailLeft span:first-child {
  border-top-left-radius: 51.72px;
}

.bubbleTailRight {
  align-items: flex-start;
}

.bubbleTailRight span:first-child {
  border-top-right-radius: 51.72px;
}

.bubbleTailRight img {
  transform: scaleX(-1);
  transform-origin: center;
}

.bubbleTail img {
  display: block;
  flex: 0 0 auto;
  width: 27.93px;
}

.bubbleTailLeft,
.bubblePlainRight {
  display: none;
}

/* ─── Quote ──────────────────────────────────────────────── */

.quote {
  animation: quoteEnter 720ms 160ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  border-radius: 19px;
  display: flex;
  flex-direction: column;
  gap: 23px;
  left: 1323px;
  padding: 24px 40px;
  position: absolute;
  top: 55px;
  width: 328px;
  z-index: 2;
}

.quoteBorder {
  height: 100%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.quoteBorder rect {
  animation: marchingDashes 34s linear infinite;
  fill: none;
  stroke: var(--yellow);
  stroke-dasharray: 2.3 1.8;
  stroke-dashoffset: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.quote p {
  color: var(--yellow);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  margin: 0;
}

.quote span {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

/* ─── Footer ─────────────────────────────────────────────── */

.footer {
  align-items: center;
  bottom: max(60px, calc(990px - (100svh / var(--stage-scale)) + (42px / var(--stage-scale))));
  display: flex;
  gap: 24px;
  left: 107px;
  position: absolute;
  text-transform: uppercase;
  z-index: 2;
}

.footerMeta {
  align-items: center;
  display: flex;
  gap: 24px;
}

.footer p,
.footer a {
  color: var(--cream);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
}

.footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Overlay layers (drawer + menu) ─────────────────────── */

.drawerLayer,
.menuOverlay {
  display: none;
  inset: 0;
  position: fixed;
  z-index: 20;
}

.drawerLayer.open,
.menuOverlay.open {
  display: block;
}

.drawerBackdrop,
.menuBackdrop {
  background: rgba(0, 0, 0, 0.64);
  border: 0;
  cursor: default;
  inset: 0;
  position: absolute;
}

/* ─── Drawer ─────────────────────────────────────────────── */

.drawer {
  animation: drawerIn 360ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  background: var(--cream);
  color: #000;
  height: 100%;
  overflow-y: auto;
  padding: 90px;
  position: absolute;
  right: 0;
  top: 0;
  width: min(600px, 100vw);
}

.drawer h2 {
  color: var(--drawer-text);
  font-family: 'Bloob', sans-serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 40px;
}

.drawerSections {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 420px;
}

.drawerSection {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawerSection + .drawerSection::before {
  background: rgba(69, 59, 60, 0.5);
  content: '';
  height: 2px;
  margin-bottom: 24px;
  width: 20px;
}

.drawerSection h3,
.drawerSection p {
  font-size: 16px;
  line-height: 1.3;
  margin: 0;
}

.drawerSection h3 {
  font-weight: 600;
}

.drawerSection p {
  font-weight: 500;
}

/* ─── Close button (drawer + mobile menu) ────────────────── */

.closeButton {
  background: transparent;
  border: 0;
  cursor: pointer;
  height: 54px;
  position: absolute;
  right: 35px;
  top: 30px;
  width: 54px;
}

.closeButton span {
  background: var(--drawer-text);
  border-radius: 999px;
  height: 4px;
  left: 10px;
  position: absolute;
  top: 25px;
  width: 42px;
}

.closeButton span:first-child {
  transform: rotate(45deg);
}

.closeButton span:last-child {
  transform: rotate(-45deg);
}

/* ─── Mobile menu ────────────────────────────────────────── */

.mobileMenu {
  animation: drawerIn 300ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  background: var(--cream);
  border-radius: 20px 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 96px 24px 24px;
  position: absolute;
  right: 0;
  top: 0;
  width: min(290px, 82vw);
}

.mobileMenu button:not(.closeButton) {
  border-color: var(--drawer-text);
  color: var(--drawer-text);
  font-size: 20px;
  height: 58px;
  text-align: left;
  width: 100%;
}

.mobileMenu button:not(.closeButton)::before {
  background: var(--drawer-text);
}

.mobileMenu button:not(.closeButton)::after {
  color: var(--cream);
  justify-content: flex-start;
  padding: 0 32px;
}

/* ─── Hamburger button ───────────────────────────────────── */

.menuButton {
  align-items: center;
  background: transparent;
  border: 1px solid var(--cream);
  border-radius: 12px;
  display: none;
  flex-direction: column;
  gap: 3px;
  height: 51px;
  justify-content: center;
  width: 62px;
}

.menuButton span {
  background: var(--cream);
  border-radius: 32px;
  height: 1.5px;
  width: 14px;
}

/* ─── Keyframes ──────────────────────────────────────────── */

@keyframes marchingDashes {
  to { stroke-dashoffset: -100; }
}

@keyframes bubbleBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-5px) rotate(-0.4deg); }
}

@keyframes heroPop {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes quoteEnter {
  from { opacity: 0; transform: translateY(-10px) rotate(0.4deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0deg); }
}

@keyframes drawerIn {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes bubbleTextIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bubbleTextOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

@keyframes cursorBlink {
  0%, 45%  { opacity: 1; }
  46%, 100% { opacity: 0; }
}

/* ─── Reduced motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .shell,
  .shell *,
  .shell *::before,
  .shell *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── Mobile ─────────────────────────────────────────────── */

@media (max-width: 700px) {
  .shell {
    --stage-scale: min(calc(100vw / 390px), calc(100svh / 844px));
    min-height: 844px;
  }

  .shell::before {
    background-image: url('public/images/hero-mobile.png');
    background-position: 80.8% top;
  }

  .stage {
    height: 844px;
    left: 50%;
    top: 0;
    transform: translateX(-50%) scale(var(--stage-scale));
    transform-origin: top center;
    width: 390px;
  }

  .background img {
    object-position: 80.8% top;
  }

  .background {
    display: none;
  }

  .header {
    gap: 0;
    justify-content: space-between;
    left: 20px;
    right: 21px;
    top: 32px;
  }

  .logo {
    height: 25px;
    width: 95px;
  }

  .nav {
    display: none;
  }

  .mobileActions {
    display: flex;
    gap: 8px;
  }

  .mobileActions .getButton {
    min-width: 129px;
    padding: 0 24px;
  }

  .menuButton {
    display: inline-flex;
  }

  .hero {
    left: 17px;
    top: 139px;
  }

  .hero h1 {
    font-size: 56px;
    line-height: 1;
    max-width: 340px;
  }

  .appStore {
    display: none;
  }

  .chatBubble {
    left: min(41vw, 154px);
    top: 361px;
    width: 229px;
  }

  .bubblePlainLeft,
  .bubbleTailRight {
    display: none;
  }

  .bubbleTailLeft,
  .bubblePlainRight {
    display: flex;
  }

  .bubbleText {
    letter-spacing: -0.1px;
    padding: 10px 0;
  }

  .quote {
    gap: 23px;
    left: 26px;
    padding: 24px 38px;
    top: 539px;
    width: min(328px, calc(100vw - 61px));
  }

  .quote p {
    font-size: 18px;
  }

  .footer {
    bottom: 72px;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    left: 26px;
    right: 27px;
  }

  .footerSocial {
    height: 18px;
    order: 2;
    width: 137px;
  }

  .footerMeta {
    align-items: center;
    display: flex;
    gap: 14px;
    order: 1;
    position: relative;
    width: 100%;
    z-index: 3;
  }

  .footer p {
    margin-right: auto;
    min-width: 0;
    white-space: nowrap;
  }

  .drawer {
    padding: 76px 28px 44px;
    width: min(360px, calc(100vw - 30px));
  }

  .drawer h2 {
    font-size: 34px;
    line-height: 1.15;
    margin-bottom: 30px;
  }

  .drawerSections {
    gap: 26px;
    max-width: none;
  }

  .drawerSection + .drawerSection::before {
    margin-bottom: 18px;
  }

  .closeButton {
    right: 16px;
    top: 16px;
  }
}

@media (max-width: 700px) and (max-height: 760px) {
  .shell {
    min-height: 100svh;
  }

  .hero {
    top: 120px;
  }

  .hero h1 {
    font-size: 48px;
    max-width: 330px;
  }

  .chatBubble {
    font-size: 18px;
    top: 316px;
  }

  .quote {
    gap: 16px;
    padding-bottom: 18px;
    padding-top: 18px;
    top: 468px;
  }

  .footer {
    bottom: 18px;
    gap: 16px 14px;
  }
}
