@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}

/* ---------- Colors and type ---------- */
:root {
  color-scheme: light dark;
  --bg: #fff8ee;
  --bg-alt: #fdecd6;
  --surface: #ffffff;
  --ink: #2a1e14;
  --muted: #6b5b4c;
  --line: #eadfd0;
  --orange: #f47a20;
  --orange-deep: #d9600f;
  --orange-soft: #ffe2c7;
  --accent-text: #b4480e;
  --teal-soft: #d4f0ec;
  --callout: #0f7f79;
  --focus: #0f7f79;
  --shadow: 0 1px 2px rgb(42 30 20 / 0.06), 0 10px 30px rgb(42 30 20 / 0.09);
  --radius: 20px;
  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --wrap: 1120px;
  --gutter: 16px;
}
@media (min-width: 700px) { :root { --gutter: 32px; } }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120f;
    --bg-alt: #201914;
    --surface: #261e18;
    --ink: #f6eee5;
    --muted: #c3b3a2;
    --line: #3b3029;
    --orange-soft: #4a2a14;
    --accent-text: #ffa266;
    --teal-soft: #173e3a;
    --focus: #5fd6ca;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.35);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--font-body);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.12;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent-text); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.nowrap { white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 14px; border-radius: 10px; }

/* ---------- Header and footer ---------- */
.site-header { padding-block: 16px; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
}
.brand svg { width: 42px; height: 42px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin-inline: -10px; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--orange-soft); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

.site-footer { border-top: 1px solid var(--line); padding-block: 28px 36px; color: var(--muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: inherit; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 24px; border-radius: 999px;
  border: 2px solid transparent; text-decoration: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
}
.btn-primary { background: var(--orange); color: #2a1e14; }
.btn-primary:hover { background: #ff8b38; }
.btn-ghost { border-color: currentColor; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding-block: 24px 64px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 880px) {
  .hero { padding-block: 56px 96px; }
  .hero .wrap { grid-template-columns: 1.05fr 1fr; }
}
.eyebrow { font-family: var(--font-display); font-weight: 600; color: var(--accent-text); margin-bottom: 0.6em; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 32em; }

/* Stripes that look like a 3D print's layers */
.layers {
  background: repeating-linear-gradient(to bottom, var(--orange) 0 0.09em, var(--orange-deep) 0.09em 0.13em);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (forced-colors: active) { .layers { background: none; color: CanvasText; } }

/* Instant-photo collage */
.collage { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 560px; margin-inline: auto; padding: 16px 8px 28px; }
.snap {
  margin: 0; padding: 8px 8px 0; background: #fff; border-radius: 6px;
  box-shadow: 0 2px 4px rgb(42 30 20 / 0.12), 0 14px 32px rgb(42 30 20 / 0.16);
}
.snap img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; border-radius: 3px; }
.snap figcaption {
  padding: 6px 2px 8px; text-align: center; color: #2a1e14;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(0.8rem, 2.4vw, 1rem);
}
.collage .snap:nth-child(1) { transform: translate(10%, 9%) rotate(-7deg); }
.collage .snap:nth-child(2) { transform: translateY(-4%) rotate(2deg); z-index: 1; }
.collage .snap:nth-child(3) { transform: translate(-10%, 12%) rotate(7deg); }

/* ---------- Sections ---------- */
.section { padding-block: 56px; }
@media (min-width: 880px) { .section { padding-block: 88px; } }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin: 0; }
.section-head p { margin: 0; color: var(--muted); }

.page-head { padding-block: 24px 32px; }
@media (min-width: 880px) { .page-head { padding-block: 48px 40px; } }
.page-head h1 { font-size: clamp(2.4rem, 6.5vw, 3.6rem); }
.page-head p { color: var(--muted); font-size: 1.15rem; max-width: 36em; margin: 0; }

/* ---------- Product cards ---------- */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.grid-compact .card-body h3 { font-size: 1.35rem; }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  scroll-margin-top: 24px;
}
.card:target { outline: 3px solid var(--orange); outline-offset: 4px; }
.card-photo {
  position: relative; display: block; width: 100%; padding: 0; border: 0;
  background: var(--line); cursor: zoom-in;
}
.card-photo img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
a.card-photo { cursor: pointer; }
.photo-count {
  position: absolute; right: 12px; bottom: 12px;
  padding: 4px 12px; border-radius: 999px;
  background: rgb(23 18 15 / 0.75); color: #fff; font-size: 0.85rem; font-weight: 600;
}
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 0; }
.thumbs button {
  width: 50px; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; border-radius: 10px; background: none;
}
.thumbs button[aria-pressed="true"] { border-color: var(--orange); }
.thumbs img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 7px; }
.card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 16px 20px 22px; }
.card-body h2, .card-body h3 { font-size: 1.55rem; margin: 0; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-body h3 a:hover { text-decoration: underline; }
.card-body p { margin: 0; }
.price { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--accent-text); }
.price.soon { font-size: 1rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.tags li { padding: 3px 12px; border-radius: 999px; background: var(--teal-soft); font-size: 0.85rem; font-weight: 600; }

/* ---------- How it's made ---------- */
.steps {
  display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; counter-reset: step;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.steps li { padding: 24px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 14px;
  border-radius: 50%; background: var(--orange); color: #2a1e14;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
}
.steps h3 { font-size: 1.3rem; }
.steps p { margin: 0; color: var(--muted); }

/* ---------- Story teaser and callouts ---------- */
.teaser { display: grid; gap: 16px 48px; align-items: center; }
@media (min-width: 760px) { .teaser { grid-template-columns: auto 1fr; } }
.stat { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1; color: var(--accent-text); font-size: clamp(4rem, 13vw, 7rem); }
.stat span { display: block; margin-top: 8px; font-size: 1.1rem; font-weight: 600; color: var(--muted); }
.teaser h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); }

.callout {
  display: grid; gap: 20px 32px; align-items: center;
  padding: clamp(24px, 5vw, 48px); border-radius: calc(var(--radius) + 8px);
  background: var(--callout); color: #fff;
}
@media (min-width: 760px) { .callout { grid-template-columns: 1fr auto; } }
.callout h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 0.3em; }
.callout p { margin: 0; max-width: 38em; }
.callout .btn { background: #fff; color: #0c4f4b; }
.callout .btn:hover { background: #e6f7f5; }
.callout :focus-visible { outline-color: #fff; }

/* ---------- Story page ---------- */
.story { max-width: 38em; font-size: 1.15rem; }
.story .hello { font-size: 1.35rem; font-family: var(--font-display); font-weight: 500; }
.pull {
  margin: 1.6em 0; padding: 6px 0 6px 22px; border-left: 6px solid var(--orange);
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 4vw, 1.9rem); line-height: 1.25;
}
.story .signature { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; color: var(--accent-text); }
.story-photos { max-width: 620px; margin: 8px 0 0; }

/* ---------- Photo viewer ---------- */
.lightbox {
  width: min(100% - 24px, 760px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.45);
}
.lightbox[open] { display: flex; flex-direction: column; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(23 18 15 / 0.78); overflow: hidden; overscroll-behavior: contain; }
.lb-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 10px 22px; }
.lb-head h2 { font-size: 1.4rem; margin: 0; }
.lb-count { margin: 0 auto 0 0; color: var(--muted); font-size: 0.95rem; }
.lb-head form { margin: 0; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: var(--bg-alt); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--orange-soft); }
.icon-btn svg { width: 22px; height: 22px; }
.lb-figure { display: grid; place-items: center; flex: 1; min-height: 0; margin: 0; background: var(--line); }
/* A fixed 3:4 box, so the viewer opens at full size before the photo has loaded */
.lb-figure img {
  aspect-ratio: 3 / 4;
  width: auto; max-width: 100%;
  /* the smaller of: what fits the screen's height, or a 3:4 box as wide as the viewer */
  height: min(calc(100vh - 170px), calc((100vw - 24px) * 4 / 3), 1013px);
  height: min(calc(100dvh - 170px), calc((100vw - 24px) * 4 / 3), 1013px);
  object-fit: contain;
}
.lb-nav { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px 16px; }
.lb-nav[hidden] { display: none; }
.lb-nav .btn { min-height: 44px; padding: 8px 20px; font-size: 1rem; }
