/* ============================================================
   hyperfix.fun — handmade prize ribbons & whimsical crafts
   Design cues: editorial typewriter structure warmed up with a
   felt-and-sequins craft palette.
   ============================================================ */

/* ── fonts (self-hosted) ───────────────────────────────────
   Fraunces + Space Mono are served from /assets/fonts (see src/assets/fonts) instead of the
   Google Fonts CDN. Each has a metric-matched fallback @font-face (generated
   with @capsizecss/core from the fonts' own metrics) so there is ~zero layout
   shift between the fallback and the real font.

   font-display: OPTIONAL (not swap) to eliminate the visible glyph swap: for a
   given face the real font is used only if it's ready within the browser's
   short (~100ms) block window (helped by the preloads in base.njk + the subset
   Fraunces files); otherwise the metric-matched fallback is kept for the whole
   page load. Either way a run of text never flash-and-changes mid-view.
   NOTE: optional is evaluated per @font-face. The preloaded faces (Fraunces
   normal + italic, Space Mono normal — see base.njk) are the most likely to
   win the block window and render real; a non-preloaded face on a slow load
   may stay on its metric-matched fallback for that load. Mixed faces are
   possible, but there is still no swap.

   The Fraunces files are the variable font instanced to just the axes we use
   (opsz + wght; SOFT/WONK pinned to their defaults) — ~45% smaller than the
   full file, so it lands inside the optional window far more often.

   NOTE: this does NOT remove the #hash realign JS in main.js — that is kept on
   purpose for cross-browser reload-to-anchor (native scrolling doesn't do it,
   notably on iOS Safari). The fonts just remove the CLS, not the realign.
   ============================================================ */
@font-face {
  font-family: "Fraunces";
  font-style: normal; font-weight: 100 900; font-display: optional;
  src: url("/assets/fonts/fraunces-latin-subset-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic; font-weight: 100 900; font-display: optional;
  src: url("/assets/fonts/fraunces-latin-subset-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal; font-weight: 400; font-display: optional;
  src: url("/assets/fonts/space-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal; font-weight: 700; font-display: optional;
  src: url("/assets/fonts/space-mono-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: italic; font-weight: 400; font-display: optional;
  src: url("/assets/fonts/space-mono-latin-400-italic.woff2") format("woff2");
}
/* Metric-matched fallbacks (Capsize) — dimensions mimic the real fonts so the
   swap causes no reflow. Declared across the weight range and for both styles
   so bold (600/900) and italic display/mono text use the matched face rather
   than defaulting to the 400/normal face (or the next family). The overrides
   are computed from the roman metrics and reused for italic — a close-enough
   approximation for the brief pre-swap window. */
@font-face {
  font-family: "Fraunces Fallback";
  font-style: normal; font-weight: 100 900;
  src: local("Georgia");
  ascent-override: 92.9623%;
  descent-override: 24.2386%;
  size-adjust: 105.2039%;
}
@font-face {
  font-family: "Fraunces Fallback";
  font-style: italic; font-weight: 100 900;
  src: local("Georgia");
  ascent-override: 92.9623%;
  descent-override: 24.2386%;
  size-adjust: 105.2039%;
}
@font-face {
  font-family: "Space Mono Fallback";
  font-style: normal; font-weight: 400 700;
  src: local("Courier New"), local("CourierNewPSMT");
  ascent-override: 109.8218%;
  descent-override: 35.3979%;
  size-adjust: 101.9834%;
}
@font-face {
  font-family: "Space Mono Fallback";
  font-style: italic; font-weight: 400 700;
  src: local("Courier New"), local("CourierNewPSMT");
  ascent-override: 109.8218%;
  descent-override: 35.3979%;
  size-adjust: 101.9834%;
}

:root {
  /* felt palette */
  --cream:       #fbf6e9;
  --cream-deep:  #f6eecf;
  --ink:         #2b2622;
  --ink-soft:    #6b6259;

  --butter:      #f7d94a;
  --butter-deep: #eec33a;
  --bubblegum:   #f4a7c0;
  --bubblegum-d: #e87ea0;
  --periwinkle:  #a7b8ea;
  --lilac:       #c9b3e6;
  --mint:        #a9d8c8;
  --tomato:      #e8543b;

  --tint-lilac:      #ece2f7;
  --tint-periwinkle: #e2e8fa;
  --tint-butter:     #fdf3c8;
  --tint-bubblegum:  #fbe1ea;
  --tint-mint:       #dcf0e8;

  --line: #e6dcc0;

  --font-display: "Fraunces", "Fraunces Fallback", Georgia, "Times New Roman", serif;
  --font-mono: "Space Mono", "Space Mono Fallback", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --wrap: 1200px;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --radius: 14px;
}

/* ── reset-ish ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* Land anchor jumps below the sticky header instead of tucked under it.
   (#top is intentionally excluded — it sits above the header and should hit y=0.) */
#gallery, #about, #commission, #main-content { scroll-margin-top: 4.5rem; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; font-weight: 900; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--cream); padding: .6rem 1rem; z-index: 200;
}
.skip-link:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 3px solid var(--tomato); outline-offset: 3px; }

/* ── bead-letter accent ───────────────────────────────── */
/* Bead letters sit on visible white boxes, so the rest of the page's
   font-display: optional (a brief invisible-text window) reads as blank boxes
   here on reload. Give just the beads a Space Mono face with font-display:
   swap, so the metric-matched fallback letter shows immediately (no blank) and
   the real font swaps in — the swap is subtle for a monospace glyph, and the
   page's other text keeps optional (no swap). */
@font-face {
  font-family: "Space Mono Beads";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/space-mono-latin-700-normal.woff2") format("woff2");
}
.beads { display: inline-flex; gap: .12em; vertical-align: baseline; }
.bead {
  display: inline-grid; place-items: center;
  width: .98em; height: .98em; margin-top: .12em;
  font-family: "Space Mono Beads", "Space Mono Fallback", ui-monospace, "Cascadia Mono", Menlo, monospace;
  font-weight: 700; font-size: .62em;
  /* line-height:1 collapses the inherited tall line-box to the em; the small
     bottom padding nudges the centered glyph up within the box (a lowercase
     glyph's ink sits below the em centre, so em-centering alone reads low).
     box-sizing is border-box, so the bead stays .98em square (see width/height). */
  line-height: 1; padding-bottom: .42em;
  color: var(--ink); background: #fff;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1.5px #eadfd0, 0 1px 2px rgba(0,0,0,.14);
  transform: rotate(var(--r, 0deg));
}
.bead:nth-child(2n)   { --r: -5deg; background: #fffdf7; }
.bead:nth-child(3n)   { --r: 5deg; }
.bead:nth-child(4n)   { --r: -2deg; background: #fef7fb; }
.bead--gap { background: none; box-shadow: none; width: .3em; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--font-mono); font-weight: 700;
  letter-spacing: .06em; text-transform: lowercase;
  padding: .85rem 1.6rem; border-radius: 999px;
  border: 2px solid var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn--primary { background: var(--butter); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.btn--ghost   { background: transparent; color: var(--ink); }
.btn--lg      { padding: 1.05rem 2rem; font-size: 1.05rem; }
.btn:hover    { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn--ghost:hover { background: #fff; }

/* ── header / nav ──────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--cream);
  border-bottom: 2px solid var(--butter);
}
.nav {
  max-width: var(--wrap); margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 1rem; padding: .85rem var(--gutter);
}
.nav__links { display: flex; gap: 1.4rem; }
.nav__links a {
  text-decoration: none; font-size: .82rem; letter-spacing: .04em;
  color: var(--ink-soft);
}
.nav__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.nav__wordmark {
  justify-self: center; text-decoration: none;
  font-family: var(--font-display); font-weight: 900; font-size: 1.6rem;
  letter-spacing: .04em; color: var(--butter-deep);
  -webkit-text-stroke: .6px var(--ink);
}
.nav__cta {
  justify-self: end; text-decoration: none; font-size: .82rem;
  font-weight: 700; padding: .4rem .9rem; border: 2px solid var(--ink);
  border-radius: 999px; background: var(--bubblegum); color: var(--ink);
}
.nav__cta:hover { background: var(--butter); }

/* ── hero ──────────────────────────────────────────────── */
.hero {
  position: relative;
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) var(--gutter) clamp(2rem, 5vw, 4rem);
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.hero__eyebrow {
  margin: 0 0 1rem; text-transform: lowercase; letter-spacing: .18em;
  font-size: .8rem; color: var(--ink-soft);
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 900; letter-spacing: -.02em;
}
.hero__title .beads { font-size: .78em; }
.hero__lede {
  margin: 1.4rem 0 2rem; max-width: 34ch;
  font-size: 1.1rem; color: var(--ink-soft);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; }

.hero__art {
  margin: 0; position: relative;
  transform: rotate(2.5deg);
}
.hero__art img {
  width: 100%; border-radius: var(--radius);
  border: 8px solid #fff;
  box-shadow: 0 18px 40px rgba(43,38,34,.22);
}
.hero__art figcaption {
  position: absolute; bottom: -.6rem; left: 50%; transform: translateX(-50%) rotate(-2deg);
  background: var(--butter); color: var(--ink);
  font-size: .72rem; letter-spacing: .04em; white-space: nowrap;
  padding: .35rem .8rem; border-radius: 999px; border: 2px solid var(--ink);
}
/* ── definition strip ──────────────────────────────────── */
.define {
  background: var(--tint-lilac);
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
}
.define__entry {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter);
}
.define__word {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 3rem);
}
.define__meta { margin: .3rem 0 1.4rem; display: flex; flex-wrap: wrap; gap: 1rem; font-size: .9rem; }
.define__pron { color: var(--ink-soft); }
.define__pos { font-weight: 700; font-style: italic; }
.define__list { counter-reset: d; display: grid; gap: 1rem; max-width: 64ch; }
.define__list li {
  counter-increment: d; position: relative; padding-left: 2.4rem; font-size: 1.02rem;
}
.define__list li::before {
  content: counter(d) ".";
  position: absolute; left: 0; top: 0; font-weight: 700; color: var(--bubblegum-d);
}
.define__list li:last-child { font-style: italic; color: var(--ink-soft); }

/* ── section headers ───────────────────────────────────── */
.section-head { max-width: var(--wrap); margin: 0 auto; padding: clamp(3rem,7vw,5rem) var(--gutter) 1.5rem; }
.section-head--center { text-align: center; }
.section-head h2 {
  font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.4rem);
}
.section-head p { margin: .6rem 0 0; color: var(--ink-soft); }

/* ── gallery (carousel) ────────────────────────────────── */
/* One-at-a-time carousel, same mechanics as catalinoquality.com: a flex track
   of full-width slides that main.js translates by 100% steps (with cloned
   end-slides for a seamless loop). With no JS the track is a flex row clipped
   by .carousel's overflow:hidden, so the first slide still shows. */
.carousel {
  position: relative; overflow: hidden;
  max-width: 680px; margin: 0 auto clamp(2rem,5vw,4rem);
  padding: 0 calc(var(--gutter) / 2);
  touch-action: pan-y pinch-zoom;
}
.carousel-track { display: flex; }
/* Each slide is exactly the track's width. `flex: 0 0 100%` (basis 100%, no
   grow/shrink) pins that against the container; `min-width: 0` stops the
   intrinsic image width from expanding the slide past 100% — without it the
   slide sizes to its content and a 100% translate no longer lands on one
   slide, so neighbours bleed in and captions drift out of alignment. */
.carousel-slide {
  flex: 0 0 100%; min-width: 0; margin: 0;
  padding: .5rem .5rem 0;
}
.carousel-slide__frame {
  border-radius: var(--radius); overflow: hidden;
  border: 6px solid #fff; background: var(--tint-butter);
  box-shadow: 0 10px 26px rgba(43,38,34,.14);
}
.card--lilac      .carousel-slide__frame { background: var(--tint-lilac); }
.card--periwinkle .carousel-slide__frame { background: var(--tint-periwinkle); }
.card--bubblegum  .carousel-slide__frame { background: var(--tint-bubblegum); }
.card--mint       .carousel-slide__frame { background: var(--tint-mint); }
/* contain (not cover) so the whole photo is always visible; the letterbox
   area falls back to the frame's felt-tint background, matting the photo
   rather than cropping it. */
.carousel-slide__frame img { display: block; width: 100%; height: clamp(280px, 52vw, 460px); object-fit: contain; }
.carousel-slide__cap { padding: .9rem .4rem 1.1rem; text-align: center; }
.carousel-slide__cap h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; }
.carousel-slide__cap p { margin: .35rem auto 0; max-width: 46ch; font-size: .9rem; color: var(--ink-soft); line-height: 1.55; }

/* Arrows only work once main.js wires them up, so keep them out of the no-JS
   render — main.js adds .is-ready to reveal them. */
.carousel-btn { display: none; }
.carousel.is-ready .carousel-btn {
  display: block;
  position: absolute; top: clamp(140px, 26vw + .5rem, 236px);
  transform: translateY(-50%); z-index: 2;
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  border: 2px solid var(--ink); background: rgba(255,255,255,.92); color: var(--ink);
  font-family: var(--font-display); font-size: 1.5rem; line-height: 1;
  cursor: pointer; transition: transform .15s ease, background .15s ease;
}
.carousel-btn:hover { background: var(--tint-butter); }
.carousel-prev { left: calc(var(--gutter) / 2 + .25rem); }
.carousel-next { right: calc(var(--gutter) / 2 + .25rem); }

/* ── about ─────────────────────────────────────────────── */
.about { background: var(--butter); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.about__inner {
  max-width: var(--wrap); margin: 0 auto; padding: clamp(3rem,7vw,5rem) var(--gutter);
  display: grid; grid-template-columns: 1.45fr .85fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.about__photo { margin: 0; position: relative; transform: rotate(-2deg); }
.about__photo img {
  width: 100%; border-radius: var(--radius); border: 8px solid #fff;
  box-shadow: 0 16px 36px rgba(43,38,34,.28);
}
.about__photo figcaption {
  position: absolute; bottom: -.7rem; left: 50%; transform: translateX(-50%) rotate(1.5deg);
  background: var(--bubblegum); color: var(--ink);
  font-family: var(--font-mono); font-weight: 700; font-size: .78rem; letter-spacing: .04em;
  white-space: nowrap; padding: .35rem .9rem; border-radius: 999px; border: 2px solid var(--ink);
}
.about__eyebrow { margin: 0 0 1rem; text-transform: lowercase; letter-spacing: .18em; font-size: .8rem; font-weight: 700; }
.about__title { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.4rem); max-width: 18ch; }
.about__statement { margin: 1.6rem 0 2.2rem; max-width: 60ch; font-size: 1.08rem; }
.about__values { display: grid; gap: 1rem; max-width: 60ch; }
.about__values li { display: flex; gap: 1rem; align-items: baseline; font-size: 1.02rem; border-top: 2px solid rgba(43,38,34,.25); padding-top: 1rem; }
.about__values span { font-weight: 700; color: var(--tomato); }

/* ── offerings ─────────────────────────────────────────── */
.offerings__list { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) clamp(2rem,5vw,4rem); }
.offering {
  display: grid; grid-template-columns: auto 1fr clamp(14rem, 25vw, 19rem); gap: clamp(1rem,4vw,3rem);
  align-items: start; padding: 2rem 0; border-top: 2px solid var(--ink);
}
.offering:last-child { border-bottom: 2px solid var(--ink); }
.offering__no { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--bubblegum-d); }
.offering__body h3 { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
.offering__body p { margin: .6rem 0 0; max-width: 46ch; color: var(--ink-soft); }
.offering__details { display: grid; gap: .5rem; min-width: 12rem; font-size: .84rem; }
.offering__details li { padding-left: 1.1rem; position: relative; }
.offering__details li::before { content: "✦"; position: absolute; left: 0; color: var(--butter-deep); }

/* ── commission ────────────────────────────────────────── */
.commission {
  background:
    radial-gradient(circle at 20% 20%, rgba(244,167,192,.5), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(167,184,234,.5), transparent 45%),
    var(--cream-deep);
  border-top: 2px solid var(--ink);
}
.commission__inner { max-width: 760px; margin: 0 auto; text-align: center; padding: clamp(3.5rem,9vw,6rem) var(--gutter); }
.commission__title { font-family: var(--font-display); font-size: clamp(2.2rem, 6vw, 4rem); }
.commission__copy { margin: 1.4rem auto 2.4rem; max-width: 50ch; font-size: 1.08rem; color: var(--ink-soft); }
.commission__note { margin-top: 1.4rem; font-size: .9rem; }
.commission__note a { font-weight: 700; }

/* ── footer ────────────────────────────────────────────── */
.site-footer {
  background: linear-gradient(120deg, var(--butter) 0%, var(--butter-deep) 60%, #e2a83a 100%);
  border-top: 2px solid var(--ink);
  display: grid; grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2rem;
  padding: clamp(2.5rem,6vw,4rem) var(--gutter) 2rem;
}
.site-footer__mark { font-family: var(--font-display); font-weight: 900; font-size: 2rem; letter-spacing: .03em; -webkit-text-stroke: .5px var(--ink); }
.site-footer__brand p { margin: .3rem 0 0; font-size: .9rem; }
.site-footer__tag { font-style: italic; opacity: .8; }
.site-footer__col h3 { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .9rem; }
.site-footer__col ul { display: grid; gap: .6rem; }
.site-footer__col a { text-decoration: none; }
.site-footer__col a:hover { text-decoration: underline; text-underline-offset: 4px; }
.soon em { opacity: .65; font-style: italic; }
.site-footer__legal { grid-column: 1 / -1; margin: 1.5rem 0 0; padding-top: 1.5rem; border-top: 2px solid rgba(43,38,34,.25); font-size: .78rem; }

/* ── responsive ────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero__art { max-width: 380px; margin: 1rem auto 0; }
  .about__inner { grid-template-columns: 1fr; }
  .about__photo { max-width: 380px; margin: 1rem auto 0; order: -1; }
  .offering { grid-template-columns: auto 1fr; }
  .offering__details { grid-column: 2; min-width: 0; }
  .site-footer { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav__links { display: none; }
  .nav__wordmark { justify-self: start; }
  .carousel-btn { top: clamp(150px, 46vw, 260px); width: 2.4rem; height: 2.4rem; font-size: 1.25rem; }
  .site-footer { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
