/* The deep green heroes with a working drawing in them: For businesses (the rule stack) and How it works (the year).
   Their own ground so they read as the page's object, not one more section: deep green, bled to both edges, a faint
   drafting grid, and a panel that shows the product's idea moving. Only transform, opacity and stroke-dashoffset
   animate. Without scripts, or with reduced motion, both show a complete still state. */

.stack-hero, .year-hero {
  --g0: #0b4630; --g1: #0d5438; --g2: rgba(242, 239, 230, 0.06); --gl: rgba(242, 239, 230, 0.14); --gl2: rgba(242, 239, 230, 0.32);
  --mint: #9fe0c0; --on: #f2efe6; --on-2: rgba(242, 239, 230, 0.8); --on-3: rgba(242, 239, 230, 0.62);
  position: relative; color: var(--on); background: var(--g1);
  box-shadow: 0 0 0 100vmax var(--g1); clip-path: inset(0 -100vmax);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px 72px; align-items: center;
  padding: 88px 0 96px; margin-bottom: 96px;
}
/* The drafting grid, fixed to the band, fading out toward the copy. */
.stack-hero::before, .year-hero::before {
  content: ""; position: absolute; inset: 0 -100vmax; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--g2) 1px, transparent 1px), linear-gradient(90deg, var(--g2) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 60% 90% at 72% 50%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 90% at 72% 50%, #000 30%, transparent 75%);
}
.stack-hero > *, .year-hero > * { position: relative; z-index: 1; }
.stack-hero .label, .year-hero .label { color: var(--on-3); }
.stack-hero h1, .year-hero h1 { font-size: clamp(40px, 5vw, 68px); letter-spacing: -0.04em; line-height: 1.02; max-width: 13ch; }
.stack-hero h1 .s, .year-hero h1 .s { color: var(--mint); }
.stack-hero .sahi, .year-hero .sahi { color: inherit; }
.sh-lead { margin-top: 24px; font-size: 18px; line-height: 1.6; color: var(--on-2); max-width: 44ch; }
.sh-actions { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.stack-hero .btn.primary, .year-hero .btn.primary { background: var(--on); border-color: var(--on); color: var(--g1); }
.stack-hero .btn.primary:hover, .year-hero .btn.primary:hover { background: #fff; border-color: #fff; }
.btn.ghost { color: var(--on); border-color: var(--gl2); }
.btn.ghost:hover { background: rgba(242, 239, 230, 0.08); border-color: var(--on); }

/* ---- The rule stack ---- */
.stack { margin: 0; padding: 22px 22px 18px; border-radius: 22px; background: rgba(6, 40, 27, 0.42); border: 1px solid var(--gl);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(242, 239, 230, 0.06); }
.stack-tabs { position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(242, 239, 230, 0.06); border: 1px solid var(--gl); overflow-x: auto; scrollbar-width: none; }
.stack-tabs::-webkit-scrollbar { display: none; }
.stack-tabs button { position: relative; z-index: 1; flex: 0 0 auto; border: 0; background: none; color: var(--on-3); font-size: 13.5px; font-weight: 500; padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: color 240ms var(--ease); }
.stack-tabs button:hover { color: var(--on); }
.stack-tabs button[aria-selected="true"] { color: var(--g1); }
/* The pill slides under the chosen tab; the thin line under it fills while the stack waits to move on. */
.stack-pill { position: absolute; z-index: 0; top: 4px; left: 0; height: calc(100% - 8px); width: var(--pw, 100px); transform: translateX(var(--px, 4px)); border-radius: 999px; background: var(--on); transition: transform 520ms var(--ease), width 520ms var(--ease); overflow: hidden; }
.stack-pill::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--g1); opacity: 0.35; transform-origin: left; transform: scaleX(0); }
.stack.cycling .stack-pill::after { animation: stack-wait var(--cycle, 4200ms) linear forwards; }
@keyframes stack-wait { to { transform: scaleX(1); } }

.stack-body { margin-top: 18px; }
.stack-slabs { --row: 50px; position: relative; list-style: none; height: calc(7 * var(--row)); }
.stack-slabs li {
  position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--row) - 8px);
  display: grid; grid-template-columns: 4px minmax(0, 1fr) auto 22px; align-items: center; gap: 0 14px; padding: 0 14px 0 0;
  border-radius: 12px; background: rgba(242, 239, 230, 0.07); border: 1px solid var(--gl);
  transform: translateY(calc(var(--slot, 0) * var(--row) * -1)); opacity: 1;
  transition: transform 620ms var(--ease), opacity 380ms var(--ease);
}
.stack-slabs li::before { content: ""; align-self: stretch; border-radius: 12px 0 0 12px; background: var(--gl2); }
.stack-slabs li[data-tier="reg"] { background: rgba(159, 224, 192, 0.12); border-color: rgba(159, 224, 192, 0.32); }
.stack-slabs li[data-tier="reg"]::before { background: var(--mint); }
.stack-slabs li[data-tier="contract"]::before { background: repeating-linear-gradient(180deg, var(--gl2) 0 4px, transparent 4px 8px); }
.sl-name { font-size: 15px; font-weight: 500; color: var(--on); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-tag { font-size: 12px; font-weight: 500; color: var(--on-3); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--gl); white-space: nowrap; }
li[data-tier="reg"] .sl-tag { color: var(--mint); border-color: rgba(159, 224, 192, 0.4); }
.sl-tick { width: 22px; height: 22px; fill: none; stroke: var(--mint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sl-tick path { stroke-dasharray: 1; stroke-dashoffset: 0; }
/* A slab not in the chosen kind lifts away; one arriving drops in from above its place. */
.stack-slabs li.off { opacity: 0; transform: translateY(calc(var(--slot, 0) * var(--row) * -1 - 18px)); pointer-events: none; }
.stack.moving .stack-slabs li.new { transition-delay: calc(var(--k, 0) * 70ms); }
.stack.moving .stack-slabs li.new .sl-tick path { animation: tick-draw 520ms var(--ease) both; animation-delay: calc(240ms + var(--k, 0) * 70ms); }
@keyframes tick-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.stack-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--gl); display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; }
.stack-count { font-size: 15px; color: var(--on-2); }
.stack-count b { font-family: var(--serif); font-weight: 400; font-size: 34px; color: var(--on); letter-spacing: -0.02em; margin-right: 4px; font-variant-numeric: tabular-nums; display: inline-block; min-width: 0.6em; }
.stack-note { font-size: 12.5px; color: var(--on-3); max-width: 38ch; }

/* ---- The year (How it works) ---- */
.year { position: relative; margin: 0; aspect-ratio: 1 / 1; max-width: 520px; justify-self: center; width: 100%; }
.year svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.yr-track { fill: none; stroke: var(--gl); stroke-width: 1.5; }
.yr-ticks line { stroke: var(--gl2); stroke-width: 1; }
.yr-ticks text { fill: var(--on-3); font: 500 11px var(--sans); letter-spacing: 0.08em; text-anchor: middle; dominant-baseline: middle; }
.yr-run { fill: none; stroke: var(--mint); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: var(--run, 0); }
.yr-node circle.ring { fill: var(--g1); stroke: var(--gl2); stroke-width: 1.5; transition: stroke 400ms var(--ease), fill 400ms var(--ease); }
.yr-node circle.halo { fill: var(--mint); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.6); transition: opacity 400ms var(--ease), transform 600ms var(--ease); }
.yr-node text { fill: var(--on-3); font: 500 12px var(--sans); text-anchor: middle; dominant-baseline: central; transition: fill 400ms var(--ease); }
.yr-node.lit circle.ring { stroke: var(--mint); fill: #0f5c3e; }
.yr-node.lit text { fill: var(--on); }
.yr-node.now circle.halo { opacity: 0.18; transform: scale(1); }
.yr-centre { position: absolute; left: 50%; top: 50%; width: 52%; transform: translate(-50%, -50%); text-align: center; }
.yr-step { display: block; font-size: 12.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mint); }
.yr-title { display: block; margin-top: 10px; font-family: var(--serif); font-size: clamp(22px, 2.3vw, 30px); line-height: 1.15; color: var(--on); letter-spacing: -0.01em; }
.yr-line { display: block; margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--on-2); }
.yr-centre > * { transition: opacity 320ms var(--ease), transform 420ms var(--ease); }
.year.swap .yr-centre > * { opacity: 0; transform: translateY(6px); }

@media (prefers-reduced-motion: reduce) {
  .stack-slabs li, .stack-pill, .yr-node *, .yr-centre > * { transition: none !important; }
  .stack-pill::after, .sl-tick path { animation: none !important; }
}
@media (max-width: 960px) {
  .stack-hero, .year-hero { grid-template-columns: minmax(0, 1fr); padding: 56px 0 64px; margin-bottom: 64px; gap: 40px; }
  .stack-hero::before, .year-hero::before { -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 75%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 90% 70% at 50% 75%, #000 30%, transparent 75%); }
  .year { max-width: 440px; }
}
@media (max-width: 520px) {
  .stack { padding: 16px 14px 14px; }
  .stack-slabs { --row: 46px; }
  .sl-name { font-size: 14px; }
  .sl-tag { display: none; }
  .stack-slabs li { grid-template-columns: 4px minmax(0, 1fr) 22px; }
  .yr-line { display: none; }
}

/* ---- Every business: three cards under the hero ---- */
.base-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; }
.base-cards li { padding: 28px 26px 26px; border-radius: var(--r-panel); background: var(--paper); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.base-cards .k { font-size: 13px; font-weight: 500; color: var(--green-ink); }
.base-cards h3 { font-size: 21px; letter-spacing: -0.02em; }
.base-cards p { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
@media (max-width: 860px) { .base-cards { grid-template-columns: minmax(0, 1fr); } }

/* Without scripts the stack is a plain list of what binds any business, and the year shows its first part. */
html:not(.js) .stack-slabs { height: auto; display: flex; flex-direction: column-reverse; gap: 8px; }
html:not(.js) .stack-slabs li { position: relative; transform: none; }
html:not(.js) .stack-slabs li:not([data-in~="any"]) { display: none; }
html:not(.js) .stack-pill { width: 104px; transform: translateX(4px); }
.yr-run { transition: stroke-dashoffset 900ms var(--ease); }
.yr-node { cursor: pointer; outline: none; }
.yr-node:focus-visible circle.ring { stroke: var(--on); stroke-width: 2.5; }
html:not(.js) .yr-run { --run: 0; }
html:not(.js) .yr-node circle.ring { stroke: var(--mint); }
.stack-tabs.more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.stack-tabs.more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
.stack-tabs.more-l.more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
