@font-face {
  font-family: "Monda";
  font-style: normal;
  font-weight: 400 700;
  src: url("../fonts/Monda-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #f8fbfc;
  --muted: rgba(238, 248, 249, 0.68);
  --line: rgba(255, 255, 255, 0.16);
  --glass: rgba(7, 35, 43, 0.42);
  --glass-strong: rgba(7, 30, 38, 0.62);
  --aqua: #87ede5;
  --coral: #ffb1a8;
  --shadow: 0 32px 80px rgba(0, 22, 29, 0.34);
}

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

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #062f3a;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  font-family: "Monda", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  color: #062f3a;
  background: var(--aqua);
}

.visual-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #062f3a url("../img/bg.jpg") center / cover no-repeat;
}

#background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

#cholder,
#canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

#canvas {
  display: block;
  min-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  opacity: 0.68;
}

.color-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, rgba(2, 24, 31, 0.88) 0%, rgba(3, 37, 46, 0.66) 42%, rgba(4, 41, 50, 0.42) 100%),
    linear-gradient(180deg, rgba(4, 35, 45, 0.08) 0%, rgba(2, 22, 29, 0.58) 100%);
}

.soft-light {
  position: absolute;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.38;
}

.soft-light-one {
  top: -22vw;
  right: -12vw;
  width: 58vw;
  height: 58vw;
  background: radial-gradient(circle, rgba(118, 243, 231, 0.64) 0%, rgba(118, 243, 231, 0) 68%);
}

.soft-light-two {
  bottom: -22vw;
  left: 18vw;
  width: 44vw;
  height: 44vw;
  background: radial-gradient(circle, rgba(255, 171, 157, 0.36) 0%, rgba(255, 171, 157, 0) 70%);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.story-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding:
    max(28px, env(safe-area-inset-top))
    max(28px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(28px, env(safe-area-inset-left));
}

.story {
  width: min(1120px, 100%);
  min-height: calc(100% - 1px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(560px, 1.28fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: clamp(36px, 6vw, 84px);
}

.intro {
  max-width: 460px;
  padding-bottom: clamp(10px, 6vh, 64px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  color: rgba(232, 251, 250, 0.68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 0 6px rgba(135, 237, 229, 0.12), 0 0 26px rgba(135, 237, 229, 0.8);
}

h1 {
  margin: 0;
  font-family: "STSong", "Songti SC", "Noto Serif CJK SC", serif;
  font-size: clamp(54px, 6.1vw, 88px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

h1 em {
  color: var(--coral);
  font-style: normal;
  text-shadow: 0 14px 38px rgba(255, 153, 141, 0.18);
}

.subtitle {
  max-width: 360px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.05em;
}

.counter-grid {
  display: grid;
  gap: 16px;
  width: 100%;
}

.counter-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(10, 49, 58, 0.58), var(--glass));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
}

.counter-card::after {
  content: "";
  position: absolute;
  top: -100px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  opacity: 0.16;
  pointer-events: none;
}

.love-card::after {
  background: radial-gradient(circle, var(--aqua), transparent 68%);
}

.baby-card {
  background: linear-gradient(135deg, rgba(48, 42, 48, 0.58), var(--glass-strong));
}

.baby-card::after {
  background: radial-gradient(circle, var(--coral), transparent 68%);
}

.card-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(135, 237, 229, 0.34);
  border-radius: 14px;
  color: var(--aqua);
  background: rgba(135, 237, 229, 0.08);
  font-family: Georgia, serif;
  font-size: 25px;
}

.baby-icon {
  border-color: rgba(255, 177, 168, 0.36);
  color: var(--coral);
  background: rgba(255, 177, 168, 0.08);
  font-size: 18px;
}

.card-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.card-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.love-number,
.pregnancy-number {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  margin-top: 22px;
  font-variant-numeric: tabular-nums;
}

.love-number strong {
  font-size: clamp(66px, 7.2vw, 96px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.love-number span,
.pregnancy-number span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0.08em;
}

.live-detail {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  color: rgba(238, 248, 249, 0.78);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.card-footer,
.baby-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 25px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(238, 248, 249, 0.54);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.card-footer time,
.baby-meta time {
  color: rgba(248, 251, 252, 0.84);
  font-variant-numeric: tabular-nums;
}

.pregnancy-number {
  gap: 3px;
  margin-top: 28px;
}

.pregnancy-number strong {
  color: var(--coral);
  font-size: clamp(52px, 6.1vw, 76px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.pregnancy-number strong + span + strong {
  margin-left: 18px;
}

.progress-track {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 5px;
  margin-top: 25px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9d92, #ffd0c9);
  box-shadow: 0 0 20px rgba(255, 177, 168, 0.52);
  transition: width 800ms ease;
}

.baby-meta {
  margin-top: 17px;
  padding-top: 0;
  border-top: 0;
}

#days-until-due {
  color: rgba(255, 217, 211, 0.86);
}

.closing {
  grid-column: 1 / -1;
  align-self: end;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(238, 248, 249, 0.54);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.closing span {
  color: var(--coral);
}

.closing p {
  margin: 0;
}

.closing a {
  color: rgba(238, 248, 249, 0.54);
  text-decoration: none;
  transition: color 180ms ease;
}

.closing a:hover,
.closing a:focus-visible {
  color: var(--ink);
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .story-shell {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    padding: 34px 20px 24px;
  }

  .story {
    min-height: calc(100vh - 58px);
    min-height: calc(100dvh - 58px);
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    align-items: start;
    gap: 28px;
  }

  .intro {
    max-width: 620px;
    padding: 0;
  }

  h1 {
    font-size: clamp(50px, 14vw, 78px);
  }

  .subtitle {
    margin-top: 20px;
  }

  .counter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .counter-card {
    border-radius: 24px;
  }

  .love-number strong {
    font-size: clamp(58px, 11vw, 84px);
  }

  .closing {
    align-self: end;
  }
}

@media (max-width: 620px) {
  .story-shell {
    padding-right: 16px;
    padding-left: 16px;
  }

  .eyebrow {
    margin-bottom: 22px;
  }

  h1 {
    font-size: clamp(48px, 15vw, 66px);
  }

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

  .counter-card {
    padding: 24px;
  }

  .love-number strong {
    font-size: clamp(62px, 21vw, 90px);
  }

  .pregnancy-number strong {
    font-size: clamp(50px, 17vw, 72px);
  }

  .baby-meta,
  .card-footer {
    align-items: flex-start;
    gap: 12px;
  }

  .closing {
    grid-template-columns: auto 1fr;
  }

  .closing a {
    display: none;
  }
}

@media (max-height: 740px) and (min-width: 861px) {
  .story-shell {
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .story {
    gap: 38px;
  }

  .intro {
    padding-bottom: 0;
  }

  .counter-card {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .love-number,
  .pregnancy-number {
    margin-top: 18px;
  }

  .card-footer {
    margin-top: 18px;
    padding-top: 14px;
  }
}

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

  #canvas {
    display: none;
  }
}
