/* CartBeCart landing page. Static, no build step.
   Tokens first; every colour below comes from here. */

@font-face {
  font-family: "Kufi";
  src: url("/static/site/fonts/kufi-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Kufi";
  src: url("/static/site/fonts/kufi-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/site/fonts/vazirmatn-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f4f1;
  --paper: #ffffff;
  --ink: #0b1640;
  --ink-2: #1b2759;
  --muted: #4a5470;
  --line: #d8ddd6;
  --amber: #f2b632;
  --amber-soft: #fbe7b0;
  --ok: #17704a;
  --ok-soft: #dff2e8;
  --code-bg: #0a1230;
  --code-text: #d7def5;

  --display: "Kufi", "Vazirmatn", system-ui, sans-serif;
  --body: "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --wrap: 1120px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.95;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}
.access :focus-visible, .dev :focus-visible { outline-color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  margin-inline-end: auto;
}
.mark { color: var(--ink); flex: none; }
.nav { display: flex; gap: 6px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background-color 0.15s, color 0.15s;
}
.nav a:hover { background: rgba(11, 22, 64, 0.07); color: var(--ink); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: 700 1rem/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: #fff; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 0.92rem; }
.btn-on-amber { background: var(--ink); color: #fff; }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 56px;
  padding-block: 72px 88px;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.55;
  text-wrap: balance;
}
.lead {
  margin-top: 20px;
  max-width: 34em;
  font-size: 1.1rem;
  color: var(--muted);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.for-whom { margin-top: 20px; font-size: 0.95rem; color: var(--muted); }

/* ---------- hero stage: the memorable thing ---------- */

.stage {
  position: relative;
  padding: 36px 0 110px;
  min-height: 460px;
}
.ticket {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-lg);
  padding: 26px 28px 22px;
  box-shadow: 8px 8px 0 var(--ink);
  max-width: 420px;
  margin-inline: auto;
  transition: border-color 0.3s;
}
.ticket-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  padding-bottom: 14px;
  border-bottom: 1.5px dashed var(--line);
}
.ticket-note { margin-top: 16px; font-size: 0.95rem; color: var(--muted); }
.amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 2px;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.5;
}
/* keep the number one left-to-right run so the tail stays last */
.digits, .pay { direction: ltr; unicode-bidi: isolate; }
.amount .digits { font-size: clamp(2rem, 6.4vw, 2.75rem); }
.amount .unit { font-size: 1rem; font-weight: 700; color: var(--muted); }
.tail {
  background: var(--amber);
  color: var(--ink);
  border-radius: 6px;
  padding: 0 0.12em;
  line-height: 1.25;
  display: inline-block;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.pan {
  margin-top: 8px;
  text-align: left;
  font-family: var(--body);
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.status {
  display: grid;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1.5px dashed var(--line);
}
.status > p {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.s-wait { color: var(--muted); opacity: 0; }
.s-ok { color: var(--ok); opacity: 1; }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}

.sms {
  position: absolute;
  inset-inline-start: -6px;
  bottom: 40px;
  max-width: 250px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-md) var(--r-md) var(--r-md) 4px;
  padding: 12px 16px 12px 18px;
  box-shadow: 0 14px 30px -10px rgba(11, 22, 64, 0.45);
  line-height: 1.7;
}
.sms-from { font-size: 0.78rem; color: #aeb8de; }
.sms-body { font-weight: 700; font-size: 1rem; }

.stage-cap { position: absolute; inset-inline: 0; bottom: 0; text-align: center; font-size: 0.85rem; color: var(--muted); }
.replay {
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0 2px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.replay:hover { text-decoration-thickness: 2px; }

/* orchestrated sequence: runs once on load, and again on request.
   Base state above is the finished state, so no-JS / reduced motion is complete. */
@keyframes rise   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes mark   { 0%, 100% { background-color: transparent; } 20%, 80% { background-color: var(--amber); } }
@keyframes keep   { from { background-color: transparent; } to { background-color: var(--amber); } }
@keyframes smsIn  { from { opacity: 0; transform: translate(-18px, 18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes waitOut { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes okIn   { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ticketOk { from { border-color: var(--ink); } to { border-color: var(--ok); } }
@keyframes pulse  { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.play .ticket   { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both, ticketOk 0.4s ease 3.6s both; }
.play .tail     { animation: keep 0.5s ease 1s both; }
.play .sms      { animation: smsIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) 2.4s both; }
.play .s-wait   { animation: rise 0.5s ease 0.5s both, waitOut 0.3s ease 3.5s forwards; }
.play .s-wait .dot { animation: pulse 1.1s ease-in-out 1.2s 2; }
.play .s-ok     { animation: okIn 0.5s ease 3.7s both; }

@media (prefers-reduced-motion: reduce) {
  .play .ticket, .play .tail, .play .sms, .play .s-wait,
  .play .s-wait .dot, .play .s-ok { animation: none !important; }
  .replay, .stage-cap { display: none; }
}

/* ---------- generic sections ---------- */

.sec { padding-block: 84px; }
.sec-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  line-height: 1.6;
  max-width: 22ch;
  text-wrap: balance;
}

/* steps: a real sequence, so numbered */
.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-top: 44px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-top: 64px;
  border-top: 1.5px solid var(--ink);
}
.steps li::before {
  content: counter(step, persian);
  position: absolute;
  top: -1.5px;
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--ink);
  color: var(--amber);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
}
.steps h3 { font-family: var(--display); font-weight: 700; font-size: 1.08rem; line-height: 1.7; }
.steps p { margin-top: 8px; color: var(--muted); font-size: 0.98rem; line-height: 1.9; }

/* unique amount */
.amount-sec {
  background: var(--paper);
  border-block: 1px solid var(--line);
}
.amount-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
  padding-block: 84px;
}
.amount-copy p { margin-top: 18px; color: var(--muted); max-width: 36em; }
.amount-copy .sec-title + p { margin-top: 22px; }
.amount-panel {
  background: var(--bg);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-lg);
  padding: 22px 22px 16px;
}
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl caption {
  text-align: start;
  font-weight: 700;
  padding-bottom: 12px;
}
.tbl th, .tbl td { padding: 11px 10px; text-align: start; border-top: 1px solid var(--line); }
.tbl thead th { font-size: 0.85rem; font-weight: 500; color: var(--muted); border-top: 0; border-bottom: 1.5px solid var(--ink); }
.tbl tbody th { font-weight: 700; }
.tbl .pay { font-family: var(--display); font-weight: 800; text-align: end; }
.panel-note { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }

/* trust */
.defs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  margin-top: 36px;
}
.defs > div { padding: 22px 0 24px; border-top: 1.5px solid var(--ink); }
.defs dt { font-family: var(--display); font-weight: 700; font-size: 1.08rem; line-height: 1.7; }
.defs dd { margin-top: 6px; color: var(--muted); font-size: 0.98rem; line-height: 1.9; }

/* limits */
.limits {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-inline-start-width: 10px;
  border-inline-start-color: var(--amber);
  border-radius: var(--r-lg);
  padding: 36px 40px;
}
.limits-lead { margin-top: 10px; font-weight: 700; }
.limits ul { margin-top: 18px; display: grid; gap: 8px; }
.limits li { position: relative; padding-inline-start: 22px; color: var(--muted); }
.limits li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.95em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--ink);
}

/* developers */
.dev {
  background: var(--ink);
  color: #fff;
  padding-block: 88px;
}
.dev .sec-title { color: #fff; }
.dev-lead { margin-top: 14px; color: #c3cbe8; max-width: 38em; }
.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
}
.code {
  background: var(--code-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-md);
  overflow: hidden;
  min-width: 0;
}
.code figcaption {
  padding: 10px 18px;
  font-size: 0.88rem;
  color: #aeb8de;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.code pre {
  margin: 0;
  padding: 16px 18px 20px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
.code code {
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.75;
  color: var(--code-text);
  white-space: pre;
}
.code .c { color: #8794c4; }
.code .k { color: #9ec5ff; }
.code .s { color: #f6d58a; }
.code .n { color: #8fe0b6; }
.dev-note { margin-top: 24px; color: #c3cbe8; font-size: 0.95rem; max-width: 46em; }

/* rollout */
.rollout { margin-top: 32px; border-top: 1.5px solid var(--ink); }
.rollout li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.rollout h3 { font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.7; }
.rollout p { color: var(--muted); font-size: 0.95rem; line-height: 1.8; }
.chip {
  flex: none;
  padding: 3px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.8;
  border: 1.5px solid var(--ink);
}
.chip-ready { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.chip-building { background: var(--amber-soft); border-color: #b98300; color: #6b4a00; }
.chip-plan { background: transparent; color: var(--muted); border-color: var(--line); }

/* faq */
.faq { margin-top: 28px; border-top: 1.5px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding: 18px 0 18px 36px;
  font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  inset-inline-end: auto;
  left: 4px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -8px;
  border-inline-end: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 0 20px; color: var(--muted); max-width: 44em; }

/* access */
.access { background: var(--amber); padding-block: 80px; }
.access-inner { display: grid; gap: 14px; justify-items: start; }
.access p { max-width: 40em; font-weight: 500; }
.access .btn { margin-top: 10px; }
.access .btn-primary:hover { background: #000; }
.access .soon {
  margin-top: 6px;
  display: inline-block;
  padding: 8px 18px;
  border: 1.5px dashed var(--ink);
  border-radius: var(--r-sm);
  font-weight: 700;
}

/* footer */
.site-footer { padding: 36px 0 48px; color: var(--muted); font-size: 0.92rem; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; align-items: baseline; }
.foot-brand { font-family: var(--display); font-weight: 800; color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-block: 48px 64px; }
  .hero h1 { max-width: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 28px; }
  .amount-grid { grid-template-columns: 1fr; gap: 36px; padding-block: 64px; }
  .code-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .sec { padding-block: 60px; }
  .defs { grid-template-columns: 1fr; }
  .limits { padding: 26px 22px; }
  .dev { padding-block: 64px; }
}
@media (max-width: 520px) {
  body { font-size: 1rem; }
  .steps { grid-template-columns: 1fr; }
  .ticket { padding: 22px 20px 18px; box-shadow: 6px 6px 0 var(--ink); }
  .sms { inset-inline-start: 0; max-width: 210px; bottom: 40px; }
  .stage { min-height: 420px; }
  .rollout li { align-items: flex-start; flex-direction: column; gap: 8px; }
  .btn { width: 100%; }
  .btn-sm { width: auto; }
  .actions { flex-direction: column; }
}
