:root {
  --kd-bg: #fdf4e3; --kd-surface: #fff9f0; --kd-text: #1c1c66; --kd-muted: #4b4b7a;
  --kd-accent: #1c1c66; --kd-on-accent: #ffffff; --kd-accent-2: #00a6a6; --kd-accent-ink: #1c1c66;
}

/* ---------- Riso zine: Little Espresso Shop ---------- */

:root {
  --display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --body: "Space Grotesk", system-ui, sans-serif;
  --teal-wash: color-mix(in srgb, var(--kd-accent-2) 22%, var(--kd-bg));
  --blue-wash: color-mix(in srgb, var(--kd-accent) 40%, var(--kd-bg));
  --misreg: 0.07em 0.05em 0 color-mix(in srgb, var(--kd-accent-2) 85%, transparent);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.4 -.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--kd-bg);
  color: var(--kd-text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Paper grain: an ink-coloured layer masked through SVG turbulence */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: var(--kd-text);
  opacity: 0.09;
  -webkit-mask: var(--noise);
  mask: var(--noise);
  mix-blend-mode: multiply;
}

img { display: block; max-width: 100%; }

a { color: var(--kd-accent-ink); text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
a:hover { text-decoration-color: var(--kd-accent-2); }

:focus-visible {
  outline: 3px dashed var(--kd-text);
  outline-offset: 4px;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1; margin: 0; }

h2 {
  font-size: clamp(2.1rem, 8vw, 4.2rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  max-width: 14ch;
}

.misreg { text-shadow: var(--misreg); }
.tilt-l { rotate: -2deg; transform-origin: left; }
.tilt-r { rotate: 1.5deg; transform-origin: left; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 60;
  background: var(--kd-accent);
  color: var(--kd-on-accent);
  padding: 0.6rem 1rem;
}
.skip:focus { top: 1rem; }

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 3px solid var(--kd-text);
  position: relative;
  z-index: 5;
}

.masthead__name {
  font-family: var(--display);
  text-decoration: none;
  font-size: 1.05rem;
  text-transform: uppercase;
  color: var(--kd-text);
  text-shadow: 2px 1px 0 var(--kd-accent-2);
}

.masthead ul { list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0; }
.masthead nav a {
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  padding: 0.15rem 0.1rem;
}
.masthead nav a:hover { text-decoration: underline; text-decoration-color: var(--kd-accent-2); text-decoration-thickness: 4px; }

/* ---------- Shared bits ---------- */

.sticker {
  display: inline-block;
  margin: 0;
  padding: 0.35rem 0.8rem;
  background: var(--kd-accent-2);
  color: var(--kd-text);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  border: 2px solid var(--kd-text);
}
.sticker--tilt-l { rotate: -4deg; }
.sticker--tilt-r { rotate: 3deg; }

.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 1rem;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border: 3px solid var(--kd-text);
  box-shadow: 5px 5px 0 var(--kd-accent-2);
}
.btn--ink { background: var(--kd-accent); color: var(--kd-on-accent); }
.btn--line { background: var(--kd-surface); color: var(--kd-text); box-shadow: 5px 5px 0 var(--blue-wash); }

/* Halftone photo: greyscale print multiplied onto an ink, then screened with dots */
.halftone {
  position: relative;
  overflow: hidden;
  background: var(--kd-accent-2);
  height: 100%;
}
.halftone--blue { background: var(--blue-wash); }
.halftone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.25) brightness(1.08);
  mix-blend-mode: multiply;
}
.halftone::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--kd-bg) 60%, transparent) 0.9px, transparent 1.5px) 0 0 / 5px 5px;
  mix-blend-mode: screen;
}

.shape { position: absolute; pointer-events: none; mix-blend-mode: multiply; }

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

.hero {
  display: grid;
  gap: 2rem;
  padding: 2rem clamp(1rem, 4vw, 3rem) 4rem;
  position: relative;
  overflow-x: clip;
}

.hero__text { display: flex; flex-direction: column; align-items: flex-start; gap: 1.2rem; position: relative; z-index: 3; }

.hero__headline {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 7.5vw, 3.6rem);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: var(--misreg);
  max-width: 12ch;
  rotate: -1.5deg;
}

.hero__sub { margin: 0; max-width: 34ch; font-size: 1.15rem; color: var(--kd-muted); }

.hero__ctas { display: flex; flex-wrap: wrap; gap: 1rem 1.2rem; margin-top: 0.4rem; }

.hero__art {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1 / 1.08;
  justify-self: center;
  order: -1;
}

.shape--teal-sun {
  width: 72%; aspect-ratio: 1;
  border-radius: 50%;
  background: var(--kd-accent-2);
  top: 0; right: -4%;
}
.shape--blue-blob {
  width: 64%; aspect-ratio: 1;
  background: var(--blue-wash);
  border-radius: 58% 42% 46% 54% / 47% 58% 42% 53%;
  bottom: 6%; left: -2%;
}
.shape--teal-dot {
  width: 20%; aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, var(--kd-accent-2) 0 3px, transparent 3px 7px);
  top: 4%; left: 6%;
}

.cutout {
  position: absolute;
  inset: 12% 10% 18% 14%;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--kd-text);
  rotate: 4deg;
}
.cutout img { scale: 1.18; }

.stamp {
  position: absolute;
  left: 0; right: 0; bottom: 2%;
  z-index: 2;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.5rem, 13vw, 5.4rem);
  line-height: 0.86;
  text-transform: uppercase;
  color: var(--kd-text);
  text-shadow: 0.05em 0.04em 0 var(--kd-accent-2);
  rotate: -7deg;
  mix-blend-mode: multiply;
}
.stamp span { display: block; }
.stamp span:nth-child(2) { padding-left: 12%; }
.stamp span:nth-child(3) { padding-left: 36%; }

.sticker--rating {
  position: absolute;
  top: 6%; right: 0;
  z-index: 3;
  rotate: 8deg;
  background: var(--kd-surface);
}

/* ---------- Zine pages ---------- */

.page {
  position: relative;
  padding: clamp(3.5rem, 9vw, 7rem) clamp(1rem, 4vw, 3rem);
  overflow: hidden;
  border-top: 3px solid var(--kd-text);
}
.page--teal { background: var(--teal-wash); }
.page--paper { background: var(--kd-surface); }
.page--blue { background: var(--kd-accent); color: var(--kd-on-accent); }
.page--visit { background: var(--kd-bg); }

/* About */
.about { display: grid; gap: 2.5rem; max-width: 1150px; margin: 0 auto; }
.about__photo { margin: 0; position: relative; aspect-ratio: 4 / 5; max-width: 460px; rotate: -2deg; border: 3px solid var(--kd-text); }
.about__photo figcaption { position: absolute; bottom: -1.1rem; right: -0.4rem; background: var(--kd-surface); }
.about__text { display: grid; gap: 1.1rem; max-width: 60ch; }
.about__text h2 { margin-bottom: 0.6rem; }
.about__text p { margin: 0; }
.about__text p:first-of-type { font-size: 1.25rem; font-weight: 500; }

/* Menu */
.menu__head { max-width: 1150px; margin: 0 auto 2.5rem; display: grid; gap: 1.2rem; position: relative; z-index: 1; }
.menu__intro { margin: 0; max-width: 46ch; font-size: 1.15rem; color: var(--kd-muted); }

.shape--menu-ring {
  width: min(70vw, 520px); aspect-ratio: 1;
  border-radius: 50%;
  border: clamp(28px, 6vw, 60px) solid var(--kd-accent-2);
  opacity: 0.55;
  top: -8%; right: -18%;
}

.slips {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1150px;
  display: grid;
  gap: 1.4rem;
  position: relative;
  z-index: 1;
}
.slip {
  background: var(--kd-bg);
  border: 2px solid var(--kd-text);
  padding: 1.2rem 1.3rem 1.3rem;
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--kd-accent-2) 70%, transparent);
}
.slip:nth-child(odd) { rotate: -1.2deg; }
.slip:nth-child(even) { rotate: 1deg; }
.slip:nth-child(3n) { rotate: -0.4deg; translate: 0.5rem 0; }
.slip h3 { font-size: 1.45rem; text-transform: uppercase; margin-bottom: 0.5rem; }
.slip p { margin: 0; color: var(--kd-muted); }
.slip--feature { background: var(--kd-accent-2); }
.slip--feature p, .slip--feature-2 p { color: var(--kd-text); }
.slip--feature-2 { background: var(--teal-wash); }
.slip--feature h3 { font-size: clamp(1.8rem, 6vw, 2.6rem); }

.menu__photos {
  max-width: 1150px;
  margin: 3.5rem auto 0;
  display: grid;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
}
.snap { margin: 0; position: relative; aspect-ratio: 4 / 3; border: 3px solid var(--kd-text); }
.snap--a { rotate: -2.5deg; }
.snap--b { rotate: 2deg; }
.snap figcaption { position: absolute; top: -1rem; left: 1rem; background: var(--kd-surface); }
.snap--b figcaption { left: auto; right: 1rem; }

/* Blue page: highlights + reviews */
.page--blue h2 { color: var(--kd-on-accent); position: relative; }
.misreg--on-blue { text-shadow: 0.07em 0.05em 0 var(--kd-accent-2); }
.page--blue a { color: var(--kd-on-accent); }
.page--blue :focus-visible { outline-color: var(--kd-on-accent); }

.shape--blue-page {
  width: min(90vw, 640px); aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, color-mix(in srgb, var(--kd-accent-2) 45%, transparent) 0 2px, transparent 2px 9px);
  mix-blend-mode: normal;
  top: -12%; right: -20%;
}

.highlights {
  list-style: none;
  padding: 0;
  margin: 3rem auto 0;
  max-width: 1150px;
  display: grid;
  gap: 2rem;
  position: relative;
}
.highlights li { border-top: 3px solid var(--kd-accent-2); padding-top: 1rem; }
.highlights li:nth-child(2) { rotate: 1deg; }
.highlights h3 { font-size: 1.5rem; text-transform: uppercase; margin-bottom: 0.6rem; }
.highlights p { margin: 0; color: color-mix(in srgb, var(--kd-on-accent) 88%, var(--kd-accent)); }

.quotes {
  max-width: 1150px;
  margin: 4rem auto 0;
  display: grid;
  gap: 2rem;
  position: relative;
}
.quote { margin: 0; padding: 1.5rem; background: var(--kd-accent-2); color: var(--kd-text); border: 3px solid var(--kd-surface); }
.quote:nth-child(2) { rotate: 1.5deg; }
.quote:nth-child(3) { rotate: -1deg; }
.quote--big { background: var(--kd-surface); rotate: -1.5deg; }
.quote blockquote { margin: 0; }
.quote p { margin: 0; font-weight: 500; font-size: 1.08rem; }
.quote--big p { font-family: var(--display); font-size: clamp(1.25rem, 3.6vw, 1.7rem); line-height: 1.2; }
.quote figcaption { margin-top: 1rem; font-weight: 700; font-size: 0.95rem; }

/* Visit */
.visit { max-width: 1150px; margin: 0 auto; display: grid; gap: 3rem; }
.visit__main { display: flex; flex-direction: column; align-items: flex-start; gap: 1.2rem; }
.visit__text { margin: 0; max-width: 42ch; font-size: 1.15rem; }
.visit__addr { margin: 0; font-family: var(--display); font-size: 1.5rem; line-height: 1.15; text-transform: uppercase; }
.visit__addr a { text-decoration-color: var(--kd-accent-2); text-decoration-thickness: 5px; }

.tags { list-style: none; padding: 0; margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tags li { border: 2px solid var(--kd-text); border-radius: 999px; padding: 0.2rem 0.85rem; font-weight: 500; font-size: 0.95rem; }
.tags li:nth-child(odd) { background: var(--teal-wash); rotate: -2deg; }

.hours {
  position: relative;
  background: var(--kd-surface);
  border: 3px solid var(--kd-text);
  padding: 1.6rem 1.4rem 1.4rem;
  box-shadow: 8px 8px 0 var(--kd-accent-2);
  rotate: 1.5deg;
  max-width: 420px;
}
.hours h3 { font-size: 2rem; text-transform: uppercase; margin-bottom: 0.8rem; text-shadow: var(--misreg); }
.hours table { width: 100%; border-collapse: collapse; }
.hours th, .hours td { padding: 0.45rem 0; border-bottom: 2px dotted color-mix(in srgb, var(--kd-text) 45%, transparent); text-align: left; }
.hours th { font-weight: 500; }
.hours td { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.hours .wknd { background: color-mix(in srgb, var(--kd-accent-2) 18%, transparent); }

.stamp--small {
  position: absolute;
  inset: auto;
  top: -1.6rem; right: -0.6rem;
  font-size: 1.3rem;
  padding: 0.4rem 0.8rem;
  border: 3px solid var(--kd-text);
  border-radius: 6px;
  background: var(--kd-accent-2);
  rotate: 9deg;
  mix-blend-mode: normal;
  text-shadow: none;
}

.visit__photo { margin: 0; aspect-ratio: 3 / 2; border: 3px solid var(--kd-text); rotate: -1.5deg; }

/* Footer */
.footer {
  background: var(--kd-accent);
  color: var(--kd-on-accent);
  padding: 2.5rem clamp(1rem, 4vw, 3rem);
  border-top: 6px solid var(--kd-accent-2);
  font-size: 0.95rem;
}
.footer p { margin: 0 0 0.5rem; }
.footer a { color: var(--kd-on-accent); }
.footer :focus-visible { outline-color: var(--kd-on-accent); }
.footer__name { font-family: var(--display); font-size: 1.6rem; text-transform: uppercase; text-shadow: 3px 2px 0 var(--kd-accent-2); }
.footer__credits { color: color-mix(in srgb, var(--kd-on-accent) 85%, var(--kd-accent)); }

/* ---------- Larger screens ---------- */

@media (min-width: 640px) {
  .slips { grid-template-columns: repeat(2, 1fr); }
  .slip--feature { grid-column: span 2; }
  .menu__photos { grid-template-columns: 1.2fr 1fr; align-items: start; }
  .snap--b { margin-top: 3rem; }
  .highlights { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr 1.1fr; align-items: center; min-height: calc(100vh - 4rem); padding-top: 3rem; }
  .hero__art { order: 0; }
  .about { grid-template-columns: 0.9fr 1.1fr; align-items: center; }
  .slips { grid-template-columns: repeat(3, 1fr); }
  .slip--feature { grid-column: span 2; grid-row: span 1; }
  .slip--feature-2 { grid-column: span 2; }
  .quotes { grid-template-columns: 1.3fr 1fr; }
  .quote--big { grid-row: span 2; align-self: start; }
  .visit { grid-template-columns: 1.2fr 1fr; align-items: start; }
  .visit__photo { grid-column: 1 / -1; max-width: 760px; justify-self: center; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* Signature: the name thunks onto the page like a rubber stamp */
  .hero .stamp { animation: thunk 0.6s cubic-bezier(0.3, 1.4, 0.5, 1) 0.5s both; }
  .sticker--rating { animation: thunk 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) 1.1s both; }

  @keyframes thunk {
    0%   { opacity: 0; transform: scale(1.3) rotate(-6deg); }
    55%  { opacity: 1; transform: scale(0.96) rotate(1deg); }
    100% { opacity: 1; transform: none; }
  }

  @supports (animation-timeline: view()) {
    .stamp--small, .about__photo figcaption, .snap figcaption {
      animation: thunk linear both;
      animation-timeline: view();
      animation-range: entry 20% entry 70%;
    }
  }

  /* Hovers use translate/rotate/scale so they don't fight the motion script's transforms */
  .btn, .slip, .masthead nav a, .tags li {
    transition: translate 0.2s ease, rotate 0.2s ease, scale 0.2s ease, box-shadow 0.2s ease;
  }
  .btn:hover, .btn:focus-visible { translate: -2px -2px; box-shadow: 8px 8px 0 var(--kd-accent-2); }
  .btn:active { translate: 3px 3px; box-shadow: 1px 1px 0 var(--kd-accent-2); }
  .slip:hover { rotate: 0deg; translate: 0 -4px; box-shadow: 10px 10px 0 var(--kd-accent-2); }
  .masthead nav a:hover { rotate: -3deg; }
  .tags li:hover { scale: 1.06; }
}
