/* Cubi Hands — marketing site
   Zero dependencies, zero external requests (Luật cứng §2/§4).
   Design tokens mirror the app (Doc 06 §2): indigo #4F46E5, mint #10B981,
   amber #F59E0B, ink #0F172A, 16px cards, capsule buttons. */

/* ---------- tokens ---------- */
:root {
  --ink: #0b1020;
  --ink-2: #141b33;
  --ink-3: #232c4d;
  --paper: #fffdf7;
  --paper-2: #f7f2e8;
  --paper-3: #efe8da;
  --line: #e0d7c4;
  --text: #14172b;
  --text-dim: #575d7a;
  --on-ink: #f2efe6;
  --on-ink-dim: #a7adc9;
  --indigo: #4f46e5;
  --indigo-deep: #3730a3;
  --indigo-soft: #eceafe;
  /* --mint / --amber are used for small text → dark enough for WCAG AA on paper
     (5.03 and 5.29). --mint-bright is the on-dark accent (countdown ring). */
  --mint: #0b7d5d;
  --mint-bright: #10b981;
  --mint-soft: #e2f6ef;
  --amber: #9a5c03;
  --amber-soft: #fdf1dc;

  --display: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 16px;
  --radius-lg: 28px;
  --shadow: 0 1px 2px rgba(11, 16, 32, .06), 0 12px 32px -18px rgba(11, 16, 32, .35);
  --shadow-lift: 0 2px 4px rgba(11, 16, 32, .07), 0 26px 50px -24px rgba(11, 16, 32, .45);
  --maxw: 1140px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* paper grain */
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  opacity: .22;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 9;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--indigo-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--indigo); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -.018em; line-height: 1.08; margin: 0 0 .5em; }
h1 { font-size: clamp(2.5rem, 6.2vw, 4.3rem); }
h2 { font-size: clamp(1.9rem, 3.9vw, 2.9rem); }
h3 { font-size: 1.3rem; line-height: 1.25; }
p { margin: 0 0 1.1em; }
ul { margin: 0 0 1.1em; padding-left: 1.15em; }
li { margin: .3em 0; }
strong { font-weight: 650; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; border-radius: 6px; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: .7rem 1.1rem; border-radius: 0 0 12px 0; z-index: 50;
}
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.15rem, 4vw, 2.5rem); }
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--indigo-deep);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: .6rem;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; opacity: .5; }
.lede { font-size: clamp(1.06rem, 1.7vw, 1.28rem); color: var(--text-dim); max-width: 34em; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 1rem; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--display); font-size: 1.12rem; font-weight: 650; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; border-radius: 9px; }
.head-nav { margin-left: auto; display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.5rem); }
.head-nav a { font-size: .93rem; color: var(--text-dim); text-decoration: none; }
.head-nav a:hover { color: var(--text); }
.lang {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px; padding: .3rem .6rem; color: var(--text-dim) !important;
}
.lang:hover { border-color: var(--indigo); color: var(--indigo) !important; }
@media (max-width: 720px) { .head-nav .hide-sm { display: none; } }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 54px; padding: 0 1.6rem;
  background: var(--bg); color: #fff;
  border: 0; border-radius: 999px;
  font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: var(--shadow);
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn--indigo { --bg: var(--indigo); }
.btn--ghost {
  --bg: transparent; color: var(--text); border: 1px solid var(--ink); box-shadow: none;
}
.btn--ghost:hover { color: var(--text); background: var(--paper-2); }
.btn small { display: block; font: 400 .72rem/1 var(--mono); opacity: .72; letter-spacing: .06em; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin: 1.8rem 0 1rem; }
.btn-note { font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; color: var(--text-dim); }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(2.6rem, 6vw, 5.2rem) 0 clamp(3rem, 7vw, 6rem); overflow: hidden; }
.hero::after { /* warm halo */
  content: ""; position: absolute; z-index: -1; width: 70vw; height: 70vw; max-width: 780px; max-height: 780px;
  right: -18vw; top: -22vw; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, .13), rgba(245, 158, 11, .1) 45%, transparent 68%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.hero h1 .accent { color: var(--indigo-deep); font-style: italic; }
.trust-strip {
  display: flex; flex-wrap: wrap; gap: .5rem .55rem; list-style: none; padding: 0; margin: 1.6rem 0 0;
}
.trust-strip li {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 999px; padding: .34rem .72rem; color: var(--text-dim);
}
/* On narrow screens the headline must stay first — the phone mock follows it. */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { margin-top: 2.2rem; }
  .hero { padding-bottom: clamp(2.4rem, 8vw, 4rem); }
}

/* ---------- phone mock (stands in for screenshots) ---------- */
.hero-art { position: relative; display: flex; justify-content: center; }
.phone {
  position: relative; width: min(300px, 78vw); aspect-ratio: 9 / 19.2;
  background: linear-gradient(168deg, var(--ink-2), var(--ink));
  border-radius: 44px; padding: 11px;
  box-shadow: 0 3px 0 rgba(255, 255, 255, .12) inset, 0 40px 70px -34px rgba(11, 16, 32, .7), 0 0 0 1px rgba(11, 16, 32, .5);
  transform: rotate(2.2deg);
}
.phone-screen {
  position: relative; height: 100%; border-radius: 34px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #2b2f63 0%, #131735 55%, #0d1027 100%);
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  text-align: center; padding: 1.4rem 1rem;
}
.phone-notch { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 78px; height: 22px; background: #05060f; border-radius: 999px; }
.ring { width: 63%; aspect-ratio: 1; position: relative; margin-bottom: .7rem; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 7; }
.ring-fill { fill: none; stroke: var(--mint-bright); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 62; filter: drop-shadow(0 0 10px rgba(16, 185, 129, .55)); }
.ring-num {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
}
.ring-num b { font: 700 2.35rem/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ring-num span { font: 400 .62rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .58); }
.phone-kid { font: 600 1.02rem/1.3 var(--sans); }
.phone-sub { font: 400 .78rem/1.4 var(--sans); color: rgba(255, 255, 255, .62); }
.phone-apps { display: flex; gap: .45rem; margin-top: 1.1rem; }
.phone-apps i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .13); display: block; }
.phone-apps i:nth-child(2) { background: rgba(16, 185, 129, .35); }
.phone-apps i:nth-child(3) { background: rgba(245, 158, 11, .3); }
.chip {
  position: absolute; z-index: 3;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: .55rem .8rem; box-shadow: var(--shadow-lift);
  font: 500 .82rem/1.25 var(--sans); display: flex; align-items: center; gap: .55rem; white-space: nowrap;
}
.chip b { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mint); }
.chip--1 { left: -6%; top: 13%; transform: rotate(-4deg); }
.chip--2 { right: -8%; bottom: 17%; transform: rotate(3.5deg); }
.chip--3 { left: -2%; bottom: 6%; transform: rotate(2deg); }
.chip--2 b { color: var(--indigo-deep); }
.chip--3 b { color: var(--amber); }
@media (max-width: 560px) {
  .phone { width: min(262px, 68vw); }
  .chip--1 { left: -1%; top: 9%; }
  .chip--2 { right: -1%; }
  .chip--3 { display: none; }
  .chip { font-size: .78rem; padding: .48rem .7rem; }
}

/* ---------- sections ---------- */
section { padding: clamp(3rem, 7vw, 6rem) 0; position: relative; }
.section-head { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.band-paper { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-ink { background: var(--ink); color: var(--on-ink); }
.band-ink h2, .band-ink h3 { color: #fff; }
.band-ink a { color: #c6c1fb; }
.band-ink .lede, .band-ink p { color: var(--on-ink-dim); }
.band-ink .eyebrow { color: #9d95fb; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: clamp(1.2rem, 3vw, 2.4rem); counter-reset: s; }
.step { position: relative; padding-top: 2.6rem; }
.step::before {
  counter-increment: s; content: "0" counter(s);
  position: absolute; top: 0; left: 0;
  font: 400 .95rem/1 var(--mono); letter-spacing: .1em; color: var(--indigo-deep);
  padding-bottom: .55rem; border-bottom: 1px solid var(--line); width: 100%;
}
.step h3 { margin-bottom: .35rem; }
.step p { color: var(--text-dim); margin: 0; font-size: .98rem; }

/* feature cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: clamp(1rem, 2vw, 1.4rem); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.45rem; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card .ico { font-size: 1.55rem; line-height: 1; display: block; margin-bottom: .85rem; }
.card h3 { margin-bottom: .4rem; }
.card p, .card ul { color: var(--text-dim); font-size: .96rem; margin-bottom: 0; }
.card ul { padding-left: 1.05em; }
.tag {
  font: 400 .66rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid currentColor; border-radius: 999px; padding: .26rem .5rem; margin-left: .5rem;
  vertical-align: middle; color: var(--indigo-deep);
}
.tag--free { color: var(--mint); }

/* privacy manifesto */
.manifesto { font-family: var(--display); font-size: clamp(1.55rem, 3.4vw, 2.5rem); line-height: 1.25; letter-spacing: -.02em; max-width: 46rem; }
.manifesto em { color: #a5f3d5; font-style: italic; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.4rem; margin-top: 2.8rem; list-style: none; padding: 0; }
.facts li { border-top: 1px solid rgba(255, 255, 255, .18); padding-top: .9rem; font-size: .95rem; color: var(--on-ink-dim); }
.facts b { display: block; font: 400 .7rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #9d95fb; margin-bottom: .5rem; }

/* truths */
.truths { display: grid; gap: 0; margin-top: 1rem; }
.truth { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.4rem; padding: 1.35rem 0; border-top: 1px solid var(--line); align-items: baseline; }
.truth:last-child { border-bottom: 1px solid var(--line); }
.truth dt { font: 400 .7rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.truth dd { margin: 0; font-size: 1.02rem; }
@media (max-width: 620px) { .truth { grid-template-columns: 1fr; gap: .4rem; } }

/* pricing */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr)); gap: clamp(1rem, 2vw, 1.6rem); align-items: start; }
.plan { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.7rem 1.55rem; }
.plan--pro { border-color: var(--ink); box-shadow: var(--shadow-lift); }
.plan h3 { display: flex; align-items: baseline; gap: .5rem; }
.plan .amount { font-family: var(--display); font-size: 2.5rem; letter-spacing: -.03em; display: block; margin: .2rem 0 .1rem; }
.plan .amount s { font-size: .95rem; color: var(--text-dim); font-family: var(--mono); letter-spacing: 0; margin-left: .4rem; }
.plan .per { font: 400 .74rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.plan ul { list-style: none; padding: 0; margin: 1.2rem 0 0; font-size: .96rem; }
.plan li { padding-left: 1.5rem; position: relative; color: var(--text-dim); }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--mint); font-weight: 700; }
.plan li.no::before { content: "—"; color: var(--line); }
.stamp {
  position: absolute; top: -1.1rem; right: 1.2rem; transform: rotate(-7deg);
  background: var(--amber-soft); color: var(--amber); border: 1px dashed currentColor; border-radius: 999px;
  font: 400 .68rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: .5rem .8rem;
}

/* faq */
.faq { max-width: 46rem; }
.faq details { border-top: 1px solid var(--line); padding: 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.15rem 2.5rem 1.15rem 0; position: relative;
  font-family: var(--display); font-size: 1.14rem; letter-spacing: -.01em; line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .3rem; top: 50%; transform: translateY(-50%);
  font: 300 1.5rem/1 var(--sans); color: var(--indigo-deep); transition: transform .2s ease;
}
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 2.5rem 1.3rem 0; color: var(--text-dim); }
.faq details > div > :last-child { margin-bottom: 0; }

/* closing CTA */
.cta-final { text-align: center; }
.cta-final h2 { font-size: clamp(2rem, 4.6vw, 3.3rem); max-width: 26em; margin-inline: auto; }
.cta-final .btn-row { justify-content: center; }

/* ---------- prose (privacy / support) ---------- */
.prose { max-width: 44rem; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); margin-top: 2.6rem; }
.prose h3 { margin-top: 1.9rem; font-size: 1.1rem; }
.prose .meta { font: 400 .76rem/1.5 var(--mono); letter-spacing: .06em; color: var(--text-dim); text-transform: uppercase; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2rem 0 1.6rem; font-size: .94rem; }
.prose th, .prose td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 400 .7rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); background: var(--paper-2); }
.prose td .no { color: var(--mint); font-weight: 650; }
.callout {
  background: var(--indigo-soft); border-left: 3px solid var(--indigo); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.3rem; margin: 1.6rem 0; font-size: .98rem;
}
.callout > :last-child { margin-bottom: 0; }
.page-head { padding: clamp(2.4rem, 5vw, 4rem) 0 0; }
.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); }

/* ---------- footer ---------- */
.site-foot { background: var(--ink); color: var(--on-ink-dim); padding: clamp(2.6rem, 5vw, 4rem) 0 2.2rem; font-size: .93rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(140px, 1fr)); gap: 2rem; }
.site-foot a { color: var(--on-ink-dim); text-decoration: none; }
.site-foot a:hover { color: #fff; text-decoration: underline; }
.site-foot h4 { font: 400 .7rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #9d95fb; margin: 0 0 1rem; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: .45rem 0; }
.foot-brand { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-size: 1.15rem; color: #fff; margin-bottom: .7rem; }
.foot-brand svg { width: 30px; height: 30px; border-radius: 9px; }
.foot-legal { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, .14); display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; font-size: .82rem; }

/* ---------- utilities (kept as classes so the CSP can forbid inline styles) ---------- */
.center { justify-content: center; text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-l { margin-top: 2.4rem; }
.mt-s { margin-top: 1.4rem; }
.pt-s { padding-top: 1.3rem; }
.btn--onink { border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn--onink:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.dim-onink { color: var(--on-ink-dim); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ringSweep { from { stroke-dashoffset: 289; } to { stroke-dashoffset: 62; } }
.rise { animation: rise .7s cubic-bezier(.2, .7, .3, 1) both; }
.rise-2 { animation-delay: .1s; }
.rise-3 { animation-delay: .2s; }
.rise-4 { animation-delay: .3s; }
.ring-fill { animation: ringSweep 1.6s cubic-bezier(.3, .8, .2, 1) .25s both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --mint-bright: #34d3a3;
    --paper: #0f1226;
    --paper-2: #161a33;
    --paper-3: #1d2242;
    --line: #2b3157;
    --text: #ecebf7;
    --text-dim: #a3a8c6;
    --indigo: #8b83ff;
    --indigo-deep: #a9a2ff;
    --indigo-soft: #1e2145;
    --mint: #34d3a3;
    --mint-soft: #102b26;
    --amber: #f0b45e;
    --amber-soft: #2b2011;
    --ink: #080b18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 14px 34px -20px rgba(0, 0, 0, .8);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .55), 0 28px 54px -26px rgba(0, 0, 0, .9);
  }
  body::before { mix-blend-mode: soft-light; opacity: .3; }
  .btn { --bg: var(--indigo); }
  .btn--ghost { --bg: transparent; border-color: var(--line); color: var(--text); }
  .card, .plan, .chip { background: var(--paper-2); }
  .prose td .no { color: var(--mint); }
}
