@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Lexend";
  src: url("/fonts/Lexend.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

:root {
  --font-display: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --font-body: "Lexend", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --bg: #fbf6ec;
  --bg-alt: #f5ecda;
  --bg-raised: #ffffff;
  --bg-input: #ffffff;
  --border: #e6d9c0;
  --text: #1f1b17;
  --text-muted: #4d453a;
  --cork: #a8691f;
  --cork-dark: #8a540f;
  --cork-soft: #e9c58f;
  --blue: #3d6aa3;
  --blue-soft: #bcd3ee;
  --radius: 16px;
  --max: 1040px;
  --max-text: 760px;
  --shadow: 0 6px 24px rgba(90, 60, 20, 0.1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 450;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: rgba(168, 105, 31, 0.15);
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

h1, h2, h3, .brand, .nav a, .button {
  font-family: var(--font-display);
}
h1, h2, h3 { font-weight: 600; }

a { color: var(--blue); }
a:hover { color: var(--cork); }

:focus-visible {
  outline: 3px solid var(--cork);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--cork);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

/* Header */
.site-header {
  border-bottom: 1px solid transparent;
  background: rgba(251, 246, 236, 0.92);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow); }
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: -0.01em;
}
/* The logo file has transparent padding around the artwork. The oversized image with
   negative margins trims it so the mug sits tight against the name. The extra 4px of
   negative top margin lifts the mug so its body, not its (cream, near-invisible) steam,
   is vertically centred on the name's letters. */
.brand img { width: 72px; height: 72px; margin: -16px -14px -8px; flex: none; object-fit: contain; }
.brand:hover { color: var(--cork); }

.nav { display: flex; gap: 8px; align-items: center; }
.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--bg-alt); color: var(--cork-dark); }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  background: var(--cork);
  color: #fff;
  border: 2px solid transparent;
  padding: 12px 26px;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.button:hover { background: var(--cork-dark); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.button:active { transform: translateY(0); }
.button.secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}
.button.secondary:hover { border-color: var(--cork); color: var(--cork-dark); background: transparent; }

/* Hero */
main.home { display: flex; flex-direction: column; }
.hero {
  position: relative;
  overflow: hidden;
  padding: 48px 0;
  flex: 1;
  display: flex;
  align-items: center;
}
.hero .container { padding-top: 0; }
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  z-index: 0;
  animation: drift 14s ease-in-out infinite alternate;
}
.hero::before { width: 380px; height: 380px; background: var(--blue-soft); top: -120px; right: -60px; }
.hero::after { width: 320px; height: 320px; background: var(--cork-soft); bottom: -140px; left: -80px; animation-delay: -6s; }
.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 32px;
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1.12; margin: 0 0 20px; }
.hero h1 .swap {
  color: var(--cork);
  display: inline-block;
  transition: opacity 0.35s, transform 0.35s;
}
.hero h1 .swap.out { opacity: 0; transform: translateY(10px); }
.hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 52ch; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { justify-self: center; position: relative; width: 100%; max-width: 520px; }
.hero-art img {
  width: 100%;
  height: auto;
  display: block;
  animation: bob 5s ease-in-out infinite;
  filter: drop-shadow(0 18px 24px rgba(90, 60, 20, 0.22));
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-14px) rotate(1deg); }
}
@keyframes drift {
  from { transform: translate(0, 0); }
  to { transform: translate(40px, 30px); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.hero .container > div:first-child > * { animation: rise 0.7s both; }
.hero .container > div:first-child > :nth-child(2) { animation-delay: 0.12s; }
.hero .container > div:first-child > :nth-child(3) { animation-delay: 0.24s; }

/* Sections */
.section { padding: 48px 0; }
.section.alt { background: var(--bg-alt); }
.section h2 { font-size: 1.8rem; margin: 0 0 12px; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 8px rgba(90, 60, 20, 0.05);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card:not(.static):hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--cork-soft); }
.card .icon { font-size: 2rem; display: block; margin-bottom: 8px; transition: transform 0.3s; }
.card:hover .icon { transform: scale(1.2) rotate(-6deg); }
.card h3 { margin: 0 0 8px; color: var(--cork); }
.card p { margin: 0; color: var(--text-muted); }

/* Scroll reveal (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s, transform 0.6s; }
.js .reveal.visible { opacity: 1; transform: none; }
.js .cards .reveal:nth-child(2) { transition-delay: 0.1s; }
.js .cards .reveal:nth-child(3) { transition-delay: 0.2s; }

/* Page content (policy, contact) */
.page { padding: 48px 0 64px; }
.page .container { max-width: var(--max-text); }
.page h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 8px; }
.page .lead { color: var(--text-muted); font-size: 1.1rem; margin: 0 0 24px; }

/* Privacy policy: plain legal text in a single block */
.policy { font-size: 1rem; }
.policy p { margin: 0 0 1em; }
.policy ul { margin: 0 0 1em; padding-left: 1.25em; }
.policy li { margin: 0 0 0.5em; }

/* Form */
.form { display: grid; gap: 18px; margin-top: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--cork);
  box-shadow: 0 0 0 4px rgba(168, 105, 31, 0.2);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #b3261e; }
.field .error { color: #b3261e; font-size: 0.9rem; margin: 4px 0 0; min-height: 1em; }
.form-note { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.form-status { font-weight: 700; margin: 0; }
.email-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(90, 60, 20, 0.05);
}
.email-card p { margin: 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 16px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.site-footer p { margin: 0; }
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  justify-content: space-between;
  align-items: center;
}
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.footer-links a, .footer-links button {
  color: var(--text-muted);
  background: none;
  border: 0;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.footer-links a:hover, .footer-links button:hover { color: var(--cork-dark); }

/* Consent banner */
.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 10px 40px rgba(90, 60, 20, 0.25);
  z-index: 200;
  animation: rise 0.5s both;
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 12px; font-size: 0.95rem; }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.consent .button { padding: 8px 20px; }

/* Only lift cards on devices that can actually hover (avoids sticky hover on touch) */
@media (hover: none) {
  .card:not(.static):hover { transform: none; box-shadow: 0 2px 8px rgba(90, 60, 20, 0.05); border-color: var(--border); }
  .card:hover .icon { transform: none; }
  .button:hover { transform: none; box-shadow: none; }
}

@media (max-width: 720px) {
  /* 16px+ inputs stop iOS Safari zooming the page on focus */
  .field input, .field select, .field textarea { font-size: 1rem; }
  .field input, .field select { min-height: 48px; }
  .button { padding: 14px 26px; }
  .footer-links { gap: 4px 20px; }
  .footer-links a, .footer-links button { padding: 10px 0; display: inline-block; }
  .site-footer .container { padding-bottom: env(safe-area-inset-bottom); }
  .consent-actions .button { flex: 1; text-align: center; }
  .section { padding: 32px 0; }
  .page { padding: 32px 0 48px; }
  .hero { padding: 32px 0; }
  .hero::before { width: 240px; height: 240px; }
  .hero::after { width: 200px; height: 200px; }
  .hero-actions .button { flex: 1 1 auto; text-align: center; }
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-art { max-width: 240px; order: -1; }
  .form-row { grid-template-columns: 1fr; }
  .site-header .container { gap: 8px; }
  .nav { gap: 0; }
  .nav a { padding: 12px 10px; }
  .brand span { display: none; }
}

@media (max-width: 380px) {
  .nav a { padding: 12px 7px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Keep display font on buttons (the .button rule above resets font via inherit) */
.button { font-family: var(--font-display); }

/* Images fade in once loaded (site.js adds .loaded) instead of popping in */
.js img { opacity: 0; transition: opacity 0.6s ease; }
.js img.loaded { opacity: 1; }
