/* Jimmy's Flower Shop: one bench of pale tickets on deep magenta. Grouped: layout, type, colour, motion. */

/* ---------- LAYOUT ---------- */

/* The shop's colours and measures, named for what they are on this bench. */
:root {
  --magenta: #930056;
  --blush: #ffd6ee;
  --jost: 'Jost', 'Futura', 'Avenir Next', system-ui, sans-serif;
  --bitter: 'Bitter', 'Rockwell', Georgia, serif;
  --bench: clamp(0.625rem, 0.2rem + 1.8vw, 1.5rem);
  --bench-edge: calc(var(--bench) + clamp(1rem, 0.4rem + 3.5vw, 3.5rem));
  --twine: 0.125rem;
  --thread: 0.0625rem;
  --bar: 0.4375rem;
  --hem: 0.5rem;
  --seam: 0.9375rem;
  --ticket-width: 46rem;
  --worktop: clamp(1.25rem, 0.8rem + 2vw, 2.5rem);
  --dock: 3rem;
  --sheet-time: 700ms;
  --ribbon-time: 900ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-block: 5rem calc(var(--bench) + var(--dock) + 1.5rem); }
body { margin: 0; min-block-size: 100vh; }
img, svg, video { display: block; max-inline-size: 100%; block-size: auto; }
[hidden] { display: none !important; }

/* Perimeter: the fixed double line round the window; the band outside it is solid so nothing shows through. */
.perimeter {
  position: fixed;
  inset: var(--bench);
  z-index: 40;
  pointer-events: none;
}

/* Skip link: class "jump", appears on focus. */
.jump {
  position: fixed;
  inset-block-start: calc(var(--bench) + 0.75rem);
  inset-inline-start: calc(var(--bench) + 0.75rem);
  z-index: 70;
  padding: 0.75rem 1rem;
  transform: translateY(-300%);
}
.jump:focus { transform: none; }

/* Name plate: class "nameplate", the solid pale link home, upper right. */
.nameplate {
  position: fixed;
  inset-block-start: calc(var(--bench) + 0.75rem);
  inset-inline-end: calc(var(--bench) + 0.75rem);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: 2.75rem;
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  --hem: 0.25rem;
  --seam: 0.4375rem;
}
.nameplate > svg { inline-size: 1.75rem; block-size: 1.75rem; }

/* Call control: class "dial", pinned upper left on phones only. */
.dial { display: none; }
@media (max-width: 47.99rem) {
  .dial {
    position: fixed;
    inset-block-start: calc(var(--bench) + 0.75rem);
    inset-inline-start: calc(var(--bench) + 0.75rem);
    z-index: 50;
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
    padding-inline: 1.1rem;
    --hem: 0.25rem;
    --seam: 0.4375rem;
  }
}

/* Menu button: class "menu", lower left in the bottom gutter, on one row with the captions; its two labels share one cell and the hidden one is visibility:hidden. */
.menu {
  position: fixed;
  inset-block-end: calc(var(--bench) + 0.5rem);
  inset-inline-start: calc(var(--bench) + 0.75rem);
  z-index: 50;
  display: grid;
  place-items: center;
  min-block-size: 2.75rem;
  min-inline-size: 5.75rem;
  padding: 0.5rem 1rem;
  border: 0;
  cursor: pointer;
  --hem: 0.25rem;
  --seam: 0.4375rem;
}
.menu > span { grid-area: 1 / 1; }
html:not(.js) .menu, html:not(.js) .sheet { display: none; }

/* Sheet: class "sheet", the full-window list of pages that the menu lowers. */
.sheet {
  position: fixed;
  inset: var(--bench);
  z-index: 30;
  overflow-y: auto;
  padding-block: 4.75rem calc(var(--dock) + 2rem);
  padding-inline: clamp(1.5rem, 1rem + 6vw, 7rem);
}
.sheet > ul { margin: 0; padding: 0; list-style: none; }
.sheet > ul + ul { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.75rem; margin-block-start: 2rem; }
.sheet a { display: inline-block; padding-block: 0.15em; }
.sheet > ul + ul :is(a, button) { display: inline-flex; align-items: center; min-block-size: 2.75rem; }
.sheet button { padding: 0; border: 0; background: none; cursor: pointer; }
html:has(.menu[aria-expanded="true"]) { overflow: hidden; }

/* Bottom gutter: class "corner" is a slim solid band inside the perimeter that the page scrolls beneath.
   One row: the Menu button sits in its left padding, then "Avon Park", and the current page at the right
   (it may wrap to two lines on a phone; it is never cut off). */
.corner {
  position: fixed;
  inset-inline: calc(var(--bench) + 0.375rem);
  inset-block-end: calc(var(--bench) + 0.375rem);
  min-block-size: var(--dock);
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-inline: 6.75rem 0.375rem;
}
.corner > p {
  margin: 0;
  padding: 0.15rem 0.25rem;
  min-inline-size: 0;
}
.corner > p:first-child { flex: none; white-space: nowrap; }
.corner > p:last-child { text-align: end; text-wrap: balance; overflow-wrap: anywhere; }

/* Main: the bench inside the perimeter; gutters clear the pinned plate above and the bottom gutter below. */
main {
  display: block;
  padding-block: calc(var(--bench) + 4.25rem) calc(var(--bench) + var(--dock) + 2rem);
  padding-inline: var(--bench-edge);
}
main > * + * { margin-block-start: clamp(2.5rem, 9vh, 6.5rem); }

/* Ticket: class "ticket", the pale double-framed panel; data-cut="wide" or "narrow" changes its width. A page opens with h1 then a lead <p> inside one. */
.ticket {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  inline-size: min(100%, var(--ticket-width));
  margin-inline: auto;
  padding: clamp(1.75rem, 1rem + 3vw, 3.25rem);
}
.ticket[data-cut="wide"] { inline-size: 100%; }
.ticket[data-cut="narrow"] { inline-size: min(100%, 30rem); }
.ticket > * { margin: 0; }

/* Rack: class "rack", shallow tickets or stubs side by side; they wrap to a stack on phones. */
.rack { display: flex; flex-wrap: wrap; align-items: start; gap: var(--worktop); }
.rack > * { flex: 1 1 18rem; margin: 0; }

/* Stub: class "stub", a product link: <img> then a .pricetag; size it per page with data-cut. */
.stub {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.35rem;
  text-decoration: none;
}
.stub > img { inline-size: 100%; object-fit: cover; }

/* Price tag: class "pricetag", product name (first span) and price (last span) on one baseline. */
.pricetag { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; margin: 0; }

/* Mount: class "mount", a <figure> holding one photograph and a <figcaption> inside the double frame. */
.mount { margin: 0; padding: 1.35rem; }
.mount > img, .mount > video { inline-size: 100%; object-fit: cover; }
.mount > figcaption { margin-block-start: 0.75rem; }

/* Pair: class "pair", two actions side by side at identical size. */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }

/* Action: class "action", the framed button or link; solid magenta, or data-paper="blush" on the magenta field. */
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 3.25rem;
  padding: 0.6rem 1.25rem;
  border: 0;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  --hem: 0.3125rem;
  --seam: 0.5rem;
}

/* Rule: class "rule" on <hr>, a double rule (2px over 1px). */
.rule { block-size: 0.375rem; margin-block: 1.5rem; border: 0; border-block: var(--twine) solid; border-block-end-width: var(--thread); }

/* Unseen: class "unseen", text for screen readers only. */
.unseen { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Trade card: class "trade" on the footer, one business card: the knot, then the name across the top,
   the address (street, then city, state and zip) beside the hours (one line each), then phone and Directions. */
.trade { padding-block: clamp(2.5rem, 9vh, 6.5rem) calc(var(--bench) + var(--dock) + 2rem); padding-inline: var(--bench-edge); }
.trade > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem clamp(1.25rem, 4vw, 3rem);
  inline-size: min(100%, 52rem);
  margin-inline: auto;
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem) clamp(1.75rem, 1rem + 3vw, 3rem);
}
.trade > div > svg { inline-size: clamp(3rem, 2rem + 4vw, 5rem); block-size: auto; }
.trade > div > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  align-items: start;
  gap: 0.35rem clamp(1.25rem, 3vw, 2.5rem);
}
.trade > div > div > * { margin: 0; }
.trade > div > div > p:first-child { grid-column: 1 / -1; margin-block-end: 0.35rem; }
.trade a { display: inline-flex; align-items: center; min-block-size: 2.75rem; }
@media (max-width: 47.99rem) {
  /* On a phone the knot stands above, so the address and hours get the card's full width. */
  .trade > div { grid-template-columns: minmax(0, 1fr); }
  .trade > div > div { grid-template-columns: minmax(0, 1fr); }
}

/* Consent label: #permission, a slim band docked just above the gutter; only mounted when optional measurement exists. */
#permission {
  position: fixed;
  inset-inline: calc(var(--bench) + 0.75rem);
  inset-block-end: calc(var(--bench) + var(--dock) + 0.75rem);
  z-index: 49;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  padding: 0.5rem 0.5rem 0.5rem 0.875rem;
  --hem: 0.125rem;
  --seam: 0.3125rem;
}
#permission > p { flex: 1 1 14rem; margin: 0; }
#permission > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; flex: 1 1 16rem; }
#permission .action { min-block-size: 2.75rem; padding: 0.3rem 0.5rem; --hem: 0.1875rem; --seam: 0.375rem; }

/* Offer ribbon: #word, a shallow pale band just above the gutter; on a desk screen it hugs the right. */
#word {
  position: fixed;
  inset-inline: calc(var(--bench) + 0.75rem);
  inset-block-end: calc(var(--bench) + var(--dock) + 0.75rem);
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem 0.5rem 0.875rem;
  --hem: 0.125rem;
  --seam: 0.3125rem;
}
#word > p { margin: 0; }
#word > button { flex: none; inline-size: 2.75rem; block-size: 2.75rem; border: 0; cursor: pointer; }
/* The offer waits its turn: while the cookie choice is open, the ribbon stays away. */
#permission:not([hidden]) ~ #word { display: none; }

@media (min-width: 64rem) {
  #permission, #word {
    inset-inline-start: auto;
    inline-size: fit-content;
  }
  #word { max-inline-size: min(44rem, calc(100vw - 2 * var(--bench) - 8.75rem)); }
  #permission { flex-wrap: nowrap; max-inline-size: min(54rem, calc(100vw - 2 * var(--bench) - 8.75rem)); }
  #permission > p { flex: 0 1 auto; }
  #permission > div { flex: none; inline-size: 20rem; }
}

/* Live hours line written by the script beside any element carrying data-hours. */
[data-hours] + p[aria-live] { margin-block-start: 0.5rem; }

/* ---------- TYPE ---------- */

body { font-family: var(--bitter); font-size: clamp(1rem, 0.94rem + 0.3vw, 1.125rem); line-height: 1.55; }
h1, h2, h3 { font-family: var(--jost); font-weight: 500; line-height: 1.15; text-wrap: balance; }
/* Headings: every h1 and h2 stands on a 7px bar the width of its text. */
main :is(h1, h2) { inline-size: fit-content; max-inline-size: 100%; padding-block-end: 0.3em; border-block-end: var(--bar) solid; margin-block: 0 0.75rem; }
h1 { font-size: clamp(1.4375rem, 1.2rem + 0.9vw, 1.875rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.25rem); }
h3 { font-size: 1.25rem; margin-block: 0 0.5rem; }
.ticket > h1 + p { font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem); }
.nameplate, .dial, .menu, .action, #word, #permission { font-family: var(--bitter); font-size: 1rem; line-height: 1.25; }
.sheet > ul:first-child a { font-family: var(--bitter); font-size: clamp(1.8rem, 1.2rem + 3vw, 3.5rem); line-height: 1.15; }
.sheet > ul + ul a { font-size: 1.125rem; }
.sheet button { font: inherit; font-size: 1.125rem; }
.corner > p, .mount > figcaption { font-size: 0.95rem; }
.corner > p { line-height: 1.2; }
.pricetag > span:first-child { font-family: var(--jost); font-weight: 500; font-size: 1.2rem; }
.pricetag > span:last-child { font-family: var(--bitter); font-size: 1.2rem; font-variant-numeric: tabular-nums lining-nums; }
.trade > div > div > p:first-child { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); line-height: 1.2; }
.trade address { font-style: normal; }
#word > button { font-size: 1.5rem; line-height: 1; }
#permission .action { font-size: 0.95rem; }
a { text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; }
.sheet a, .nameplate, .dial { text-decoration: none; }

/* ---------- COLOUR ---------- */

body { background: var(--magenta); color: var(--blush); }
a { color: inherit; }
.perimeter {
  border: var(--twine) solid var(--blush);
  box-shadow: 0 0 0 var(--bench) var(--magenta), inset 0 0 0 0.1875rem var(--magenta), inset 0 0 0 0.25rem var(--blush);
}
.jump, .corner > p { background: var(--magenta); color: var(--blush); }
.jump { background: var(--blush); color: var(--magenta); }
.corner { background: var(--magenta); border-block-start: var(--thread) solid var(--blush); }
.sheet { background: var(--magenta); color: var(--blush); }
.sheet button { color: inherit; }
.sheet a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: var(--bar); text-underline-offset: 0.25em; }
main :is(h1, h2) { border-color: var(--blush); }
:is(.ticket, .stub, .mount, .trade) :is(h1, h2) { border-color: var(--magenta); }

/* Double frame, pale: outer 2px stroke held inside the edge, a gap, then a 1px inset stroke. */
.ticket, .stub, .mount, .trade > div, #permission, #word, .nameplate, .dial, .menu, .action[data-paper="blush"] {
  background: var(--blush);
  color: var(--magenta);
  outline: var(--twine) solid var(--magenta);
  outline-offset: calc(-1 * var(--hem));
  box-shadow: inset 0 0 0 var(--seam) var(--blush), inset 0 0 0 calc(var(--seam) + var(--thread)) var(--magenta);
}
/* Double frame, reversed: the solid magenta action with pale strokes. */
.action:not([data-paper="blush"]) {
  background: var(--magenta);
  color: var(--blush);
  outline: var(--twine) solid var(--blush);
  outline-offset: calc(-1 * var(--hem));
  box-shadow: inset 0 0 0 var(--seam) var(--magenta), inset 0 0 0 calc(var(--seam) + var(--thread)) var(--blush);
}
.action:not([data-paper="blush"]):hover { box-shadow: inset 0 0 0 var(--seam) var(--magenta), inset 0 0 0 calc(var(--seam) + var(--twine)) var(--blush); }
:is(.stub, .action[data-paper="blush"], .nameplate, .dial, .menu):hover { box-shadow: inset 0 0 0 var(--seam) var(--blush), inset 0 0 0 calc(var(--seam) + var(--twine)) var(--magenta); }
#word > button { background: var(--magenta); color: var(--blush); }

/* Focus: a clear ring outside each control, in a colour that shows on its ground. */
:where(a, button):focus-visible { outline: 0.1875rem solid currentColor; outline-offset: 0.2rem; }
.action:not([data-paper="blush"]):focus-visible { outline: 0.1875rem solid var(--magenta); outline-offset: 0.25rem; }
:is(.stub, .nameplate, .dial, .menu, .action[data-paper="blush"]):focus-visible { outline: 0.1875rem solid var(--blush); outline-offset: 0.25rem; }
#permission .action:focus-visible, #word :focus-visible { outline-color: var(--magenta); }

/* ---------- MOTION ---------- */

/* Sheet: eases down as one piece over 700ms. */
.js .sheet { visibility: hidden; transform: translateY(-100%); transition: transform var(--sheet-time) cubic-bezier(0.22, 0.7, 0.18, 1), visibility 0s linear var(--sheet-time); }
.js .menu[aria-expanded="true"] ~ .sheet { visibility: visible; transform: none; transition: transform var(--sheet-time) cubic-bezier(0.22, 0.7, 0.18, 1), visibility 0s; }
.menu[aria-expanded="true"] > span:first-child, .menu:not([aria-expanded="true"]) > span:last-child { visibility: hidden; }

/* Offer ribbon: rests off the right edge, unrolls in once. */
#word { transform: translateX(calc(100% + 3rem)); opacity: 0; transition: transform var(--ribbon-time) cubic-bezier(0.25, 0.8, 0.25, 1), opacity 400ms ease-out; }
#word.is-in { transform: none; opacity: 1; }

/* Slip: class "slip" settles into place when scrolled to; the script sets data-pinned. */
.js .slip[data-pinned="false"] { transform: translateY(1.25rem); opacity: 0.35; }
.js .slip[data-pinned="true"] { transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 600ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .js .slip[data-pinned="false"] { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
@media (min-width: 120.0625rem) { html { font-size: 0.8333vw; } }
header :is(a, button), nav :is(a, button) { position: relative; z-index: 2; }
html, body { overflow-x: clip; }
