:root {
  --ink: #211811;
  --cream: #fbf3e3;
  --paper: #f3e7cf;
  --red: #a51f1c;
  --red-dark: #781611;
  --gold: #f2bf4d;
  --line: #d9cbb2;
  --display: "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
  --body: "DM Sans", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 1rem/1.55 var(--body); }
body:has(dialog[open]) { overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0; line-height: .94; }
h2 { font-size: clamp(3.2rem, 7vw, 6.1rem); letter-spacing: -.018em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #23654e; outline-offset: 4px; }
.wrap { width: min(100% - 7rem, 1250px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 20; top: 10px; left: 10px; padding: 12px; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.announcement-bar { display: flex; align-items: center; min-height: 37px; background: var(--red-dark); color: #fff3dd; }
.announcement-window { flex: 1; min-width: 0; overflow: hidden; }
.announcement-run { display: flex; width: max-content; animation: announcement-loop 34s linear infinite; }
.announcement-group { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-around; min-width: 100vw; gap: clamp(1.5rem, 6vw, 5rem); padding: 5px 2rem; white-space: nowrap; font-size: .875rem; font-weight: 750; }
.announcement-group span { display: flex; align-items: center; gap: .65rem; }
.announcement-group span::before { content: ""; width: 19px; height: 14px; flex: 0 0 auto; background: var(--gold); mask: url("./images/fihaara-mark.png") center / contain no-repeat; }
@keyframes announcement-loop { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .announcement-run { width: 100%; animation: none; }
  .announcement-group { justify-content: center; min-width: 100%; white-space: normal; padding: 5px 12px; text-align: center; }
  .announcement-group span:not(:first-child), .announcement-group + .announcement-group { display: none; }
}

.jerky-loader { display: none; }
html[data-loading], html[data-loading] body { overflow: hidden; overscroll-behavior: none; }
html[data-loading]:not([data-loading="exiting"]) body { background: #631811; }
html[data-loading]:not([data-loading="exiting"]) body > :not(.jerky-loader) { opacity: 0; }
html[data-loading] .jerky-loader {
  display: grid;
  position: fixed;
  z-index: 100;
  inset: 0;
  min-height: 100dvh;
  place-items: center;
  overflow: auto;
  padding: 1rem;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 38%, #a73927, #631811 70%);
  color: #fff1d2;
  text-align: center;
}
.loader-content { display: grid; justify-items: center; gap: .75rem; }
.loader-content h2 { font-size: clamp(2.8rem, 10vw, 5.3rem); }
.loader-progress { display: grid; justify-items: center; gap: .42rem; width: min(210px, 72vw); }
#loader-percent { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
#loader-meter {
  appearance: none;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #48130e;
  color: var(--gold);
}
#loader-meter::-webkit-progress-bar { background: #48130e; }
#loader-meter::-webkit-progress-value { background: var(--gold); }
#loader-meter::-moz-progress-bar { background: var(--gold); }
.loader-art { position: relative; display: grid; place-items: end center; width: 210px; height: 220px; }
.loader-pouch { position: relative; z-index: 1; width: 96px; height: 135px; object-fit: contain; animation: loader-pouch 1.85s ease-in-out infinite; }
.loader-jerky { position: absolute; width: 90px; height: auto; top: 10px; left: 60px; animation: loader-jerky 1.85s cubic-bezier(.31,.15,.37,1) infinite; }
@keyframes loader-jerky {
  0% { opacity: 0; transform: translateY(-14px) rotate(-12deg); }
  20% { opacity: 1; }
  58% { opacity: 1; transform: translateY(80px) rotate(82deg) scale(.62); }
  68%, 100% { opacity: 0; transform: translateY(125px) rotate(90deg) scale(.52); }
}
@keyframes loader-pouch {
  0%, 55%, 85%, 100% { transform: scale(1); }
  68% { transform: scale(1.04,.96); }
}
html[data-loading="failed"] :is(.loader-art,.loader-progress) { display: none; }
html[data-loading="exiting"] .jerky-loader { animation: loader-out .22s ease forwards; }
html[data-loading="exiting"] .loader-pouch { animation: none; }
html[data-loading="exiting"] .loader-jerky { visibility: hidden; }
@keyframes loader-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .loader-jerky, .loader-pouch { animation: none; }
}
.header { position: sticky; z-index: 10; top: 0; background: var(--cream); border-bottom: 1px solid var(--line); }
#bite, #menu, #story, .product { scroll-margin-top: 95px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; }
.wordmark { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font: 900 1.82rem/.73 var(--display); }
.wordmark small { display: block; margin-top: 4px; font-size: .7em; letter-spacing: .055em; }
.header nav { display: flex; gap: 2.4rem; font-weight: 700; }
.header nav a, .footer a { text-decoration: none; }
.header nav a:hover, .footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.bag-toggle { display: flex; align-items: center; gap: .55rem; background: transparent; border: 1px solid var(--line); border-radius: 100px; color: var(--ink); padding: 7px 10px 7px 13px; font-weight: 800; }
.bag-toggle:hover { border-color: var(--ink); }
.bag-count { min-width: 23px; min-height: 23px; padding: 0 5px; display: grid; place-items: center; border-radius: 100px; background: var(--red); color: white; font-size: .82rem; }
.cart-icon { display: block; position: relative; width: 17px; height: 12px; margin: -3px 1px 0 2px; border: 1.5px solid; border-radius: 1px 2px 3px 3px; transform: skewX(-8deg); }
.cart-icon::before { content: ""; position: absolute; top: -4px; left: -4px; width: 5px; height: 4px; border-top: 1.5px solid; border-right: 1.5px solid; transform: skewX(8deg); }
.cart-icon::after { content: ""; position: absolute; left: 2px; bottom: -5px; width: 3px; height: 3px; border-radius: 50%; background: currentColor; box-shadow: 8px 0 currentColor; }
.origin { display: flex; align-items: center; gap: .48rem; font-weight: 800; letter-spacing: .12em; font-size: .875rem; }
.origin-mark {
  position: relative;
  flex: none;
  width: 1.05rem;
  height: 1.2rem;
  border: 1.5px solid currentColor;
  border-radius: 2px 2px 5px 5px;
  color: var(--red);
  transform: rotate(-12deg);
}
.origin-mark::before, .origin-mark::after { content: ""; position: absolute; }
.origin-mark::before { inset: .19rem 0 auto; border-top: 1px solid currentColor; }
.origin-mark::after {
  left: .21rem;
  bottom: .2rem;
  width: .2rem;
  height: .44rem;
  background: currentColor;
  border-radius: 45% 13% 35% 18%;
  box-shadow: .26rem .09rem 0 -.025rem currentColor;
  transform: skewX(-16deg) rotate(11deg);
}
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 50px; padding: .72rem 1.25rem; border: 1px solid transparent; border-radius: 5px; text-decoration: none; font-weight: 800; }
.primary { background: var(--red); color: #fff8ed; }
.primary:hover { background: var(--red-dark); }
.pack-stage { position: absolute; inset: 0; }
.outline { border-color: currentColor; background: transparent; }
.outline:hover { background: var(--ink); color: var(--cream); }
.story { background: var(--red); color: var(--cream); padding: 65px 0; }
.story-inner { display: grid; grid-template-columns: .75fr 1fr; gap: 2rem; align-items: center; }
.story .origin-mark { color: var(--gold); }
.story h2 { margin: .7rem 0 1.1rem; }
.story p:not(.origin) { max-width: 42ch; margin-bottom: 1.3rem; }
.story .outline:hover { background: var(--cream); color: var(--red-dark); }
.story-drawing { display: grid; place-items: center; justify-self: center; width: min(90%, 290px); aspect-ratio: 1; border-radius: 50%; border: 1px dashed #f4bb75; outline: 1px solid #f4bb75; outline-offset: 7px; transform: rotate(-8deg); }
.story-drawing img { max-width: 67%; filter: brightness(0) saturate(100%) invert(82%) sepia(42%) saturate(839%) hue-rotate(331deg) brightness(105%) contrast(92%); }
.faq { padding-block: 58px; display: grid; grid-template-columns: 1fr 1.25fr; gap: 24px; }
.faq h2 { font-size: clamp(2.85rem, 5vw, 4.6rem); }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 13px 4px; font-weight: 800; }
details p { padding: 0 4px 14px; }
.footer { background: var(--ink); color: var(--cream); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-block: 24px; }
.footer-inner > div { display: flex; gap: 18px; }
.footer .wordmark img { filter: brightness(0) invert(.85); }
.bag-dialog { position: fixed; inset: 0 0 0 auto; color: var(--ink); margin: 0; width: min(100%, 450px); max-width: 100%; height: 100%; max-height: 100%; border: 0; padding: 0; background: var(--cream); box-shadow: -12px 0 35px #28150840; }
.bag-dialog[open] { display: flex; flex-direction: column; }
.bag-dialog::backdrop { background: #23160fc0; }
.bag-head { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--line); }
.bag-head h2 { font-size: 3.15rem; }
.close { min-width: 44px; min-height: 44px; color: var(--ink); border: 1px solid var(--line); background: transparent; border-radius: 50%; font-size: 1.6rem; line-height: 1; }
.bag-body { flex: 1; min-height: 80px; padding: 16px 20px; overflow: auto; }
.bag-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.bag-row h3 { font-size: 1.55rem; }
.bag-row p { margin-top: 4px; font-size: .875rem; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-weight: 800; }
.stepper button:hover { border-color: var(--ink); }
.checkout { display: grid; gap: 8px; border-top: 1px solid var(--line); padding: 16px 20px 19px; }
.checkout label, .subtotal { font-weight: 800; }
.checkout :is(input, textarea) { width: 100%; border: 1px solid #aa997d; background: #fffaf0; padding: 10px; border-radius: 4px; color: var(--ink); font: inherit; }
.checkout-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr)); gap: 8px; }
.checkout-actions .button { padding-inline: .6rem; }
.checkout-actions .outline, .instagram-handoff .outline { color: var(--red-dark); }
.checkout-actions .outline:hover, .instagram-handoff .outline:hover { background: var(--red-dark); color: var(--cream); }
.instagram-handoff { display: grid; gap: 8px; padding-top: 8px; }
.checkout textarea { resize: vertical; }
.checkout-note, .send-note { font-size: .875rem; color: #5a4938; }
.send-note { padding: .55rem .7rem; border-left: 3px solid var(--red); border-radius: 3px; background: #f4e2d2; }
.send-note strong { display: block; color: var(--red-dark); }
.toast { position: fixed; z-index: 2; bottom: 18px; left: 50%; transform: translateX(-50%); border-radius: 5px; color: var(--cream); background: var(--ink); box-shadow: 0 4px 12px #30180955; opacity: 0; pointer-events: none; transition: opacity .2s; width: max-content; max-width: calc(100% - 30px); padding: 9px 14px; }
.toast.visible { opacity: 1; }
@media (max-width: 1050px) {
  .wrap { width: calc(100% - 4rem); }
}
@media (max-width: 720px) {
  #bite, #menu, #story, .product { scroll-margin-top: 80px; }
  .wrap { width: calc(100% - 2rem); }
  .header-inner { min-height: 64px; }
  .header nav { gap: .85rem; font-size: .875rem; }
  .story { padding-block: 42px; }
  .story-inner { grid-template-columns: 1fr; }
  .story-drawing { display: none; }
  .faq { grid-template-columns: 1fr; padding-block: 36px; }
}
@media (max-width: 365px) {
  .header nav a:last-child { display: none; }
}
@media (max-height: 570px) { .checkout { padding-block: 8px; gap: 5px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
.header nav a { white-space: nowrap; }
@media (max-width: 720px) {
  .header nav { gap: .7rem; }
  .header .wordmark { font-size: 1.46rem; gap: 4px; }
  .header .wordmark img { width: 33px; height: auto; }
}
@media (max-width: 375px) {
  .header nav a:last-child { display: none; }
}

html:not([data-view="menu"]) #menu,
html:not([data-view="menu"]) .menu-skip,
html[data-view="menu"] main > :not(#menu),
html[data-view="menu"] .skip-link:not(.menu-skip) { display: none; }
