/* ============================================================
   Nouly — marketing site
   Brand: Telegram blue #229ED9 + navy ink #1A2A44, Inter.
   Utility/data type: JetBrains Mono (chat stamps, stat keys) —
   grounds the "delivered, on time" feel in the product's own world.
   ============================================================ */

:root {
  --bg:      #F8F9FA;
  --surface: #FFFFFF;
  --ink:     #1A2A44;
  --soft:    #5B6675;
  --faint:   #8A93A2;
  --border:  #E7E9EE;
  --accent:  #229ED9;
  --accent-2:#2AABEE;
  --accent-soft: rgba(34,158,217,.10);
  --success: #34C759;

  --chat:   #E9EEF3;
  --bubble: #FFFFFF;
  --key:    #F1F4F8;

  --radius: 22px;
  --radius-lg: 32px;
  --shadow: 0 30px 60px rgba(26,42,68,.14);
  --maxw: 1160px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(34,158,217,.22); }
a { color: inherit; text-decoration: none; }
img { display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
  transform: translateY(-160%); transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 15px; line-height: 1;
  padding: 13px 22px; border-radius: 999px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn__tg { font-size: 13px; transform: rotate(-45deg); display: inline-block; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(34,158,217,.28); }
.btn--primary:hover { background: var(--accent-2); box-shadow: 0 12px 26px rgba(34,158,217,.36); }
.btn--ghost { color: var(--ink); }
.btn--ghost:hover { color: var(--accent); transform: translateX(3px); }
.btn--on-accent { background: #fff; color: var(--accent); box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.btn--lg { padding: 16px 28px; font-size: 16.5px; }
.btn--sm { padding: 9px 16px; font-size: 13.5px; }

/* ---------- Eyebrow / section head ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 22px;
}
.eyebrow--ink { color: var(--accent); }
.eyebrow--on-dark { color: var(--accent-2); }
.eyebrow__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(34,158,217,.5); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,158,217,.45); }
  70% { box-shadow: 0 0 0 9px rgba(34,158,217,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,158,217,0); }
}
.section-head { max-width: 660px; margin: 0 0 clamp(34px, 5vw, 56px); }
.section-head__title {
  font-size: clamp(29px, 4vw, 44px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.08; margin: 0;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 15px clamp(18px, 5vw, 60px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__brand { display: flex; align-items: center; gap: 10px; }
.nav__logo { border-radius: 50%; }
.nav__word { font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); }
.nav__links a { color: var(--soft); font-size: 15px; font-weight: 500; transition: color .15s; }
.nav__links a:hover { color: var(--ink); }

/* ---------- Layout wrappers ---------- */
.hero, .pillars, .how, .features, .cta { max-width: var(--maxw); margin: 0 auto; }
.hero, .how, .features { padding-left: clamp(18px, 5vw, 60px); padding-right: clamp(18px, 5vw, 60px); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.04fr .96fr; gap: 52px; align-items: center;
  padding-top: clamp(34px, 5vw, 66px); padding-bottom: clamp(46px, 6vw, 78px);
}
.hero__title {
  font-size: clamp(30px, 7.2vw, 70px); font-weight: 900;
  letter-spacing: -.04em; line-height: 1.03; margin: 0 0 22px;
  text-wrap: balance; overflow-wrap: break-word;
}
.hero__lede {
  font-size: clamp(16.5px, 1.4vw, 19.5px); color: var(--soft);
  max-width: 500px; margin: 0 0 32px;
}
.hero__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.stat-row {
  list-style: none; margin: 36px 0 0; padding: 22px 0 0;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(3, auto); gap: clamp(20px, 4vw, 48px);
  justify-content: start;
}
.stat-row li { display: flex; flex-direction: column; gap: 3px; }
.stat-row__k { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--accent); line-height: 1; }
.stat-row__v { font-size: 13.5px; color: var(--faint); }

/* ---------- Phone ---------- */
.hero__stage { position: relative; display: flex; justify-content: center; isolation: isolate; }
.glow {
  position: absolute; inset: -10% -6%;
  background: radial-gradient(circle at 60% 38%, var(--accent-soft), transparent 68%);
  z-index: 0;
}
.phone {
  position: relative; z-index: 1;
  width: 300px; height: 616px; border-radius: 46px;
  background: #0e1621; padding: 10px; box-shadow: var(--shadow);
  animation: float 8s ease-in-out infinite;
}
.hero__stage .phone { animation: float 8s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.phone__notch {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 22px; border-radius: 999px; background: #0e1621; z-index: 5;
}
.phone__screen {
  width: 100%; height: 100%; border-radius: 37px; overflow: hidden;
  background: var(--chat); display: flex; flex-direction: column;
}

.chat__head {
  display: flex; align-items: center; gap: 10px;
  padding: 42px 15px 12px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.chat__back { color: var(--accent); font-size: 22px; font-weight: 600; }
.chat__avatar { border-radius: 50%; }
.chat__id { display: flex; flex-direction: column; line-height: 1.2; }
.chat__name { font-weight: 600; font-size: 15px; }
.chat__status { font-size: 12px; color: var(--accent); }
.chat__body {
  flex: 1; padding: 17px 13px; display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
}
.chat__body::-webkit-scrollbar { display: none; }

/* chat bubbles */
.msg { max-width: 92%; font-size: 13.5px; line-height: 1.42; }
.msg--in {
  align-self: flex-start; background: var(--bubble); color: var(--ink);
  border-radius: 16px 16px 16px 5px; padding: 14px 15px;
  box-shadow: 0 1px 2px rgba(26,42,68,.07); position: relative;
}
.msg--out {
  align-self: flex-end; max-width: 82%; background: var(--accent); color: #fff;
  border-radius: 16px 16px 5px 16px; padding: 11px 15px; font-size: 13px;
}
.msg__stamp {
  position: absolute; bottom: 6px; right: 10px;
  font-family: var(--mono); font-size: 9.5px; color: var(--faint);
}
.msg--out {  /* whole-message stamp room not needed; keep tight */ }
.msg__hello { margin: 0; padding-right: 26px; }

/* rolling message: list + story share this bubble, edited in place */
.msg--roll, .keys-wrap { transition: opacity .16s ease; }
.msg--roll.fade, .keys-wrap.fade { opacity: 0; }
.msg--roll:empty, .keys-wrap:empty { display: none; }

.digest__title { margin: 0 0 12px; font-weight: 700; font-size: 14px; }
.digest__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.digest__list li { font-size: 13px; line-height: 1.4; }
.digest__list .d-n { color: var(--faint); font-variant-numeric: tabular-nums; }
.digest__list .d-t { color: var(--ink); }
.digest__foot { margin: 14px 0 0; font-size: 11px; font-style: italic; color: var(--faint); }

/* story (single) view */
.st-title { margin: 0 0 11px; font-weight: 700; font-size: 13.5px; line-height: 1.35; }
.st-body { margin: 0 0 9px; font-size: 12.5px; color: var(--soft); line-height: 1.55; }
.st-src { margin: 12px 0 0; font-size: 12px; color: var(--accent); font-weight: 500; }

/* keyboards */
.keys-wrap { align-self: stretch; display: flex; flex-direction: column; gap: 7px; }
.keys { display: flex; gap: 7px; }
.keys--tight { margin-top: 4px; }
.key {
  flex: 1; text-align: center; background: var(--key); border-radius: 10px;
  padding: 10px 4px; font-size: 13.5px; font-weight: 600; color: var(--ink);
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.key--wide { font-size: 12px; }
.key--accent { background: var(--accent); color: #fff; font-size: 12px; }
.key.pressed { transform: scale(.9); background: var(--accent); color: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }

/* AI-generated funny posts */
.msg--posts { padding-bottom: 12px; }
.posts-h { margin: 0 0 12px; font-size: 12.5px; font-weight: 600; }
.tw {
  margin: 0 0 9px; padding: 11px 13px 11px 32px; position: relative;
  background: var(--key); border-radius: 11px; font-size: 12px; line-height: 1.5; color: var(--ink);
  opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease;
}
.tw:last-child { margin-bottom: 0; }
.tw.in { opacity: 1; transform: translateY(0); }
.tw-n {
  position: absolute; left: 9px; top: 9px; font-family: var(--mono);
  font-size: 11px; font-weight: 600; color: var(--accent);
}

/* greeting reveal */
#hb-greet { opacity: 0; transform: translateY(10px); transition: opacity .35s ease, transform .35s ease; }
#hb-greet.shown { opacity: 1; transform: translateY(0); }

/* loop wipe */
.chat--wipe .msg, .chat--wipe .keys-wrap, .chat--wipe .typing { opacity: 0; transition: opacity .45s ease; }

/* typing indicator */
.typing {
  align-self: flex-start; background: var(--bubble); border-radius: 15px 15px 15px 5px;
  padding: 12px 14px; display: inline-flex; gap: 5px; box-shadow: 0 1px 2px rgba(26,42,68,.07);
}
.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--faint);
  animation: blink 1.3s infinite both;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,80%,100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Pillars ---------- */
.pillars { padding: clamp(10px, 3vw, 30px) clamp(18px, 5vw, 60px) clamp(30px, 5vw, 56px); }
.pillars__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 24px);
}
.pillar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px 32px; position: relative; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.pillar::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .3s ease;
}
.pillar:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.pillar:hover::before { transform: scaleY(1); }
.pillar__mark {
  display: inline-block; font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.pillar__h { font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.18; margin: 0 0 10px; }
.pillar__p { font-size: 15px; color: var(--soft); margin: 0; }
.pillar__p code {
  font-family: var(--mono); font-size: 13px; background: var(--key);
  padding: 1px 6px; border-radius: 6px; color: var(--ink);
}

/* ---------- How ---------- */
.how { padding-top: clamp(46px, 6vw, 84px); padding-bottom: clamp(46px, 6vw, 84px); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 2.4vw, 30px); }
.step {
  border-top: 2px solid var(--ink); padding-top: 22px; position: relative;
}
.step__num { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--accent); }
.step__h { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 12px 0 8px; }
.step__p { font-size: 15px; color: var(--soft); margin: 0; }

/* ---------- Drafts (dark) ---------- */
.drafts { background: var(--ink); color: #fff; }
.drafts__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(52px, 7vw, 96px) clamp(18px, 5vw, 60px);
  display: grid; grid-template-columns: .92fr 1.08fr; gap: 52px; align-items: center;
}
.drafts__stage { display: flex; justify-content: center; }
.phone--dark { animation: none; box-shadow: 0 34px 66px rgba(0,0,0,.45); }
.phone--dark .chat__head { background: #fff; }
.phone--dark .chat__name { color: var(--ink); }
.drafts__title { font-size: clamp(28px, 4vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1.06; margin: 0 0 20px; }
.drafts__lede { font-size: clamp(16px, 1.3vw, 19px); color: #B7C2D4; max-width: 520px; margin: 0 0 26px; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.ticks li { display: flex; align-items: center; gap: 12px; font-size: 16px; color: #E7ECF4; }
.ticks li::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); flex: none;
}

/* ---------- Features ---------- */
.features { padding-top: clamp(48px, 7vw, 92px); padding-bottom: clamp(48px, 7vw, 92px); }
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.feature { background: var(--surface); padding: 32px 28px; transition: background .2s; }
.feature:hover { background: #fbfcfe; }
.feature__ico { font-size: 22px; display: block; margin-bottom: 15px; }
.feature h3 { font-size: 18px; font-weight: 700; margin: 0 0 7px; }
.feature p { font-size: 14.5px; color: var(--soft); margin: 0; }

/* ---------- CTA ---------- */
.cta { padding: 0 clamp(18px, 5vw, 60px) clamp(48px, 6vw, 78px); }
.cta__card {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: var(--radius-lg); text-align: center; color: #fff;
  padding: clamp(48px, 6vw, 84px) clamp(28px, 5vw, 60px); position: relative; overflow: hidden;
}
.cta__card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% -10%, rgba(255,255,255,.28), transparent 55%);
  pointer-events: none;
}
.cta__logo { border-radius: 50%; margin: 0 auto 22px; box-shadow: 0 0 0 6px rgba(255,255,255,.2); position: relative; }
.cta__title { font-size: clamp(28px, 4.4vw, 48px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 0 0 14px; position: relative; }
.cta__p { font-size: clamp(16px, 1.4vw, 19px); color: rgba(255,255,255,.9); margin: 0 auto 30px; max-width: 440px; position: relative; }
.cta .btn { position: relative; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); }
.footer__grid {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) clamp(18px, 5vw, 60px);
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px;
}
.footer__brand p { font-size: 15px; color: var(--soft); max-width: 260px; margin: 14px 0 0; }
.footer__col { display: flex; flex-direction: column; gap: 11px; }
.footer__h { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 3px; }
.footer__col a { font-size: 14px; color: var(--soft); transition: color .15s; }
.footer__col a:hover { color: var(--accent); }
.footer__base {
  max-width: var(--maxw); margin: 0 auto;
  padding: 18px clamp(18px, 5vw, 60px); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 13px; color: var(--faint); flex-wrap: wrap;
}

/* ---------- Scroll reveal (only hidden when JS is present) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .hero { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero__lede { margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }
  .stat-row { justify-content: center; }
  .pillars__grid, .steps, .feature-grid { grid-template-columns: 1fr; }
  .feature-grid { border-radius: var(--radius); }
  .drafts__inner { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .ticks li { justify-content: center; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .stat-row { grid-template-columns: 1fr; gap: 14px; text-align: center; }
  .stat-row li { align-items: center; }
  .footer__grid { grid-template-columns: 1fr; }
  .btn--lg { width: 100%; justify-content: center; }
  .hero__actions { flex-direction: column; align-items: stretch; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .chat--play [data-step] { opacity: 1; transform: none; }
  .btn:hover, .pillar:hover { transform: none; }
}
