:root {
  --terracotta: #D9653B;
  --terracotta-dark: #B84F29;
  --mint: #1F9E7A;
  --ink: #1B1F2E;
  --ink-soft: #4A4F63;
  --cream: #FFF6EA;
  --sand: #F6E7D2;
  --saffron: #F2B63D;
  --radius: 20px;
  --font-head: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { --font-head: "IBM Plex Sans Arabic", system-ui, sans-serif; --font-body: "IBM Plex Sans Arabic", system-ui, sans-serif; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.02em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { letter-spacing: 0; line-height: 1.35; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 600; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(800px, 100% - 40px); }
.section { padding: 88px 0; }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 36em; }
.center { text-align: center; margin-inline: auto; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: rgba(255, 246, 234, .88); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(27, 31, 46, .06); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.brand.small { font-size: 1.1rem; gap: 8px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang { border: 1px solid rgba(27, 31, 46, .15); background: transparent; border-radius: 999px; padding: 7px 14px; font: 600 .9rem "IBM Plex Sans Arabic", var(--font-body); cursor: pointer; color: var(--ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--terracotta); color: #fff; text-decoration: none; font-weight: 600; border-radius: 999px; padding: 14px 26px; transition: background .2s, transform .2s; }
.btn:hover { background: var(--terracotta-dark); transform: translateY(-1px); }
.btn-small { padding: 9px 18px; font-size: .92rem; }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(27, 31, 46, .2); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-ghost { background: none; border: 0; color: var(--ink); font: 600 1rem var(--font-body); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 14px 6px; }

/* Spinning border beam CTA (technique adapted from ThreeUI SpinningBorderButton, MIT) */
.btn-beam { position: relative; display: inline-flex; overflow: hidden; border-radius: 999px; padding: 2px; text-decoration: none; transition: transform .3s, box-shadow .3s; box-shadow: 0 10px 30px -10px rgba(217, 101, 59, .7); }
.btn-beam .beam { position: absolute; inset: -150%; background: conic-gradient(from 90deg at 50% 50%, transparent 0%, transparent 70%, var(--saffron) 100%); animation: spin 3s linear infinite; }
.btn-beam .btn-surface { position: relative; display: inline-flex; align-items: center; gap: 10px; background: linear-gradient(180deg, #E2744B, var(--terracotta)); color: #fff; font-weight: 600; font-size: 1.02rem; border-radius: 999px; padding: 15px 26px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-beam:hover { transform: translateY(-2px); }
.btn-beam.light .btn-surface { background: var(--cream); color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-beam .beam { animation: none; opacity: 0; } }

/* Hero */
.hero { padding: 64px 0 88px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-block; font-weight: 600; font-size: .85rem; color: var(--mint); background: rgba(31, 158, 122, .1); padding: 6px 12px; border-radius: 999px; margin: 0 0 18px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 30px 0 14px; }
.note { font-size: .9rem; color: var(--ink-soft); margin: 0; }

.hero-visual { position: relative; display: flex; justify-content: center; min-height: 480px; }
.phone { width: 270px; height: 540px; background: var(--ink); border-radius: 42px; padding: 14px; box-shadow: 0 40px 80px -30px rgba(27, 31, 46, .5); position: relative; transform: rotate(-3deg); }
html[dir="rtl"] .phone { transform: rotate(3deg); }
.phone-notch { position: absolute; top: 14px; left: 50%; width: 90px; height: 22px; background: var(--ink); border-radius: 0 0 14px 14px; transform: translateX(-50%); z-index: 2; }
.card-ui { background: var(--cream); height: 100%; border-radius: 30px; padding: 48px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; text-align: start; }
.shop-logo { width: 46px; height: 46px; border-radius: 14px; background: var(--ink); color: var(--saffron); display: grid; place-items: center; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; flex: none; }
.shop-name { font-weight: 700; font-family: var(--font-head); font-size: 1.1rem; }
.shop-sub { font-size: .82rem; color: var(--ink-soft); }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; background: #fff; padding: 16px; border-radius: 18px; box-shadow: 0 2px 0 rgba(27, 31, 46, .05); }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2.5px dashed rgba(217, 101, 59, .45); display: grid; place-items: center; transition: transform .25s, background .25s; }
.stamp.on { background: var(--terracotta); border: 0; }
.stamp.on::after { content: ""; width: 38%; height: 38%; border-radius: 50%; background: var(--cream); }
.stamp.reward { border-color: var(--saffron); }
.stamp.reward.on { background: var(--saffron); }
.stamp.pop { animation: pop .35s ease-out; }
@keyframes pop { 50% { transform: scale(1.25); } }
.card-progress { font-weight: 600; font-size: .95rem; }
.card-reward { background: rgba(242, 182, 61, .18); border-radius: 14px; padding: 12px 14px; font-size: .9rem; }

.qr-sticker { position: absolute; right: 0; bottom: 10px; background: #fff; border-radius: 18px; padding: 14px; width: 150px; box-shadow: 0 20px 40px -20px rgba(27, 31, 46, .4); transform: rotate(5deg); text-align: center; }
html[dir="rtl"] .qr-sticker { right: auto; left: 0; transform: rotate(-5deg); }
.qr { aspect-ratio: 1; border-radius: 8px; background:
  conic-gradient(from 0deg at 50% 50%, var(--ink) 0 25%, transparent 0 50%, var(--ink) 0 75%, transparent 0) 0 0 / 22% 22%;
  outline: 6px solid #fff; outline-offset: -6px; position: relative; }
.qr::before { content: ""; position: absolute; inset: 35%; background: #fff url("/assets/kartiya-mark.svg") center / 80% no-repeat; border-radius: 6px; }
.qr-label { font-size: .75rem; font-weight: 600; margin-top: 8px; color: var(--terracotta); }

/* Problem */
.problem { background: var(--ink); color: var(--cream); }
.problem h2 { text-align: center; margin-bottom: 40px; }
.pb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pb-item { background: rgba(255, 246, 234, .06); border-radius: var(--radius); padding: 24px; }
.pb-item p { margin: 10px 0 0; color: rgba(255, 246, 234, .82); }
.pb-num { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 1.6rem; color: var(--terracotta); }

/* How */
.how h2 { text-align: center; margin-bottom: 48px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: s; }
.steps li { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: 0 1px 0 rgba(27, 31, 46, .06); }
.steps p { color: var(--ink-soft); margin: 0; }
.step-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--terracotta); color: #fff; display: grid; place-items: center; font: 800 1.3rem "Bricolage Grotesque", sans-serif; margin-bottom: 18px; }
.steps li:nth-child(2) .step-icon { background: var(--mint); }
.steps li:nth-child(3) .step-icon { background: var(--saffron); color: var(--ink); }

/* Benefits */
.benefits { background: var(--sand); }
.benefits h2 { margin-bottom: 40px; }
.ben-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ben { background: var(--cream); border-radius: var(--radius); padding: 26px; }
.ben p { margin: 0; color: var(--ink-soft); }
.ben h3::before { content: ""; display: block; width: 28px; height: 4px; border-radius: 2px; background: var(--terracotta); margin-bottom: 14px; }

/* Demo */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.demo-card { all: unset; box-sizing: border-box; cursor: pointer; background: #fff; border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 22px; box-shadow: 0 30px 60px -30px rgba(27, 31, 46, .35); transition: transform .2s; width: 100%; max-width: 440px; justify-self: center; }
.demo-card:hover { transform: translateY(-3px); }
.demo-card:focus-visible { outline: 3px solid var(--mint); outline-offset: 4px; }
.stamps.big { background: var(--cream); gap: 14px; padding: 20px; }
.demo-status { font-weight: 600; min-height: 1.5em; }
.demo-status.win { color: var(--mint); }

/* Pricing */
.pricing h2 { text-align: center; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 44px; align-items: stretch; }
.plan { background: #fff; border-radius: 24px; padding: 32px 28px; display: flex; flex-direction: column; position: relative; box-shadow: 0 1px 0 rgba(27, 31, 46, .06); }
.plan.featured { background: var(--ink); color: var(--cream); transform: translateY(-8px); box-shadow: 0 30px 60px -30px rgba(27, 31, 46, .6); }
.plan h3 { font-size: 1.35rem; }
.price { margin: 6px 0 2px; font-size: 1rem; }
.price strong { font: 800 2.8rem "Bricolage Grotesque", sans-serif; letter-spacing: -0.03em; }
.setup { margin: 0 0 22px; font-size: .9rem; color: var(--ink-soft); }
.featured .setup { color: rgba(255, 246, 234, .7); }
.plan ul { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; flex: 1; }
.plan li { padding-inline-start: 28px; position: relative; }
.plan li::before { content: "✓"; position: absolute; inset-inline-start: 0; top: .1em; width: 18px; height: 18px; border-radius: 50%; background: var(--mint); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.featured .btn-outline, .plan .btn { width: 100%; }
.badge { position: absolute; top: -13px; inset-inline-start: 28px; background: var(--saffron); color: var(--ink); font-weight: 700; font-size: .8rem; padding: 5px 12px; border-radius: 999px; }
.offer { text-align: center; margin-top: 34px; font-weight: 600; color: var(--terracotta-dark); }

/* FAQ */
.faq h2 { margin-bottom: 28px; }
details { background: #fff; border-radius: 16px; padding: 18px 22px; margin-bottom: 12px; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--terracotta); }
details[open] summary::after { content: "–"; }
details p { margin: 12px 0 0; color: var(--ink-soft); }

/* Final */
.final { background: var(--terracotta); color: #fff; padding: 88px 0; text-align: center; }
.final-inner { display: flex; flex-direction: column; align-items: center; }
.final p { font-size: 1.1rem; opacity: .92; margin: 0 0 28px; }
.final .btn-beam { box-shadow: 0 10px 30px -10px rgba(27, 31, 46, .5); }

/* Footer */
.footer { padding: 40px 0; font-size: .9rem; color: var(--ink-soft); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer p { margin: 0; }

/* Responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero { padding-top: 36px; }
  .hero-grid, .demo-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { min-height: 440px; }
  .phone { width: 230px; height: 460px; }
  .qr-sticker { width: 108px; right: 2%; bottom: -24px; padding: 10px; }
  .pb-grid, .steps, .ben-grid, .plans { grid-template-columns: 1fr; }
  .plan.featured { transform: none; }
  .section { padding: 64px 0; }
}
@media (max-width: 420px) {
  .btn-beam .btn-surface { padding: 14px 18px; font-size: .95rem; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn-beam { justify-content: center; }
  .btn-beam .btn-surface { justify-content: center; width: 100%; }
}
