/* Mesai - marketing site.
   Plain CSS, no build step. Dark first on purpose: the market trades from 4pm
   to 8am under sodium light, and that is the room this page is describing. The
   light palette below is complete, not an afterthought - a visitor who forces
   light gets a designed page, not an inversion. */

:root {
  /* dark - the default */
  --ground:      #0E1113;
  --ground-2:    #131719;
  --surface:     #171B1F;
  --surface-2:   #1D2226;
  --ink:         #F0F2F3;
  --ink-soft:    #B9C0C6;
  --ink-mute:    #838C94;
  --line:        #242A2F;
  --line-firm:   #333B42;
  --sodium:      #F0A742;
  --sodium-dim:  #8A5F1E;
  --sodium-wash: rgba(240, 167, 66, 0.10);
  --good:        #58C08A;
  --good-wash:   rgba(88, 192, 138, 0.12);
  --bad:         #E88A79;
  --bad-wash:    rgba(232, 138, 121, 0.12);
  --shadow:      0 30px 60px -30px rgba(0, 0, 0, 0.85);

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --measure: 60ch;
  --pad: clamp(20px, 5vw, 60px);
  --r: 14px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground:      #FBFBFA;
    --ground-2:    #FFFFFF;
    --surface:     #FFFFFF;
    --surface-2:   #F2F3F4;
    --ink:         #14181B;
    --ink-soft:    #444C53;
    --ink-mute:    #6E777E;
    --line:        #E3E6E8;
    --line-firm:   #C9CFD4;
    --sodium:      #9A5D06;
    --sodium-dim:  #E7C68C;
    --sodium-wash: rgba(154, 93, 6, 0.07);
    --good:        #2F6B4A;
    --good-wash:   rgba(47, 107, 74, 0.09);
    --bad:         #9B3628;
    --bad-wash:    rgba(155, 54, 40, 0.08);
    --shadow:      0 26px 50px -28px rgba(20, 24, 27, 0.28);
  }
}

:root[data-theme="light"] {
  --ground:      #FBFBFA;
  --ground-2:    #FFFFFF;
  --surface:     #FFFFFF;
  --surface-2:   #F2F3F4;
  --ink:         #14181B;
  --ink-soft:    #444C53;
  --ink-mute:    #6E777E;
  --line:        #E3E6E8;
  --line-firm:   #C9CFD4;
  --sodium:      #9A5D06;
  --sodium-dim:  #E7C68C;
  --sodium-wash: rgba(154, 93, 6, 0.07);
  --good:        #2F6B4A;
  --good-wash:   rgba(47, 107, 74, 0.09);
  --bad:         #9B3628;
  --bad-wash:    rgba(155, 54, 40, 0.08);
  --shadow:      0 26px 50px -28px rgba(20, 24, 27, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, b, .btn { font-family: var(--f-display); }
h1, h2 { letter-spacing: -0.03em; text-wrap: balance; margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }

a:focus-visible, button:focus-visible, li:focus-visible {
  outline: 2px solid var(--sodium);
  outline-offset: 3px;
  border-radius: 4px;
}

/* The one sodium lamp on the page. Fixed, so it does not travel with scroll. */
.glow {
  position: fixed;
  top: -280px; left: 50%;
  width: min(1100px, 130vw);
  height: 620px;
  margin-left: min(-550px, -65vw);
  background: radial-gradient(50% 50% at 50% 50%, var(--sodium-wash) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main, .topbar, footer { position: relative; z-index: 1; }

.inner { max-width: 1120px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.inner.narrow { max-width: 740px; }
.inner > p { max-width: var(--measure); }

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 13px var(--pad);
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}

.brand-mark {
  width: 14px; height: 14px;
  border-radius: 4px;
  background: var(--sodium);
  box-shadow: 0 0 14px var(--sodium);
}

.topbar nav { display: flex; gap: clamp(12px, 2.4vw, 26px); }
.topbar nav a {
  font-family: var(--f-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color 0.16s ease;
}
.topbar nav a:hover { color: var(--ink); }

.lang { display: flex; border: 1px solid var(--line-firm); border-radius: 7px; overflow: hidden; }
.lang button {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  background: transparent;
  color: var(--ink-mute);
  border: 0;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.lang button:hover { color: var(--ink); }
.lang button.on { background: var(--sodium); color: #14181B; font-weight: 500; }

@media (max-width: 720px) { .topbar nav { display: none; } }

/* ------------------------------------------------------------------ hero */

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(44px, 8vw, 100px) var(--pad) clamp(48px, 8vw, 96px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: center;
}

.eyebrow, .kicker {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sodium);
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(2.5rem, 6.6vw, 4.4rem);
  line-height: 0.98;
  font-weight: 800;
}

.lede {
  font-size: clamp(1.06rem, 2vw, 1.2rem);
  color: var(--ink-soft);
  margin-top: 22px;
  max-width: 44ch;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 30px; }

.btn {
  display: inline-block;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 9px;
  background: var(--sodium);
  color: #14181B;
  border: 1px solid var(--sodium);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -12px var(--sodium); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-firm); }
.btn.ghost:hover { border-color: var(--sodium); box-shadow: none; }
.btn.small { padding: 9px 16px; font-size: 0.86rem; }

.ticks { list-style: none; margin: 34px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ticks li {
  position: relative;
  padding-left: 26px;
  font-size: 0.93rem;
  color: var(--ink-mute);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.42em;
  width: 13px; height: 7px;
  border-left: 2px solid var(--good);
  border-bottom: 2px solid var(--good);
  transform: rotate(-45deg);
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
}

/* ---------------------------------------------------- the physical scene --
   A phone meeting a tag. Both are drawn rather than photographed so they stay
   sharp, theme correctly, and weigh nothing. */

.hero-art { display: flex; justify-content: center; }

.scene {
  position: relative;
  width: 100%;
}

.scene-hero { max-width: 330px; aspect-ratio: 1 / 1.28; }
.scene-flow  { aspect-ratio: 1 / 0.95; }

/* the tag, stuck to a surface */
.surface {
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: 132px; height: 88px;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-firm);
  display: grid;
  place-items: center;
}

.tag-sticker {
  width: 54px; height: 54px;
  border-radius: 12px;
  background: var(--ground-2);
  border: 1px solid var(--line-firm);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
}

.nfc { position: relative; width: 26px; height: 26px; display: grid; place-items: center; }
.nfc i {
  position: absolute;
  border: 1.7px solid var(--ink-mute);
  border-radius: 50%;
  border-right-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(45deg);
  opacity: 0.45;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}
.nfc i:nth-child(1) { width: 8px;  height: 8px; }
.nfc i:nth-child(2) { width: 16px; height: 16px; }
.nfc i:nth-child(3) { width: 24px; height: 24px; }

.scene.live .nfc i { border-color: var(--sodium); border-right-color: transparent; border-bottom-color: transparent; opacity: 1; }
.scene.live .nfc i:nth-child(1) { animation: nfcpulse 1.1s ease-out infinite; }
.scene.live .nfc i:nth-child(2) { animation: nfcpulse 1.1s ease-out 0.14s infinite; }
.scene.live .nfc i:nth-child(3) { animation: nfcpulse 1.1s ease-out 0.28s infinite; }

@keyframes nfcpulse { 0% { opacity: 0.25; } 40% { opacity: 1; } 100% { opacity: 0.25; } }

/* the field, spreading out of the tag */
.ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 14px;
  border: 1.5px solid var(--sodium);
  opacity: 0;
  z-index: 1;
}
.scene.live .ring  { animation: field 1.5s ease-out infinite; }
.scene.live .ring.r2 { animation: field 1.5s ease-out 0.5s infinite; }

@keyframes field {
  0%   { transform: scale(1);   opacity: 0; }
  22%  { opacity: 0.7; }
  100% { transform: scale(2.9); opacity: 0; }
}

/* the one-time code the chip produces */
.code-chip {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, 4px);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--sodium);
  color: #14181B;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(.4,0,.2,1);
  z-index: 4;
}
.code-chip.show { opacity: 1; transform: translate(-50%, 14px); }

/* the phone */
.device {
  position: absolute;
  left: 50%; bottom: 0;
  width: 152px;
  aspect-ratio: 1 / 2.04;
  border-radius: 26px;
  background: linear-gradient(168deg, var(--surface-2), var(--ground-2));
  border: 1px solid var(--line-firm);
  box-shadow: var(--shadow);
  padding: 7px;
  transform: translateX(-50%) translateY(0) rotate(0deg);
  transition: transform 0.85s cubic-bezier(.34,.01,.2,1);
}
.device.up { transform: translateX(-50%) translateY(-38px) rotate(-3deg); }

.notch {
  position: absolute;
  left: 50%; top: 12px;
  transform: translateX(-50%);
  width: 42px; height: 4px;
  border-radius: 3px;
  background: var(--line-firm);
  z-index: 3;
}

.viewport {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: var(--ground);
  display: grid;
}

.vscreen {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.32s ease, transform 0.32s ease;
  pointer-events: none;
}
.viewport[data-show="lock"]    .v-lock,
.viewport[data-show="check"]   .v-check,
.viewport[data-show="confirm"] .v-confirm,
.viewport[data-show="face"]    .v-face,
.viewport[data-show="done"]    .v-done { opacity: 1; transform: scale(1); }

.lock-time { font-family: var(--f-display); font-weight: 500; font-size: 1.5rem; color: var(--ink-mute); letter-spacing: -0.02em; }

.spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-firm);
  border-top-color: var(--sodium);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.v-confirm .dir {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.42rem;
  letter-spacing: 0.01em;
  color: var(--good);
  line-height: 1;
}
.v-confirm .clock { font-family: var(--f-mono); font-size: 0.86rem; color: var(--ink-mute); }
.v-confirm .cta {
  margin-top: 12px;
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 9px 18px;
  border-radius: 7px;
  background: var(--sodium);
  color: #14181B;
}

.faceid { color: var(--sodium); }
.faceid svg { width: 40px; height: 40px; }
.face-label, .done-label {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  text-align: center;
}

.tick {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--good-wash);
  color: var(--good);
  display: grid;
  place-items: center;
}
.tick svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------- workflow */

.flow-section { padding: clamp(52px, 8vw, 96px) 0; }
.flow { margin-top: 34px; }

.flow-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(22px, 3.5vw, 38px);
}

/* the server side */
.rail { display: flex; flex-direction: column; gap: 16px; justify-content: center; }

.rail-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.rail-head .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line-firm);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.rail.busy .dot { background: var(--sodium); box-shadow: 0 0 10px var(--sodium); }

.rail-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.rail-lines li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 9px;
  background: transparent;
  opacity: 0.28;
  transform: translateX(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.35s ease;
}
.rail-lines li code {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  min-width: 96px;
  flex-shrink: 0;
}
.rail-lines li span { font-size: 0.9rem; color: var(--ink-soft); }

.rail-lines li.on {
  opacity: 1;
  transform: translateX(0);
  background: var(--surface-2);
}
.rail-lines li.on code { color: var(--sodium); }

.rail-lines li.ok::after {
  content: "";
  margin-left: auto;
  width: 12px; height: 7px;
  border-left: 2px solid var(--good);
  border-bottom: 2px solid var(--good);
  transform: rotate(-45deg);
  flex-shrink: 0;
}

@media (max-width: 780px) {
  .flow-grid { grid-template-columns: 1fr; }
  .scene-flow { max-width: 300px; margin: 0 auto; aspect-ratio: 1 / 1.2; }
  .rail-lines li code { min-width: 82px; }
}

/* steps */

.steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  gap: 10px;
  counter-reset: st;
}

.steps li {
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  counter-increment: st;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}
.steps li::before {
  content: counter(st);
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-mute);
  transition: color 0.3s ease;
}
.steps li b { font-size: 0.94rem; font-weight: 600; }
.steps li span { font-size: 0.87rem; line-height: 1.5; color: var(--ink-mute); }
.steps li:hover { border-color: var(--line-firm); }
.steps li.active {
  border-color: var(--sodium);
  background: var(--surface);
  transform: translateY(-2px);
}
.steps li.active::before { color: var(--sodium); }
.steps li.active span { color: var(--ink-soft); }

.flow-controls { margin-top: 18px; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.hint { font-size: 0.85rem; color: var(--ink-mute); }

/* ------------------------------------------------------------------ bands */

.band { padding: clamp(52px, 8vw, 96px) 0; }
.band.alt { background: var(--ground-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.1; }
.band h2, .flow-section h2, .closing h2 { margin-bottom: 22px; }
.band p + p { margin-top: 16px; }

.sub { color: var(--ink-mute); margin-top: -10px; margin-bottom: 30px; max-width: var(--measure); }

.pull {
  margin-top: 28px !important;
  padding: 18px 22px;
  border-radius: 11px;
  background: var(--sodium-wash);
  border-left: 3px solid var(--sodium);
  font-size: 1.1rem;
  color: var(--ink);
}

.footnote { margin-top: 26px; color: var(--ink-mute); font-size: 0.93rem; max-width: var(--measure); }

/* -------------------------------------------------------------- comparison */

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.card.muted { background: transparent; border-style: dashed; }
.card p { font-size: 0.95rem; color: var(--ink-soft); }

.tagline {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.copies { display: flex; gap: 9px; flex-wrap: wrap; }
.chip {
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line-firm);
}
.chip.dup { border-style: dashed; color: var(--bad); }
.chip.live { background: var(--sodium-wash); border-color: var(--sodium); color: var(--sodium); }
.chip.stale { opacity: 0.4; text-decoration: line-through; }

.verdict {
  font-family: var(--f-display);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 7px;
  align-self: flex-start;
}
.verdict.bad  { background: var(--bad-wash); color: var(--bad); }
.verdict.good { background: var(--good-wash); color: var(--good); }

/* --------------------------------------------------------------- includes */

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 26px 32px; }
.grid li { display: flex; flex-direction: column; gap: 7px; padding-top: 16px; border-top: 1px solid var(--line-firm); }
.grid li b { font-size: 0.98rem; font-weight: 600; }
.grid li span { font-size: 0.91rem; color: var(--ink-mute); line-height: 1.5; }

/* ---------------------------------------------------------------- pricing */

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.pr {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.pr.key { border-color: var(--sodium-dim); background: var(--sodium-wash); }
.pr-band { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-mute); }
.pr.key .pr-band { color: var(--sodium); }
.pr-amt { font-family: var(--f-display); font-size: 2.1rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.pr-amt i { font-size: 0.85rem; font-style: normal; font-weight: 500; color: var(--ink-mute); letter-spacing: 0; }
.pr-note { font-size: 0.86rem; color: var(--ink-mute); }

/* ---------------------------------------------------------------- closing */

.closing { padding: clamp(64px, 9vw, 112px) 0; text-align: center; }
.closing p { margin: 0 auto 30px; color: var(--ink-soft); max-width: 46ch; }

footer { border-top: 1px solid var(--line); padding: 26px 0; font-size: 0.86rem; color: var(--ink-mute); }
footer .inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- reveal */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.6,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* --------------------------------------------------------- reduced motion --
   The page still explains itself: steps still highlight, the server rail still
   ticks. What goes is travel and spin - the parts that are only atmosphere. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .device, .device.up { transform: translateX(-50%); }
  .ring { display: none; }
  .glow { display: none; }
}
