/* Small Hours Creamery: a calm, editorial menu site. One cream page, warm ink, two quiet accents. */

@font-face { font-family: 'Newsreader'; src: url(../fonts/newsreader.woff2) format('woff2-variations'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url(../fonts/newsreader-italic.woff2) format('woff2-variations'); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url(../fonts/hanken.woff2) format('woff2-variations'); font-weight: 100 900; font-display: swap; }

/* The palette. tests/contrast.test.mjs holds these pairs to WCAG AA. */
:root {
  --paper: #f6f1e8;
  --paper-2: #ede5d6;
  --ink: #29231d;
  --ink-2: #665949;
  --sage: #55633e;
  --rose: #8f4537;
  --rule: rgb(41 35 29 / 0.16);

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Hanken Grotesk', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --pad: clamp(1.25rem, 5vw, 4rem);
  --gap: clamp(5.5rem, 12vw, 11rem);
  --max: 82rem;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--paper); color: var(--ink);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth; scroll-padding-top: 1.5rem;
}
body { margin: 0; font: 400 1.0625rem/1.6 var(--sans); overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; font-optical-sizing: auto; }
p { margin: 0; text-wrap: pretty; }
em { font-style: italic; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: var(--pad); top: -4rem; z-index: 10; padding: 0.6rem 1rem; background: var(--ink); color: var(--paper); }
.skip:focus { top: 1rem; }

.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }
.link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); transition: text-decoration-color 200ms ease, text-underline-offset 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: currentColor; text-underline-offset: 0.22em; }
}

/* ---------- Header ---------- */
.top {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem 1rem;
  max-width: var(--max); margin: 0 auto; padding: max(1.4rem, env(safe-area-inset-top)) var(--pad) 0;
}
.mark { font: 500 1.45rem/1 var(--serif); text-decoration: none; letter-spacing: -0.01em; padding: 0.2rem 0; }
.mark span { font: 600 0.68rem/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; margin-left: 0.35rem; vertical-align: 0.2em; }
.concept { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rose); border: 1px solid color-mix(in srgb, var(--rose) 40%, transparent); padding: 0.2rem 0.45rem 0.15rem; border-radius: 2px; }
.top nav { margin-left: auto; display: flex; gap: clamp(1rem, 2.4vw, 2rem); font-size: 0.9rem; }
.top nav a { white-space: nowrap; text-decoration: none; padding: 0.35rem 0; color: var(--ink-2); transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .top nav a:hover { color: var(--ink); } }
@media (max-width: 360px) { .top nav { font-size: 0.85rem; gap: 0.85rem !important; } .concept { font-size: 0.62rem; } }
@media (max-width: 720px) {
  .top nav { order: 3; width: 100%; margin: 0.6rem 0 0; gap: 1.1rem; overflow-x: auto; scrollbar-width: none; }
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 7vw, 5.5rem) var(--pad) 0;
  display: grid; gap: 2.5rem;
}
.hero h1 { margin-top: 1.1rem; font-size: clamp(3rem, 8.4vw, 6.75rem); font-weight: 340; line-height: 0.98; letter-spacing: -0.025em; }
.hero h1 em { font-weight: 300; }
.lede { margin-top: 1.5rem; max-width: 34ch; font-size: clamp(1.1rem, 0.6vw + 0.95rem, 1.3rem); line-height: 1.55; color: var(--ink-2); }
.hero-links { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; font-weight: 500; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
figcaption { margin-top: 0.75rem; font-size: 0.85rem; color: var(--ink-2); }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; column-gap: clamp(2rem, 6vw, 6rem); }
  .hero-copy { padding-bottom: 4.5rem; }
}

/* ---------- Section heads ---------- */
.section-head { display: grid; gap: 0.9rem; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.section-head h2, .story h2, .feature h2, .visit h2 { font-size: clamp(2.3rem, 4.8vw, 3.9rem); line-height: 1.04; letter-spacing: -0.02em; font-weight: 360; }
.section-head p { max-width: 42ch; color: var(--ink-2); font-size: 1.1rem; }
@media (min-width: 900px) {
  .section-head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; column-gap: clamp(2rem, 6vw, 6rem); }
}

/* ---------- This week ---------- */
.week { padding-top: var(--gap); }
.week-list {
  list-style: none; margin: 2.75rem auto 0; padding: 0 var(--pad);
  display: grid; grid-auto-flow: column; grid-auto-columns: min(72vw, 20rem); gap: 1.25rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad); scrollbar-width: none; overscroll-behavior-x: contain;
  max-width: var(--max);
}
.week-list::-webkit-scrollbar { display: none; }
.week-list li { scroll-snap-align: start; }
.week-list figure { overflow: hidden; }
.week-list img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform 900ms var(--ease-out); }
.week-list .num { margin-top: 1rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; color: var(--rose); }
.week-list h3 { margin-top: 0.3rem; font-size: 1.5rem; line-height: 1.15; font-style: italic; font-weight: 380; }
.week-list h3 + p { margin-top: 0.45rem; font-size: 0.95rem; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .week-list li:hover img { transform: scale(1.025); } }
@media (min-width: 600px) {
  .week-list { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; gap: 2.5rem clamp(1.25rem, 2.2vw, 2rem); }
}
@media (min-width: 900px) {
  .week-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- The flavors ---------- */
.menu { padding-top: var(--gap); }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: var(--max); margin: 2.5rem auto 0; padding: 0 var(--pad); }
.chip {
  padding: 0.5rem 0.95rem; min-height: 2.5rem; border: 1px solid var(--rule); border-radius: 999px; background: transparent;
  font-size: 0.875rem; font-weight: 500; color: var(--ink-2);
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (hover: hover) and (pointer: fine) { .chip:not([aria-pressed='true']):hover { border-color: var(--ink-2); color: var(--ink); } }
.chip:active { transform: scale(0.97); }
.shown { max-width: var(--max); margin: 1rem auto 0; padding: 0 var(--pad); font-size: 0.85rem; color: var(--ink-2); }
.groups { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.group { padding-top: 3.25rem; }
.group[hidden] { display: none; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--ink); }
.group-head h3 { font-size: clamp(1.75rem, 2.6vw, 2.25rem); font-style: italic; font-weight: 360; }
.group-head p { color: var(--ink-2); font-size: 0.95rem; }
.flavors { list-style: none; margin: 0; padding: 0; display: grid; }
.flavor { padding: 1.2rem 0 1.3rem; border-bottom: 1px solid var(--rule); }
.flavor[hidden] { display: none; }
.flavor h4 { font-size: 1.35rem; line-height: 1.2; font-weight: 450; }
.flavor h4 + p { margin-top: 0.3rem; color: var(--ink-2); max-width: 46ch; }
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.55rem; }
.tag { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sage); }
.tag-nuts, .tag-alcohol { color: var(--rose); }
@media (min-width: 760px) {
  .flavors { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 5vw, 5rem); }
}

/* ---------- Story ---------- */
.story {
  margin-top: var(--gap); padding: clamp(4.5rem, 10vw, 8rem) var(--pad); background: var(--paper-2);
  display: grid; justify-items: center; text-align: center; gap: 1.4rem;
}
.story h2 { max-width: 18ch; font-style: italic; }
.story-body { display: grid; gap: 1rem; max-width: 36rem; font-size: 1.1rem; color: var(--ink-2); }

/* ---------- Pints and catering ---------- */
.feature { max-width: var(--max); margin: var(--gap) auto 0; padding: 0 var(--pad); display: grid; gap: 2rem; }
.feature img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.feature-copy { display: grid; gap: 1rem; align-content: center; }
.feature-copy h2 { margin-top: -0.25rem; }
.feature-copy p:not(.eyebrow) { max-width: 38ch; font-size: 1.1rem; color: var(--ink-2); }
@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
  .feature-flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .feature-flip figure { order: 2; }
}

/* ---------- Visit ---------- */
.visit { max-width: var(--max); margin: var(--gap) auto 0; padding: 0 var(--pad); }
.visit-photo { margin: 0 calc(var(--pad) * -1); }
.visit-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.visit-grid { display: grid; gap: 2.5rem; margin-top: 3rem; }
.visit-grid > div { display: grid; gap: 0.9rem; align-content: start; }
.visit-grid p { color: var(--ink-2); max-width: 36ch; }
.visit-grid h3 { font-size: 1.5rem; font-style: italic; font-weight: 380; }
.visit-grid .status { color: var(--ink); font-weight: 500; display: flex; gap: 0.6rem; align-items: baseline; }
.status::before { content: ''; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--sage); border: 1.5px solid var(--sage); transform: translateY(-0.1em); }
.status.is-closed::before { background: transparent; border-color: var(--ink-2); }
.hours { margin: 0; }
.hours div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); font-size: 0.98rem; }
.hours div:first-child { border-top: 1px solid var(--ink); }
.hours dd { margin: 0; color: var(--ink-2); }
.hours .today dt, .hours .today dd { color: var(--ink); font-weight: 600; }
@media (min-width: 900px) {
  .visit-photo { margin: 0; }
  .visit-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); column-gap: clamp(2rem, 5vw, 5rem); }
}

/* ---------- Footer ---------- */
.foot { width: min(calc(100% - 2 * var(--pad)), calc(var(--max) - 2 * var(--pad))); margin: var(--gap) auto 0; padding: 2.5rem 0 max(2.5rem, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem 2rem; border-top: 1px solid var(--ink); }
.foot-mark { font: italic 340 clamp(2.75rem, 7vw, 5.5rem)/1 var(--serif); letter-spacing: -0.02em; }
.credit { font-size: 0.9rem; color: var(--ink-2); }

/* ---------- Motion: calm reveals only ---------- */
.js .rv { opacity: 0; transform: translateY(14px); transition: opacity 800ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.js .rv.in { opacity: 1; transform: none; }
@keyframes show { to { opacity: 1; transform: none; } }
.js:not(.ready) .rv { animation: show 0s 2.5s forwards; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { transform: none; transition: opacity 300ms ease; transition-delay: 0s; }
  .week-list img, .link, .chip { transition: none; }
  .chip:active { transform: none; }
  .week-list li:hover img { transform: none; }
}
