/* Acies, the site. The app's own look (app/acies/lib/look.dart): the page colour, forest ink, forest green
   for action, gold for rewards, Fredoka; its buttons are the app's TileButton and HexButton (a face on an ink
   lip, outlined in ink, that sinks onto the lip when pressed and settles back a touch past the top).
   Fredoka is SIL OFL 1.1 (assets/fonts/OFL.txt). */
@font-face { font-family: Fredoka; src: url(assets/fonts/Fredoka-400.ttf); font-weight: 400; font-display: block; }
@font-face { font-family: Fredoka; src: url(assets/fonts/Fredoka-600.ttf); font-weight: 600; font-display: block; }

:root {
  --page: #F2F0E6;
  --cream: #FBF9F1;
  --ink: #20372E;
  --text: #3A4A40;
  --meta: #5D6A61;
  --green: #356B4D;
  --green-hi: #3E7A59;
  --sage: #9DB7A0;
  --gold: #D5AD63;
  --stone: #D7D5C8;
  --hex: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  --down: 70ms;                                    /* the app's press: quick down, eased out */
  --up: 260ms;                                     /* and back up with a slight settle past the top */
  --settle: cubic-bezier(.34, 1.36, .64, 1);
  --out: cubic-bezier(.22, 1, .36, 1);
  --veil: 0px;
}
* { box-sizing: border-box; }
html { background: var(--page); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 400 17px/1.5 Fredoka, system-ui, sans-serif;
       -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--sage); color: var(--ink); }
/* the logo is part of the page, not a picture to save: no long-press menu, no drag; taps go to its button */
img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: clamp(38px, 7.4vw, 68px); line-height: 1.0; }
h2 { font-size: clamp(30px, 6vw, 54px); line-height: 1.04; }
h1, h2, h3 { text-wrap: balance; }                         /* no word left alone on a headline's last line */
.lede { margin: 18px 0 0; max-width: 36ch; font-size: clamp(17px, 2.4vw, 21px); line-height: 1.5; color: var(--text); text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 4px; }

/* ---- the app's wide button: a long flat-topped hexagon on an ink lip ---- */
.tile { --h: 54px; --lip: 5px; --line: 2.7px; --pt: calc(var(--h) * .2887); --drop: 0px; --mx: 0px; --my: 0px;
        --face: var(--green); --face-hi: var(--green-hi); --fg: var(--cream);
        position: relative; display: inline-flex; align-items: center; justify-content: center; isolation: isolate;
        height: calc(var(--h) + var(--lip)); padding: 0 calc(var(--pt) + 20px) var(--lip);
        color: var(--fg); font: 600 16px/1 Fredoka, system-ui, sans-serif; letter-spacing: 1.5px; text-transform: uppercase;
        text-decoration: none; cursor: pointer; user-select: none; touch-action: manipulation;
        transform: translate(var(--mx), var(--my)); transition: transform .45s var(--out); }
.tile::before, .tile__face { content: ""; position: absolute; left: 0; right: 0; height: var(--h);
        clip-path: polygon(0 50%, var(--pt) 0, calc(100% - var(--pt)) 0, 100% 50%, calc(100% - var(--pt)) 100%, var(--pt) 100%); }
.tile::before { top: var(--lip); background: var(--ink); z-index: -2; }                      /* the lip */
.tile__face { top: 0; background: var(--ink); z-index: -1; transform: translateY(var(--drop));  /* the outline */
              transition: transform var(--up) var(--settle); overflow: hidden; }
.tile__face::before { content: ""; position: absolute; inset: var(--line); background: var(--face); transition: background .2s;
        clip-path: polygon(0 50%, calc(var(--pt) - var(--line) * .6) 0, calc(100% - var(--pt) + var(--line) * .6) 0, 100% 50%,
                           calc(100% - var(--pt) + var(--line) * .6) 100%, calc(var(--pt) - var(--line) * .6) 100%); }
.tile__face::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);            /* a glint */
        background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.28) 48%, rgba(255,255,255,.08) 54%, transparent 66%); }
.tile__label { position: relative; transform: translateY(var(--drop)); transition: transform var(--up) var(--settle);
               display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
@media (hover: hover) {
  .tile:hover { --drop: -2px; }
  .tile:hover .tile__face::before { background: var(--face-hi); }
  .tile:hover .tile__face::after { transform: translateX(120%); transition: transform .75s var(--out); }
}
.tile.down { --drop: calc(var(--lip) - 1px); }
.tile.down .tile__face, .tile.down .tile__label { transition: transform var(--down) ease-out; }
.tile:focus-visible { outline: none; }
.tile:focus-visible .tile__face::before { box-shadow: inset 0 0 0 3px var(--gold); }
/* arriving at the end by the button: the store buttons lift once to say here */
.tile.hello .tile__face, .tile.hello .tile__label { animation: hello .7s var(--settle); }
@keyframes hello { 35% { transform: translateY(-7px); } }
.tile--small { --h: 42px; --lip: 4px; font-size: 13px; padding: 0 calc(var(--pt) + 14px) var(--lip); }
.tile--cream { --face: var(--cream); --face-hi: #FFFFFF; --fg: var(--ink); }
/* a store not open yet: the button answers, and says so */
/* to its outer side where there is room (a desktop), else below it (a phone): site.js */
.tile:has(.tag.on) { z-index: 2; }
.tile .tag { position: absolute; top: 50%; padding: 6px 12px; border-radius: 8px; white-space: nowrap;
             background: var(--ink); color: var(--cream); font-size: 12px; letter-spacing: 1px;
             opacity: 0; pointer-events: none; transition: opacity .2s, transform .35s var(--settle); }
.tile .tag.right { left: calc(100% + 12px); transform: translate(-6px, -50%) scale(.9); }
.tile .tag.left { right: calc(100% + 12px); transform: translate(6px, -50%) scale(.9); }
.tile .tag::after { content: ""; position: absolute; top: 50%; margin-top: -6px; border: 6px solid transparent; }
.tile .tag.right::after { right: 100%; border-right-color: var(--ink); }
.tile .tag.left::after { left: 100%; border-left-color: var(--ink); }
.tile .tag.on { opacity: 1; transform: translate(0, -50%) scale(1); }
.tile .tag.below { top: calc(100% + 12px); left: 50%; transform: translate(-50%, -6px) scale(.9); }
.tile .tag.below.on { transform: translate(-50%, 0) scale(1); }
.tile .tag.below::after { top: auto; bottom: 100%; left: 50%; margin: 0 0 0 -6px; border-bottom-color: var(--ink); }

/* ---- the bar ---- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: 72px; display: flex; align-items: center;
       justify-content: space-between; padding: 0 clamp(16px, 4vw, 48px); pointer-events: none;
       transition: background .3s, box-shadow .3s; }
.nav > * { pointer-events: auto; }
/* on a tall screen (no rail), a thin line along the top says how far through the story you are */
.nav::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--green);
               transform-origin: 0 50%; transform: scaleX(var(--prog, 0)); opacity: 0; transition: opacity .3s; }
.nav.reading::before { opacity: 1; }
/* past the story the bar takes the page's colour (solid: a backdrop blur here cost 100-200 ms frames) */
.nav.solid { background: var(--page); box-shadow: 0 1px 0 rgba(32,55,46,.08); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600;
         font-size: 17px; letter-spacing: 2px; text-transform: uppercase; }
.hexlogo { width: 40px; height: 35px; background: var(--ink); clip-path: var(--hex); display: grid; place-items: center; flex: none;
           transition: transform .45s var(--settle); }
.hexlogo img { width: 37px; height: 32px; object-fit: cover; clip-path: var(--hex); transition: transform .45s var(--settle); }
@media (hover: hover) {
  .brand:hover .hexlogo { transform: translateY(-2px); }
  .brand:hover .hexlogo img { transform: rotate(-8deg) scale(1.08); }
}
.brand:active .hexlogo { transform: scale(.92); transition-duration: var(--down); }

/* ---- the rail: where you are in the story, and a way to jump in it ---- */
.rail { position: fixed; right: clamp(14px, 2vw, 28px); top: 50%; transform: translateY(-50%); z-index: 15;
        display: none; flex-direction: column; gap: 6px; transition: opacity .4s, transform .4s var(--out); }
.rail.gone { opacity: 0; pointer-events: none; transform: translate(12px, -50%); }
.rail button { position: relative; width: 30px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
/* ink, so a marker reads on the page and on the land alike */
.rail button::before { content: ""; width: 12px; height: 10.4px; clip-path: var(--hex); background: rgba(32,55,46,.3);
                       transition: background .25s, transform .35s var(--settle); }
.rail button.on::before { background: var(--ink); transform: scale(1.3); }
.rail button span { position: absolute; right: 34px; top: 50%; padding: 5px 10px; border-radius: 7px; white-space: nowrap;
                    background: var(--ink); color: var(--cream); font: 600 12px/1 Fredoka, sans-serif; letter-spacing: 1px; text-transform: uppercase;
                    opacity: 0; transform: translate(6px, -50%); pointer-events: none; transition: opacity .2s, transform .3s var(--out); }
@media (hover: hover) {
  .rail button:hover::before { background: var(--ink); transform: scale(1.4); }
  .rail button:hover span { opacity: 1; transform: translate(0, -50%); }
}
.rail button:active::before { transform: scale(.9); transition-duration: var(--down); }

/* ---- the story: a long track, the stage pinned while it scrolls past. The words have their own zone (a
   column on wide screens, the top on tall ones); the land is fitted into what is left, by hero.js. ---- */
.story { position: relative; height: 1100vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; background: var(--page); }
#rise { position: absolute; inset: 0; opacity: 0; transform: translateY(40px); will-change: transform, opacity;
        transition: opacity 1s ease-out, transform 1.5s var(--out); }
#rise.up { opacity: 1; transform: none; }
#float { position: absolute; inset: 0; will-change: transform; }
#float.on { animation: float 8s ease-in-out infinite; }
#float.settle { transition: transform .5s ease-out; transform: translateY(0); }
@keyframes float { 0%,100% { transform: translateY(0) } 25% { transform: translateY(-6px) } 75% { transform: translateY(6px) } }
canvas { display: block; width: 100%; height: 100%; }
.stage.pointer canvas { cursor: pointer; }
.veil { position: absolute; inset: 0; pointer-events: none; opacity: 0;
        background: linear-gradient(180deg, var(--page) 0, var(--page) var(--veil), rgba(242,240,230,0) calc(var(--veil) + 140px)); }
.beat { position: absolute; left: 0; right: 0; top: 0; padding: 92px 20px 0; pointer-events: none; }
.copy { max-width: 560px; will-change: opacity, transform; }
.copy a { pointer-events: auto; }
.copy .tile { margin-top: 28px; }
.hero-stores { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-stores .tile { margin-top: 0; }
#b2, #b3, #b4, #b5 { opacity: 0; visibility: hidden; }
.big { display: block; margin-left: -.04em; font-size: clamp(100px, 26vw, 200px); line-height: .8; letter-spacing: -.04em;
       font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; transform-origin: 0 70%; }
.big + h2, .big + .swap { margin-top: 18px; }
.big.pop { animation: pop .5s var(--settle); }
@keyframes pop { 40% { transform: scale(1.06); color: var(--green); } }
.clock { font-size: clamp(84px, 22vw, 180px); }
/* two states of one beat, stacked, so the beat keeps the height of the taller */
.swap { display: grid; }
.swap > * { grid-area: 1 / 1; transition: opacity .35s, transform .5s var(--out); }
.swap > :nth-child(2) { opacity: 0; transform: translateY(14px); }
.swap.two > :first-child { opacity: 0; transform: translateY(-14px); }
.swap.two > :nth-child(2) { opacity: 1; transform: none; }

/* the headline comes up word by word, each from behind its own line */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.w > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--out); }
.in .w > span { transform: none; }
.fade { opacity: 0; transform: translateY(12px); transition: opacity .9s ease-out, transform 1.1s var(--out); }
.in .fade { opacity: 1; transform: none; }

/* ---- the sections after the story ---- */
.sect { position: relative; padding: clamp(80px, 12vw, 160px) 0; }
.sect.first { padding-top: clamp(96px, 14vw, 180px); }
.wrap { width: min(1160px, 100% - 40px); margin: 0 auto; }
/* the sections after the story sit on the page's centre line */
.wrap--centre { text-align: center; }
.wrap--centre .lede { margin-left: auto; margin-right: auto; }
.wrap--centre .facts { max-width: 980px; margin-left: auto; margin-right: auto; }
.wrap--centre .facts li { padding: 30px 8px 32px; }
.wrap--centre .facts p { margin-left: auto; margin-right: auto; }
.wrap--centre .facts__hex { position: relative; top: auto; display: block; margin: 0 auto 14px; }
.wrap--centre .faq { max-width: 820px; margin-left: auto; margin-right: auto; text-align: left; }
/* centred, a hovered fact lifts instead of stepping right, and its rule grows out from the middle */
.wrap--centre .facts li::after { left: 50%; transform: translateX(-50%); }
@media (hover: hover) { .wrap--centre .facts li:hover h3, .wrap--centre .facts li:hover p { transform: translateY(-2px); } }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease-out, transform 1s var(--out); }
.reveal.seen { opacity: 1; transform: none; }

.facts { list-style: none; margin: clamp(40px, 6vw, 72px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(24px, 4vw, 56px); }
.facts li { position: relative; padding: 28px 0 30px 40px; border-top: 2px solid rgba(53,107,77,.16); }
.facts li:nth-child(2) { transition-delay: .08s; } .facts li:nth-child(3) { transition-delay: .16s; } .facts li:nth-child(4) { transition-delay: .24s; }
.facts li::after { content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: 0; background: var(--green); transition: width .6s var(--out); }
.facts h3 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.15; transition: transform .45s var(--out); }
.facts p { margin: 10px 0 0; max-width: 40ch; color: var(--text); transition: transform .45s var(--out) .03s; }
.facts__hex { position: absolute; left: 0; top: 36px; width: 18px; height: 15.6px; clip-path: var(--hex); background: var(--stone);
              transition: background .3s, transform .5s var(--settle); }
@media (hover: hover) {
  .facts li:hover::after { width: 100%; }
  .facts li:hover .facts__hex { background: var(--green); transform: rotate(60deg) scale(1.15); }
  .facts li:hover h3, .facts li:hover p { transform: translateX(4px); }
}

.faq { margin-top: clamp(28px, 4vw, 48px); border-top: 2px solid rgba(53,107,77,.16); }
.q { border-bottom: 2px solid rgba(53,107,77,.16); }
.q button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 0;
            border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink);
            font: 600 clamp(19px, 2vw, 23px)/1.25 Fredoka, system-ui, sans-serif; }
.q button span { transition: transform .45s var(--out); }
.q i { position: relative; flex: none; width: 34px; height: 29.4px; clip-path: var(--hex); background: var(--cream);
       box-shadow: inset 0 0 0 2px var(--stone); transition: background .25s, transform .5s var(--settle); }
.q i::before, .q i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2.5px; margin: -1.25px 0 0 -6px;
                            background: var(--ink); border-radius: 2px; transition: transform .4s var(--settle), background .25s; }
.q i::after { transform: rotate(90deg); }
/* open: the hexagon goes green and the plus folds flat into a minus */
.q.open i { background: var(--green); box-shadow: none; }
.q.open i::before, .q.open i::after { background: var(--cream); }
.q.open i::after { transform: rotate(0deg); }
@media (hover: hover) {
  .q button:hover span { transform: translateX(4px); }
  .q button:hover i { background: var(--page); transform: scale(1.08); }
  .q.open button:hover i { background: var(--green-hi); transform: scale(1.08); }
}
.q button:active i { transform: scale(.9); transition-duration: var(--down); }
.a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--out); }
.a > div { overflow: hidden; }
.a p { margin: 0; padding: 0 56px 26px 0; color: var(--text); opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .45s var(--out); }
.q.open .a { grid-template-rows: 1fr; }
.q.open .a p { opacity: 1; transform: none; transition-delay: .08s; }

.link { color: var(--green); font-weight: 600; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
        transition: background-size .35s var(--out), color .2s; }
.link:hover { background-size: 100% 2px; color: var(--ink); }

/* ---- the end: the watcher, the call ---- */
.end { text-align: center; padding-bottom: clamp(96px, 12vw, 150px); }
.end__wrap { display: flex; flex-direction: column; align-items: center; }
.end .lede { margin-left: auto; margin-right: auto; }
.stores { margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* the app's HexButton: a flat-topped hexagon face on an ink lip, here with the watcher in it */
.badge { --r: 84px; --lip: 9px; --drop: 0px; --tx: 0deg; --ty: 0px;
         position: relative; width: calc(var(--r) * 2); height: calc(var(--r) * 1.732 + var(--lip)); margin-bottom: 36px;
         padding: 0; border: 0; background: none; cursor: pointer; isolation: isolate; touch-action: manipulation; }
.badge::before, .badge__face { content: ""; position: absolute; left: 0; right: 0; height: calc(var(--r) * 1.732); clip-path: var(--hex); }
.badge::before { top: var(--lip); background: var(--ink); z-index: -2; }
.badge__face { top: 0; background: var(--ink); display: grid; place-items: center; transform: translateY(var(--drop));
               transition: transform var(--up) var(--settle); }
.badge__face img { width: calc(100% - 7px); height: calc(100% - 6px); object-fit: cover; clip-path: var(--hex);
                   transform: translateY(var(--ty)) rotate(var(--tx)); transition: transform .5s var(--settle); }
@media (hover: hover) { .badge:hover { --drop: -3px; } }
.badge.down { --drop: calc(var(--lip) - 1px); }
.badge.down .badge__face { transition: transform var(--down) ease-out; }
.badge.hop .badge__face img { animation: hop .6s var(--settle); }
@keyframes hop { 35% { transform: translateY(-16px) rotate(var(--tx)) scale(1.04); } 60% { transform: translateY(2px) rotate(var(--tx)) scale(.98, 1.02); } }
.spark { position: absolute; width: 20px; height: 17.3px; clip-path: var(--hex); pointer-events: none; z-index: 2; }

.foot { padding: 40px 0 48px; border-top: 2px solid rgba(53,107,77,.12); }
.foot__wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.foot__links { display: flex; gap: 24px; }
.foot__credit { margin: 0 0 0 auto; color: var(--meta); font-size: 14px; }

#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--page); transition: opacity .6s ease-out, visibility .6s; }
#loader.gone { opacity: 0; visibility: hidden; }
#loader .hexlogo { width: 96px; height: 84px; animation: breathe 2.4s ease-in-out infinite; }
#loader .hexlogo img { width: 90px; height: 78px; }
@keyframes breathe { 50% { transform: scale(1.06) } }

/* ---- wide screens: the words in a column on the left, the land to the right ---- */
@media (min-aspect-ratio: 11/10) and (min-width: 900px) {
  .beat { right: auto; bottom: 0; padding: 0; left: clamp(32px, 6vw, 120px); width: min(620px, 35vw); display: flex; align-items: center; }
  .veil { background: linear-gradient(90deg, var(--page) 0, var(--page) var(--veil), rgba(242,240,230,0) calc(var(--veil) + 260px)); }
  h1 { font-size: clamp(40px, 4.8vw, 96px); }
  h2 { font-size: clamp(32px, 3.4vw, 68px); }
  .lede { font-size: clamp(17px, 1.3vw, 23px); }
  .big { font-size: clamp(110px, 11vw, 220px); }
  .clock { font-size: clamp(90px, 8.6vw, 180px); }
  .rail { display: flex; }
  .nav::before { display: none; }
}
@media (max-width: 899px), (max-aspect-ratio: 11/10) {
  /* tall screens: the words sit centred above the land, which is centred below them */
  .beat { text-align: center; }
  .copy { margin: 0 auto; }
  .copy .lede { margin-left: auto; margin-right: auto; }
  .hero-stores { justify-content: center; }
  .big { margin-left: 0; transform-origin: 50% 70%; }
  .brand__word { display: none; }
  .nav .brand__word { display: none; }
  .foot .brand__word { display: inline; }
}
@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; }
  .foot__credit { margin: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #float.on { animation: none; }
  .w > span, .fade, #rise, .reveal { transition: none; }
}
