/* Layout: a market-stall scrapbook on beeswax paper — wavy section edges, slightly tilted jar labels, hand-drawn marks; one reading column. */
@font-face { font-family: "Alegreya"; src: url("fonts/alegreya-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("fonts/alegreya-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("fonts/kalam-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #f6eed9;        /* beeswax paper */
  --paper-2: #ecdfbf;      /* comb band */
  --card: #fbf6e8;         /* jar label */
  --ink: #3a2a18;          /* walnut ink */
  --muted: #6e5a3e;
  --honey: #c47d14;        /* amber honey */
  --honey-ink: #fffaf0;
  --meadow: #5f7a3c;       /* linden leaf */
  --line: #cdb88c;
  --display: "Alegreya", Georgia, "Times New Roman", serif;
  --body: "Alegreya Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  --hand: "Kalam", "Bradley Hand", "Segoe Print", cursive;
  --step-0: 1.15rem; --step-1: 1.45rem; --step-2: clamp(1.9rem, 4vw, 2.5rem); --step-3: clamp(2.5rem, 6vw, 4rem);
  --wrap: 66rem;
  --wobble: 255px 18px 225px 16px / 16px 225px 18px 255px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .15 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #241d13; --paper-2: #2e2517; --card: #33291a; --ink: #f1e6cc; --muted: #c4b08a; --line: #5a4a30;
  --honey: #e9a83b; --honey-ink: #241d13; --meadow: #a8c27f; color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #241d13; --paper-2: #2e2517; --card: #33291a; --ink: #f1e6cc; --muted: #c4b08a; --line: #5a4a30;
  --honey: #e9a83b; --honey-ink: #241d13; --meadow: #a8c27f; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper) var(--grain); color: var(--ink); font: 400 var(--step-0)/1.6 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--honey); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:focus-visible, button:focus-visible { outline: 3px dashed var(--honey); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.band { position: relative; padding-block: clamp(3rem, 8vw, 5.5rem); }
.band--comb { background: var(--paper-2) var(--grain); }
/* wavy top and bottom edges on coloured bands */
.band--comb::before, .band--comb::after { content: ""; position: absolute; left: 0; right: 0; height: 26px; background: var(--paper-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 26' preserveAspectRatio='none'%3E%3Cpath d='M0 26 C 90 4 170 22 260 12 S 430 0 520 14 S 700 26 790 10 S 980 2 1060 16 S 1160 20 1200 8 L1200 26 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 26' preserveAspectRatio='none'%3E%3Cpath d='M0 26 C 90 4 170 22 260 12 S 430 0 520 14 S 700 26 790 10 S 980 2 1060 16 S 1160 20 1200 8 L1200 26 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.band--comb::before { top: -25px; }
.band--comb::after { bottom: -25px; transform: scaleY(-1) scaleX(-1); }

.hand { font-family: var(--hand); color: var(--honey); font-size: 1.3rem; line-height: 1.2; }

/* Header */
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; padding-block: 1.1rem; }
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; font-family: var(--display); font-size: 1.45rem; }
.brand img { width: 44px; height: auto; transform: rotate(-12deg); }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; font-size: 1.05rem; }
.nav a { text-decoration: none; padding-block: .2rem; background: linear-gradient(var(--honey), var(--honey)) 0 100% / 0 3px no-repeat; transition: background-size .2s; }
.nav a:hover, .nav a[aria-current="page"] { background-size: 100% 3px; border-radius: 2px; }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
.hero h1 { font-size: var(--step-3); }
.hero h1 em { color: var(--honey); }
.hero .hand { margin-bottom: .6rem; transform: rotate(-2deg); display: inline-block; }
.hero .lede { margin-top: 1.25rem; font-size: var(--step-1); color: var(--muted); max-width: 30ch; line-height: 1.45; }
.hero .actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .9rem; }
.hero figure { margin: 0; transform: rotate(1.5deg); }
.framed { border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%; overflow: hidden; box-shadow: 0 0 0 6px var(--card), 0 0 0 8px var(--line); }

/* Buttons: hand-cut edges */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .55rem 1.35rem;
  border-radius: var(--wobble); font: 700 1.05rem var(--body); text-decoration: none; border: 2.5px solid var(--ink); cursor: pointer;
  box-shadow: 3px 4px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
.btn--fill { background: var(--honey); color: var(--honey-ink); }
.btn--line { background: var(--card); color: var(--ink); }
.btn:hover { transform: translate(1px, 2px) rotate(-1deg); box-shadow: 1px 2px 0 var(--ink); }

/* Section heads */
.section-head { display: grid; gap: .4rem; max-width: 40rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: var(--step-2); }
.section-head p:not(.hand) { color: var(--muted); }

/* Products as jar labels on a stall */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr)); gap: 2.75rem 2.25rem; }
.product { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--card); padding: 1rem 1rem 1.25rem;
  border-radius: 6px 14px 8px 12px / 12px 6px 14px 8px; box-shadow: 0 1px 0 var(--line), 4px 6px 0 rgba(58,42,24,.12); min-width: 0; }
.product:nth-child(3n+1) { transform: rotate(-1.4deg); }
.product:nth-child(3n+2) { transform: rotate(1deg); }
.product:nth-child(3n) { transform: rotate(-.6deg); }
.product::before { content: ""; position: absolute; top: -14px; left: 50%; width: 92px; height: 26px; translate: -50% 0; rotate: -4deg;
  background: rgba(236,214,150,.75); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.product img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 4px; }
.product .body { display: flex; flex-direction: column; gap: .45rem; padding-top: 1rem; }
.product h3 { font-size: var(--step-1); }
.product .desc { color: var(--muted); }
.product .buy { margin-top: auto; padding-top: .9rem; border-top: 2px dashed var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.price { font-family: var(--display); font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.unit { display: block; font-family: var(--body); font-size: .9rem; color: var(--muted); }

.notes { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: .5rem 2rem; color: var(--muted); }
.notes p::before { content: "✿ "; color: var(--meadow); }

/* Tour */
.tour .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
.tour figure { margin: 0; transform: rotate(-1.5deg); }
.tour .text { display: grid; gap: 1rem; min-width: 0; }
.tour h2 { font-size: var(--step-2); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.facts li { display: flex; gap: .7rem; }
.facts li::before { content: ""; flex: none; width: 1.4rem; height: 1.1rem; margin-top: .3rem; background: url("img/bee.svg") center / contain no-repeat; }
.tour .buy { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
.tour .after { color: var(--muted); font-size: 1rem; }

/* Polaroid snapshots */
.snaps { padding-block: clamp(2.5rem, 6vw, 4rem); }
.polaroids { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.75rem; margin-top: 1rem; }
.polaroid { margin: 0; background: var(--card); padding: .7rem .7rem .4rem; width: min(100%, 17rem); box-shadow: 0 1px 0 var(--line), 4px 7px 0 rgba(58,42,24,.13); }
.polaroid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: sepia(.18) saturate(1.05); }
.polaroid figcaption { font-family: var(--hand); text-align: center; padding-top: .45rem; font-size: 1.15rem; }
.polaroids .polaroid:nth-child(1) { rotate: -3deg; }
.polaroids .polaroid:nth-child(2) { rotate: 2deg; translate: 0 .8rem; }
.polaroids .polaroid:nth-child(3) { rotate: -1.2deg; }
.framed.portrait { aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; width: 100%; border-radius: 48% 52% 46% 54% / 44% 46% 54% 56%; }
.framed.photo { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; filter: sepia(.15); }

/* Beekeeper */
.keeper .wrap { display: grid; grid-template-columns: 17rem 1fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
.keeper figure { margin: 0; }
.keeper blockquote { margin: 0; font-family: var(--hand); font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.25; color: var(--ink); transform: rotate(-1.5deg); }
.keeper .sig { margin-top: 1rem; color: var(--muted); }

/* Prose pages */
.prose { max-width: 40rem; display: grid; gap: 1.1rem; }
.prose h1 { font-size: var(--step-3); }
.prose h2 { font-size: var(--step-1); margin-top: 1.25rem; }
.prose ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.about-head { display: grid; grid-template-columns: 1fr 15rem; gap: 2rem; align-items: center; max-width: 52rem; }
.year { display: grid; grid-template-columns: 8rem 1fr; gap: .25rem 1rem; padding-block: .8rem; border-top: 2px dashed var(--line); }
.year dt { font-family: var(--hand); color: var(--meadow); font-size: 1.2rem; }
.year dd { margin: 0; }

.todo { background: var(--card); border: 2px dashed var(--honey); padding: .75rem 1rem; font-size: 1rem; border-radius: 8px; }

.sprig { position: absolute; width: clamp(90px, 14vw, 160px); opacity: .9; pointer-events: none; }

/* Footer */
.site-foot { border-top: 2px dashed var(--line); color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; padding-block: 2rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }

@media (max-width: 760px) {
  .hero .wrap, .tour .wrap, .keeper .wrap, .about-head { grid-template-columns: 1fr; }
  .keeper figure, .about-head figure { max-width: 13rem; }
  .year { grid-template-columns: 1fr; }
  .sprig { display: none; }
}
@media (prefers-reduced-motion: reduce) { .btn, .nav a { transition: none; } }

/* Bee that follows the cursor */
.cursor-bee { position: fixed; left: -17px; top: -15px; height: auto; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .4s; will-change: transform; }
.cursor-bee.on { opacity: 1; }

/* Version switch (bottom left) */
.vswitch { position: fixed; z-index: 60; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card); border: 2px solid var(--ink); box-shadow: 2px 3px 0 var(--ink); font: 700 .85rem var(--body); }
.vswitch > * { padding: .35rem .8rem; border-radius: 999px; text-decoration: none; color: var(--ink); }
.vswitch-on { background: var(--honey); color: var(--honey-ink) !important; }
.vswitch a:hover { background: var(--paper-2); }
