/* Olives pre-launch page. One screen, one decision at a time.
   Tokens follow docs/design/html-v3/css/tokens.css (Paper and olive). */

@font-face {
  font-family: "Alegreya";
  src: url("fonts/Alegreya.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/SchibstedGrotesk.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #F3EDE2;
  --surface: #FBF8F1;
  --ink: #24221B;
  --muted: #6F6A5C;
  --olive: #3F4A1F;
  --olive-press: #333C18;
  --on-olive: #F6F1E6;
  --line: rgba(36, 34, 27, 0.14);
  --danger: #A8402B;
  --display: "Alegreya", Georgia, serif;
  --ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 500 17px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* soft paper light, no images */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 78% 40%, rgba(255, 252, 244, 0.9), transparent 60%),
    radial-gradient(900px 600px at 10% 100%, rgba(226, 216, 196, 0.45), transparent 60%);
  z-index: -1;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--olive); color: var(--on-olive); padding: 10px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) var(--gutter) 0;
  height: 76px;
}
.wordmark { font: 500 28px/1 var(--display); letter-spacing: -0.01em; text-decoration: none; }
.wordmark .stop { color: var(--ink); }
.lang { display: flex; align-items: center; gap: 6px; font: 600 14px/1 var(--ui); color: var(--muted); }
.lang a { text-decoration: none; padding: 12px 6px; min-width: 44px; text-align: center; }
.lang a[aria-current="page"] { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 56px);
  padding: 0 0 0 var(--gutter);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}
.hero__copy { max-width: 600px; padding: clamp(12px, 3vh, 40px) 0; }

.kicker {
  margin: 0 0 20px;
  font: 600 13px/1.4 var(--ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive);
}
.title {
  margin: 0;
  font: 500 clamp(44px, 5.6vw, 84px)/1.0 var(--display);
  letter-spacing: -0.022em;
  text-wrap: balance;
  max-width: 13em;
}
.lede {
  margin: 22px 0 0;
  max-width: 34ch;
  font: 500 clamp(17px, 1.45vw, 20px)/1.5 var(--ui);
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- the one decision ---------- */
.join { margin-top: clamp(28px, 4.5vh, 44px); max-width: 520px; }
.step:focus { outline: none; }
.join__h { margin: 0; font: 600 19px/1.3 var(--ui); color: var(--ink); text-wrap: balance; }
.join__p { margin: 4px 0 0; font: 500 17px/1.45 var(--ui); color: var(--ink); }
.join__anchor { margin: 2px 0 0; font: 500 15px/1.45 var(--ui); color: var(--muted); }
.join__form { display: flex; gap: 10px; margin-top: 16px; }
.join__field {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink);
  font: 500 17px/1 var(--ui);
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.join__field::placeholder { color: #8A8474; }
.join__field:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(63, 74, 31, 0.16); }
.join__field[aria-invalid="true"] { border-color: var(--danger); }
.join__small { margin: 12px 0 0; font: 500 14px/1.45 var(--ui); color: var(--muted); max-width: 46ch; }
.join__error { margin: 10px 0 0; font: 500 15px/1.4 var(--ui); color: var(--danger); }

.btn {
  flex: 0 0 auto;
  height: 56px;
  padding: 0 26px;
  border: 0;
  border-radius: 28px;
  font: 600 17px/1 var(--ui);
  cursor: pointer;
  transition: transform .18s var(--ease-out), background-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn--primary {
  background: var(--olive);
  color: var(--on-olive);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 10px 24px -12px rgba(47, 55, 20, 0.55);
}
.btn--primary:hover { background: var(--olive-press); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn.is-loading .btn__label { opacity: 0; }
.btn.is-loading { position: relative; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(246, 241, 230, 0.35);
  border-top-color: var(--on-olive);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.step--upsell .btn { margin-top: 16px; }

.done { margin: 0 0 18px; font: 500 16px/1.45 var(--ui); color: var(--ink); display: flex; gap: 10px; align-items: flex-start; }
.done b { font-weight: 600; overflow-wrap: anywhere; }
.done__tick {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 0;
  border-radius: 50%;
  background: var(--olive);
  position: relative;
}
.done__tick::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid var(--on-olive);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- founding code + countdown ---------- */
.code { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; }
.code__value {
  font: 600 26px/1 var(--ui);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--olive);
  padding: 12px 18px;
  border: 1.5px dashed rgba(63, 74, 31, 0.45);
  border-radius: 14px;
  background: rgba(251, 248, 241, 0.7);
  user-select: all;
}
.code__copy {
  border: 0; background: none; padding: 12px 4px; min-height: 44px;
  font: 600 15px/1 var(--ui); color: var(--olive); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.timer {
  display: inline-block;
  min-width: 3.2ch;
  font-variant-numeric: tabular-nums;
  color: var(--olive);
}
.timer.is-low { color: var(--danger); }
.timer.tick { animation: tick .35s var(--ease-out); }
@keyframes tick { from { transform: scale(1.12); } to { transform: none; } }

/* ---------- laurels: true facts only (no ratings or counts until they are real) ---------- */
.laurels {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  gap: clamp(8px, 1.4vw, 18px);
  flex-wrap: nowrap;
}
.laurel { display: flex; align-items: center; gap: 2px; color: var(--olive); }
.laurel__leaf { width: 19px; height: 46px; flex: 0 0 auto; }
.laurel__leaf--r { transform: scaleX(-1); }
.laurel__body { display: flex; flex-direction: column; align-items: center; text-align: center; width: 14ch; }
.laurel__big { font: 700 22px/1 var(--display); color: var(--ink); }
.laurel__small { margin-top: 3px; font: 500 11px/1.25 var(--ui); color: var(--muted); text-wrap: balance; }
.laurel__src { margin-top: 4px; font: 500 10px/1.2 var(--ui); color: var(--muted); opacity: .8; text-decoration: none; }
a.laurel__src { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(111,106,92,.4); }
a.laurel__src:hover { color: var(--ink); }
.source { margin: 10px 0 0; max-width: 64ch; font: 500 12px/1.45 var(--ui); color: var(--muted); }
.source a { color: inherit; text-underline-offset: 2px; }
.js .laurel { opacity: 0; transform: translateY(8px); }
.js.ready .laurel { opacity: 1; transform: none; transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.js.ready .laurel:nth-child(1) { transition-delay: .55s; }
.js.ready .laurel:nth-child(2) { transition-delay: .65s; }
.js.ready .laurel:nth-child(3) { transition-delay: .75s; }

/* ---------- art ---------- */
/* The branch enters from the right edge, so the art column bleeds off the page. */
.hero__art {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding-right: var(--gutter);
}
.art {
  position: relative;
  width: min(100%, 860px);
  margin-right: 0;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform .9s var(--ease-out);
}
.art__img {
  display: block;
  width: 100%;
  height: auto;
  /* the render's branch leaves its frame on the right: dissolve it into the paper instead of a hard cut */
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 74%, transparent 98%);
          mask-image: linear-gradient(to right, #000 0%, #000 74%, transparent 98%);
  animation: sway 7s ease-in-out infinite;
  transform-origin: 100% 62%; /* pivots where the branch leaves the frame */
}
@keyframes sway {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(-0.9deg) translateY(-3px); }
}

/* ---------- entrance (only when JS runs, so no-JS shows everything) ---------- */
.js .rise { opacity: 0; transform: translateY(16px); }
.js.ready .rise {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: calc(var(--i) * 90ms + 80ms);
}
.js .hero__art .art { opacity: 0; transform: translate3d(0, 24px, 0) scale(0.97); }
.js.ready .hero__art .art {
  opacity: 1;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: opacity .9s var(--ease-out) .15s, transform 1.1s var(--ease-spring) .15s;
}
.js.ready.settled .hero__art .art { transition: transform .9s var(--ease-out); }

/* step swap */
.step.is-leaving { opacity: 0; transform: translateY(-8px); transition: opacity .22s var(--ease-out), transform .22s var(--ease-out); }
.step.is-entering { animation: stepIn .5s var(--ease-out) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.step.is-entering .done__tick { animation: pop .5s var(--ease-spring) .1s both; }
@keyframes pop { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.join__field.shake { animation: shake .32s var(--ease-out); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px var(--gutter) max(18px, env(safe-area-inset-bottom));
  font: 500 13px/1.4 var(--ui);
  color: var(--muted);
}
.foot__links { display: flex; gap: 18px; }
.foot__links a { text-decoration: none; padding: 6px 0; }
.foot__links a:hover { color: var(--ink); }

/* ---------- desktop: one wide picture, text on its empty paper ---------- */
.hero__bg { display: none; }
@media (min-width: 861px) {
  body { background: #F2EBDB; }          /* the render's own paper, so there is no seam */
  body::before { display: none; }
  .top, .foot { position: relative; z-index: 2; }
  .hero { position: relative; grid-template-columns: minmax(0, 1fr); max-width: none; margin: 0; }
  .hero__copy { position: relative; z-index: 2; max-width: min(600px, 44vw); }
  .hero__art { display: none; }
  .laurels {
    position: absolute;
    z-index: 2;
    left: 50%;
    right: 2vw;
    bottom: clamp(36px, 9vh, 96px);
    margin: 0;
    justify-content: center;
    gap: clamp(14px, 2vw, 30px);
  }
  .hero__bg {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 78% 50%;
    z-index: 0;
    pointer-events: none;
    animation: drift 14s ease-in-out infinite alternate;
  }
  .js .hero__bg { opacity: 0; }
  .js.ready .hero__bg { opacity: 1; transition: opacity 1.1s var(--ease-out); }
  @keyframes drift { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.045) translate3d(-0.6%, -0.4%, 0); } }
}
@media (min-width: 861px) and (prefers-reduced-motion: reduce) {
  .hero__bg { animation: none; opacity: 1 !important; }
}

/* ---------- phone: a poster, not a column of text ---------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 0 var(--gutter);
    gap: 0;
    align-content: start;
    text-align: center;
  }
  .hero__art { order: -1; min-height: 0; padding-right: 0; margin: 0 calc(-1 * var(--gutter)) 0; overflow: hidden; }
  .art { width: min(112%, 520px); margin-left: -6%; }
  .hero__copy { padding: 0 0 12px; margin: -2px auto 0; max-width: 420px; }
  .kicker { display: none; }
  .title { font-size: clamp(40px, 11.6vw, 56px); line-height: 1.0; margin: 0 auto; max-width: 9.5em; }
  .lede { margin: 16px auto 0; font-size: 17px; max-width: 30ch; }
  .join { margin: 28px auto 0; }
  .join__h { font-size: 17px; }
  .join__form { flex-direction: column; margin-top: 14px; }
  .btn { width: 100%; }
  .join__small { margin-left: auto; margin-right: auto; font-size: 13px; text-wrap: balance; }
  .done { justify-content: center; text-align: left; }
  .code { justify-content: center; }
  .code__value { font-size: 22px; }
  .laurels { justify-content: center; margin-top: 26px; flex-wrap: wrap; row-gap: 12px; }
  .join { min-width: 0; max-width: 100%; }
  .laurel__body { width: 9.5ch; }
  .laurel__leaf { width: 15px; height: 38px; }
  .laurel__big { font-size: 19px; }
  .source { margin-left: auto; margin-right: auto; text-align: center; }
  .foot { justify-content: center; text-align: center; padding-top: 28px; }
}
@media (max-width: 860px) and (max-height: 760px) {
  .art { width: min(92%, 380px); margin-left: 4%; }
  .title { font-size: clamp(36px, 10.4vw, 48px); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .art__img { animation: none; }
  .js .rise, .js .hero__art .art { opacity: 1 !important; transform: none !important; transition: none !important; }
  .step.is-entering, .step.is-entering .done__tick, .join__field.shake, .timer.tick { animation: none; }
  .js .laurel { opacity: 1 !important; transform: none !important; }
  .art { transition: none; transform: none !important; }
}
