/* ==========================================================================
   Bunfolk — marketing site styles
   Static, no build step. Fonts are local (assets/fonts).
   ========================================================================== */

@font-face {
  font-family: "Bree Serif";
  src: url("assets/fonts/BreeSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("assets/fonts/Nunito.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #FFF9ED;
  --panel: #FFF2D6;
  --surface: #F3E1BE;
  --card: #FFF8E8;
  --text: #49362A;
  --desc: #4F3A2E;
  --heading: #5C2A1E;
  --copper: #934B35;
  --orange: #E8552A;
  --orange-deep: #C83F1C;
  --line: #A27D60;
  --line-soft: rgba(162, 125, 96, 0.25);
  --line-faint: rgba(162, 125, 96, 0.16);
  --ph-bg: #D9D9D9;
  --ph-fg: #9A9A9A;
  --steam: #1B2838;
  --kick: #05CE78;
  --discord: #5865F2;
  --radius-panel: 20px;
  --radius-card: 14px;
  --radius-ph: 12px;
  --shadow-pill: 0 4px 10px rgba(73, 54, 42, 0.22);
  --font-display: "Bree Serif", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --gutter: 16px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image: url("assets/paper-texture.svg");
  background-repeat: repeat;
  background-size: 180px 180px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--heading);
  margin: 0;
  line-height: 1.15;
}
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); }
h3 { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem); }

p { margin: 0; }

a { color: var(--copper); }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--heading);
  color: #fff;
  font-family: var(--font-display);
  border-radius: 999px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.pastry {
  display: inline-block;
  line-height: 1;
  font-style: normal;
  filter: drop-shadow(0 2px 2px rgba(73, 54, 42, 0.25));
}

.lede {
  font-style: italic;
  color: var(--desc);
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
  line-height: 1.45;
  max-width: 48ch;
}
.lede.center { margin-inline: auto; text-align: center; }

/* ---------------------------------------------------------------- pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-pill);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.pill:hover { transform: translateY(-1px); filter: brightness(1.06); }
.pill:active { transform: translateY(0); }
.pill .glyph { width: 18px; height: 18px; flex: none; }
.pill .glyph-k { width: 16px; height: 16px; }
.pill .arrow { font-family: var(--font-body); font-weight: 800; }

.pill-steam { background: linear-gradient(180deg, #2A3B50, var(--steam)); }
.pill-kick { background: linear-gradient(180deg, #27DB8C, var(--kick)); }
.pill-discord { background: linear-gradient(180deg, #6B77F5, var(--discord)); }

.pill-cta {
  padding: 14px 28px;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  gap: 12px;
  background: linear-gradient(180deg, #F2693A 0%, var(--orange) 55%, var(--orange-deep) 100%);
  box-shadow: 0 6px 14px rgba(200, 63, 28, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.pill-cta .play { font-size: 0.8em; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 249, 237, 0.96);
  background-image: url("assets/paper-texture.svg");
  background-size: 180px 180px;
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 36px);
  min-height: 64px;
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  margin-right: auto;
}
.brand-pastry { font-size: 1.6rem; }
.brand-word {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
  line-height: 1;
  color: var(--heading);
  background: linear-gradient(180deg, #8A3E25 0%, #5C2A1E 60%, #3F1C12 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
}

.header-ctas { display: flex; gap: 12px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(14px, 2.4vw, 30px);
}
.site-nav a {
  position: relative;
  display: inline-block;
  padding: 6px 2px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--heading);
  text-decoration: none;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 160ms ease;
}
.site-nav a:hover::after { width: 60%; }
.site-nav a.is-active { color: var(--orange); }
.site-nav a.is-active::after {
  width: 100%;
  height: 2px;
  /* dot in the centre of the underline, like the mockup */
  box-shadow: 0 0 0 2px var(--orange);
  clip-path: inset(-6px 0);
}
.site-nav a.is-active::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  transform: translateX(-50%);
}


/* ---------------------------------------------------------------- hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(28px, 4vw, 48px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(16px, 2.5vw, 28px);
}

.wordmark-wrap {
  position: relative;
  display: inline-block;
  padding: 10px 44px;
}
.wordmark {
  font-size: clamp(4rem, 2.6rem + 7vw, 7.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #A24D2B 0%, #7A3620 45%, #4F2114 80%, #3A160D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(255, 255, 255, 0.55)) drop-shadow(0 6px 10px rgba(73, 54, 42, 0.28));
}
.accent { position: absolute; font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); }
.accent-croissant { left: 0; top: 4px; transform: rotate(-15deg); }
.accent-roll { right: 0; top: 0; }
.accent-wheat { right: -4px; bottom: 2px; transform: rotate(18deg); }

.tagline {
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.1rem, 1rem + 0.8vw, 1.5rem);
  line-height: 1.4;
  color: var(--heading);
}

/* ---------------------------------------------------------------- placeholders */
.ph {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--ph-bg);
  color: var(--ph-fg);
  border-radius: var(--radius-ph);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  flex: none;
}
/* Real image / video in a slot (see README "Images"). <img class="ph ph-sm ph-img"> etc.
   Keep the size class (ph-hero / ph-wide / ph-sm / ph-xs) so the layout stays the same. */
.ph-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-ph);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Hero <video>: same box as the <img> it replaced; solid backdrop so nothing flashes before the poster paints */
video.ph-img { background: var(--ph-bg); }

.ph-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
}

.ph-wide {
  width: 100%;
  min-height: 150px;
  aspect-ratio: 3.6 / 1;
}

.ph-sm {
  width: 64px;
  height: 64px;
}

.ph-xs { width: 48px; height: 48px; border-radius: 10px; }

/* ---------------------------------------------------------------- panels & cards */
.panel {
  background: linear-gradient(180deg, rgba(255, 242, 214, 0.55), rgba(255, 242, 214, 0.35));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
  padding: clamp(20px, 2.6vw, 32px);
  margin-block: clamp(18px, 2.2vw, 28px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
/* keep the 16px gutter on phones while the panel itself has side margins */
.panel.container {
  width: calc(100% - (var(--gutter) * 2));
  max-width: 1200px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.section-icon { font-size: 40px; flex: none; margin-top: -2px; }

.kicker {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--heading);
  margin: 4px 0 10px;
}

.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.cards-v { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: linear-gradient(180deg, rgba(255, 248, 232, 0.9), rgba(255, 242, 214, 0.6));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.card p {
  font-style: italic;
  color: var(--desc);
  font-size: 0.92rem;
  line-height: 1.4;
}

.card-v {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 14px 10px 16px;
}
.card-v h3 { font-size: 0.95rem; margin-top: 4px; }
.card-v p { font-size: 0.8rem; }

.card-h {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
}
.card-h h3 { margin-bottom: 6px; }

/* About */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, 0.75fr);
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
}
.about-intro { display: flex; gap: 14px; align-items: flex-start; }
.about-cards.cards-v { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.about-cards .card-v { padding: 12px 6px 14px; }
.about-cards .card-v h3 { font-size: 0.82rem; }
.about-cards .card-v p { font-size: 0.68rem; }
.about-cards .ph-sm { width: 56px; height: 56px; }
.about-wide { aspect-ratio: auto; height: 100%; min-height: 160px; }

/* Baking */
.baking-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 48px);
  align-items: center;
  margin-bottom: 20px;
}
.baking-top .ph-wide { aspect-ratio: 3.2 / 1; }

/* Business */
.business .section-head { margin-bottom: 20px; }

/* Make it yours */
.yours-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 48px);
  align-items: center;
  margin-bottom: 20px;
}
.yours-top .ph-wide { aspect-ratio: 5 / 1; min-height: 100px; }
.cards-6 .card-v h3 { font-size: 0.88rem; }
.cards-6 .card-v p { font-size: 0.74rem; }

/* Living town */
.town .section-head { margin-bottom: 16px; }
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 4vw, 64px);
}
.feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-faint);
}
.feature:nth-child(-n+2) { border-top: 0; }
.feature h3 { margin-bottom: 4px; }
.feature p {
  font-style: italic;
  color: var(--desc);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  position: relative;
  margin-top: clamp(24px, 3vw, 40px);
  padding: clamp(28px, 3.5vw, 44px) 0 clamp(20px, 2.5vw, 32px);
  border-top: 1px solid var(--line-soft);
  text-align: center;
  overflow: hidden;
}
.footer-inner { position: relative; z-index: 1; }
.join-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.join-icon { font-size: 28px; }
.social-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(14px, 3vw, 40px);
  margin-top: 22px;
}
.social-row .pill { padding: 11px 22px; font-size: 1rem; }
.copyright {
  margin-top: 26px;
  font-size: 0.8rem;
  color: var(--desc);
  opacity: 0.8;
}

.pastry-cluster {
  position: absolute;
  bottom: 14px;
  display: flex;
  gap: 2px;
  font-size: clamp(32px, 5vw, 56px);
  pointer-events: none;
  z-index: 0;
}
.cluster-left { left: clamp(8px, 2vw, 32px); }
.cluster-right { right: clamp(8px, 2vw, 32px); }
.cluster-left .pastry:last-child,
.cluster-right .pastry:first-child { font-size: 0.72em; align-self: flex-end; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .about { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .about-wide { grid-column: 1 / -1; height: auto; aspect-ratio: 4 / 1; min-height: 140px; }
}

@media (max-width: 900px) {
  .cards-v, .about-cards.cards-v { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-cards.cards-v { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .about-cards .card-v h3 { font-size: 0.9rem; }
  .about-cards .card-v p { font-size: 0.78rem; }
}

@media (max-width: 800px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { order: 0; }
  .ph-hero { order: 1; }
  .baking-top, .yours-top { grid-template-columns: minmax(0, 1fr); }
  .baking-top .ph-wide { order: 1; }
  .feature-list { grid-template-columns: minmax(0, 1fr); }
  .feature:nth-child(2) { border-top: 1px solid var(--line-faint); }
}

@media (max-width: 700px) {
  .cards-3 { grid-template-columns: minmax(0, 1fr); }
  .header-inner { flex-wrap: wrap; row-gap: 6px; }
  .brand { margin-right: auto; }
  .header-ctas { order: 2; width: 100%; justify-content: center; }
  .site-nav { order: 3; width: 100%; }
  .site-nav ul { justify-content: center; }
  html { scroll-padding-top: 150px; }
}

@media (max-width: 600px) {
  .cards-v, .about-cards.cards-v { grid-template-columns: minmax(0, 1fr); }
  .cards-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-v { padding: 16px 12px; }
  .card-v h3, .cards-6 .card-v h3, .about-cards .card-v h3 { font-size: 1rem; }
  .card-v p, .cards-6 .card-v p, .about-cards .card-v p { font-size: 0.85rem; }
  .pill { padding: 9px 14px; font-size: 0.9rem; }
  .wordmark-wrap { padding: 10px 36px; }
  .social-row { gap: 12px; }
  .site-footer { padding-bottom: 60px; }
  .pastry-cluster { font-size: 26px; bottom: 12px; }
  .copyright { margin-top: 20px; }
}

@media (max-width: 420px) {
  .header-ctas { gap: 8px; }
  .pill-cta { padding: 12px 20px; }
  .ph-wide { min-height: 110px; }
}

/* ---------------------------------------------------------------- share rail
   <aside class="share-rail"> after <main>. One markup, two layouts:
   ≥900px: fixed vertical rail of 44px round buttons on the right (header stays above at z 100).
           ≥1400px it is vertically centred in the free margin; between 900 and 1399px the 1240px
           container reaches under it, so it is anchored bottom-right to stay clear of the hero and nav.
   <900px: collapses to one floating Share button; the list becomes a popover (.is-open). */
.share-rail { position: fixed; right: 16px; z-index: 60; font-family: var(--font-body); }
.share-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.share-btn, .share-fab {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: var(--card); color: var(--heading);
  border: 2px solid var(--line); box-shadow: var(--shadow-pill);
  cursor: pointer; text-decoration: none; font: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.share-btn svg, .share-fab svg { width: 20px; height: 20px; display: block; }
.share-btn:hover, .share-fab:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: 0 6px 14px rgba(73, 54, 42, 0.26); }
.share-btn:active, .share-fab:active { transform: translateY(0); }
.share-btn:focus-visible, .share-fab:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.share-fab { width: 52px; height: 52px; }
.share-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  padding: 8px 14px; border-radius: 999px; background: var(--heading); color: #fff;
  font-size: 0.9rem; font-weight: 700; white-space: nowrap; box-shadow: var(--shadow-pill);
  opacity: 0; pointer-events: none; transition: opacity 200ms ease; z-index: 61;
}
.share-toast.is-visible { opacity: 1; }
.share-fallback { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (min-width: 900px) {
  .share-rail { top: 50%; transform: translateY(-50%); }
  .share-fab { display: none; }
  .share-list { flex-direction: column; }
}
@media (min-width: 900px) and (max-width: 1399px) {
  .share-rail { top: auto; bottom: 24px; transform: none; }
}
@media (max-width: 899px) {
  .share-rail { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .share-list {
    display: none; position: absolute; right: 0; bottom: 64px;
    flex-wrap: wrap; justify-content: flex-end; width: max-content; max-width: calc(100vw - 32px);
    padding: 10px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pill);
  }
  .share-rail.is-open .share-list { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .share-btn, .share-fab, .share-toast { transition: none; }
  .share-btn:hover, .share-fab:hover { transform: none; }
}
@media print { .share-rail, .share-toast { display: none !important; } }
