/* Home page only (index.html loads it after styles.css). Same four brand colours; what changes is the hero bench,
   the type rhythm and the motion hooks for assets/home-motion.js. Everything here reads fine with motion off. */

.hm-page {
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Before GSAP starts (html.hm-motion, set by assets/main.js) the hero parts it reveals stay hidden. */
.hm-motion [data-hm] {
  visibility: hidden;
}

/* Scroll progress: a 2 px cobalt-to-cyan line under the header, scaled by home-motion.js. */
.hm-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: 2px;
  background: linear-gradient(90deg, var(--cobalt), var(--cyan));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Hero ---------- */

.hm-hero.cs-hero {
  padding-block: var(--s-7) var(--s-8);
  background:
    var(--navy);
}

.hm-hero.cs-hero::before {
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 72% 40%, black 15%, transparent 70%);
}

.hm-hero-grid {
  display: grid;
  gap: var(--s-7);
  align-items: center;
}

.hm-hero-main {
  min-width: 0;
}

.hm-hero .cs-eyebrow {
  margin-bottom: var(--s-4);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.hm-hero h1 {
  max-width: 15ch;
  font-size: clamp(2.375rem, 1.3rem + 4vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

/* SplitText lines are masked, so each line rises out of its own slot. */
.hm-hero h1 .hm-line-mask {
  padding-bottom: 0.08em;
}

.hm-hero .cs-hero-sub {
  max-width: 56ch;
  margin-top: var(--s-5);
  font-size: 1.0625rem;
}

.hm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

.hm-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  gap: var(--s-3) var(--s-6);
  margin-top: var(--s-6);
  padding: var(--s-5) 0 0;
  border-top: 1px solid var(--hair-dark);
  list-style: none;
}

.hm-proof li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hm-proof strong {
  color: var(--white);
  font: 600 clamp(1.25rem, 1rem + 0.8vw, 1.625rem)/1.1 var(--font-head);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.hm-proof span {
  color: var(--on-dark-2);
  font-size: 0.8125rem;
}

/* The bench: an Etiketto label and a Columna sheet lying on the desk, overlapping. Decorative copies of the
   samples in "Start here"; the figure caption says they are sample data. */
.hm-bench {
  position: relative;
  display: grid;
  min-width: 0;
  margin: 0;
  padding: var(--s-2) 0 var(--s-6);
  perspective: 1200px;
}

.hm-label,
.hm-sheet {
  position: relative;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.6) inset,
    0 30px 60px -20px rgb(0 0 0 / 0.55),
    0 12px 24px -12px rgb(0 0 0 / 0.35);
}

.hm-label {
  z-index: 1;
  width: min(100%, 22rem);
  padding: var(--s-4) var(--s-5) var(--s-5);
  border-top: 4px solid var(--cobalt);
  transform: rotate(-2.5deg);
}

.hm-sheet {
  z-index: 2;
  justify-self: end;
  width: min(100%, 25rem);
  margin-top: calc(var(--s-7) * -1);
  padding: var(--s-4);
  border-top: 4px solid var(--cyan);
  transform: rotate(1.5deg);
}

.hm-file {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
  color: var(--ink-3);
  font: 500 0.6875rem/1.2 var(--font-mono);
  letter-spacing: 0.02em;
}

.hm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cobalt);
}

.hm-dot-cyan {
  background: var(--cyan);
}

.hm-label-name {
  font: 600 1.125rem/1.2 var(--font-head);
  letter-spacing: -0.01em;
}

.hm-label-ing {
  margin-top: var(--s-2);
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.hm-label-ing b {
  color: var(--ink);
}

/* Allergens: bold, with a cobalt underline home-motion.js draws in. */
.hm-allergen {
  background: linear-gradient(var(--cobalt), var(--cobalt)) 0 100% / 100% 2px no-repeat;
}

.hm-motion .hm-allergen {
  background-size: 0% 2px;
}

.hm-nut {
  margin-top: var(--s-3);
  border-top: 6px solid var(--navy);
  font-size: 0.8125rem;
}

.hm-nut div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding-block: 5px;
  border-bottom: 1px solid var(--line);
}

.hm-nut dt {
  font-weight: 600;
}

.hm-nut dd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.hm-nut-sub dt {
  padding-left: var(--s-3);
  color: var(--ink-3);
  font-weight: 400;
}

/* The sheet: line-item properties in their own columns. The raw "Engraving: …; Font: …" cell sits over the two
   property columns; home-motion.js lifts it away and the columns slide in. With motion off it is never shown. */
.hm-grid {
  position: relative;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 1fr 0.8fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  overflow: hidden;
}

.hm-grid > span {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-grid > span:nth-last-child(-n + 5) {
  border-bottom: 0;
}

.hm-th {
  background: var(--soft);
  color: var(--ink-3);
  font-weight: 600;
}

.hm-th.hm-prop {
  background: color-mix(in srgb, var(--cyan) 16%, var(--white));
  color: var(--navy);
}

.hm-raw {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 50%;
  display: none;
  align-items: center;
  padding: 0 10px;
  border-left: 1px dashed var(--line-2);
  background: var(--white);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.hm-motion .hm-raw {
  display: flex;
}

.hm-bench figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  color: var(--on-dark-2);
  font-size: 0.75rem;
}

@media (min-width: 1000px) {
  .hm-hero.cs-hero {
    padding-block: var(--s-8) var(--s-9);
  }

  .hm-hero-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--s-7);
  }

  .hm-hero h1 {
    max-width: 14ch;
  }

  .hm-hero .cs-hero-sub {
    margin-top: var(--s-6);
  }
}

@media (max-width: 560px) {
  .hm-proof {
    grid-template-columns: repeat(2, minmax(0, auto));
  }

  .hm-sheet {
    margin-top: calc(var(--s-5) * -1);
  }

  .hm-label {
    width: 92%;
  }

  .hm-sheet {
    width: 96%;
  }
}

/* ---------- Section rhythm ---------- */

.hm-page .block-head h2,
.hm-page .rt-head h2 {
  letter-spacing: -0.01em;
}

.hm-page .cs-kicker {
  padding: 0;
  background: none;
  color: var(--cobalt);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.hm-page .cs-kicker::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  margin: 0.6em 10px 0 0;
  background: currentColor;
  vertical-align: top;
}

/* Router and featured cards: one lift on hover, the same for every card on the page. */
.hm-page .rt-item a,
.hm-page .feat-card {
  transition:
    transform 240ms var(--ease-out),
    box-shadow 240ms var(--ease-out),
    border-color 240ms var(--ease-out);
}

.hm-page .rt-lead a:hover,
.hm-page .rt-main a:hover,
.hm-page .feat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -24px rgb(var(--navy-rgb) / 0.45);
}

.hm-page .feat-main {
  background:
    var(--tint);
}

.hm-page .food-label-card {
  transform: rotate(1deg);
  box-shadow: 0 24px 48px -28px rgb(var(--navy-rgb) / 0.55);
}

.hm-page .sheet {
  box-shadow: 0 24px 48px -30px rgb(var(--navy-rgb) / 0.45);
}

/* Why: big numerals, the item in view turns cobalt (home-motion.js toggles .is-on). */
.hm-page .why-list {
  counter-reset: why;
}

.hm-page .why-list li {
  counter-increment: why;
  transition: opacity 300ms var(--ease-out);
}

.hm-page .why-k::before {
  content: counter(why, decimal-leading-zero);
  width: auto;
  height: auto;
  margin-right: 10px;
  border-radius: 0;
  background: none;
  color: var(--ink-3);
  font: 500 0.75rem/1 var(--font-mono);
  transition: color 300ms var(--ease-out);
}

.hm-motion .hm-page .why-list li {
  opacity: 0.45;
}

.hm-motion .hm-page .why-list li.is-on {
  opacity: 1;
}

.hm-page .why-list li.is-on .why-k::before {
  color: var(--cobalt);
}

.hm-page .final-cta h2 {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  letter-spacing: -0.01em;
}

@media (prefers-reduced-motion: reduce) {
  .hm-page .rt-item a,
  .hm-page .feat-card {
    transition: none;
  }

  .hm-page .rt-lead a:hover,
  .hm-page .rt-main a:hover,
  .hm-page .feat-card:hover {
    transform: none;
  }
}
