/* Kitch, Chiswick
   All text is the logo blue. Orange sits on the hero, the coffee stage and the footer; cream everywhere else. */

:root {
  color-scheme: light;
  --orange: #FE7531;
  --blue: #2D3AAB;
  --cream: #FFF8EC;
  --frame: #FFE8D3;
  --butter: #FFD66B;
  --rule: rgba(45, 58, 171, .28);
  --blue-soft: rgba(45, 58, 171, .62);

  --f-serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --f-type: 'Special Elite', 'Courier Prime', 'Courier New', Courier, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.76, 0, .24, 1);

  --gutter: clamp(16px, 3.2vw, 48px);
  --header-h: 84px;
  --frame-w: clamp(4px, .45vw, 6px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--blue);
  font-family: var(--f-type);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--f-serif);
  font-weight: 350;
  font-variation-settings: "SOFT" 100;
  letter-spacing: -.015em;
  line-height: 1.1;
  text-wrap: balance;
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
::selection { background: var(--blue); color: var(--cream); }

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

[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* SplitText line masks: a little room so descenders aren't clipped */
[data-split] > div { padding-bottom: .12em; margin-bottom: -.12em; }

/* Animated text and images stay hidden until their animation is set up,
   so nothing flashes in the wrong font or layout. Failsafe after 5s. */
.js [data-split]:not(.is-ready),
.js [data-reveal]:not(.is-ready),
.js [data-clip]:not(.is-ready) {
  visibility: hidden;
  animation: kitch-show .01s linear 5s forwards;
}
@keyframes kitch-show { to { visibility: visible; } }

/* Intro: header and hero hidden until the intro script runs */
.js-intro .site-logo,
.js-intro .nav-link,
.js-intro .hero-card,
.js-intro .hero-tagline {
  opacity: 0;
  animation: kitch-failsafe .01s linear 4s forwards;
}
@keyframes kitch-failsafe { to { opacity: 1; } }

.intro-logo {
  position: fixed;
  z-index: 45;
  top: 0;
  left: 0;
  height: auto;
  pointer-events: none;
  will-change: transform;
}


/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--header-h);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--gutter) 12px;
  transition: background-color .5s var(--ease-out), transform .9s var(--ease-inout);
}
.site-header.is-solid { background: var(--orange); }
.site-header.is-hidden { transform: translateY(-110%); }

.nav-left { justify-self: start; display: flex; gap: 24px; }
.nav-right { justify-self: end; display: flex; gap: 24px; align-items: center; }

.site-logo { display: block; justify-self: center; }
.site-logo img { height: clamp(44px, 4.4vw, 62px); width: auto; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-size: clamp(19px, 1.7vw, 24px);
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

/* Rolling text on hover */
.roll { position: relative; overflow: hidden; line-height: 1.2; }
.roll > span { position: relative; display: block; transition: transform .8s var(--ease-out); }
.roll > span::after { content: attr(data-text); position: absolute; left: 0; top: 100%; }
.roll:hover > span, .roll:focus-visible > span { transform: translateY(-100%); }

.bag-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 .4em;
  border-radius: 999px;
  background: var(--blue);
  color: var(--cream);
  font-family: var(--f-type);
  font-size: .62em;
  line-height: 1;
}
.bag-count[data-empty] { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }


/* ---------- Pills and buttons ---------- */

.pill {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55em 1.25em .6em;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: var(--blue);
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-size: 18px;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: color .6s var(--ease-out);
}
.pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--blue);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform .7s var(--ease-out);
}
.pill:hover, .pill:focus-visible { color: var(--cream); }
.pill:hover::before, .pill:focus-visible::before { transform: translateY(0); }


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

.hero {
  position: relative;
  height: 100svh;
  min-height: 620px;
  max-height: 1200px;
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + 24px) var(--gutter) 96px;
  background: var(--orange);
  overflow: hidden;
}
.hero-inner { display: grid; place-items: center; will-change: transform, opacity; }

.hero-stack {
  position: relative;
  width: min(320px, 24vw, calc((100svh - 310px) * .75));
  min-width: 190px;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.hero-card {
  position: absolute;
  inset: 0;
  border: var(--frame-w) solid var(--cream);
  border-radius: 14px;
  background: var(--cream);
  overflow: hidden;
  transform-origin: 50% 60%;
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

.hero-tagline {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  text-align: center;
  font-size: clamp(15px, 1.3vw, 18px);
  letter-spacing: .05em;
  text-transform: uppercase;
}


/* ---------- About ---------- */

.about {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 3vw, 44px);
  padding-block: clamp(90px, 12vw, 170px);
  padding-inline: var(--gutter);
  text-align: center;
}

.about-illustration { width: clamp(200px, 22vw, 300px); }
.about-illustration img { width: 100%; height: auto; transform-origin: 50% 95%; }

.about-lede {
  max-width: 19em;
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-weight: 350;
  font-size: clamp(26px, 3.1vw, 44px);
  line-height: 1.18;
  letter-spacing: -.012em;
  text-wrap: balance;
}


/* ---------- Marquee ---------- */

.marquee {
  overflow: hidden;
  padding-block: clamp(14px, 1.6vw, 22px);
  border-block: 1px solid var(--rule);
  white-space: nowrap;
}
.marquee-track { display: inline-flex; will-change: transform; }
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  padding-right: .55em;
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-weight: 350;
  font-size: clamp(28px, 3.6vw, 52px);
  letter-spacing: -.015em;
}
.marquee-item img { width: auto; height: .72em; flex: none; }


/* ---------- Coffee (home and shop) ---------- */

.coffee { padding: 0 var(--gutter) clamp(90px, 11vw, 160px); }

.section-title {
  font-size: clamp(34px, 4vw, 56px);
  padding-block: clamp(60px, 7vw, 110px) clamp(24px, 3vw, 44px);
}

.coffee-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 110px);
  max-width: 1300px;
  margin-inline: auto;
}

.coffee-stage {
  position: relative;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 1 / 1;
  justify-self: center;
  border-radius: clamp(26px, 2.6vw, 38px);
  background: var(--orange);
  overflow: hidden;
}

.coffee-bag {
  position: absolute;
  bottom: 17%;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out);
}
.coffee-bag img { height: 100%; width: auto; filter: drop-shadow(0 18px 16px rgba(120, 36, 0, .22)); }
.coffee-bag::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -9%;
  height: 4%;
  border-radius: 50%;
  background: rgba(120, 36, 0, .2);
  filter: blur(6px);
}
.bag-big { left: 13%; height: 60%; }
.bag-small { right: 13%; height: 40%; }

/* Shop: the size that isn't selected steps back */
.coffee-stage[data-selected="250g"] .bag-big,
.coffee-stage[data-selected="1kg"] .bag-small { transform: scale(.88); filter: saturate(.85) brightness(.96); }

.spill-bean { position: absolute; left: 0; top: 0; width: 38px; height: auto; pointer-events: none; z-index: 3; }

.coffee-info { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; max-width: 34em; }
.coffee-name { font-size: clamp(36px, 4.2vw, 60px); }
.coffee-desc { font-size: 16px; }

.coffee-sizes { width: 100%; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.coffee-sizes li {
  display: flex;
  justify-content: space-between;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-size: clamp(20px, 1.8vw, 24px);
}
.coffee-collect { font-size: 14px; }


/* ---------- What's on ---------- */

.happening { padding: clamp(60px, 8vw, 120px) var(--gutter) clamp(120px, 14vw, 220px); }

.happening-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}
.happening-head h2 { font-size: clamp(34px, 4vw, 56px); }
.happening-head p { max-width: 46ch; }

.collage {
  position: relative;
  max-width: 1400px;
  aspect-ratio: 1400 / 1500;
  margin: clamp(80px, 9vw, 140px) auto 0;
}
.collage-item { position: absolute; left: var(--x); top: var(--y); width: var(--w); z-index: 1; }
.collage-item.is-note { z-index: 2; }

.photo {
  margin: 0;
  padding: 6px;
  border-radius: 6px;
  background: var(--frame);
  transition: transform .9s var(--ease-out);
}
.photo img { width: 100%; aspect-ratio: var(--ar, 4 / 5); object-fit: cover; border-radius: 2px; }
.photo:hover { transform: rotate(var(--tilt, -1.5deg)) scale(1.02); }

.note {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(20px, 2.4vw, 36px);
  border-radius: 4px;
  background: var(--butter);
  transform: rotate(-5deg);
}
.note h3 { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.12; }
.note p { font-size: 15px; }
.note-row { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1.5px solid var(--blue); margin-top: 6px; }
.note-row input {
  flex: 1;
  min-width: 0;
  padding: .6em 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: 16px/1.2 var(--f-type);
}
.note-row input::placeholder { color: var(--blue-soft); }
.note-row input:focus { outline: none; }
.note-row:focus-within { box-shadow: 0 1.5px 0 var(--blue); }
.note-row button {
  flex: none;
  padding: .55em 1.1em .6em;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: var(--cream);
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-size: 17px;
  cursor: pointer;
}
.note-status { min-height: 1.5em; font-size: 14px; }


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

.site-footer {
  display: flex;
  flex-direction: column;
  gap: clamp(48px, 6vw, 90px);
  padding: clamp(110px, 10vw, 150px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 20px);
  background: var(--orange);
  overflow: hidden;
}

.footer-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.visit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  text-align: center;
}
.visit-grid h3 { font-size: clamp(28px, 2.6vw, 38px); margin-bottom: 14px; }
.visit-grid p,
.visit-grid dl {
  margin: 0;
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.35;
}
.visit-grid a { text-decoration-thickness: 1px; text-underline-offset: .18em; }
.hours div + div { margin-top: .5em; }
.hours dd { margin: 0; }

/* Sized to the screen height so it sits low when you reach the bottom */
.footer-logo { display: flex; justify-content: center; padding-top: clamp(40px, 8vh, 120px); }
.footer-logo img {
  width: min(100%, 1180px, calc((100svh - 190px) * 1.78));
  height: auto;
  will-change: transform;
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: calc(-1 * clamp(24px, 4vw, 66px));
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-size: 19px;
}
.footer-bar nav { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-bar a { text-decoration: none; }


/* ---------- Shop ---------- */

.shop-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: calc(var(--header-h) + clamp(56px, 8vw, 120px)) var(--gutter) clamp(60px, 7vw, 110px);
  background: var(--orange);
  text-align: center;
}
.shop-hero h1 { font-size: clamp(54px, 9vw, 140px); line-height: 1; letter-spacing: -.03em; }
.shop-hero p {
  max-width: 30em;
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.3;
}

.product { padding: clamp(60px, 7vw, 110px) var(--gutter) clamp(90px, 11vw, 160px); }

.buy { display: flex; flex-direction: column; gap: 12px; width: min(100%, 420px); }

.size-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.size-options input { position: absolute; opacity: 0; pointer-events: none; }
.size-options label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: .7em 1.1em;
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  transition: background-color .35s var(--ease-out), color .35s var(--ease-out);
}
.size-options input:checked + label { background: var(--blue); color: var(--cream); }
.size-options input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 3px; }

.buy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.buy select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: .7em 2.4em .7em 1.1em;
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232D3AAB' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 1.1em center / 12px 8px;
  color: var(--blue);
  font: 15px/1.2 var(--f-type);
  cursor: pointer;
}

.qty { display: flex; align-items: center; border: 1.5px solid var(--blue); border-radius: 999px; }
.qty button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--blue);
  font: 18px/1 var(--f-type);
  cursor: pointer;
}
.qty output { min-width: 2ch; text-align: center; font-size: 15px; }

.add-btn {
  display: flex;
  justify-content: center;
  gap: .5em;
  padding: .8em 1.2em;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: var(--cream);
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-size: 19px;
  cursor: pointer;
  transition: transform .5s var(--ease-out);
}
.add-btn:active { transform: scale(.97); }
.add-btn[disabled] { opacity: .5; cursor: not-allowed; }

.grind { max-width: 1100px; margin-inline: auto; padding: 0 var(--gutter) clamp(90px, 11vw, 160px); }
.grind .section-title { padding-top: 0; text-align: center; }
.grind-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.grind-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  align-items: baseline;
  gap: 24px;
  padding-block: 24px;
  border-bottom: 1px solid var(--rule);
}
.grind-list h3 { font-size: clamp(24px, 2.4vw, 34px); }
.grind-list p { max-width: 48ch; font-size: 16px; }


/* ---------- Bag drawer ---------- */

.bag-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(45, 58, 171, .3);
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s var(--ease-out), visibility 0s .6s;
}
.bag {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
  background: var(--cream);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .8s var(--ease-inout), visibility 0s .8s;
}
.bag-open .bag-overlay { opacity: 1; visibility: visible; transition: opacity .6s var(--ease-out); }
.bag-open .bag { transform: none; visibility: visible; transition: transform .8s var(--ease-inout); }

.bag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.bag-head h2 { font-size: 34px; }
.bag-head .pill { font-size: 16px; padding: .45em 1em .5em; }

.bag-items { flex: 1; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.bag-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  padding-block: 18px;
  border-bottom: 1px solid var(--rule);
}
.bag-item img { width: 64px; height: 88px; object-fit: contain; }
.bag-item h3 { font-size: 22px; }
.bag-item .meta { font-size: 14px; margin-top: 2px; }
.bag-item .qty { margin-top: 10px; width: max-content; }
.bag-item .qty button { width: 32px; height: 32px; font-size: 16px; }
.bag-item-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.bag-item-price { font-family: var(--f-serif); font-variation-settings: "SOFT" 100; font-size: 20px; }
.bag-remove {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 14px/1.2 var(--f-type);
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}
.bag-empty {
  padding-block: 36px;
  font-family: var(--f-serif);
  font-variation-settings: "SOFT" 100;
  font-size: 22px;
  line-height: 1.3;
}
.bag-empty .pill { margin-top: 14px; }

.bag-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; }
.bag-total { display: flex; justify-content: space-between; font-family: var(--f-serif); font-variation-settings: "SOFT" 100; font-size: 24px; }
.bag-note { font-size: 14px; }


/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .coffee-layout { grid-template-columns: 1fr; }
  .coffee-info { align-items: center; text-align: center; margin-inline: auto; }
  .buy { margin-inline: auto; }
}

@media (max-width: 760px) {
  :root { --header-h: 70px; }
  .nav-left, .nav-right { gap: 14px; }
  .hero-stack { width: min(56vw, calc((100svh - 280px) * .75)); }
  .section-title { text-align: center; }

  .collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    aspect-ratio: auto;
  }
  .collage-item { position: static; width: auto; }
  .collage-item.is-wide,
  .collage-item.is-note { grid-column: 1 / -1; }
  .collage-item.is-offset { margin-top: 44px; }
  .collage-item.is-note { margin-top: 24px; }
  .note { transform: rotate(-2deg); }

  .visit-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-bar { justify-content: center; text-align: center; margin-top: 0; }
  .footer-bar nav { justify-content: center; }

  .grind-list li { grid-template-columns: 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
