/* Pog Barley — knitted 3D type (pre-launch landing page). Colours and font match pogbarley.co.uk. */

:root {
  --cream: #FFF9F2;
  --sand-light: #FAF6EF;
  --sand: #F2E4CC;
  --dark: #1E1A14;
  --muted: #7A6B5A;
  --orange: #E8652A;
  --seafoam: #8ECDC2;
  --seafoam-mid: #6BB5A9;
  --seafoam-dark: #4A9A8E;
  --slate: #5C6B73;
  --slate-dark: #3A4A52;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gut: clamp(18px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--cream);
  /* faint woven texture */
  background-image:
    repeating-linear-gradient(0deg, rgba(30, 26, 20, .018) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(90deg, rgba(30, 26, 20, .018) 0 2px, transparent 2px 5px);
}
body {
  margin: 0;
  overflow-x: clip;
  color: var(--dark);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, p, ul { margin: 0; padding: 0; }
em { font-style: normal; color: var(--orange); }
.mono { font: 500 12px/1.4 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
a:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; border-radius: 999px; }

/* ---------- Scene ---------- */
#knit {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  /* Full screen height that doesn't change when a phone's address bar slides in and out */
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  display: block;
  pointer-events: none;
}

/* ---------- Top bar ---------- */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px var(--gut);
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--dark);
  color: var(--cream);
  font: 500 14px/1 var(--font);
  white-space: nowrap;
  transition: background .4s var(--ease), transform .4s var(--ease);
}
.pill:hover { background: var(--orange); transform: translateY(-1px); }
.pill-lg { padding: 17px 28px; font-size: 16px; }
@media (max-width: 560px) {
  .top .mono { display: none; }
  .top { justify-content: flex-end; }
}

/* ---------- Hero ---------- */
main { position: relative; z-index: 1; }
.hero {
  position: relative;
  height: 100svh;
  min-height: 520px;
}
/* The real heading is for screen readers and search; the 3D scene shows the knitted version. */
.hero h1 {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* Pinned to the bottom of the screen; main.js fades it out as you scroll. */
.hero-copy {
  position: fixed;
  left: 50%;
  bottom: clamp(26px, 5vh, 48px);
  transform: translateX(-50%);
  width: min(640px, calc(100% - 2 * var(--gut)));
  text-align: center;
  z-index: 2;
}
.tagline {
  font: 600 clamp(24px, 2.6vw, 38px)/1.15 var(--font);
  letter-spacing: -.02em;
  color: var(--dark);
}
.byline {
  margin-top: 8px;
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--muted);
}

/* Entrance: the copy appears once the name has knitted */
html.js .hero-copy { opacity: 0; transition: opacity 1.2s var(--ease); }
html.js.knitted .hero-copy { opacity: var(--copy, 1); }
html.js.scrolling .hero-copy { transition: none; }

/* ---------- Pinned run ---------- */
.run { position: relative; height: 250vh; }
.pin { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.swatch-labels { list-style: none; }
.swatch-label {
  position: fixed;
  left: 0;
  top: 0;
  font: 500 clamp(15px, 1.3vw, 19px)/1.2 var(--font);
  white-space: nowrap;
  opacity: 0;
  will-change: transform, opacity;
}
@media (max-width: 760px) {
  .swatch-label {
    width: 28vw;
    white-space: normal;
    text-align: center;
    font-size: 13px;
    line-height: 1.25;
  }
}

/* ---------- Launch ---------- */
.launch {
  position: relative;
  min-height: 90svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 12vh var(--gut) 14vh;
  text-align: center;
  z-index: 3;
}
/* Space for the knitted name; the 3D scene places it here */
.launch-knit {
  width: min(860px, 86vw);
  height: clamp(140px, 24vh, 280px);
  display: grid;
  place-items: center;
}
.launch-fallback { display: none; font: 900 clamp(48px, 8vw, 120px)/.95 var(--font); letter-spacing: -.03em; }
.launch h2 { margin-top: 10px; font: 900 clamp(30px, 4vw, 60px)/1.05 var(--font); letter-spacing: -.02em; }
@media (max-width: 760px) {
  .launch-knit { height: clamp(170px, 30vh, 260px); }
}
.launch-copy { max-width: 540px; color: var(--muted); font-size: 18px; }

/* ---------- Fallback when the browser can't draw 3D ---------- */
html.no3d #knit { display: none; }
html.no3d .hero h1 {
  position: absolute; width: auto; height: auto; overflow: visible; clip: auto; clip-path: none;
  left: 50%; top: 40%; transform: translate(-50%, -50%);
  font: 900 clamp(64px, 13vw, 220px)/.9 var(--font);
  letter-spacing: -.03em;
  white-space: normal;
  text-align: center;
}
.pog { color: var(--orange); }
.barley { color: var(--seafoam-dark); }
html.no3d .hero-copy { opacity: 1; position: absolute; }

/* ---------- Reduced motion: no pinned run, copy sits at the foot of the first screen ---------- */
html.rm .run { height: 70vh; }
html.rm .hero-copy { position: absolute; }

/* Without the moving scene, the closing panel is a solid panel with the name as text */
html.rm .launch, html.no3d .launch { background: var(--sand-light); border-radius: 36px 36px 0 0; }
html.rm .launch-knit, html.no3d .launch-knit { height: auto; }
html.rm .launch-fallback, html.no3d .launch-fallback { display: block; }
