/* bloma.fn2.studio landing page. Colours are DESIGN.md swatches; system type only. */
:root {
  --paper: #FAF8F3;
  --linen: #F1EEE7;
  --tile: #EFEBE2;
  --stone: #8C8577;
  --ink: #1B2A1D;
  --muted: rgba(27, 42, 29, 0.62);
  --faint: rgba(27, 42, 29, 0.1);
  --moss: #5E6F48;
  --deep: #2F4A34;
  --sand: #E6D3B6;
  --wash: rgba(94, 111, 72, 0.16);
  --grain: #3B3B39;
  --grain-opacity: 0.06;
  --cell: rgba(241, 238, 231, 0.75);
  --tile-bg: #F4F1EA;
  --tile-edge: rgba(140, 133, 119, 0.22);
  --nav-bg: rgba(250, 248, 243, 0.82);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink); overflow-x: hidden;
  font: 400 17px/1.6 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'Segoe UI', sans-serif;
}
body::before { /* the app's paper grain over everything */
  content: ''; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: var(--grain); -webkit-mask: url(/img/grain.png) 0 0 / 256px; mask: url(/img/grain.png) 0 0 / 256px; opacity: var(--grain-opacity);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2 { font-weight: 300; letter-spacing: -0.025em; margin: 0; }
h2 { font-size: clamp(34px, 5.2vw, 60px); line-height: 1.06; }
.eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--moss); }

.wordmark { display: block; background: var(--ink); -webkit-mask: url(/bloma.svg) left center / contain no-repeat; mask: url(/bloma.svg) left center / contain no-repeat; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 15px 24px; border-radius: 14px;
  background: var(--moss); color: #fff; text-decoration: none; font-weight: 500; font-size: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 28px -10px rgba(47, 74, 52, 0.7);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.3), box-shadow .35s ease, background .3s;
}
.btn svg { width: 20px; height: 20px; fill: currentColor; margin-top: -2px; }
.btn:hover { transform: translateY(-2px) scale(1.02); background: #687C50; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 18px 36px -12px rgba(47, 74, 52, 0.8); }
.btn:active { transform: scale(.98); }
.btn-small { padding: 9px 16px; font-size: 14px; border-radius: 11px; }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: space-between; align-items: center;
  padding: 14px max(16px, calc(50% - 560px)); transition: background .4s, box-shadow .4s, transform .5s;
}
.nav.solid { background: var(--nav-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--faint); }
.nav-brand .wordmark { width: 92px; height: 22px; opacity: 0; transform: translateY(-6px); transition: opacity .4s, transform .4s; }
.nav.solid .nav-brand .wordmark { opacity: .9; transform: none; }

/* Hero */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 96px 16px 64px; overflow: hidden; }
.wash { position: absolute; left: 62%; top: 50%; width: 120vmax; height: 120vmax; translate: -50% -50%; border-radius: 50%; background: radial-gradient(closest-side, var(--wash), transparent 70%); animation: breathe 10s ease-in-out infinite; pointer-events: none; }
@keyframes breathe { 50% { scale: 1.12; } }
.hero-inner { position: relative; z-index: 2; width: 100%; max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.wordmark-hero { width: 150px; height: 36px; margin-bottom: 28px; opacity: .9; }
.hero h1 { font-size: clamp(44px, 6.6vw, 84px); line-height: 1.0; max-width: 11ch; }
.lede { margin: 22px 0 0; max-width: 30em; font-size: clamp(17px, 1.5vw, 19px); color: var(--muted); }
.cta-row { margin-top: 32px; }
.fine { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.hero-copy > * { animation: rise 1s cubic-bezier(.2, .8, .2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; } .hero-copy > :nth-child(3) { animation-delay: .18s; }
.hero-copy > :nth-child(4) { animation-delay: .28s; } .hero-copy > :nth-child(5) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }


/* Board */
.play { display: flex; flex-direction: column; align-items: center; animation: rise 1.1s .3s cubic-bezier(.2, .8, .2, 1) both; }
.board {
  --gap: clamp(7px, 1.6vw, 11px); --size: min(440px, 86vw);
  position: relative; width: var(--size); max-width: 100%; aspect-ratio: 1; padding: var(--gap); border-radius: 26px;
  background: color-mix(in srgb, var(--paper) 70%, var(--stone) 8%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 40px 80px -40px rgba(27, 42, 29, .45), 0 0 0 1px var(--tile-edge);
  touch-action: none; user-select: none; -webkit-user-select: none; outline: none; cursor: grab;
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.board:focus-visible { box-shadow: 0 0 0 3px var(--moss), 0 40px 80px -40px rgba(27, 42, 29, .45); }
.cells { position: absolute; inset: var(--gap); display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.cells i { border-radius: 14px; background: var(--cell); }
.tile {
  position: absolute; left: var(--gap); top: var(--gap); width: calc((100% - var(--gap) * 5) / 4); aspect-ratio: 1; border-radius: 14px;
  background: var(--tile-bg); box-shadow: 0 0 0 1px var(--tile-edge), 0 3px 0 rgba(140, 133, 119, .16);
  transform: translate(calc(var(--x) * (100% + var(--gap))), calc(var(--y) * (100% + var(--gap))));
  transition: transform .14s cubic-bezier(.3, .7, .3, 1); will-change: transform;
}
.tile img { width: 100%; height: 100%; padding: 8%; object-fit: contain; pointer-events: none; }
.tile.new img { animation: sprout .32s cubic-bezier(.2, .9, .3, 1.5) both; }
.tile.merged img { animation: merge .34s cubic-bezier(.2, .9, .3, 1.6); }
@keyframes sprout { from { scale: 0; opacity: 0; } }
@keyframes merge { 40% { scale: 1.22; } }
.tile.full { background: #FBF3E6; box-shadow: 0 0 0 2px #D9A441, 0 0 34px 6px rgba(217, 164, 65, .5); z-index: 2; }
.tile.full img { animation: bloom 1.6s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes bloom { 0% { scale: .6; rotate: -12deg; } 35% { scale: 1.45; rotate: 6deg; } 60% { scale: 1.2; rotate: -2deg; } 100% { scale: 1; rotate: 0; } }
.play-caption { display: flex; align-items: center; gap: 10px; margin: 22px 0 0; min-height: 1.6em; font-size: 15px; color: var(--muted); text-align: center; transition: opacity .3s; }
.play-caption b { color: var(--ink); font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--moss); box-shadow: 0 0 0 0 rgba(94, 111, 72, .5); animation: ping 1.8s infinite; flex: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(94, 111, 72, 0); } 100% { box-shadow: 0 0 0 0 rgba(94, 111, 72, 0); } }

.burst { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.petal { position: absolute; width: 14px; height: 22px; border-radius: 100% 0 100% 0; }
.spark { position: absolute; width: 22px; height: 22px; fill: #D9A441; }

/* Grow: a flower climbing through its stages as you scroll */
.grow { position: relative; height: 340vh; }
.grow-stick { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; max-width: 1120px; margin: 0 auto; padding: 72px 16px 32px; }
.grow-copy p:not(.eyebrow) { color: var(--muted); max-width: 26em; margin: 18px 0 0; font-size: 18px; }
.stage-count { margin-top: 40px; display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.stage-count #stageNum { font-size: clamp(64px, 9vw, 120px); font-weight: 200; line-height: .9; letter-spacing: -.04em; color: var(--moss); }
.stage-count .of { font-size: 20px; color: var(--muted); }
.stage-dots { display: flex; gap: 7px; margin-top: 18px; }
.stage-dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--faint); transition: background .35s, width .35s; }
.stage-dots i.on { background: var(--moss); }
.stage-dots i.now { width: 40px; }
.grow-art { position: relative; aspect-ratio: 1; width: min(100%, 340px); justify-self: center; } /* the stage art is 512px: never show it larger than that on retina */
.grow-art::before { /* a soft paper disc behind the flower */
  content: ''; position: absolute; inset: -16%; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #FBF9F4, #F1EEE7 62%, #EAE5DA);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 0 0 1px rgba(140, 133, 119, .12), 0 40px 70px -40px rgba(27, 42, 29, .35);
  scale: var(--d, .96); transition: scale .8s cubic-bezier(.2, .9, .3, 1.3);
}
.grow-halo { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(217, 164, 65, .32), rgba(217, 164, 65, 0) 72%); scale: var(--h, .3); opacity: var(--ho, .3); transition: scale .6s ease, opacity .6s; }
.grow-stack { position: absolute; inset: 0; }
.grow-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; scale: .82; translate: 0 6%; filter: blur(4px) drop-shadow(0 26px 30px rgba(27, 42, 29, .18)); transition: opacity .45s ease, scale .7s cubic-bezier(.2, .9, .3, 1.3), translate .7s, filter .45s; }
.grow-stack img.on { opacity: 1; scale: 1; translate: 0 0; filter: blur(0) drop-shadow(0 26px 30px rgba(27, 42, 29, .18)); }
.grow-sparks { position: absolute; inset: 0; pointer-events: none; }
.grow-sparks svg { position: absolute; width: 28px; height: 28px; fill: #D9A441; opacity: 0; scale: 0; transition: opacity .4s, scale .6s cubic-bezier(.2, .9, .3, 1.6); }
.grow-art.full .grow-sparks svg { opacity: 1; scale: 1; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { scale: .55; rotate: 45deg; } }

/* Garden marquee */
.garden { padding: 120px 0 110px; overflow: hidden; }
.garden-head { max-width: 1120px; margin: 0 auto 56px; padding: 0 16px; }
.garden-head p:not(.eyebrow) { color: var(--muted); max-width: 32em; margin: 18px 0 0; font-size: 18px; }
.marquee { display: flex; width: max-content; gap: 18px; padding: 10px 0; animation: slide 70s linear infinite; }
.marquee.reverse { animation-direction: reverse; animation-duration: 80s; margin-top: 8px; }
.marquee:hover { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.card {
  flex: none; width: 210px; padding: 18px 18px 20px; border-radius: 22px; background: var(--tile-bg);
  box-shadow: 0 0 0 1px var(--tile-edge), 0 14px 30px -22px rgba(27, 42, 29, .4); transition: transform .5s cubic-bezier(.2, .9, .3, 1.4), box-shadow .4s;
}
.card img { width: 128px; height: 128px; margin: 0 auto 10px; transition: transform .6s cubic-bezier(.2, .9, .3, 1.5); }
.card b { display: block; font-weight: 500; font-size: 16px; }
.card small { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 2px; }
.card:hover { transform: translateY(-8px) rotate(-1.5deg); box-shadow: 0 0 0 1px var(--tile-edge), 0 26px 40px -24px rgba(27, 42, 29, .5); }
.card:hover img { transform: scale(1.12) rotate(6deg); }

/* Send: one postcard that turns over */
.send { max-width: 1120px; margin: 0 auto; padding: 100px 16px 120px; display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: center; }
.send-copy p:not(.eyebrow) { color: var(--muted); max-width: 26em; margin: 18px 0 0; font-size: 18px; }
.card-wrap { display: flex; flex-direction: column; align-items: center; perspective: 1600px; }
.postcard {
  --ink: #6B3A1F; /* the tulip's postcard ink (postcardInk.generated.ts): never black */
  position: relative; display: block; width: 100%; max-width: 560px; aspect-ratio: 3 / 2; padding: 0; border: 0; background: none; cursor: pointer;
  transform-style: preserve-3d; transform: rotateY(var(--flip, 0deg)) rotateZ(-2deg); transition: transform 1s cubic-bezier(.3, 1.3, .4, 1);
  font: inherit; color: var(--ink); text-align: left; -webkit-tap-highlight-color: transparent;
}
.postcard:hover { transform: rotateY(var(--flip, 0deg)) rotateZ(-1deg) translateY(-6px); }
.postcard.flipped { --flip: 180deg; }
.postcard:focus-visible { outline: 3px solid var(--moss); outline-offset: 6px; border-radius: 8px; }
.pc-face { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 1px 2px rgba(27, 42, 29, .12), 0 30px 60px -30px rgba(27, 42, 29, .45); }
.pc-front img { width: 100%; height: 100%; object-fit: cover; }
.pc-name { position: absolute; left: 6%; top: 8%; font-size: clamp(18px, 2.4vw, 26px); font-weight: 400; color: var(--ink); line-height: 1.1; }
.pc-name small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .7; margin-bottom: 4px; }
.pc-mark { position: absolute; right: 5%; bottom: 7%; width: 54px; height: 13px; background: var(--ink); opacity: .75; }
.pc-back { transform: rotateY(180deg); background: #FBF7EE; display: grid; grid-template-columns: 1fr 1px 1fr; gap: 5%; padding: 7% 6%; }
.pc-note { font-size: clamp(14px, 1.7vw, 19px); line-height: 1.45; color: var(--ink); }
.pc-rule { background: #C9BFA9; }
.pc-right { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 14%; padding-bottom: 4%; }
.pc-stamp {
  position: absolute; right: 0; top: 0; width: 34%; aspect-ratio: 4 / 5; padding: 6%; background: #FFFEFA;
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 3.5px, #0000 96%, #000) -5px -5px / 10px 10px round;
  mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle 3.5px, #0000 96%, #000) -5px -5px / 10px 10px round;
}
.pc-stamp-face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #EFE4CF; }
.pc-stamp-face img { width: 86%; }
.pc-postmark { position: absolute; right: 22%; top: 18%; width: 36%; fill: none; stroke: #C8553D; stroke-width: 3; opacity: .8; rotate: -14deg; mix-blend-mode: multiply; }
.pc-postmark text { fill: #C8553D; stroke: none; font: 700 13px/1 -apple-system, sans-serif; letter-spacing: .12em; }
.pc-postmark text.small { font-size: 7px; }
.pc-line { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid #C9BFA9; padding-bottom: 4px; font-size: clamp(14px, 1.6vw, 18px); color: var(--ink); }
.pc-line small { font-size: 11px; opacity: .7; }
.card-hint { display: flex; align-items: center; gap: 10px; margin: 26px 0 0; font-size: 15px; color: var(--muted); }

/* Calm */
.calm { text-align: center; padding: 80px 16px 120px; }
.words { font-size: clamp(40px, 7vw, 92px); line-height: 1.05; }
.words span { display: inline-block; opacity: 0; transform: translateY(30px); filter: blur(8px); transition: opacity .9s, transform .9s cubic-bezier(.2, .8, .2, 1), filter .9s; }
.words.in span { opacity: 1; transform: none; filter: none; }
.words.in span:nth-child(2) { transition-delay: .18s; } .words.in span:nth-child(3) { transition-delay: .36s; color: var(--moss); }
.calm p { margin: 24px auto 0; max-width: 30em; color: var(--muted); font-size: 19px; }

/* Final */
.final { position: relative; min-height: max(100vh, 760px); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; padding: 120px 16px 0; overflow: hidden; }
.final-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.final-bloom { width: 150px; animation: drift 7s ease-in-out infinite; filter: drop-shadow(0 20px 26px rgba(27, 42, 29, .2)); }
.final h2 { margin: 12px 0 32px; }
.hills { position: absolute; left: 0; right: 0; bottom: 0; height: 58%; z-index: 1; }
.hills img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; -webkit-mask: linear-gradient(transparent, #000 24%); mask: linear-gradient(transparent, #000 24%); }
.petal-rain { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.petal-rain .petal { top: -30px; animation: fall linear infinite; opacity: .85; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }

.foot { text-align: center; padding: 26px 16px 44px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--faint); }
.foot a { color: var(--muted); }

/* Reveal on scroll */
[data-reveal]:not(.words) { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .8, .2, 1); }
[data-reveal].in:not(.words) { opacity: 1; transform: none; }

/* Phones */
@media (max-width: 860px) {
  .hero { padding-top: 88px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 40px; }
  .wordmark-hero { margin: 0 auto 22px; -webkit-mask-position: center; mask-position: center; }
  .hero h1 { margin: 0 auto; }
  .lede { margin-left: auto; margin-right: auto; }
  .grow-stick { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 8px; text-align: center; padding-top: 80px; }
  .grow-copy p:not(.eyebrow) { margin-left: auto; margin-right: auto; }
  .stage-count { justify-content: center; margin-top: 18px; }
  .stage-count #stageNum { font-size: 56px; }
  .stage-dots { justify-content: center; gap: 5px; }
  .stage-dots i { width: 14px; } .stage-dots i.now { width: 26px; }
  .grow-art { width: min(70vw, 40svh, 300px); align-self: center; }
  .grow-art::before { inset: -9%; }
  .send { grid-template-columns: 1fr; text-align: center; padding-top: 60px; }
  .send-copy p:not(.eyebrow) { margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
  .marquee { flex-wrap: wrap; width: auto; justify-content: center; }
}
