/* Crafting Grannies - "seed catalogue" cottagecore × grid
   Plain CSS, no framework or build step. */

/* ---------- Fonts (self-hosted, Latin characters only, trimmed to the weights in use) ---------- */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url('fonts/cormorant-garamond-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/newsreader-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('fonts/newsreader-italic-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/caveat-latin.woff2') format('woff2');
}

/* Georgia, resized to match each web font, so text doesn't jump when the fonts arrive */
@font-face {
  font-family: 'Cormorant Fallback';
  src: local('Georgia');
  size-adjust: 88.7%;
  ascent-override: 104.2%;
  descent-override: 32.4%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Newsreader Fallback';
  src: local('Georgia');
  size-adjust: 95.9%;
  ascent-override: 76.6%;
  descent-override: 27.6%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Newsreader Fallback';
  font-style: italic;
  src: local('Georgia Italic'), local('Georgia-Italic');
  size-adjust: 95.9%;
  ascent-override: 76.6%;
  descent-override: 27.6%;
  line-gap-override: 0%;
}

:root {
  --paper: #f7f1e6;
  --paper-2: #efe6d5;
  --card: #fffcf6;
  --ink: #2b2420;
  --ink-2: #5a4e45;
  --rule: #d9ccb6;
  --rule-strong: #b7a68b;
  --wine: #8b2635;
  --wine-deep: #6e1c29;
  --sage: #7d8f6e;
  --sage-deep: #4c5d43;
  --moss: #2f3a2c;
  --butter: #f3e2a6;
  --butter-deep: #e2c66b;

  --font-display: 'Cormorant Garamond', 'Cormorant Fallback', Georgia, 'Times New Roman', serif;
  --font-body: 'Newsreader', 'Newsreader Fallback', Georgia, 'Times New Roman', serif;
  --font-hand: 'Caveat', 'Bradley Hand', 'Segoe Print', cursive;

  --wrap: 75rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 6px;
  --shadow: 0 1px 2px rgb(43 36 32 / 0.08), 0 8px 24px -12px rgb(43 36 32 / 0.25);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html:has(dialog[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.6;
  background-color: var(--paper);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .28 0 0 0 0 .18 .09 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* <picture> only chooses between AVIF and WebP; it shouldn't affect layout */
picture {
  display: contents;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--wine);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--wine-deep);
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.kicker {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wine);
}

.kicker.light {
  color: var(--butter);
}

.hand-note {
  font-family: var(--font-hand);
  font-weight: 500;
  color: var(--wine);
  line-height: 1;
}

.sprig {
  width: 7.5rem;
  height: 2.25rem;
  color: var(--sage);
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.65rem 1.4rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.btn-wine {
  background: var(--wine);
  color: #fff;
}

.btn-wine:hover {
  background: var(--wine-deep);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-ghost:hover {
  background: var(--card);
  color: var(--ink);
  border-color: var(--ink-2);
}

.btn-small {
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.text-link svg {
  width: 1.1rem;
  height: 1.1rem;
  transition: transform 0.15s ease;
}

.text-link:hover svg {
  transform: translateX(3px);
}

/* ---------- Ribbon & header ---------- */

.ribbon {
  background: var(--wine);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 0.45rem var(--gutter) 0.35rem;
}

/* little scalloped valance under the ribbon */
.scallops {
  height: 10px;
  background: radial-gradient(circle at 10px 0, var(--wine) 9.5px, transparent 10px) 0 0 / 20px 10px repeat-x, var(--paper);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgb(247 241 230 / 0.94);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--wine);
}

.brand-bug {
  width: 1.7rem;
  height: 1.7rem;
  flex: none;
  overflow: visible;
}

.main-nav {
  display: none;
  margin-left: auto;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  text-decoration: none;
  padding-block: 0.4rem;
  border-bottom: 1.5px solid transparent;
}

.main-nav a:hover {
  color: var(--wine);
  border-bottom-color: currentColor;
}

.header-cta {
  margin-left: auto;
  gap: 0.3em;
  white-space: nowrap;
}

@media (max-width: 479px) {
  .cta-extra {
    display: none;
  }
}

.menu-button {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.menu-button svg {
  width: 1.6rem;
  height: 1.6rem;
}

.mobile-menu {
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0.25rem var(--gutter) 0.75rem;
}

.mobile-menu a {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--rule);
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 500;
  text-decoration: none;
}

@media (max-width: 400px) {
  .brand {
    font-size: 1.35rem;
  }

  .header-cta {
    padding-inline: 0.8rem;
  }
}

/* Smallest phones: no room for the Contact button (it's in the menu as "Contact Carol") */
@media (max-width: 374px) {
  .header-cta {
    display: none;
  }

  .menu-button {
    margin-left: auto;
  }
}

@media (min-width: 900px) {
  .main-nav {
    display: flex;
  }

  .header-cta {
    margin-left: 0.5rem;
  }

  .menu-button,
  .mobile-menu {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 6vw, 5rem);
}

.hero-inner {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero h1 {
  margin-top: 0.9rem;
  font-size: clamp(2.6rem, 1.6rem + 4vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.h1-sub {
  display: block;
  margin-top: 1rem;
  max-width: 32rem;
  font-family: var(--font-body);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--sage-deep);
}

.lede {
  margin-top: 1.25rem;
  max-width: 34rem;
  color: var(--ink-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* 2 × 2 specimen drawer */
.hero-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--card);
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow);
}

.hero-tiles li {
  box-shadow: 1px 0 0 0 var(--rule), 0 1px 0 0 var(--rule);
}

.hero-tile {
  display: block;
  padding: clamp(0.5rem, 1.5vw, 0.85rem);
  color: var(--ink);
  text-decoration: none;
}

.hero-tile img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.hero-tile-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.4rem;
  padding: 0.55rem 0.15rem 0.1rem;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.3rem);
  font-weight: 600;
  line-height: 1.2;
}

.tile-no {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.hero-tile:hover .hero-tile-label {
  color: var(--wine);
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: 1.1fr 1fr;
  }

  .hero-tiles {
    width: 100%;
    max-width: 31rem;
    margin-left: auto;
  }
}

/* ---------- Section headings ---------- */

.section-head {
  display: grid;
  gap: 0.5rem;
}

.section-head.center {
  justify-items: center;
  text-align: center;
}

.section-head h2,
.collection-head h2 {
  font-size: clamp(2.1rem, 1.6rem + 2vw, 3rem);
  font-weight: 500;
}

/* ---------- How a custom gift comes together ---------- */

.how {
  padding-block: clamp(3rem, 6vw, 4.5rem);
  background: var(--paper-2);
  border-block: 1px solid var(--rule);
}

.steps {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.step {
  position: relative;
  padding: 1.6rem 1.5rem 1.5rem 4.6rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  /* stitched edge */
  outline: 1.5px dashed rgb(139 38 53 / 0.3);
  outline-offset: -7px;
}

.step-no {
  position: absolute;
  left: 1.25rem;
  top: 1.35rem;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--butter);
  color: var(--wine-deep);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
}

.step h3 {
  font-size: 1.5rem;
}

.step p {
  margin-top: 0.4rem;
  color: var(--ink-2);
}

/* the note under the steps: about past pieces and budgets */
.how-note {
  max-width: 44rem;
  margin: 2rem auto 0;
  text-align: center;
  font-style: italic;
  color: var(--ink-2);
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* ---------- Seasonal note ---------- */

.seasonal {
  margin-block: clamp(2.5rem, 5vw, 3.5rem) 0;
  isolation: isolate;
}

.seasonal-card {
  position: relative;
  display: grid;
  gap: 1rem;
  align-items: center;
  padding: 1.75rem 1.5rem 1.5rem;
  background-color: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* gingham border */
.seasonal-card::before {
  content: '';
  position: absolute;
  inset: -9px;
  z-index: -1;
  border-radius: calc(var(--radius) + 6px);
  background-color: var(--card);
  background-image:
    linear-gradient(90deg, rgb(139 38 53 / 0.22) 50%, transparent 50%),
    linear-gradient(rgb(139 38 53 / 0.22) 50%, transparent 50%);
  background-size: 12px 12px;
}

.seasonal-card h2 {
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
  font-weight: 600;
}

.seasonal-card p {
  margin-top: 0.35rem;
  color: var(--ink-2);
}

.seasonal-card .hand-note {
  position: absolute;
  top: -1.4rem;
  left: 1.25rem;
  margin: 0;
  padding: 0 0.5rem;
  background: var(--paper);
  font-size: 1.6rem;
  transform: rotate(-3deg);
}

@media (min-width: 760px) {
  .seasonal-card {
    grid-template-columns: 1fr auto;
    padding: 2rem 2.25rem 1.75rem;
  }
}

/* ---------- Collections ---------- */

.collection {
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}

.collection.alt {
  background: var(--paper-2);
  border-block: 1px solid var(--rule);
}

.collection-head {
  display: grid;
  justify-items: start;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
}

.collection-no {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wine);
}

.collection-head .sprig {
  margin-top: 0.15rem;
}

.collection-intro {
  max-width: 40rem;
  margin-top: 0.4rem;
  color: var(--ink-2);
}

/* Filter chips */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  min-height: 2.6rem;
  padding: 0.35rem 1rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: 500 0.98rem/1.2 var(--font-body);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--wine);
}

.chip[aria-pressed='true'] {
  background: var(--wine);
  border-color: var(--wine);
  color: #fff;
}

.filter-status {
  margin: 0.85rem 0 1.25rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-2);
}

/* The ruled catalogue grid: hairlines shared between cells, like a seed catalogue page.
   Flexbox rather than CSS grid so a short last row (or a filtered list) sits centred
   instead of leaving an empty box beside it. */
.specimens {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.specimens > li {
  flex: 0 0 50%;
  max-width: 50%;
  background: var(--card);
  box-shadow:
    1px 0 0 0 var(--rule),
    0 1px 0 0 var(--rule),
    1px 1px 0 0 var(--rule),
    1px 0 0 0 var(--rule) inset,
    0 1px 0 0 var(--rule) inset;
}

@media (min-width: 720px) {
  .specimens > li {
    flex-basis: 33.333%;
    max-width: 33.333%;
  }
}

@media (min-width: 1080px) {
  .specimens:not(.specimens--3) > li {
    flex-basis: 25%;
    max-width: 25%;
  }
}

.specimen {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(0.65rem, 1.6vw, 1.1rem);
  transition: background-color 0.2s ease;
}

.specimen[hidden] {
  display: none;
}

.specimen:hover {
  background: #fff;
}

.specimen:focus-within {
  outline: 3px solid var(--wine);
  outline-offset: -3px;
}

.specimen-photo {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}

.specimen-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

@media (prefers-reduced-motion: no-preference) {
  .specimen-photo img {
    transition: transform 0.5s ease;
  }

  .specimen:hover .specimen-photo img {
    transform: scale(1.04);
  }
}

.specimen-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.specimen-no {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.specimen-name {
  margin-top: 0.35rem;
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  line-height: 1.15;
}

.specimen-name a {
  color: var(--ink);
  text-decoration: none;
}

/* the whole cell is clickable */
.specimen-name a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.specimen-name a:focus-visible {
  outline: none;
}

.specimen:hover .specimen-name a {
  color: var(--wine);
}

.specimen-for {
  margin-top: 0.3rem;
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-2);
}

/* Price tags, with a punched hole */
.price-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.6rem 0.1rem 1.15rem;
  background: var(--butter);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.5;
  clip-path: polygon(0.65rem 0, 100% 0, 100% 100%, 0.65rem 100%, 0 50%);
}

.price-tag::before {
  content: '';
  position: absolute;
  left: 0.6rem;
  top: 50%;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: var(--card);
  box-shadow: inset 0 0 0 1px rgb(43 36 32 / 0.25);
  transform: translateY(-50%);
}

.price-tag--large {
  padding: 0.2rem 0.9rem 0.2rem 1.5rem;
  font-size: 1.35rem;
  clip-path: polygon(0.85rem 0, 100% 0, 100% 100%, 0.85rem 100%, 0 50%);
}

.price-tag--large::before {
  left: 0.8rem;
  width: 0.4rem;
  height: 0.4rem;
}

/* A piece with no price shows no tag */
.price-tag:empty {
  display: none;
}

/* Inukshuk meaning card */
.specimen-note {
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  background: var(--paper-2);
}

.specimen-note h3 {
  font-size: 1.45rem;
}

.specimen-note p {
  margin-top: 0.6rem;
  font-size: 0.98rem;
  color: var(--ink-2);
}

@media (max-width: 719px) {
  .specimens > .specimen-note {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* ---------- Story bands ---------- */

.story {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}

.story-text p:not(.kicker) {
  margin-top: 1rem;
  color: var(--ink-2);
}

.story-text h2 {
  margin-top: 0.5rem;
  font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
  font-weight: 500;
}

.story-text .text-link {
  margin-top: 1.25rem;
}

.polaroid {
  justify-self: center;
  width: min(100%, 22rem);
  margin: 0;
  padding: 0.85rem 0.85rem 0;
  background: #fff;
  box-shadow: var(--shadow);
}

.polaroid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.polaroid figcaption {
  padding: 0.6rem 0 0.85rem;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  text-align: center;
  color: var(--ink-2);
}

.tilt-left {
  transform: rotate(-2.5deg);
}

@media (min-width: 900px) {
  .story {
    grid-template-columns: 2fr 3fr;
  }
}

.glass-band {
  padding-block: clamp(3rem, 6vw, 4.5rem);
  background: var(--moss);
  color: #f3efe6;
}

.glass-inner {
  display: grid;
  gap: 1.5rem 3rem;
}

.glass-band h2 {
  margin-top: 0.5rem;
  font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem);
  font-weight: 500;
}

.glass-text p + p {
  margin-top: 1rem;
}

.glass-text p {
  color: #d9d4c7;
}

@media (min-width: 900px) {
  .glass-inner {
    grid-template-columns: 1fr 1.2fr;
    align-items: center;
  }
}

/* ---------- Contact ---------- */

.contact {
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
}

.contact-inner {
  display: grid;
  gap: 2.5rem;
}

.contact-intro h2 {
  margin-top: 0.5rem;
  font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
  font-weight: 500;
}

.contact-intro > p:not(.kicker) {
  margin-top: 1rem;
  color: var(--ink-2);
}

.contact-list {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.contact-list li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 479px) {
  .contact-list li {
    grid-template-columns: 6.25rem 1fr;
  }
}

.contact-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-top: 0.2rem;
}

.contact-list a {
  font-weight: 600;
  word-break: break-word;
}

.form-card {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  outline: 1.5px dashed rgb(139 38 53 / 0.25);
  outline-offset: -8px;
}

.field-row {
  display: grid;
  gap: 0 1rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field label,
.field legend {
  padding: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.optional {
  font-weight: 400;
  color: var(--ink-2);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: 400 1rem/1.4 var(--font-body);
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--wine);
  outline: 2px solid rgb(139 38 53 / 0.25);
  outline-offset: 0;
}

.field ::placeholder {
  color: #756a60;
  opacity: 1;
}

.form-status:empty {
  display: none;
}

.form-status {
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  background: var(--paper-2);
  font-size: 0.98rem;
}

.form-success {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
}

.form-success[hidden] {
  display: none;
}

.success-bug {
  width: 3rem;
  height: 3rem;
}

.form-success h3 {
  font-size: 2rem;
}

.form-success p {
  color: var(--ink-2);
}

@media (min-width: 640px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .contact-inner {
    grid-template-columns: 1fr 1.15fr;
    gap: 4rem;
    align-items: start;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--moss);
  color: #d9d4c7;
  font-size: 0.95rem;
}

.gingham-strip {
  height: 14px;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, rgb(139 38 53 / 0.3) 50%, transparent 50%),
    linear-gradient(rgb(139 38 53 / 0.3) 50%, transparent 50%);
  background-size: 14px 14px;
}

.footer-inner {
  display: grid;
  gap: 2rem;
  padding-block: 3rem 2rem;
}

.brand-light,
.brand-light:hover {
  color: #fff;
}

.footer-brand p {
  margin-top: 0.6rem;
  max-width: 22rem;
}

.footer-nav,
.footer-contact {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.site-footer a {
  color: #fff;
}

.footer-nav a {
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-small .credit {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.footer-small {
  padding-block: 1.25rem 2rem;
  border-top: 1px solid rgb(255 255 255 / 0.12);
  font-size: 0.85rem;
  color: #b8b3a6;
}

@media (min-width: 760px) {
  .footer-inner {
    grid-template-columns: 1.4fr 1fr 1.2fr;
  }
}

/* ---------- Product dialog ---------- */

.product-dialog {
  width: min(100% - 1.5rem, 62rem);
  max-width: none;
  max-height: min(92dvh, 46rem);
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.45);
  overflow: hidden;
}

.product-dialog::backdrop {
  background: rgb(43 36 32 / 0.65);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 1.25rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: rgb(255 252 246 / 0.95);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.dialog-close svg {
  width: 1.3rem;
  height: 1.3rem;
}

.pd {
  max-height: min(92dvh, 46rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pd-photo {
  position: relative;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}

.pd-photo img {
  width: 100%;
  max-height: 52dvh;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* previous / next arrows sit on the photo */
.pd-step {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-top: -1.375rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: rgb(255 252 246 / 0.92);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.pd-step svg {
  width: 1.3rem;
  height: 1.3rem;
}

.pd-step:hover {
  background: #fff;
  color: var(--wine);
}

.pd-step[hidden] {
  display: none;
}

.pd-step--prev {
  left: 0.75rem;
}

.pd-step--next {
  right: 0.75rem;
}

.pd-step--next svg {
  transform: scaleX(-1);
}

.pd-body {
  padding: 1.5rem clamp(1.25rem, 3vw, 2.25rem) 1.5rem;
}

.pd-kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wine);
}

.pd-body h2 {
  margin-top: 0.35rem;
  padding-right: 2.5rem;
  font-size: clamp(1.9rem, 1.5rem + 1.2vw, 2.4rem);
  font-weight: 500;
}

.pd-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  margin-top: 0.75rem;
}

.pd-status,
.pd-size {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--sage-deep);
}

.pd-size {
  color: var(--ink-2);
}

.pd-size:empty {
  display: none;
}

.pd-details {
  margin-top: 1rem;
  font-size: 1.0625rem;
  line-height: 1.55;
}

.pd-description p + p {
  margin-top: 0.75rem;
}

.pd-details h3 {
  margin-top: 1.1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.dot-list {
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.2rem 1.25rem;
  font-size: 0.98rem;
}

.dot-list li {
  position: relative;
  padding-left: 1.1rem;
}

.dot-list li::before {
  content: '';
  position: absolute;
  left: 0.1rem;
  top: 0.62em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--sage);
}

@media (min-width: 560px) {
  .dot-list {
    grid-template-columns: 1fr 1fr;
  }
}

.pd-care {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-top: 1.1rem;
  padding: 0.6rem 0.9rem;
  border: 1px dashed var(--butter-deep);
  border-radius: var(--radius);
  background: rgb(243 226 166 / 0.45);
  font-size: 0.95rem;
  line-height: 1.45;
}

.pd-care svg {
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
  margin-top: 0.1rem;
  color: var(--sage-deep);
}

.pd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.pd-share-status {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--sage-deep);
}

.pd-share-status:empty {
  display: none;
}

.pd-share-link {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: 400 0.95rem/1.4 var(--font-body);
}

.pd-ordering {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-2);
}

@media (min-width: 820px) {
  .pd {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    height: min(92dvh, 46rem);
    overflow: hidden;
  }

  .pd-photo {
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }

  .pd-photo img {
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
  }

  .pd-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: 1.75rem;
  }
}

/* On laptop and desktop screens the popup is wider, so the details fit without scrolling */
@media (min-width: 1100px) {
  .product-dialog {
    width: min(100% - 3rem, 80rem);
    max-height: min(94dvh, 50rem);
  }

  /* the text decides the height (up to the cap); the photo fills whatever height that is */
  .pd {
    grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
    height: auto;
    min-height: min(94dvh, 40rem);
    max-height: none;
  }

  .pd-photo img {
    position: absolute;
    inset: 0;
  }

  .pd-body {
    max-height: min(94dvh, 50rem);
    padding: 1.6rem 2.5rem 1.4rem;
  }

  .dot-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Shorter laptop screens: tighten the spacing a little so the popup still fits */
@media (min-width: 1100px) and (max-height: 720px) {
  .pd-body {
    padding-top: 1.2rem;
    padding-bottom: 1rem;
  }

  .pd-details {
    margin-top: 0.75rem;
  }

  .pd-actions {
    margin-top: 1rem;
  }

  .pd-ordering {
    margin-top: 0.6rem;
  }

  .pd-details h3,
  .pd-care {
    margin-top: 0.85rem;
  }
}

/* ---------- Ladybugs (Carol loves them) ---------- */

/* lets the wing cases open smoothly (see the i-ladybug symbol) */
@property --open {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

.bug {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  overflow: visible;
  pointer-events: none;
}

/* crawling along the top of the hero drawer */
.hero-nav {
  position: relative;
}

.bug--hero {
  position: absolute;
  z-index: 1;
  top: -0.85rem;
  right: 22%;
  width: 1.75rem;
  height: 1.75rem;
  rotate: -80deg;
}

/* landed on the polaroid in the baskets story */
.polaroid {
  position: relative;
}

.bug--polaroid {
  position: absolute;
  right: 0.9rem;
  bottom: 0.55rem;
  width: 1.25rem;
  height: 1.25rem;
  rotate: 28deg;
  transform-origin: 50% 100%;
}

/* resting on the sprig above the stone cacti */
.sprig-wrap {
  position: relative;
  display: inline-block;
  margin-top: 0.15rem;
}

.bug--sprig {
  position: absolute;
  top: -0.35rem;
  left: 3rem;
  width: 1.15rem;
  height: 1.15rem;
  rotate: -35deg;
  transform-origin: 50% 100%;
}

/* the Christmas Kitchen Plaid Tin really does come with a little ladybug */
.bug--card {
  position: absolute;
  z-index: 1;
  top: 0.3rem;
  right: 0.3rem;
  width: 1.45rem;
  height: 1.45rem;
  rotate: 40deg;
}

/* strolls along the gingham strip once, when the footer comes into view */
.gingham-strip {
  position: relative;
}

.walker {
  position: absolute;
  top: -0.45rem;
  left: 12%;
}

.walker .bug {
  rotate: 90deg;
}

/* back to top */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow);
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top svg {
  width: 1.7rem;
  height: 1.7rem;
  overflow: visible;
}

.success-bug-wrap {
  display: block;
}

/* Hover animations: a different one for every ladybug (the gingham one just walks).
   Each also plays when tapped on a phone, via the .bug-tap class added in script.js. */
@media (prefers-reduced-motion: no-preference) {
  /* header logo: a little hop */
  .site-header .brand:hover .brand-bug {
    animation: bug-hop 0.55s ease-out;
  }

  /* footer logo: turns all the way around */
  .site-footer .brand:hover .brand-bug {
    animation: bug-spin 0.9s ease-in-out;
  }

  /* hero drawer: scurries along the edge and back */
  .hero-nav:hover .bug--hero {
    animation: bug-scurry 1.4s ease-in-out;
  }

  /* Plaid Tin card: wiggles */
  .specimen:hover .bug--card {
    animation: bug-wiggle 0.6s ease-in-out 2;
  }

  /* cacti sprig: sways like the leaf is in a breeze */
  .sprig-wrap:hover .bug--sprig,
  .sprig-wrap.bug-tap .bug--sprig {
    animation: bug-sway 1.6s ease-in-out;
  }

  /* polaroid: peek-a-boo, ducks down and pops back up */
  .polaroid:hover .bug--polaroid,
  .polaroid.bug-tap .bug--polaroid {
    animation: bug-peek 1.1s ease-in-out;
  }

  /* back to top: opens its wings and lifts off */
  .back-to-top svg {
    transition: translate 0.3s ease, --open 0.3s ease;
  }

  .back-to-top:hover svg,
  .back-to-top:focus-visible svg {
    --open: 1;
    translate: 0 -0.3rem;
  }

  /* thank-you message: a happy little dance */
  .success-bug-wrap:hover .success-bug,
  .success-bug-wrap.bug-tap .success-bug {
    animation: bug-dance 0.9s ease-in-out 2;
  }

  /* footer: walks in once (see script.js) */
  .walker.is-ready {
    left: -2rem;
  }

  .walker.is-walking {
    left: 12%;
    transition: left 4.5s cubic-bezier(0.3, 0.1, 0.4, 1);
  }

  .walker.is-walking .bug {
    animation: bug-waddle 0.5s ease-in-out 9;
  }
}

@keyframes bug-hop {
  0%, 100% { translate: 0 0; scale: 1; }
  35% { translate: 0 -0.45rem; scale: 1; }
  70% { translate: 0 0; scale: 1.12 0.88; }
}

@keyframes bug-spin {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

@keyframes bug-scurry {
  0%, 100% { translate: 0 0; }
  15% { rotate: -74deg; }
  30% { rotate: -86deg; }
  45% { translate: -2.2rem 0; rotate: -80deg; }
  60% { translate: -2.2rem 0; rotate: 100deg; }
  95% { translate: 0 0; rotate: 100deg; }
  100% { rotate: -80deg; }
}

@keyframes bug-wiggle {
  0%, 100% { rotate: 40deg; }
  25% { rotate: 25deg; }
  75% { rotate: 55deg; }
}

@keyframes bug-sway {
  0%, 100% { rotate: -35deg; }
  25% { rotate: -55deg; }
  50% { rotate: -18deg; }
  75% { rotate: -45deg; }
}

@keyframes bug-peek {
  0%, 100% { scale: 1; translate: 0 0; }
  30%, 55% { scale: 0.15; translate: 0 0.4rem; }
  75% { scale: 1.2; translate: 0 -0.15rem; }
}

@keyframes bug-dance {
  0%, 100% { rotate: 0deg; translate: 0 0; }
  25% { rotate: -14deg; translate: 0 -0.25rem; }
  50% { rotate: 0deg; translate: 0 0; }
  75% { rotate: 14deg; translate: 0 -0.25rem; }
}

@keyframes bug-waddle {
  0%, 100% { rotate: 84deg; }
  50% { rotate: 96deg; }
}
