/* Petal Pour website. A florist's catalogue: warm paper, ink, serif type,
   and the game's own art (bottles, shop, flowers, map). */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f5eee2;
  --paper-deep: #ece2cf;
  --card: #fbf7ef;
  --ink: #2c2822;
  --ink-soft: #6a6052;
  --rule: #d8cab2;
  --rose: #b0456a;
  --moss: #546d47;
  --wood: #6e4527;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--rose); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
p { margin: 0 0 1em; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule); }
.masthead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 600 21px/1 "Fredoka", var(--sans);
  letter-spacing: -0.01em;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span { white-space: nowrap; }
.masthead nav { display: flex; gap: 26px; font-size: 15px; }
.masthead nav a { color: var(--ink-soft); text-decoration: none; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--ink); }

/* Hero */
.hero { padding: 64px 0 72px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: center;
}
.kicker {
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(46px, 6.2vw, 82px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
}
.lede {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 30em;
}
.stores {
  list-style: none;
  padding: 0;
  margin: 34px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.stores li {
  display: flex;
  flex-direction: column;
  padding: 10px 18px 11px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  min-width: 150px;
}
.store-name { font-weight: 600; font-size: 15px; }
.store-state { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 15px; }

/* The shop counter with the playable pour */
.counter { margin: 0; }
.counter-window {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(43, 26, 14, 0) 35%, rgba(43, 26, 14, 0.5) 100%),
    url("/assets/art/shop.webp") center 38% / cover no-repeat;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 24px 48px -28px rgba(70, 40, 20, 0.55);
  min-height: 440px;
  display: flex;
  align-items: flex-end;
}
.demo { position: relative; width: 100%; padding: 0 22px 26px; }
.demo-bottles {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(10px, 3.2vw, 24px);
  padding-top: 40px;
}
.demo-shelf { position: relative; z-index: 1; width: 100%; height: 20px; margin-top: -8px; object-fit: fill; }
.counter-note {
  margin-top: 14px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  text-align: center;
  min-height: 1.6em;
}

.demo-bloom {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(251, 246, 236, 0.9);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 24px;
}
.demo-bloom[hidden] { display: none; }
.demo-bloom img { width: 150px; animation: bloom 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.demo-bloom-title { font-family: var(--serif); font-size: 30px; margin: 6px 0 2px; }
.demo-bloom-sub { color: var(--ink-soft); margin-bottom: 18px; }
.demo-again {
  font: 600 15px/1 var(--sans);
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
}
.demo-again:hover { background: var(--rose); }

/* A bottle, drawn like the game: nectar clipped to the inside of the glass */
.bottle {
  --bw: clamp(46px, 10.5vw, 72px);
  position: relative;
  width: var(--bw);
  aspect-ratio: 295 / 653;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  transition: transform 0.25s ease;
}
button.bottle { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.bottle:focus-visible { outline: 2px solid #fff; outline-offset: 6px; border-radius: 12px; }
.bottle .glass { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.bottle .nectar {
  position: absolute;
  inset: 0;
  z-index: 1;
  clip-path: polygon(32% 4%, 68% 4%, 74% 17%, 80% 21%, 90.5% 25.5%, 95% 31%, 95.2% 89.7%, 94.6% 92.7%, 90.7% 95.8%, 86.8% 97.3%, 80.6% 98.4%, 50% 98.5%, 19.4% 98.4%, 13.2% 97.3%, 9.3% 95.8%, 5.4% 92.7%, 4.8% 89.7%, 5% 31%, 9.5% 25.5%, 20% 21%, 26% 17%);
}
.layer {
  position: absolute;
  left: 0;
  right: 0;
  height: 18.685%;
  bottom: calc(1.68% + var(--i) * 18.685%);
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--c) 64%, #000) 0%,
    color-mix(in srgb, var(--c) 70%, #fff) 20%,
    var(--c) 48%,
    color-mix(in srgb, var(--c) 88%, #000) 80%,
    color-mix(in srgb, var(--c) 60%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform-origin: bottom;
}
.layer.first { bottom: 0; height: calc(18.685% + 1.68%); }
.layer.fresh { animation: fill 0.32s ease-out both; }
.bottle .cork {
  position: absolute;
  left: 31%;
  top: -2.54%;
  width: 38%;
  height: 12.04%;
  z-index: 3;
  object-fit: fill;
  animation: cork 0.35s ease-out both;
}
.bottle.is-selected { transform: translateY(-16px); }
.bottle.is-pouring-left { transform: translateY(-22px) rotate(-16deg); }
.bottle.is-pouring-right { transform: translateY(-22px) rotate(16deg); }
.bottle.is-wrong { animation: wobble 0.35s ease; }

@keyframes fill { from { transform: scaleY(0); } }
@keyframes cork { from { transform: translateY(-40%); opacity: 0; } }
@keyframes wobble { 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes bloom { from { transform: scale(0.4); opacity: 0; } }

/* Section heads */
.section-head {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
}

/* How it plays */
.how { padding: 72px 0 84px; border-top: 1px solid var(--rule); }
.steps {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}
.step { border-top: 1px solid var(--ink); padding-top: 22px; }
.step-art {
  height: 170px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  margin-bottom: 18px;
}
.step-art .bottle { --bw: 64px; }
.step-art-flower img { width: 150px; }
.step-num {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  color: var(--rose);
  font-size: 18px;
  margin-bottom: 4px;
}
.step h3 { font-size: 30px; margin-bottom: 8px; }
.step p { color: var(--ink-soft); max-width: 22em; }

/* The flowers */
.flowers { padding: 84px 0 90px; background: var(--paper-deep); }
.flowers-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 44px;
}
.flowers-intro .section-head { margin: 0; }
.flowers-intro p { color: var(--ink-soft); font-family: var(--serif); font-size: 19px; line-height: 1.55; margin: 0; }
.specimens {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.specimen {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  column-gap: 16px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 18px 16px 12px;
}
.specimen img { grid-row: 1 / span 3; width: 104px; height: 104px; object-fit: contain; }
.specimen h3 { font-size: 21px; line-height: 1.2; margin-top: 6px; }
.specimen .latin { font-family: var(--serif); font-style: italic; color: var(--moss); margin: 2px 0 6px; }
.specimen .meta { font-size: 13px; color: var(--ink-soft); margin: 0; }
.rare {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose);
  vertical-align: middle;
  margin-left: 4px;
}
.factcard {
  margin-top: 36px;
  padding: 28px 32px;
  background: var(--paper);
  border-left: 3px solid var(--rose);
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  column-gap: 32px;
  align-items: baseline;
}
.factcard-label {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}
.factcard blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.3;
}
.factcard-sources { grid-column: 2; margin: 14px 0 0; font-size: 14px; color: var(--ink-soft); }

/* Atlas */
.atlas { padding: 88px 0; }
.atlas-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: 56px;
  align-items: center;
}
.atlas-copy > p { color: var(--ink-soft); font-family: var(--serif); font-size: 19px; line-height: 1.55; }
.atlas-map { border-radius: 16px; box-shadow: 0 24px 48px -30px rgba(30, 60, 90, 0.6); }
.chapters { margin: 28px 0 14px; }
.chapters div { border-top: 1px solid var(--rule); padding: 12px 0; }
.chapters div:last-child { border-bottom: 1px solid var(--rule); }
.chapters dt { font-family: var(--serif); font-size: 20px; }
.chapters dd { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.small { font-size: 14px; color: var(--ink-soft); }

/* Small print */
.fineprint { padding: 64px 0 72px; border-top: 1px solid var(--rule); }
.fineprint-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; }
.fineprint-grid .section-head { font-size: clamp(26px, 3vw, 34px); }
.fineprint p { color: var(--ink-soft); max-width: 40em; }

/* Colophon */
.colophon { border-top: 1px solid var(--ink); padding: 28px 0 40px; font-size: 14px; color: var(--ink-soft); }
.colophon-row { display: flex; justify-content: space-between; gap: 18px 32px; flex-wrap: wrap; align-items: flex-start; }
.colophon p { margin: 0; }
.colophon nav { display: flex; gap: 22px; }
.colophon nav a { color: var(--ink-soft); }

/* Long-form pages: support, privacy, 404 */
.page { padding: 56px 0 88px; }
.page .wrap { max-width: 720px; }
.page h1 { font-size: clamp(40px, 6vw, 58px); line-height: 1.05; letter-spacing: -0.015em; margin-bottom: 18px; }
.page h2 { font-size: 26px; line-height: 1.2; margin: 2em 0 0.5em; }
.page .meta { color: var(--ink-soft); font-size: 15px; }
.page li { margin-bottom: 0.4em; }
.page table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; }
.page th, .page td { text-align: left; padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.page th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.callout { background: var(--card); border-left: 3px solid var(--moss); padding: 16px 20px; margin: 20px 0; }

/* Narrow screens */
@media (max-width: 900px) {
  .hero { padding: 40px 0 56px; }
  .hero-grid, .flowers-intro, .atlas-grid, .fineprint-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .counter-window { min-height: 360px; }
  .specimens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .factcard { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
  .factcard-sources { grid-column: 1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: min(var(--wrap), 100% - 32px); }
  .masthead nav { gap: 16px; font-size: 14px; }
  .masthead nav a[href="#how"], .masthead nav a[href="/#flowers"] { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .step { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 20px; }
  .step-art { grid-row: 1 / span 3; height: auto; margin: 0; justify-content: center; }
  .step-art .bottle { --bw: 50px; }
  .step-art-flower img { width: 76px; }
  .step h3 { font-size: 26px; }
  .specimens { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .specimen { display: block; padding: 12px 12px 14px; }
  .specimen img { width: 88px; height: 88px; margin: 0 auto 6px; }
  .specimen h3 { font-size: 18px; }
  .specimen .latin { font-size: 15px; }
  .specimen .meta { font-size: 12px; }
  .demo { padding: 0 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
