/* ─────────────────────────────────────────────────────────────────────────
   HORMACHUELOS — the home page's own sections (home.js).

   The hero shows the real thing: the terminal and the desktop app building
   the same game, one recording after the other. Below it:
   the numbers at a glance, the features as a bento grid, and a dark closing
   band. Colours are the sketchbook's ink and paper.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Hero ── */

.hero h1.hero-tagline {
  margin-bottom: 14px;
}

/* The download menu drops down over the showcase below it. */
.hero .actions {
  position: relative;
  z-index: 30;
}

.hero-sub {
  max-width: 44ch;
  margin: 0 auto 30px;
  font-family: var(--font-body);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ── How many builders are here (builders.js) ── */

.builders {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 20px 0 0;
  padding: 4px 14px 5px;
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: clamp(17px, 1.7vw, 21px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  /* The house marker: a sanguine swipe fading at both ends, the same wash the
     plan perks wear, so the line reads as marked on the page by hand. */
  background: linear-gradient(
    180deg,
    rgba(142, 58, 28, 0.02) 6%,
    rgba(142, 58, 28, 0.2) 18%,
    rgba(142, 58, 28, 0.2) 84%,
    rgba(142, 58, 28, 0.04) 95%
  );
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.builders strong {
  display: inline-block;
  min-width: 3.2ch;
  text-align: right;
  font-family: var(--font-display);
  font-size: 1.55em;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transform-origin: 100% 80%;
}

/* A step is one person almost every time, so the change shows as a small
   flash rather than a run of digits. */
.builders strong.is-bump {
  animation: builders-bump 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes builders-bump {
  0% {
    transform: translateY(-2px) scale(1.16);
    color: var(--sanguine);
  }
  100% {
    transform: none;
    color: var(--ink);
  }
}

.builders-sep {
  margin: 0 2px;
  color: var(--sanguine);
  opacity: 0.7;
}

.builders-stat {
  white-space: nowrap;
}

/* The green dot: the same "live" green the free offer wears. */
.builders-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--leaf-lit);
  box-shadow: 0 0 0 3px rgba(31, 174, 90, 0.18);
  animation: builders-pulse 2.6s ease-in-out infinite;
}

@keyframes builders-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* At phone width three items would wrap the words apart, so the line folds to
   two stacked rows: the dot and the total, then the day's arrivals. */
@media (max-width: 520px) {
  .builders {
    display: inline-grid;
    grid-template-columns: auto auto;
    gap: 2px 8px;
    padding: 7px 16px 9px;
  }

  .builders-dot {
    grid-row: 1;
    grid-column: 1;
    align-self: center;
  }

  .builders-stat:first-of-type {
    grid-row: 1;
    grid-column: 2;
  }

  .builders-sep {
    display: none;
  }

  .builders-stat:last-of-type {
    grid-row: 2;
    grid-column: 1 / -1;
    font-size: 0.72em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .builders-dot {
    animation: none;
  }

  .builders strong.is-bump {
    animation: none;
  }
}

/* ── See it work: the terminal and the desktop app ── */

.show {
  width: min(1040px, 100%);
  margin: 46px auto 40px;
}

.show-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.show-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.show-tab:hover {
  transform: translateY(-2px);
}

.show-tab svg {
  flex: none;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.show-tab-text {
  display: grid;
  gap: 2px;
}

.show-tab strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.show-tab small {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
}

.show-tab.is-on {
  background: #2a2016;
  border-color: #2a2016;
  color: #fbf7f0;
}

.show-tab.is-on small {
  color: rgba(251, 247, 240, 0.75);
}

.show-tab:focus-visible,
.show-play:focus-visible {
  outline: 3px solid #e9a24a;
  outline-offset: 3px;
}

/* How far the clip has played, along the tab's bottom edge. */
.show-meter {
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: rgba(42, 32, 22, 0.1);
}

.show-tab.is-on .show-meter {
  background: rgba(251, 247, 240, 0.16);
}

.show-meter i {
  display: block;
  height: 100%;
  width: calc(var(--played, 0) * 100%);
  background: linear-gradient(90deg, #e9a24a, #f0743a);
}

.show-stage {
  position: relative;
  overflow: hidden;
  background: #0d0b0a;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow:
    0 2px 0 rgba(42, 32, 22, 0.06),
    0 40px 80px -40px rgba(42, 32, 22, 0.55);
}

.show-panel {
  margin: 0;
  animation: show-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.show-panel[hidden] {
  display: none;
}

/* Both clips sit in the same 16:9 frame: the CLI ad fills it, the app run is a touch wider. */
.show-panel video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #0d0b0a;
}

@keyframes show-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
}

.show-play {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(251, 247, 240, 0.4);
  border-radius: 50%;
  background: rgba(42, 32, 22, 0.78);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.show-play:hover {
  background: var(--sanguine);
  transform: scale(1.06);
}

.show-play svg {
  width: 20px;
  height: 20px;
  fill: #fbf7f0;
  stroke: #fbf7f0;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sound: the CLI ad has a soundtrack; it starts muted (browsers insist) until asked. */
.show-sound {
  right: 68px;
}

.show.no-sound .show-sound,
.show-icon-sound,
.show.is-sound .show-icon-muted {
  display: none;
}

.show.is-sound .show-icon-sound {
  display: block;
}

.show-icon-play,
.show.is-paused .show-icon-pause {
  display: none;
}

.show.is-paused .show-icon-play {
  display: block;
}

/* ── The CLI in one line ── */

.cli-install {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
}

.cli-install-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cli-install-line {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #1a1410;
  box-shadow: 0 18px 36px -24px rgba(42, 32, 22, 0.6);
}

.cli-install-line code {
  overflow-x: auto;
  white-space: nowrap;
  font-family: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
  font-size: 15px;
  color: #fbf7f0;
  scrollbar-width: none;
}

.cli-install-prompt {
  color: #ff5fa2;
  user-select: none;
}

.cli-install-copy {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: #fbf7f0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.cli-install-copy:hover,
.cli-install-copy.is-done {
  background: var(--sanguine);
  color: #fbf7f0;
}

.cli-install-copy:focus-visible {
  outline: 2px solid var(--sanguine);
  outline-offset: 2px;
}

.cli-install-note {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink-soft);
}

.cli-install-note code {
  font-family: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
  font-size: 0.95em;
  color: var(--ink);
}

.cli-install-note a {
  color: var(--sanguine);
}

.show-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 12px 4px 0;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-soft);
}

.show-said {
  font-style: italic;
  color: var(--ink);
}

.show-speed {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sanguine);
}

@media (max-width: 560px) {
  .show {
    margin-top: 34px;
  }

  .show-tab {
    gap: 10px;
    padding: 12px 12px 15px;
  }

  .show-tab svg {
    width: 24px;
    height: 24px;
  }

  .show-tab strong {
    font-size: 15px;
  }

  .show-tab small {
    font-size: 12.5px;
  }

  .show-stage {
    border-radius: 12px;
  }

  .show-play {
    right: 8px;
    bottom: 8px;
    width: 38px;
    height: 38px;
  }

  .show-sound {
    right: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .show-panel {
    animation: none;
  }
}

/* ── At a glance ── */

.glance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: min(1180px, calc(100% - 40px));
  margin: 6vh auto 0;
}

.glance-item {
  display: grid;
  gap: 6px;
  padding: 24px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 4px 14px -10px rgba(42, 32, 22, 0.24);
}

.glance-item strong {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.4vw, 44px);
  font-weight: 800;
  line-height: 1;
  color: var(--sanguine);
  font-variant-numeric: tabular-nums;
}

.glance-item small {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* ── Features: a bento grid ── */

.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 40px;
}

.bento .feature {
  overflow: hidden;
}

.bento-wide {
  grid-column: span 2;
}

.bento-art {
  position: relative;
  height: 64px;
  margin-top: 8px;
}

.art-site {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}

.art-site i {
  border-radius: 8px;
  background: rgba(142, 58, 28, 0.12);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.2), background 0.4s ease;
}

.art-site i:first-child {
  grid-row: span 2;
  background: linear-gradient(120deg, #f8e3c3, #eebd80);
}

.feature:hover .art-site i {
  transform: translateY(-4px);
  background: rgba(142, 58, 28, 0.22);
}

.feature:hover .art-site i:first-child {
  background: linear-gradient(120deg, #f4d3a4, #e9a24a);
}

.art-site i:nth-child(2) { transition-delay: 0.04s; }
.art-site i:nth-child(3) { transition-delay: 0.08s; }
.art-site i:nth-child(4) { transition-delay: 0.12s; }

.art-pc {
  border-radius: 10px;
  background: rgba(42, 32, 22, 0.05);
}

.art-pc-btn {
  position: absolute;
  right: 18%;
  top: 50%;
  translate: 0 -50%;
  padding: 7px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fffcf6;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s ease 0.7s, scale 0.15s ease 0.7s;
}

.art-pc-cursor {
  position: absolute;
  left: 8%;
  top: 60%;
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 3.5 18.5 12 12 13.4 9 19.5Z' fill='%232a2016' stroke='%23fffdf8' stroke-width='1.6' stroke-linejoin='round'/></svg>")
    center / contain no-repeat;
  transition: left 0.7s cubic-bezier(0.3, 0.7, 0.2, 1), top 0.7s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.feature:hover .art-pc-cursor {
  left: calc(82% - 48px);
  top: 48%;
}

.feature:hover .art-pc-btn {
  background: var(--sanguine);
  scale: 0.94;
}

.art-meter {
  height: 14px;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(42, 32, 22, 0.1);
  overflow: hidden;
}

.art-meter span {
  display: block;
  height: 100%;
  width: 18%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e9a24a, var(--sanguine));
  transition: width 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s;
}

.feature.is-in .art-meter span,
.feature:hover .art-meter span {
  width: 82%;
}

/* ── Last word ── */

.closer {
  display: grid;
  justify-items: center;
  width: min(1180px, calc(100% - 40px));
  margin: 12vh auto 10vh;
  padding: clamp(48px, 8vw, 88px) 28px;
  border-radius: 28px;
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(233, 162, 74, 0.18), rgba(233, 162, 74, 0) 60%),
    #2a2016;
  text-align: center;
  overflow: hidden;
}

.closer .fx-glow {
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(233, 162, 74, 0.22), rgba(233, 162, 74, 0) 70%);
}

/* Lettered like every section title: solid capitals, the second line lit. */
.closer h2 {
  margin: 0 0 18px;
  font-family: "Orbitron", "Sora", "Segoe UI", sans-serif;
  font-size: clamp(32px, 5.6vw, 72px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.08;
  color: #fbf7f0;
}

.closer h2 span {
  color: #e9a24a;
}

.closer p {
  max-width: 40ch;
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  color: rgba(251, 247, 240, 0.82);
}

.closer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

.closer .cta {
  padding: 16px 30px;
  background: #e9a24a;
  border-color: #e9a24a;
  color: #2a2016;
}

.closer .cta:hover {
  background: #f2b765;
}

.closer-dl {
  display: inline-flex;
  align-items: center;
  padding: 16px 30px;
  border: 1px solid rgba(251, 247, 240, 0.55);
  border-radius: 999px;
  color: #fbf7f0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.closer-dl:hover {
  background: #fbf7f0;
  color: #2a2016;
}

/* ── Sizes ── */

@media (max-width: 960px) {
  .glance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bento-wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .bento {
    grid-template-columns: 1fr;
  }

  .bento-wide {
    grid-column: auto;
  }

  .glance-item {
    padding: 18px 16px;
  }

  .glance-item small {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .art-meter span {
    width: 82%;
    transition: none;
  }
}
