:root {
  --ink: #111015;
  --paper: #eaf8ff;
  --sky: #9edfff;
  --sky-soft: #ddf6ff;
  --lavender: #9d82ed;
  --green: #38bc54;
  --pink: #f4a4ea;
  --coral: #ff4778;
  --sun: #ffd85f;
  --line: rgba(17, 16, 21, 0.14);
  --shadow: 0 22px 64px rgba(17, 16, 21, 0.18);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #b9ebff;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

body.is-locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.access-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  min-height: 100svh;
  overflow: hidden;
  background: var(--sky);
}

.band {
  position: absolute;
  inset-inline: 0;
  z-index: -1;
}

.band-top {
  top: 0;
  height: 36%;
  background: #86d4ff;
}

.band-middle {
  top: 36%;
  height: 32%;
  border-block: 10px solid rgba(255, 255, 255, 0.5);
  background: #b9eaff;
}

.band-bottom {
  bottom: 0;
  height: 32%;
  background: #e5f7ff;
}

.access-panel {
  width: min(92vw, 520px);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: popIn 700ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tiny-label {
  margin: 0 0 10px;
  color: rgba(17, 16, 21, 0.62);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.access-panel h1,
.yo-section h1 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0;
}

.access-panel h1 {
  font-size: clamp(2rem, 7vw, 3rem);
}

.access-panel p:not(.tiny-label):not(.access-error) {
  margin: 16px 0 24px;
  color: rgba(17, 16, 21, 0.68);
}

.access-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 850;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.password-row input {
  min-width: 0;
  width: 100%;
  padding: 14px 15px;
  border: 2px solid rgba(17, 16, 21, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  outline: 0;
}

.password-row input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 71, 120, 0.16);
}

button {
  min-height: 42px;
  border: 1px solid rgba(17, 16, 21, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  font-weight: 900;
}

button:hover {
  background: rgba(17, 16, 21, 0.08);
}

.password-row button {
  padding: 12px 18px;
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.access-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: #9d1841;
  font-weight: 850;
}

.app {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(255, 255, 255, 0.86) 0 48px, transparent 49px),
    radial-gradient(ellipse at 23% 19%, rgba(255, 255, 255, 0.78) 0 74px, transparent 75px),
    radial-gradient(ellipse at 76% 15%, rgba(255, 255, 255, 0.7) 0 92px, transparent 93px),
    radial-gradient(ellipse at 83% 17%, rgba(255, 255, 255, 0.62) 0 58px, transparent 59px),
    linear-gradient(180deg, #eefbff 0%, #bdefff 33%, #8fd8ff 72%, #77c9f2 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  animation: skyBreathe 16s ease-in-out infinite alternate;
}

.app::before,
.app::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  filter: blur(1px);
}

.app::before {
  top: 150px;
  left: -70px;
  width: 560px;
  height: 230px;
  opacity: 0.78;
  background:
    radial-gradient(ellipse at 18% 58%, #ffffff 0 62px, transparent 63px),
    radial-gradient(ellipse at 34% 46%, #ffffff 0 92px, transparent 93px),
    radial-gradient(ellipse at 54% 58%, #ffffff 0 70px, transparent 71px),
    radial-gradient(ellipse at 74% 52%, #ffffff 0 52px, transparent 53px);
  animation: cloudDrift 28s ease-in-out infinite alternate;
}

.app::after {
  right: -120px;
  bottom: 190px;
  width: 640px;
  height: 260px;
  opacity: 0.56;
  background:
    radial-gradient(ellipse at 22% 56%, #ffffff 0 70px, transparent 71px),
    radial-gradient(ellipse at 42% 44%, #ffffff 0 105px, transparent 106px),
    radial-gradient(ellipse at 66% 58%, #ffffff 0 82px, transparent 83px),
    radial-gradient(ellipse at 84% 50%, #ffffff 0 56px, transparent 57px);
  animation: cloudDriftReverse 34s ease-in-out infinite alternate;
}

.yo-section {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 42px 0 22px;
}

.yo-section h1 {
  font-size: clamp(3.4rem, 13vw, 8.5rem);
  font-weight: 950;
  animation: yoFloat 4.8s ease-in-out infinite;
}

.moments-section {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 0 0 92px;
}

.moments-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  isolation: isolate;
}

.moment-card {
  position: relative;
  z-index: 2;
  margin: 0;
  opacity: 0;
  transform: translateY(34px) scale(0.94) rotate(var(--start-rotate, -1deg));
  filter: blur(8px);
  transition:
    opacity 720ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 720ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 720ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0ms);
}

.moment-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(var(--rotate, 0deg));
  filter: blur(0);
}

.chat-shot {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  padding: 92px 16px 62px;
  border: 8px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.8) 0 52px, transparent 53px),
    linear-gradient(145deg, #f4fbff, #dff4ff 48%, #eef9ff);
  box-shadow: 0 24px 54px rgba(42, 112, 153, 0.24);
  transition:
    transform 260ms ease,
    box-shadow 260ms ease;
}

.moment-card.is-visible .chat-shot {
  animation: cardFloat 7s ease-in-out infinite;
  animation-delay: var(--delay, 0ms);
}

.shot-header {
  position: absolute;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  height: 82px;
  padding: 22px 18px 12px;
  border-bottom: 1px solid rgba(80, 115, 136, 0.16);
  background: rgba(255, 255, 255, 0.92);
}

.shot-header::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 50%;
  width: 96px;
  height: 16px;
  border-radius: 999px;
  background: #111015;
  transform: translateX(-50%);
  opacity: 0.9;
}

.shot-avatar {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(17, 16, 21, 0.16);
}

.shot-meta {
  min-width: 0;
  padding-top: 3px;
}

.shot-time {
  display: block;
  font-size: 0.78rem;
  font-weight: 950;
}

.shot-online {
  display: block;
  color: rgba(17, 16, 21, 0.48);
  font-size: 0.66rem;
  font-weight: 850;
}

.shot-dots {
  color: rgba(17, 16, 21, 0.48);
  font-size: 1.3rem;
  font-weight: 950;
  letter-spacing: 1px;
}

.shot-messages {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow: hidden;
}

.shot-date {
  align-self: center;
  max-width: 88%;
  margin: -2px 0 2px;
  padding: 5px 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  background: rgba(80, 115, 136, 0.28);
  color: rgba(17, 16, 21, 0.72);
  box-shadow:
    0 8px 20px rgba(42, 112, 153, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(10px);
  font-size: clamp(0.58rem, 0.72vw, 0.75rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.chat-bubble-dom {
  width: fit-content;
  max-width: 84%;
  margin: 0;
  padding: 8px 11px 9px;
  border: 1px solid rgba(17, 16, 21, 0.08);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 255, 0.96));
  box-shadow:
    0 9px 18px rgba(17, 16, 21, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  color: #111015;
  font-size: clamp(0.64rem, 0.78vw, 0.86rem);
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.chat-bubble-dom.me {
  align-self: flex-end;
  background: linear-gradient(145deg, #e3ffd5, #c8f5b8);
  border-color: rgba(93, 170, 81, 0.36);
  box-shadow:
    0 9px 18px rgba(71, 151, 82, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.chat-bubble-dom.them {
  align-self: flex-start;
  border-color: rgba(80, 115, 136, 0.1);
}

.moment-card.is-visible .chat-bubble-dom {
  animation: bubbleRise 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.moment-card.is-visible .shot-date {
  animation: datePop 480ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.moment-card.is-visible .chat-bubble-dom:nth-child(2) {
  animation-delay: 80ms;
}

.moment-card.is-visible .chat-bubble-dom:nth-child(3) {
  animation-delay: 150ms;
}

.moment-card.is-visible .chat-bubble-dom:nth-child(4) {
  animation-delay: 220ms;
}

.moment-card.is-visible .chat-bubble-dom:nth-child(5) {
  animation-delay: 290ms;
}

.moment-card.is-visible .chat-bubble-dom:nth-child(6) {
  animation-delay: 360ms;
}

.shot-input {
  position: absolute;
  inset: auto 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: rgba(17, 16, 21, 0.38);
  font-size: 0.68rem;
  font-weight: 850;
}

.shot-input b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
}

.moment-card img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border: 8px solid rgba(255, 255, 255, 0.88);
  border-radius: var(--radius);
  background: #d7f6df;
  box-shadow: 0 24px 54px rgba(17, 16, 21, 0.2);
  transition:
    transform 260ms ease,
    box-shadow 260ms ease;
}

.moment-card:hover .chat-shot,
.moment-card:hover img {
  transform: translateY(-7px) scale(1.018);
  box-shadow: 0 32px 70px rgba(42, 112, 153, 0.32);
}

.moment-card figcaption {
  width: fit-content;
  max-width: 100%;
  margin: 10px auto 0;
  padding: 7px 10px;
  border: 1px solid rgba(17, 16, 21, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 10px 28px rgba(17, 16, 21, 0.08);
  font-size: 0.9rem;
  font-weight: 950;
  text-align: center;
}

.character-break {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: clamp(230px, 27vw, 360px);
  margin: -22px 0 -78px;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transform: translateY(24px) scale(0.92);
  filter: blur(8px);
  transition:
    opacity 720ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 720ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.character-break::before {
  content: "";
  position: absolute;
  width: min(430px, 74vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.66) 0 28%, rgba(255, 255, 255, 0.2) 52%, transparent 72%);
  filter: blur(9px);
  transform: translateX(var(--character-x, 0));
  opacity: 0.76;
}

.character-break.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.character-break img {
  position: relative;
  z-index: 1;
  width: min(440px, 78vw);
  max-height: 430px;
  height: auto;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 26px 26px rgba(42, 112, 153, 0.24));
  transform: translateX(var(--character-x, 0)) translateY(8px) rotate(var(--character-rotate, -1deg)) scale(var(--character-scale, 1));
  transform-origin: 50% 82%;
}

.character-break.is-visible img {
  animation: characterBob 5.4s ease-in-out infinite;
}

.character-break-0 {
  --character-x: -18%;
  --character-rotate: -5deg;
  --character-sway: 3deg;
  --character-scale: 1.02;
}

.character-break-1 {
  --character-x: 14%;
  --character-rotate: 4deg;
  --character-sway: -3deg;
  --character-scale: 0.94;
}

.character-break-2 {
  --character-x: -8%;
  --character-rotate: 2deg;
  --character-sway: -4deg;
  --character-scale: 1;
}

.character-break-3 {
  --character-x: 19%;
  --character-rotate: -3deg;
  --character-sway: 4deg;
  --character-scale: 0.98;
}

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

@keyframes skyBreathe {
  from {
    background-position:
      0 0,
      0 0,
      0 0,
      0 0,
      0 0;
  }
  to {
    background-position:
      22px 10px,
      -18px 16px,
      14px -8px,
      -20px -10px,
      0 0;
  }
}

@keyframes cloudDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(90px, 18px, 0);
  }
}

@keyframes cloudDriftReverse {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-110px, -12px, 0);
  }
}

@keyframes yoFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-0.8deg);
  }
  50% {
    transform: translateY(-7px) rotate(0.7deg);
  }
}

@keyframes cardFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes bubbleRise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes datePop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes characterBob {
  0%,
  100% {
    transform: translateX(var(--character-x, 0)) translateY(0) rotate(var(--character-rotate, -1deg)) scale(var(--character-scale, 1));
  }
  50% {
    transform: translateX(var(--character-x, 0)) translateY(-16px) rotate(var(--character-sway, 1deg)) scale(var(--character-scale, 1));
  }
}

@media (max-width: 1080px) {
  .moments-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .yo-section {
    padding-top: 28px;
  }

  .moments-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .moment-card img {
    border-width: 6px;
  }

  .chat-shot {
    border-width: 6px;
    padding: 88px 14px 58px;
  }

  .shot-header {
    height: 78px;
    padding-inline: 15px;
  }

  .character-break {
    min-height: 240px;
    margin: -16px 0 -54px;
  }

  .character-break img {
    width: min(360px, 84vw);
    max-height: 360px;
  }
}

@media (max-width: 460px) {
  .password-row {
    grid-template-columns: 1fr;
  }

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

  .moment-card {
    max-width: 310px;
    margin-inline: auto;
  }

  .character-break {
    min-height: 220px;
    margin-bottom: -44px;
  }

  .character-break img {
    width: min(320px, 88vw);
    max-height: 320px;
  }
}

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