/* Jevan & Simpy · landing page · "living painting"
   EB Garamond (as the PDFs) · Old Standard TT Italic for the monogram */

:root {
  --parchment: #F1E5CC;
  --paper-hi: #FBF5E8;
  --madder: #70322B;
  --madder-deep: #5A2420;
  --madder-night: #3E1714;
  --maroon: #6E1F23;
  --ink: #3B2A23;
  --ink-soft: #5A4A3F;
  --gold: #A8843F;
  --gold-soft: #C9AE78;
  --rule: rgba(168, 132, 63, .4);

  --serif: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
  --mono: 'Old Standard TT', 'EB Garamond', Georgia, serif;

  /* stage geometry: pure CSS on the *small* viewport height, so it never jumps
     when a phone's address bar shows or hides, and never depends on script timing */
  --tab: 76px;                                       /* the card's tab peeking at the bottom */
  --gap: max(14px, 3.5svh);
  --peek: calc(100svh - var(--tab));
  --sw: min(calc((var(--peek) - 2 * var(--gap)) * 848 / 1264), 100vw, 848px);
}

@supports not (height: 1svh) {
  :root { --gap: max(14px, 3.5vh); --peek: calc(100vh - var(--tab)); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font: 500 20px/1.6 var(--serif);
  font-variant-numeric: lining-nums;
  background: radial-gradient(120% 90% at 50% 45%, var(--madder) 0%, var(--madder-deep) 50%, var(--madder-night) 100%) fixed var(--madder-deep);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 3px; }
/* viewport probe: lets the script read the real small-viewport size on every frame */
#vp { position: fixed; left: 0; top: 0; width: 100%; height: 100svh; visibility: hidden; pointer-events: none; z-index: -1; }
@supports not (height: 1svh) { #vp { height: 100vh; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- monogram (veil + card) ---------- */
.mono {
  position: relative; display: flex; align-items: flex-start; gap: .06em; width: max-content;
  font: italic 400 64px/1 var(--mono); color: var(--gold-soft);
}
.mono span:last-child { margin-top: .26em; }
.mono i {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  font: italic 500 .3em/1 var(--serif); color: var(--gold);
}

/* ---------- loading veil ---------- */
.veil {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  background: var(--madder-deep);
  transition: opacity 1.3s ease, visibility 0s linear 1.3s;
}
.veil .mono { animation: breathe 2.4s ease-in-out infinite; }
.is-ready .veil { opacity: 0; visibility: hidden; }

/* ---------- the painting ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.stage {
  position: absolute; left: 50%; top: calc(var(--peek) / 2);
  width: var(--sw); aspect-ratio: 848 / 1264;
  transform: translate(-50%, -50%);
  container-type: inline-size;
  isolation: isolate;
  overflow: hidden;                                   /* the extended layers never show outside the painting */
  box-shadow: 0 30px 70px -20px rgba(20, 6, 4, .75);  /* sits on the page like a card */
  will-change: transform;
}

.layer {
  position: absolute; inset: 0;
  opacity: 0; will-change: transform, opacity;
  transform-origin: 50% 100%;
}
.layer > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; user-select: none; }
.layer[data-layer="sky"] { overflow: hidden; }
.layer[data-layer="sky"] > img   { inset: auto; left: -12%; top: -12%; width: 124%; height: 124%; object-fit: cover; }
.layer[data-layer="far"] > img   { inset: auto; left: -50%; top: 0; width: 200%; height: 100%; }
.layer[data-layer="floor"] > img { inset: auto; left: -50%; top: 0; width: 200%; height: 150%; }
.layer[data-layer="far"]         { transform-origin: 50% 62%; }
.layer[data-layer="floor"]       { transform-origin: 50% 63%; }
.layer[data-layer="cypressFar"]  { transform-origin: 50% 65.5%; }
.layer[data-layer="cypressNear"] { transform-origin: 50% 70.3%; }

/* warm light drifting across the sky */
.glow {
  position: absolute; left: -20%; top: 4%; width: 80%; height: 50%;
  background: radial-gradient(closest-side, rgba(255, 236, 196, .75), rgba(255, 236, 196, 0));
  opacity: .45;
  animation: glow 26s ease-in-out infinite alternate;
}
/* the pavilion reflected in the channel, broken up by ripples */
.reflection {
  position: absolute; inset: 0;
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 4px, rgba(0, 0, 0, .3) 6px, #000 8px) 0 0 / 100% 8px;
          mask: repeating-linear-gradient(180deg, #000 0 4px, rgba(0, 0, 0, .3) 6px, #000 8px) 0 0 / 100% 8px;
  animation: ripple-bands 1.4s linear infinite;
}
.reflection img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform-origin: 50% 62%;
  animation: wobble 4.5s ease-in-out infinite alternate;
}
/* the water channel shimmers */
.water {
  position: absolute; inset: 0;
  -webkit-mask: url(assets/garden/water-mask.png) 0 0 / 100% 100% no-repeat;
          mask: url(assets/garden/water-mask.png) 0 0 / 100% 100% no-repeat;
  opacity: .2;
}
.water i {
  position: absolute; inset: -130px 0 0;
  background:
    repeating-linear-gradient(176deg, rgba(255,255,255,0) 0 7px, rgba(255,255,255,.55) 9px, rgba(255,255,255,0) 12px 15px),
    repeating-linear-gradient(183deg, rgba(255,255,255,0) 0 13px, rgba(255,255,255,.4) 15px, rgba(255,255,255,0) 18px 24px);
  animation: flow 9s linear infinite;
}

.bird { position: absolute; width: 7.1%; height: auto; opacity: 0; will-change: transform, opacity; }
.bird[data-bird="0"] { left: 52.1%; top: 15.7%; }
.bird[data-bird="1"] { left: 56.4%; top: 22.9%; width: 7%; }

.sky-words {
  position: absolute; left: 14%; right: 14%; top: 23.5%;
  text-align: center; color: var(--maroon);
  opacity: 0; will-change: transform, opacity;
}
.mono--sky { margin: 0 auto; font-size: 17cqw; color: var(--maroon); gap: 1.4cqw; }
.mono--sky i { font-size: .3em; }

.petals { position: absolute; inset: 0; }
.petal { position: absolute; top: -40px; left: var(--x); width: var(--size); opacity: 0; animation: fall var(--dur) linear var(--delay) infinite; }
.shade { position: absolute; inset: 0; background: var(--madder-night); opacity: 0; will-change: opacity; }


/* ---------- little living details ---------- */
/* clouds: the sky drifts very slowly */
.sky-img { animation: drift 140s ease-in-out infinite alternate; }
/* sunbeams falling through the arch */
.rays {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(112deg, transparent 16%, rgba(255, 246, 225, .22) 23%, transparent 30%, transparent 38%, rgba(255, 246, 225, .16) 44%, transparent 51%, transparent 59%, rgba(255, 246, 225, .13) 64%, transparent 70%);
  animation: rays 13s ease-in-out 3s infinite alternate both;
}
/* fountain: rings spreading on the water */
.ripples {
  position: absolute; inset: 0;
  -webkit-mask: url(assets/garden/water-mask.png) 0 0 / 100% 100% no-repeat;
          mask: url(assets/garden/water-mask.png) 0 0 / 100% 100% no-repeat;
}
.ripples i {
  position: absolute; left: 50%; top: 80.3%; width: 9%; aspect-ratio: 1 / .3;
  border: 1.5px solid rgba(255, 255, 255, .75); border-radius: 50%;
  opacity: 0; animation: ripple 4.8s cubic-bezier(.2, .6, .4, 1) infinite;
}
.ripples i:nth-child(2) { animation-delay: 1.6s; }
.ripples i:nth-child(3) { animation-delay: 3.2s; }
/* fountain: water falling from both basins */
.fall {
  position: absolute; opacity: .45;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0) 0 3px, rgba(255,255,255,.85) 4px, rgba(255,255,255,0) 6px 9px);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 1px, transparent 1px 4px), linear-gradient(90deg, #000 0 32%, transparent 40% 60%, #000 68%);
  -webkit-mask-composite: source-in;
          mask: repeating-linear-gradient(90deg, #000 0 1px, transparent 1px 4px) intersect, linear-gradient(90deg, #000 0 32%, transparent 40% 60%, #000 68%);
  animation: trickle .55s linear infinite;
}
.fall--upper { left: 47.6%; width: 4.8%; top: 73.3%; height: 2.1%; }
.fall--lower { left: 45.4%; width: 9.2%; top: 76.1%; height: 4.1%; }
/* fountain: a little spray from the jet */
.spray { position: absolute; left: 50%; top: 70.7%; width: 0; height: 0; }
.spray i {
  position: absolute; left: -.17cqw; top: 0; width: .34cqw; height: .34cqw; border-radius: 50%;
  background: rgba(255, 255, 255, .9); opacity: 0;
  animation: spray 1.7s cubic-bezier(.3, .1, .6, 1) infinite;
}
.spray i:nth-child(1) { --dx: -2.1cqw; animation-delay: 0s; }
.spray i:nth-child(2) { --dx:  1.8cqw; animation-delay: .2s; }
.spray i:nth-child(3) { --dx: -1.2cqw; animation-delay: .45s; }
.spray i:nth-child(4) { --dx:  2.4cqw; animation-delay: .65s; }
.spray i:nth-child(5) { --dx: -2.5cqw; animation-delay: .9s; }
.spray i:nth-child(6) { --dx:  1.1cqw; animation-delay: 1.1s; }
.spray i:nth-child(7) { --dx: -1.6cqw; animation-delay: 1.3s; }
.spray i:nth-child(8) { --dx:  2.0cqw; animation-delay: 1.5s; }

/* ---------- the card (rises like a letter from an envelope) ---------- */
main { position: relative; z-index: 2; padding: 0 14px; }
main::before { content: ''; display: block; height: var(--peek); }

.card {
  position: relative;
  max-width: 600px; margin: 0 auto;
  padding: 18px clamp(22px, 6vw, 56px) clamp(32px, 6vw, 48px);
  text-align: center;
  background: var(--paper-hi);
  border: 1px solid var(--gold-soft);
  outline: 1px solid var(--gold-soft); outline-offset: -9px;
  box-shadow: 0 -20px 60px -24px rgba(20, 6, 4, .65), 0 40px 80px -30px rgba(20, 6, 4, .7);
  opacity: 0; transform: translateY(24px);
  transition: opacity 1.2s ease 3.4s, transform 1.4s cubic-bezier(.2, .7, .2, 1) 3.4s;
}
.is-ready .card { opacity: 1; transform: none; }
.card__tab {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 0 auto 30px; padding: 6px 12px 2px; width: max-content;
  font: 600 12px/1 var(--serif); letter-spacing: .26em; text-transform: uppercase; text-decoration: none; color: var(--gold);
}
.card__tab i { width: 9px; height: 9px; border-left: 1.5px solid var(--gold); border-top: 1.5px solid var(--gold); transform: rotate(45deg); order: -1; animation: nudge 2.4s ease-in-out infinite; }
.card__eyebrow { font: 600 13px/1.4 var(--serif); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.card__when { margin-top: 10px; font: 600 14px/1.4 var(--serif); letter-spacing: .24em; text-transform: uppercase; color: var(--maroon); }
.card__title { font: italic 500 clamp(44px, 9.5vw, 62px)/1.05 var(--serif); color: var(--maroon); white-space: nowrap; }
.card__title span { color: var(--gold); }
.divider {
  width: 132px; height: 16px; margin: 24px auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='16' viewBox='0 0 132 16'%3E%3Cpath d='M0 8H54M78 8H132' stroke='%23A8843F' stroke-width='1.2'/%3E%3Cpath d='M66 1L73 8L66 15L59 8Z' fill='%23A8843F'/%3E%3Ccircle cx='50' cy='8' r='1.6' fill='%23A8843F'/%3E%3Ccircle cx='82' cy='8' r='1.6' fill='%23A8843F'/%3E%3C/svg%3E") center/contain no-repeat;
}
.card__lead { font-size: 21px; line-height: 1.5; max-width: 30em; margin: 0 auto; }

.sides { display: grid; gap: 28px; margin-top: 32px; }
@media (min-width: 560px) { .sides { grid-template-columns: 1fr 1fr; gap: 20px; } }
.side h3 {
  font: 600 13px/1.4 var(--serif); letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  padding-bottom: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--rule);
}
.side ul { display: grid; gap: 20px; }
.person__name { font: italic 500 30px/1.1 var(--serif); color: var(--maroon); }
.person__num { display: inline-block; margin-top: 2px; font: 600 20px/1.4 var(--serif); letter-spacing: .04em; text-decoration: none; color: var(--ink); }
.person__acts { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 96px; padding: 0 18px;
  font: 600 13px/1 var(--serif); letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  color: var(--paper-hi); background: var(--madder); border: 1px solid var(--madder); border-radius: 999px;
  transition: background .25s ease, transform .25s ease;
}
.pill:hover { background: var(--maroon); transform: translateY(-1px); }
.pill--ghost { background: transparent; color: var(--madder); }
.pill--ghost:hover { background: rgba(112, 50, 43, .08); }
.person__line { display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; padding-left: 34px; }  /* balances the icon so the number stays centred */
.person__line .person__num { margin-top: 0; }
.copy {
  position: relative; display: inline-grid; place-items: center;
  width: 40px; height: 40px; margin-right: -8px; padding: 0;
  background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--gold);
  -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent;
  transition: color .2s ease, background .2s ease;
}
.copy:hover { color: var(--madder); background: rgba(112, 50, 43, .06); }
.copy svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.copy .i-done { opacity: 0; }
.copy.is-copied { color: var(--madder); }
.copy.is-copied .i-copy { opacity: 0; }
.copy.is-copied .i-done { opacity: 1; }
.copy__tip {
  position: absolute; left: 50%; bottom: calc(100% - 2px); transform: translate(-50%, 4px);
  padding: 3px 8px; border-radius: 4px; white-space: nowrap;
  font: 600 11px/1.2 var(--serif); letter-spacing: .14em; text-transform: uppercase;
  color: var(--paper-hi); background: var(--madder);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.copy.is-copied .copy__tip { opacity: 1; transform: translate(-50%, 0); }

.email { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--rule); }
.email__label { font: 600 13px/1.4 var(--serif); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.email__link {
  display: inline-block; margin-top: 6px;
  font: italic 500 clamp(22px, 5.4vw, 28px)/1.3 var(--serif); color: var(--maroon);
  text-decoration: underline; text-decoration-color: var(--gold-soft); text-underline-offset: 5px; text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
}
.card__note { font-size: 19px; color: var(--ink-soft); max-width: 28em; margin: 0 auto; }
.card__note strong { font-weight: 500; font-style: italic; color: var(--maroon); }

.foot { margin-top: 30px; color: var(--gold); }
.foot img { width: 150px; height: auto; margin: 0 auto 8px; }
.foot p { font: 600 12px/1.4 var(--serif); letter-spacing: .24em; text-transform: uppercase; }
main::after { content: ''; display: block; height: calc(14px + env(safe-area-inset-bottom)); }

/* ---------- motion ---------- */
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes nudge { 0%, 100% { transform: translateY(2px) rotate(45deg); } 50% { transform: translateY(-3px) rotate(45deg); } }
@keyframes glow { from { transform: translateX(0); } to { transform: translateX(85%); } }
@keyframes flow { from { transform: translateY(0); } to { transform: translateY(120px); } } /* 120 = lcm of both ripple periods */
@keyframes drift { from { transform: translateX(4%); } to { transform: translateX(-4%); } }
@keyframes rays { from { opacity: .3; transform: translateX(-2.5%); } to { opacity: .85; transform: translateX(2.5%); } }
@keyframes ripple { 0% { transform: translate(-50%, -50%) scale(1); opacity: 0; } 12% { opacity: .85; } 100% { transform: translate(-50%, -50%) scale(2.7); opacity: 0; } }
@keyframes ripple-bands { to { -webkit-mask-position: 0 8px; mask-position: 0 8px; } }
@keyframes wobble { from { transform: skewX(-.9deg) scaleX(1.012); } to { transform: skewX(.9deg) scaleX(.99); } }
@keyframes trickle { to { background-position: 0 9px; } }
@keyframes spray { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .9; } 45% { transform: translate(calc(var(--dx) * .55), -1.1cqw); } 100% { transform: translate(var(--dx), 2.6cqw); opacity: 0; } }
@keyframes fall {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) rotate(var(--rot)); }
  10%  { opacity: .9; }
  50%  { transform: translate3d(var(--drift), 50vh, 0) rotate(calc(var(--rot) + 140deg)); }
  90%  { opacity: .9; }
  100% { opacity: 0; transform: translate3d(calc(var(--drift) * -.4), 105vh, 0) rotate(calc(var(--rot) + 280deg)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .veil .mono, .glow, .water i, .card__tab i, .sky-img, .ripples i, .fall, .spray i, .reflection, .reflection img { animation: none; }
  .rays { animation: none; opacity: .5; }
  .petals { display: none; }
  .card { transition: none; }
}
