:root {
  --bg-a: #fff8df;
  --bg-b: #ffd8e8;
  --bg-c: #bff7ee;
  --ink: #30203f;
  --muted: #755f86;
  --card: rgba(255, 255, 255, 0.72);
  --card-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(98, 52, 132, 0.14);
  --sun: #ffb703;
  --pink: #ff5c9f;
  --mint: #26c6a4;
  --blue: #4776ff;
  --shadow: 0 24px 70px rgba(112, 61, 145, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-a);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 183, 3, 0.34), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(38, 198, 164, 0.28), transparent 24%),
    radial-gradient(circle at 50% 92%, rgba(255, 92, 159, 0.24), transparent 34%),
    linear-gradient(135deg, var(--bg-a), var(--bg-b) 52%, var(--bg-c));
  color: var(--ink);
  font-family:
    ui-rounded, "PingFang SC", "Microsoft YaHei UI", "Segoe UI", system-ui,
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.26) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

#joyCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    0
    max(28px, env(safe-area-inset-bottom));
}

.hero {
  min-height: calc(100vh - 46px);
  min-height: calc(100svh - 46px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.58)),
    radial-gradient(circle at 78% 72%, rgba(255, 183, 3, 0.2), transparent 34%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(16px, 3vw, 26px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--sun), #ff7aa8);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(255, 92, 159, 0.28);
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-content {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(18px, 6vw, 74px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(58px, 13vw, 148px);
  line-height: 0.92;
  letter-spacing: 0;
  text-wrap: balance;
  background: linear-gradient(90deg, #ff7a3d, var(--pink), var(--blue), var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 14px 24px rgba(255, 92, 159, 0.18));
}

.lead {
  width: min(720px, 100%);
  margin-bottom: 28px;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 26px);
  line-height: 1.62;
  text-wrap: balance;
}

.action-row,
.mood-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

button:hover {
  transform: translateY(-2px);
}

.primary-button {
  background: linear-gradient(135deg, #ffcf33, #ff6fa9);
  color: #fff;
  box-shadow: 0 18px 34px rgba(255, 92, 159, 0.32);
}

.soft-button,
.mood-buttons button {
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 14px 32px rgba(93, 63, 128, 0.1);
}

.small {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
}

.joy-card {
  width: min(720px, 100%);
  margin-top: 28px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 26px;
  background: var(--card-strong);
  box-shadow: 0 18px 46px rgba(97, 56, 130, 0.12);
}

.joy-card span {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(38, 198, 164, 0.13);
  color: #11836e;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 12px;
}

.joy-card p {
  margin: 0;
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 900;
  line-height: 1.32;
  text-wrap: balance;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.mini-card,
.mood-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 18px 48px rgba(97, 56, 130, 0.1);
  backdrop-filter: blur(16px);
}

.mini-card {
  min-height: 210px;
  padding: 24px;
}

.mini-card span {
  color: var(--pink);
  font-weight: 900;
}

.mini-card h2 {
  margin: 12px 0 10px;
  font-size: 24px;
}

.mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.mood-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 24px;
}

.mood-panel h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 40px);
}

body[data-mood="calm"] {
  --bg-a: #e8fff8;
  --bg-b: #d9efff;
  --bg-c: #fff1c6;
  --pink: #2da7c7;
  --blue: #3f8cff;
  --mint: #22b991;
}

body[data-mood="brave"] {
  --bg-a: #fff1d8;
  --bg-b: #ffd6d6;
  --bg-c: #d6e5ff;
  --pink: #ff4f73;
  --blue: #5a66ff;
  --mint: #ff9f1c;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 560px);
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .hero {
    min-height: calc(100svh - 20px);
    border-radius: 22px;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    font-size: 23px;
  }

  .brand small {
    max-width: 190px;
  }

  .small {
    min-height: 38px;
    padding: 0 12px;
  }

  .hero-content {
    align-content: start;
    padding: 18px 16px 22px;
  }

  .eyebrow {
    margin-bottom: 8px;
  }

  h1 {
    margin-bottom: 10px;
    font-size: clamp(48px, 18vw, 82px);
  }

  .lead {
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.52;
  }

  .action-row,
  .mood-buttons {
    width: 100%;
  }

  .action-row button,
  .mood-buttons button {
    width: 100%;
  }

  .joy-card {
    margin-top: 16px;
    padding: 18px;
    border-radius: 20px;
  }

  .joy-card p {
    font-size: clamp(21px, 7vw, 30px);
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .mini-card {
    min-height: 0;
    padding: 20px;
  }

  .mood-panel {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }
}

@media (max-width: 390px) {
  .topbar {
    gap: 10px;
  }

  .brand small {
    display: none;
  }

  .lead {
    font-size: 15px;
  }
}
