/* =========================================================
   Soohoo Baby — soft editorial nursery aesthetic
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Manrope:wght@300;400;500;600&display=swap');

:root {
  /* warm, oatmeal-leaning palette pulled from the nursery photo */
  --cream:        #f5ecdd;
  --cream-deep:   #ecdfca;
  --paper:        #faf4e9;
  --ink:          #4a3f33;
  --ink-soft:     #6b5e51;
  --ink-mute:     #968878;
  --blush:        #e8c7b8;
  --sky:          #b9d3df;
  --sage:         #c5ccb6;
  --gold:         #c8a96b;

  --serif:  'Lora', 'Cormorant Garamond', Georgia, serif;
  --sans:   'Manrope', 'Helvetica Neue', system-ui, sans-serif;

  --radius:    18px;
  --max:       1200px;
  --gutter:    clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img { max-width: 100%; display: block; }

/* ---------- subtle page atmosphere: a soft grain ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* =========================================================
   Navigation
   ========================================================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
  background: rgba(250, 244, 233, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(74,63,51, 0.06);
}

.nav.is-overlay {
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav.is-overlay .nav__brand,
.nav.is-overlay .nav__links a {
  color: var(--ink);
}

.nav__brand {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.005em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.nav__brand::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blush);
  transform: translateY(-3px);
}

.nav__links {
  display: flex;
  gap: clamp(20px, 3vw, 38px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  position: relative;
  font-size: 13.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 6px 0;
  color: var(--ink-soft);
  transition: color .2s ease;
}

.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .35s cubic-bezier(.7,.1,.3,1);
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--ink);
}

.nav__links a:hover::after,
.nav__links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* =========================================================
   Footer
   ========================================================= */

.footer {
  margin-top: 120px;
  padding: 64px var(--gutter) 48px;
  border-top: 1px solid rgba(74,63,51, 0.08);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}

.footer__brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.footer__legal { line-height: 1.7; }

.footer__contact a {
  border-bottom: 1px solid rgba(74,63,51,.2);
  padding-bottom: 1px;
  transition: border-color .2s ease, color .2s ease;
}
.footer__contact a:hover { color: var(--ink); border-color: var(--ink); }

@media (max-width: 640px) {
  .footer { grid-template-columns: 1fr; }
}

/* =========================================================
   Shared layout
   ========================================================= */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 140px) var(--gutter);
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.h-display {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.018em;
  line-height: 1.02;
  margin: 0;
}

.h-display em {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}

.lede {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 56ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.btn:hover { transform: translateY(-2px); background: #2d2620; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(74,63,51,.35);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn__arrow {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: width .25s ease;
}
.btn__arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}
.btn:hover .btn__arrow { width: 26px; }

/* =========================================================
   HOME — hero
   ========================================================= */

.hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  z-index: 2;
}

.hero__photo {
  position: absolute;
  inset: 0;
  background-image: url('images/nursery-hero.png');
  background-size: cover;
  background-position: center 30%;
  /* gentle warm wash to unify with the cream palette */
  filter: saturate(0.95) brightness(1.02);
}

.hero__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 100%, rgba(245,236,221,.85) 0%, rgba(245,236,221,0) 55%),
    linear-gradient(to bottom, rgba(245,236,221,.18) 0%, rgba(245,236,221,0) 30%, rgba(245,236,221,.55) 100%);
}

.hero__content {
  position: relative;
  z-index: 3;
  margin-top: auto;
  margin-bottom: clamp(60px, 10vh, 110px);
  padding: 0 var(--gutter);
  max-width: var(--max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
}

.hero__title {
  font-size: clamp(44px, 7vw, 88px);
  max-width: 14ch;
  animation: rise .9s cubic-bezier(.2,.7,.2,1) both;
}

.hero__title em {
  display: block;
}

.hero__sub {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.55;
  letter-spacing: 0.005em;
  max-width: 38ch;
  margin: 22px 0 0;
  color: var(--ink-soft);
  animation: rise 1s .15s cubic-bezier(.2,.7,.2,1) both;
}

/* circular launch seal */
.seal {
  --size: clamp(120px, 13vw, 168px);
  width: var(--size);
  height: var(--size);
  position: relative;
  flex-shrink: 0;
  animation: rise 1s .25s cubic-bezier(.2,.7,.2,1) both, spin 32s linear infinite;
  align-self: end;
}

.seal__ring {
  position: absolute;
  inset: 0;
}

.seal__ring text {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 8.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  fill: var(--ink);
}

.seal__center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(28px, 3.4vw, 40px);
  color: var(--ink);
  line-height: .9;
  animation: counter-spin 32s linear infinite;
}

.seal__center small {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
  font-weight: 500;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes counter-spin { to { transform: rotate(-360deg); } }

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

@media (max-width: 720px) {
  .hero__content {
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
  }
  .seal { align-self: start; }
}

/* tiny twinkles on the hero — celestial cue from the playmat */
.twinkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 12px 2px rgba(255,255,255,.7);
  z-index: 2;
  opacity: 0;
  animation: twinkle 4s ease-in-out infinite;
}
.twinkle--1 { top: 18%;  left: 12%; animation-delay: .2s; }
.twinkle--2 { top: 32%;  left: 86%; animation-delay: 1.6s; width: 4px; height: 4px; }
.twinkle--3 { top: 58%;  left: 8%;  animation-delay: 2.4s; width: 5px; height: 5px; }
.twinkle--4 { top: 22%;  left: 64%; animation-delay: 3.1s; width: 4px; height: 4px; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.6); }
  50%      { opacity: .9; transform: scale(1); }
}

/* =========================================================
   PLAY MAT page
   ========================================================= */

.product {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

@media (max-width: 880px) {
  .product { grid-template-columns: 1fr; gap: 40px; }
}

.product__media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 30px 60px -30px rgba(74,63,51,.25), 0 1px 0 rgba(74,63,51,.06);
}

.product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product__illo {
  position: absolute;
  bottom: -32px;
  right: -32px;
  width: 42%;
  background: var(--paper);
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 18px 36px -16px rgba(74,63,51,.3);
  rotate: -6deg;
  transition: rotate .6s cubic-bezier(.2,.7,.2,1);
}
.product__illo img {
  border-radius: 50%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.product__media:hover .product__illo { rotate: 0deg; }

.product__copy h1 {
  font-size: clamp(36px, 5vw, 60px);
  margin: 16px 0 18px;
}

.product__price {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.product__features {
  list-style: none;
  padding: 0;
  margin: 28px 0 36px;
  display: grid;
  gap: 14px;
  border-top: 1px solid rgba(74,63,51,.1);
  padding-top: 28px;
}

.product__features li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.product__features svg {
  width: 22px;
  height: 22px;
  color: var(--blush);
  margin-top: 2px;
}

.product__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.product__note {
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: 18px;
}

/* =========================================================
   STORY page
   ========================================================= */

.story {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(80px, 12vw, 140px) var(--gutter);
  position: relative;
  z-index: 2;
}

.story__hero {
  text-align: center;
  margin-bottom: 80px;
}

.story__title {
  font-size: clamp(44px, 7vw, 84px);
  margin: 18px 0 0;
}

.story__body {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.7;
  color: var(--ink-soft);
  column-count: 1;
}

.story__body p { margin: 0 0 1.4em; }
.story__body p:first-of-type::first-letter {
  font-size: 4.5em;
  float: left;
  line-height: .9;
  padding-right: 14px;
  padding-top: 6px;
  font-style: italic;
  color: var(--ink);
  font-weight: 400;
}

.story__divider {
  width: 64px;
  height: 1px;
  background: rgba(74,63,51,.25);
  margin: 56px auto;
  position: relative;
}
.story__divider::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--blush);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.story__signature {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 18px;
}

/* =========================================================
   CONTACT page
   ========================================================= */

.contact {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(80px, 12vw, 140px) var(--gutter);
  text-align: center;
  position: relative;
  z-index: 2;
}

.contact__title {
  font-size: clamp(48px, 7vw, 88px);
  margin: 18px 0 24px;
}

.contact__body {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(19px, 1.6vw, 22px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 auto 48px;
  max-width: 50ch;
}

.contact__email {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--ink);
  border-bottom: 1px solid rgba(74,63,51,.3);
  padding: 4px 8px 8px;
  transition: border-color .25s ease, color .25s ease;
}
.contact__email:hover { color: var(--blush); border-color: var(--blush); }

.contact__details {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  font-size: 14px;
  color: var(--ink-mute);
}
.contact__details strong {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* =========================================================
   Page-load reveal for sections
   ========================================================= */
.reveal { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.reveal.delay-1 { animation-delay: .1s; }
.reveal.delay-2 { animation-delay: .2s; }
.reveal.delay-3 { animation-delay: .3s; }
.reveal.delay-4 { animation-delay: .4s; }

/* =========================================================
   Shopify Buy Button — Solar System Play Mat
   Target div sits beside the existing .btn fallback.
   Fallback is hidden by JS once Shopify's afterRender fires.
   ========================================================= */
#shopify-buy-button-playmat {
  display: inline-block;
  width: 180px;
  vertical-align: middle;
  line-height: 0;
}

#shopify-buy-button-playmat:empty {
  display: none;
}

/* The SDK injects an iframe at width:100% with its own height
   (~70px) sized to accommodate the button plus internal padding.
   We constrain only the width so layout stays predictable; the
   iframe controls its own height to avoid clipping the button. */
#shopify-buy-button-playmat iframe {
  width: 100% !important;
  display: block !important;
}

/* Safety net — brand styling is passed via the SDK's `styles` config,
   but if the SDK exposes a sub-element the config can't reach, this
   block keeps brand consistency. */
#shopify-buy-button-playmat .shopify-buy__btn {
  font-family: var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
