/* Dimiana teaser. Colours and font from palmengine/brand.json (the brand's one file). */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/PlusJakartaSans-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* the shopper app's dark look (brand.json -> colors_app.dark, founder 11 Nov 2026) */
  --page: #0F1312;            /* app-bg: near-black green */
  --deep-teal: #004741;       /* app-on-cta: text on Lime */
  --lime: #E2F98F;            /* app-hero / app-cta: the ONE accent */
  --lime-hover: #EBFAAC;
  --mantis: #59C749;          /* app-progress: progress bars only */
  --mantis-hover: #89D862;
  --milky: #FFFDF1;           /* app-text */
  --milky-soft: #C3CAC6;      /* app-muted */
  --milky-quiet: #A9B2AE;     /* app-tab: small print */
  --track: #26302D;           /* app-track */
  --input-line: #6B7873;      /* 4:1 against the page (inputs keep a border) */
  --red-on-dark: #FFA39B;     /* app-error */

  /* type */
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* motion (strong curves; Emil Kowalski's tokens) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  /* space: 8px grid */
  --edge: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
  background:
    radial-gradient(ellipse 60% 55% at 78% 34%, rgba(89, 199, 73, 0.10), transparent 70%),
    radial-gradient(ellipse 80% 60% at 10% 100%, rgba(0, 71, 65, 0.35), transparent 70%),
    var(--page);
  color: var(--milky);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- the sensor field behind everything ---------- */
.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.top, .stage { position: relative; z-index: 1; }

/* ---------- top line ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(24px, env(safe-area-inset-top)) var(--edge) 0;
}
.logo { display: block; height: 28px; width: auto; }
.top-right { display: flex; align-items: center; gap: 8px; }
.pause {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--track);
  border-radius: 999px;
  background: rgba(15, 19, 18, 0.6);
  color: var(--milky-quiet);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.pause-icon { width: 10px; height: 10px; display: block; }
.place {
  margin: 0 8px 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--milky-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- the stage ---------- */
.stage {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "meter" "words" "notify";
  align-content: center;
  row-gap: 40px;
  padding: 40px var(--edge) max(40px, env(safe-area-inset-bottom));
}
.meter { grid-area: meter; min-width: 0; }
.words { grid-area: words; max-width: 34rem; }
.notify { grid-area: notify; max-width: 30rem; }

@media (min-width: 1024px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
    grid-template-areas: "meter meter" "words notify";
    column-gap: 64px;
    row-gap: 56px;
    align-items: end;
  }
  .notify { justify-self: end; width: 100%; }
}

/* the number */
.count {
  margin: 0 0 8px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;   /* the number rests above the missing 1% */
  padding-right: 1%;
  font-weight: 200;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  user-select: none;
  text-shadow: 0 0 48px rgba(226, 249, 143, 0.28), 0 0 2px rgba(226, 249, 143, 0.4);
}
.count-num { font-size: clamp(8rem, 31vw, 26rem); }
.count-pct {
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  margin: 0.18em 0 0 0.1em;
  letter-spacing: 0;
  font-weight: 300;
}

/* the bar: a real button, so the joke works by touch and keyboard */
.bar {
  display: block;
  width: 100%;
  margin: 0;
  padding: 18px 0;           /* 56px tall target around a 20px bar */
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
.bar-track {
  position: relative;
  display: block;
  height: 20px;
  border-radius: 999px;
  background: var(--track);
  box-shadow: inset 0 0 0 1px rgba(255, 253, 241, 0.06);
}
.bar-fill {
  position: relative;
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2F8F3A, var(--mantis) 70%, #89D862);
  box-shadow: 0 0 24px rgba(89, 199, 73, 0.45), 0 0 2px rgba(137, 216, 98, 0.9);
  transform-origin: 0 50%;
  transform: scaleX(0.99);
  overflow: hidden;
}
/* a light sweep runs along the bar */
.bar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 22%;
  background: linear-gradient(90deg, transparent, rgba(255, 253, 241, 0.55), transparent);
  transform: translateX(-110%);
  animation: sheen 3400ms linear infinite;
}
@keyframes sheen {
  0%   { transform: translateX(-110%); }
  60%  { transform: translateX(470%); }
  100% { transform: translateX(470%); }
}
/* the stuck tip, right where 100% should be */
.bar-tip {
  position: absolute;
  top: 50%;
  left: 99%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 14px 5px rgba(226, 249, 143, 0.55);
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
}
.bar.is-settled .bar-tip { opacity: 1; animation: tip 1800ms ease-in-out infinite; }
@keyframes tip {
  0%, 100% { transform: scale(0.8); opacity: 0.6; }
  50%      { transform: scale(1.15); opacity: 1; }
}
.bar.is-shaking .bar-track { animation: shake 360ms var(--ease-out); }
.bar.is-straining .bar-fill {
  animation: strain 1600ms var(--ease-in-out);
}
@keyframes shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-8px); }
  45%  { transform: translateX(6px); }
  70%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
/* every so often it tries for 100% and doesn't make it */
@keyframes strain {
  0%   { transform: scaleX(0.99); }
  70%  { transform: scaleX(0.996); }
  78%  { transform: scaleX(0.996); }
  100% { transform: scaleX(0.99); }
}

.meter-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.eta {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--milky-quiet);
  font-variant-numeric: tabular-nums;
}
.eta-value { color: var(--lime); font-weight: 700; }
.nudge {
  margin: 0;
  min-height: 1.5em;
  font-size: 1rem;
  font-weight: 600;
  color: var(--lime);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.nudge.is-fresh { opacity: 0; transform: translateY(4px); transition: none; }

/* the words */
.status {
  margin: 0 0 12px;
  font-size: clamp(2.25rem, 5.6vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.clue {
  margin: 0;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  color: var(--milky-soft);
  text-wrap: pretty;
  max-width: 30em;
}

/* ---------- notify form ---------- */
.form { margin: 0; }
.form-label {
  display: block;
  margin-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 700;
}
.form-row { display: flex; gap: 8px; }
.input {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 24px;
  border: 1.5px solid var(--input-line);
  border-radius: 999px;
  background: rgba(255, 253, 241, 0.04);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--milky);
  font: inherit;
  font-size: 1rem;
  transition: border-color 160ms ease;
}
.input::placeholder { color: var(--milky-quiet); opacity: 1; }
.input:hover { border-color: var(--milky-soft); }
.input[aria-invalid="true"] { border-color: var(--red-on-dark); }

.send {
  flex: 0 0 auto;
  height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--lime);
  color: var(--deep-teal);
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 200ms ease, transform 120ms var(--ease-out);
}
.send:active { transform: scale(0.97); }
.send[disabled] { cursor: progress; opacity: 0.85; }

.form-note {
  margin: 12px 0 0 24px;
  font-size: 0.875rem;
  color: var(--milky-quiet);
}
.form-privacy {
  margin: 4px 0 0 24px;
  font-size: 0.8125rem;
  color: var(--milky-quiet);
}
.form-privacy a {
  color: var(--milky-soft);
  text-decoration: underline;
  text-decoration-color: var(--input-line);
  text-underline-offset: 3px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
.form-privacy a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 2px; }
.form-note.is-error { color: var(--red-on-dark); }
.form-note.is-done { color: var(--lime); font-weight: 600; }

/* spam trap: off-screen for people, there for bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (hover: hover) and (pointer: fine) {
  .send:hover { background: var(--lime-hover); box-shadow: 0 0 32px rgba(226, 249, 143, 0.35); }
  .pause:hover { color: var(--milky); border-color: var(--input-line); }
  .form-privacy a:hover { color: var(--milky); text-decoration-color: var(--milky-soft); }
  .bar:hover .bar-fill { background: var(--mantis-hover); }
}

/* focus you can see */
:focus { outline: none; }
.bar:focus-visible .bar-track,
.input:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}
.pause:focus-visible,
.send:focus-visible {
  outline: 3px solid var(--milky);
  outline-offset: 3px;
}

/* small phones */
@media (max-width: 479px) {
  .logo { height: 22px; }
  .place { margin-right: 4px; font-size: 0.8125rem; }
  .pause { padding: 0 12px; }
  .count-num { font-size: 38vw; }
  .count-pct { font-size: 10vw; }
  .form-row { flex-direction: column; }
  .send { width: 100%; }
  .form-note, .form-privacy { margin-left: 0; }
  .stage { row-gap: 32px; }
}

/* short, wide screens (laptops): keep it all on one screen */
@media (min-width: 1024px) and (max-height: 820px) {
  .count-num { font-size: clamp(8rem, 24vw, 20rem); }
  .stage { row-gap: 40px; }
}

/* motion paused (the Pause button, or reduced motion) */
html.is-still .bar-fill::after { animation: none; transform: translateX(-110%); }
html.is-still .bar.is-settled .bar-tip { animation: none; opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .bar.is-shaking .bar-track,
  .bar.is-straining .bar-fill { animation: none; }
  .nudge, .send, .input { transition: opacity 200ms ease, background-color 160ms ease, border-color 160ms ease; }
  .nudge.is-fresh { transform: none; }
  .send:active { transform: none; }
}
