/* ==========================================================================
   BLENDZ — hero section
   --------------------------------------------------------------------------
   Every number below is traced from assets/references/Blendz h.png.
   Reference artboard = 506 x 472 px (design centre x = 288).

   Scaling model
   -------------
   .hero__inner is a size container. Everything that must keep its shape
   (type sizes, artwork widths, offsets that glue one element to another) is
   expressed in `cqw` = 1% of that container's width, so the whole poster
   scales as one piece. Vertical *positions* are `%` of .hero__composition,
   which is allowed to grow taller than the reference aspect on tall
   viewports — that only opens up the gaps between rows, it never distorts
   or resizes anything.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Local pixel fonts
   `block` (not `swap`) is deliberate: both the wordmark and the two arc-set
   SVG labels are laid out from these metrics, so a fallback flash would show
   the composition in the wrong shape rather than just the wrong face.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Pixel Gosub";
  src: url("../assets/fonts/Pixel Gosub.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Partita1990";
  src: url("../assets/fonts/Partita1990-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* --------------------------------------------------------------------------
   Tokens — all colours sampled from the reference
   -------------------------------------------------------------------------- */
:root {
  --purple:        #5a35b6; /* page + hero canvas          */
  --purple-plate:  #8547a7; /* tagline banner              */
  --purple-plate2: #7e44a9; /* EST label strip             */
  --cream:         #f9f18c; /* wordmark / label type       */
  --menu-green:    #3a4a1f; /* MENU printed on the fruit   */

  --font-display: "Pixel Gosub", "Courier New", monospace;
  --font-label:   "Partita1990", "Courier New", monospace;
}

/* --------------------------------------------------------------------------
   Reset (minimal)
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  background: var(--purple);
  overflow-x: hidden;
}

img { display: block; border: 0; }

h1 { margin: 0; font-weight: 400; }

/* ==========================================================================
   Hero shell
   ========================================================================== */
.hero {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 82vh;      /* fallback for browsers without svh */
  min-height: 82svh;
  padding: clamp(10px, 2.5vw, 32px);
  background: var(--purple);
  overflow: hidden;       /* keeps any edge bleed off the scrollbars */
}

/* Size container. The three caps are, in order: never wider than the hero
   box, never wider than the poster should get, and never so wide that the
   poster becomes taller than the viewport. */
.hero__inner {
  width: min(100%, 1100px, 88vh);   /* fallback for browsers without svh */
  width: min(100%, 1100px, 88svh);
  container-type: inline-size;
}

/* 93.28cqw is the reference aspect (472 / 506) — the floor. The 120cqw ceiling
   lets a tall viewport open the row gaps a little rather than stranding the
   poster in the middle of an empty screen. */
.hero__composition {
  --canvas-h: max(93.28cqw, min(120cqw, 88vh));    /* svh fallback */
  --canvas-h: max(93.28cqw, min(120cqw, 88svh));

  position: relative;
  width: 100%;
  height: var(--canvas-h);
  /* Artwork heights are width-driven, so every pixel of stretch past the
     reference aspect lands as dead space *below* the fruit row. This puts the
     composition back on the optical centre line. */
  transform: translateY(calc(.17265 * var(--canvas-h) - 16.725cqw));
}

/* ==========================================================================
   Pixel sprite crop
   --------------------------------------------------------------------------
   Every supplied PNG is a 1080 x 1350 canvas with the artwork floating in
   transparent padding. These wrappers are sized to the *artwork* and pull the
   image into place, so positions stay predictable and the peach's hit area
   matches its silhouette instead of the whole 1080 x 1350 box.
     --wf  artwork width  / 1080
     --lf  artwork left   / 1080
     --tf  artwork top    / 1350
   -------------------------------------------------------------------------- */
.pxsprite {
  position: absolute;
  display: block;
  overflow: hidden;
}

.pxsprite > img {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / var(--wf));
  height: auto;
  transform: translate(calc(var(--lf) * -100%), calc(var(--tf) * -100%));
  image-rendering: pixelated;
}

.pxsprite--star       { --wf: .6166667; --lf: .1888889; --tf: .2681481; aspect-ratio: 666 / 635; }
.pxsprite--cherry     { --wf: .6657407; --lf: .1435185; --tf: .26;      aspect-ratio: 719 / 686; }
.pxsprite--peach      { --wf: .6333333; --lf: .1935185; --tf: .1711111; aspect-ratio: 684 / 793; }
.pxsprite--strawberry { --wf: .4601852; --lf: .2685185; --tf: .2740741; aspect-ratio: 497 / 613; }

/* ==========================================================================
   1 — EST label  (ref plate x 222–352, y 72–105)
   ========================================================================== */
.hero__established {
  position: absolute;
  left: 36.96%;
  top: 10.17%;
  width: 25.69cqw;
  aspect-ratio: 130 / 33;
  z-index: 2;
}

.hero__established-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero__established-text {
  font-family: var(--font-label);
  font-size: 20.6px;      /* = 20.6 viewBox units */
  fill: var(--cream);
}

/* coral asterisk — same supplied graphic as the big star */
.hero__est-star {
  left: 87.69%;
  top: 30.3%;
  width: 8.46%;
}

/* ==========================================================================
   2 — BLENDZ wordmark  (ref ink box x 90–490, y 124–212)
   .hero__brand-wrap *is* that ink box, which is what the star hangs off.
   ========================================================================== */
.hero__brand-wrap {
  position: absolute;
  left: 10.87%;
  top: 21.19%;
  width: 79.05cqw;
  height: 17.39cqw;
  z-index: 3;
}

.hero__brand {
  font-family: var(--font-display);
  font-size: 23.72cqw;    /* ref 120px / 506px artboard */
  line-height: 1;
  letter-spacing: .00833em;
  color: var(--cream);
  white-space: nowrap;
  /* Pixel Gosub sits its cap 0.2792em below the top of a line-height:1 box;
     this pulls the cap line onto .hero__brand-wrap's top edge. */
  margin-top: -.2792em;
}

.hero__brand-kern { margin-right: -.06667em; }

/* ==========================================================================
   4 — Decorative star, glued to the top-right of the wordmark
        (ref x 454–504, y 93–140 — overlaps the crown of the Z)
   ========================================================================== */
.hero__star {
  left: 91%;
  top: -35.23%;
  width: 12.5%;
  z-index: 4;
}

/* ==========================================================================
   3 — Curved tagline banner  (ref plate x 80–496, y 222–292)
   ========================================================================== */
.hero__tagline {
  position: absolute;
  left: 8.89%;
  top: 41.95%;
  width: 82.21cqw;
  aspect-ratio: 416 / 70;
  overflow: visible;
  z-index: 2;
}

.hero__tagline-text {
  font-family: var(--font-label);
  font-size: 35.5px;      /* = 35.5 viewBox units */
  fill: var(--cream);
}

.hero__plate--est     { fill: var(--purple-plate2); }
.hero__plate--tagline { fill: var(--purple-plate); }

/* ==========================================================================
   5 — Fruit row
   ========================================================================== */
.hero__fruit { z-index: 5; }

.hero__fruit--cherries {
  left: 1.38%;
  top: 53.81%;
  width: 31.62cqw;
}

/* The peach is the link to the future blend-builder — its whole silhouette
   box is the hit area, not just the MENU letters. */
.hero__fruit--peach {
  left: 35.57%;
  top: 55.3%;
  width: 28.85cqw;
  z-index: 6;
  cursor: pointer;
  text-decoration: none;
}

.hero__fruit--strawberry {
  left: 65.02%;
  top: 54.24%;
  width: 27.87cqw;
}

/* ==========================================================================
   6 — MENU printed on the peach  (ref ink x 250–321, y 390–411)
   ========================================================================== */
.hero__menu {
  position: absolute;
  left: 50%;
  top: 61.4%;             /* % of the peach box */
  transform: translateX(-50%);
  margin-top: -.2792em;   /* cap-line correction, as per .hero__brand */
  font-family: var(--font-display);
  font-size: 5.66cqw;     /* ref 28.64px / 506px artboard */
  line-height: 1;
  color: var(--menu-green);
  white-space: nowrap;
  z-index: 1;
}

/* Flat, pixel-flavoured focus ring — no glow, no soft shadow. */
.hero__fruit--peach:focus-visible {
  outline: max(4px, 1cqw) solid var(--cream);
  outline-offset: max(4px, 1cqw);
}
