/* Blossom Folio: hero (header + first screen). Values come from tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: var(--leading-text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, figure { margin: 0; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip {
  position: absolute; left: var(--s0); top: -4rem; z-index: 10;
  background: var(--paper); color: var(--ink);
  padding: var(--s-1) var(--s0);
}
.skip:focus { top: var(--s0); }

/* ---------- The folio page: margins with visible rules ---------- */

.hero {
  position: relative;
  padding-left: var(--margin);
  padding-right: var(--margin);
}
/* the outer margin rule, drawn the full height of the page */
.hero::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: var(--rule-inset);
  border-left: var(--hairline) solid var(--rule);
  pointer-events: none;
}

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-1) var(--s1);
  padding: var(--s1) 0 var(--s0);
  border-bottom: var(--hairline) solid var(--rule);
}
/* min-height: the link is a 44px tap target (Apple HIG), not 42px */
.wordmark { display: flex; align-items: center; min-height: 2.75rem; line-height: 0; border-radius: 2px; }
.wordmark svg { width: clamp(12.5rem, 17vw, 18rem); height: auto; overflow: visible; }
.wm-text { font-family: var(--display); font-size: 40px; fill: var(--gold); letter-spacing: 0.005em; }
.wm-bloom path { fill: var(--sakura); stroke: var(--gold); stroke-width: 0.45; stroke-linejoin: round; }
.wm-heart { fill: var(--gold); }
.wm-swash { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; }

.availability {
  display: flex; align-items: center; gap: var(--s-1);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
}
.dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--sakura);
  box-shadow: 0 0 0 1px var(--gold);
}

/* ---------- Copy column ---------- */

.copy { padding: var(--s2) 0 var(--s2); }

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: var(--leading-display);
  letter-spacing: -0.012em;
  max-width: 13em;
  text-wrap: balance;
}

.lede {
  margin-top: var(--s1);
  max-width: var(--measure);
  font-size: var(--step-1);
  text-wrap: pretty;
}
.lede strong { font-weight: 700; }

.actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--s0) var(--s1);
  margin-top: var(--s2);
}
.btn {
  display: inline-block;
  padding: 0.875rem 1.625rem;
  border-radius: 999px;
  background: var(--sakura);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease;
}
.btn:hover, .btn:active { background: var(--sakura-deep); }
.mail {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  padding-block: 0.75rem; /* comfortable tap target */
}
.mail:hover { text-decoration-thickness: 2px; }

/* ---------- The services run (one flowing sentence) ---------- */

.services {
  position: relative;
  margin-top: var(--s3);
  padding-top: var(--s1);
  border-top: var(--hairline) solid var(--rule);
}
.margin-label {
  position: absolute;
  top: var(--s1);
  right: calc(100% + (var(--margin) - var(--rule-inset)) / 2);
  transform: translateX(50%) rotate(180deg);
  writing-mode: vertical-rl;
  font-family: var(--text);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-soft);
}
.run {
  font-family: var(--display);
  font-size: var(--step-run);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.sep { color: var(--ink-soft); }

/* ---------- The artwork ---------- */

.art {
  position: relative;
  overflow: hidden;
  background: var(--print-ground);
  /* a size container, so the petals can measure the crop (cqw/cqh) */
  container-type: size;
  --ox: 0.72;   /* the img's horizontal object-position, as a fraction */
}
.art img {
  width: 100%; height: 100%;
  object-fit: cover;
}
/* the art's own margin rule: a gilt hairline where paper meets print */
.art::after {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  border-left: var(--hairline) solid var(--rule);
  pointer-events: none;
}

/* ---------- Petals: cut from the print, drifting over the art only ---------- */

/* The petals only fall through the empty sky on the left of the print. The
   birds begin 42% across the print itself, but where that lands on screen
   depends on the crop, so the sky's width is worked out from the container:
   the img is scaled to cover (its width is the larger of the box width and
   the box height x the print's 1600/2026 ratio), then shifted by --ox of the
   overflow. The sky stops at 40% of the print, a little short of the birds. */
.petals {
  --print-w: max(100cqw, 100cqh * 0.7897);
  position: absolute; inset: 0 auto 0 0;
  width: 34%;   /* fallback without container units */
  width: clamp(5rem, var(--print-w) * 0.4 - (var(--print-w) - 100cqw) * var(--ox), 100%);
  pointer-events: none;
}
/* each lane keeps 16px clear of both sky edges for the sway */
.track {
  position: absolute;
  top: 0; left: calc(16px + (100% - 76px) * var(--x));
  height: 100%;
  width: 44px;
  animation: fall 24s linear var(--w) infinite;
  animation-play-state: paused;
  will-change: transform;
}
.petal {
  display: block;
  width: 44px; height: 44px;
  /* a window onto the print's own blossom, with a light pink wash multiplied
     over it so it reads on the grey while the print's grain shows through */
  background:
    linear-gradient(var(--t, var(--petal-tint-1)), var(--t, var(--petal-tint-1))),
    url("../assets/art/koson-petals.webp") var(--bx) var(--by) / 300px 300px no-repeat;
  background-blend-mode: multiply, normal;
  /* a cherry petal, not a heart: longer than it is wide (about 1.6 to 1),
     tapering to a blunt stalk, widest in its upper half, with one small
     V-notch set right of centre and a left shoulder a touch fuller */
  clip-path: path("M21.4 42.6C17.2 38.4 11.6 31.2 10 23.2 8.6 16.2 10.6 9.6 15.6 6.4 17.6 5.1 19.8 4.6 21.8 5L23.3 7.6 24.3 4.9C26.6 4.7 29 5.4 30.8 6.9 33.6 9.6 34.4 15.4 33.4 21.8 32.2 29.6 27.8 37.2 23.6 42.4 23 43.1 22 43.2 21.4 42.6Z");
  animation: sway var(--sw, 6s) ease-in-out var(--w) infinite alternate;
  animation-play-state: paused;
}
.art.is-live .track, .art.is-live .petal { animation-play-state: running; }

@keyframes fall {
  from { transform: translateY(-8%); }
  to   { transform: translateY(100%); }
}
/* each petal keeps its own size (--s) and resting angle (--r) as it tumbles */
@keyframes sway {
  from { transform: translateX(0) rotate(var(--r)) scale(var(--s)); }
  to   { transform: translateX(var(--sway)) rotate(calc(var(--r) + 55deg)) scale(var(--s)); }
}

@media (prefers-reduced-motion: reduce) {
  .petals { display: none; }
  .btn { transition: none; }
}

/* ---------- Phone and small tablet: one column, art as a full-bleed band ---------- */

@media (max-width: 56.1875rem) {
  .folio { display: flex; flex-direction: column; }
  .copy { display: contents; }
  h1 { order: 1; margin-top: var(--s2); }
  .lede { order: 2; }
  .actions { order: 3; }
  /* the services line comes straight after the button, before the artwork */
  .services { order: 4; margin-top: var(--s3); }
  .art {
    order: 5;
    margin: var(--s3) calc(-1 * var(--margin)) 0;
    height: min(118vw, 34rem);
  }
  /* sits higher than the desktop crop so the top bird keeps its head at 600-899px */
  .art img { object-position: 72% 30%; }
  .art::after { inset: 0 0 auto 0; border-left: 0; border-top: var(--hairline) solid var(--rule); }
}

/* ---------- Desktop: half-screen split, art bleeds top, right and bottom ---------- */

@media (min-width: 56.25rem) {
  .hero {
    --art-w: 46%;
    min-height: 100svh;
    padding-right: calc(var(--art-w) + var(--margin));
    display: flex; flex-direction: column;
  }
  .folio { flex: 1; display: flex; }
  /* headline, lede, button and services move as one block with a fixed gap,
     centred in the space under the masthead (no dead band on tall screens) */
  .copy {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    padding-block: var(--s2);
  }
  .art {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: var(--art-w);
  }
  .art { --ox: 0.78; }
  .art img { object-position: 78% 70%; }
}
/* small laptops and landscape tablets: give the words a little more width */
@media (min-width: 56.25rem) and (max-width: 71.875rem) {
  .hero { --art-w: 40%; }
}
/* short desktop screens: tighten the vertical rhythm so the services line
   ends above the fold (checked at 1024x768, 1280x800 and 905x700) */
@media (min-width: 56.25rem) and (max-height: 50rem) {
  .masthead { padding-top: var(--s0); }
  .copy { padding-block: var(--s1); }
  .lede { margin-top: var(--s0); }
  .actions { margin-top: var(--s1); }
  .services { margin-top: var(--s2); padding-top: var(--s0); }
  .margin-label { top: var(--s0); }
}

/* ---------- Section 2: what you get (an editorial folio page) ---------- */

.wyg {
  position: relative;
  padding: var(--s4) var(--margin);
  border-top: var(--hairline) solid var(--rule);
}
/* the folio margin rule carries on from the hero */
.wyg::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: var(--rule-inset);
  border-left: var(--hairline) solid var(--rule);
  pointer-events: none;
}
.wyg h2, .wyg h3 { margin: 0; font-family: var(--display); font-weight: 400; }
.wyg h2 {
  font-size: var(--step-3);
  line-height: var(--leading-display);
  letter-spacing: -0.012em;
}
.wyg-intro { margin-top: var(--s0); max-width: var(--measure); font-size: var(--step-1); text-wrap: pretty; }
.draft { margin-top: var(--s-1); font-size: var(--step--1); color: var(--ink-soft); }

/* One register with three rhythms: Websites alone, then a pair, then a short
   ledger. Each group sits under the same full-width gilt hairline (the one
   divider style); entries inside a group are parted by space, not rules. */
.entry--lead, .entry-pair, .entry-ledger {
  margin-top: var(--s2);
  padding-top: var(--s1);
  border-top: var(--hairline) solid var(--rule);
}
.entry-pair .entry + .entry,
.entry-ledger .entry + .entry { margin-top: var(--s2); }
.entry h3 { font-size: var(--step-2); line-height: 1.12; letter-spacing: -0.01em; }
.entry-body { margin-top: var(--s-1); }
.entry p { max-width: var(--measure); text-wrap: pretty; }
.price {
  margin-top: var(--s-1);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
}
/* the ledger: name and price share a line, the price ranged right on the
   names column so the two prices stand in one column */
.entry-line {
  display: flex; flex-wrap: wrap;
  align-items: baseline; justify-content: space-between;
  gap: var(--s-2) var(--s0);
}
.entry-line .price { margin-top: 0; }

/* Websites: the lead entry, name set larger than the rest */
.entry--lead { margin-top: var(--s3); }
.entry--lead h3 {
  font-size: var(--step-4);
  line-height: var(--leading-display);
  letter-spacing: -0.015em;
}
.entry--lead .entry-body { margin-top: var(--s0); font-size: var(--step-1); }

/* A clean, hard-edged crop of the print: no border, shadow, feather or blend.
   On phones it goes edge to edge; from the desktop breakpoint it lines up
   with the content grid's left edge, under "Websites". */
.plate {
  position: relative; z-index: 1;   /* sits above the folio margin rule on phones */
  margin: var(--s2) calc(-1 * var(--margin)) 0;   /* phones: full width, edge to edge */
  background: var(--print-ground);
}
.plate img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 60% 45%;
}

/* The honest line and the same two actions as the hero */
.wyg-foot {
  margin-top: var(--s3);
  padding-top: var(--s2);
  border-top: var(--hairline) solid var(--rule);
}
.honest {
  max-width: 24em;
  font-family: var(--display);
  font-size: var(--step-2);
  line-height: 1.2;
  text-wrap: pretty;
}
.wyg-foot .actions { margin: var(--s2) 0 0; }

@media (min-width: 56.25rem) {
  .wyg > * { max-width: 84rem; }
  .wyg-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--s1); align-items: end; }
  .wyg-head h2 { grid-column: 1 / 6; }
  .wyg-intro, .wyg-head .draft { grid-column: 7 / 13; }
  .wyg-intro { margin-top: 0; }
  .wyg-head .draft { grid-row: 2; }

  /* Two shared columns for every entry: names start at column 1 (the
     heading's edge), copy at column 7 (the intro's edge). */
  .entry--lead, .entry-pair, .entry-ledger .entry {
    display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--s1);
  }
  .entry--lead, .entry-pair, .entry-ledger { padding-top: var(--s2); }

  /* Websites: name on the names edge, copy on the copy edge */
  .entry--lead { grid-template-rows: auto 1fr; }
  .entry--lead h3 { grid-column: 1 / 6; }
  .entry--lead .entry-body { grid-column: 7 / 13; grid-row: 1 / 3; margin-top: 0.6em; }
  /* the print crop fills the space under "Websites", flush with the names edge */
  .plate {
    grid-column: 1 / 6; grid-row: 2; align-self: start;
    margin: var(--s1) 0 0;   /* no bleed: left edge matches "Websites" / Care plans */
  }
  .plate img { aspect-ratio: 16 / 9; }

  /* the pair: one entry on each edge, each stacked name, copy, price */
  .entry-pair .entry:first-child { grid-column: 1 / 6; }
  .entry-pair .entry + .entry { grid-column: 7 / 13; margin-top: 0; }

  /* the ledger: name and price on the names column, copy on the copy edge */
  .entry-line { grid-column: 1 / 6; }
  .entry-ledger .entry-body { grid-column: 7 / 13; grid-row: 1; margin-top: 0.35em; }
  .entry-ledger .entry + .entry { margin-top: var(--s1); }

  .wyg-foot {
    display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--s1);
    align-items: end;
  }
  .honest { grid-column: 1 / 8; }
  .wyg-foot .actions { grid-column: 9 / 13; margin: 0; justify-self: end; }
}

/* ---------- Contact, footer and the privacy page ---------- */

/* the folio margin rule carries on down every block below the hero */
.contact, .site-foot, .page { position: relative; }
.contact::before, .site-foot::before, .page::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: var(--rule-inset);
  border-left: var(--hairline) solid var(--rule);
  pointer-events: none;
}

.contact {
  padding: var(--s4) var(--margin);
  border-top: var(--hairline) solid var(--rule);
}
.contact h2, .notice h1, .notice h2 { font-family: var(--display); font-weight: 400; }
.contact h2 {
  font-size: var(--step-3);
  line-height: var(--leading-display);
  letter-spacing: -0.012em;
}
.contact-body { margin-top: var(--s1); }
.contact-body p { max-width: var(--measure); font-size: var(--step-1); text-wrap: pretty; }
/* the address is the call to action: set in the display face, underlined */
.contact-body .contact-address {
  margin-top: var(--s1);
  font-family: var(--display);
  font-size: var(--step-2);
  line-height: 1.2;
}
.contact-address a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.contact-address a:hover { text-decoration-thickness: 2px; }
.contact-body .contact-note { margin-top: var(--s0); font-size: var(--step-0); color: var(--ink-soft); }

/* a quiet footer: one small line, parted by space */
.site-foot {
  padding: var(--s1) var(--margin) var(--s2);
  border-top: var(--hairline) solid var(--rule);
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.site-foot ul {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0 var(--s1);
  margin: 0; padding: 0; list-style: none;
}
.site-foot li { padding-block: var(--s-2); }
.site-foot a {
  color: var(--ink-soft);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  padding-block: var(--s-2);   /* tap target */
}
.site-foot a:hover { color: var(--ink); }

/* privacy page: the same masthead, then a short register of notes */
.page { padding: 0 var(--margin); }
.notice { padding: var(--s3) 0 var(--s4); }
.notice h1 { max-width: none; }
.notice-intro { margin-top: var(--s0); max-width: var(--measure); font-size: var(--step-1); text-wrap: pretty; }
.notice section {
  margin-top: var(--s2);
  padding-top: var(--s1);
  border-top: var(--hairline) solid var(--rule);
}
.notice h2 { margin: 0; font-size: var(--step-2); line-height: 1.12; letter-spacing: -0.01em; }
.notice section > div { margin-top: var(--s-1); }
.notice p, .notice ul { max-width: var(--measure); text-wrap: pretty; }
.notice p + p, .notice p + ul, .notice ul + p { margin-top: var(--s-1); }
.notice ul { margin-bottom: 0; padding-left: 1.2em; }
.notice a { color: var(--ink); text-underline-offset: 0.2em; }
.notice .updated { margin-top: var(--s2); color: var(--ink-soft); font-size: var(--step--1); }

@media (min-width: 56.25rem) {
  .notice { max-width: 84rem; }
  /* the same 84rem register width as section 2, on the same 12 columns */
  .contact {
    display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--s1);
    padding-right: max(var(--margin), 100% - 84rem - var(--margin));
  }
  .contact h2 { grid-column: 1 / 6; }
  .contact-body { grid-column: 7 / 13; margin-top: 0.4em; }

  .notice section { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--s1); padding-top: var(--s2); }
  .notice h2 { grid-column: 1 / 6; }
  .notice section > div { grid-column: 7 / 13; margin-top: 0.35em; }
}
