/*
 * FreeSmsOtp landing layer — the premium, full-width marketing surface that sits
 * on top of the app design system. Deep gradient hero, glass panels, animated
 * inline SVG, section rhythm. Everything here is decoration for the home page
 * and the entity pages' hero blocks; the app UI stays calm.
 * All motion is disabled under prefers-reduced-motion (see the end of the file).
 */
@layer landing {
  :root {
    --night-900: #061310;
    --night-800: #0a1a16;
    --night-700: #10231d;
    --on-night: #f6f4ef;
    --on-night-2: #c4d3cc;
    --on-night-3: #8fa79c;
    --section-pad: clamp(1.5rem, .9rem + 1.4vw, 2.25rem);
  }

  /* ---------------------------------------------------------------- shell
     The landing page renders inside <main class="full">, which drops the app's
     width cap. Sections centre themselves; full-bleed ones keep their own
     background and pad to the page width with max(). */
  .lp > * { max-width: var(--page); margin-inline: auto; padding-inline: var(--gap); }
  .lp-section { padding-block: var(--section-pad); }
  .lp-section.compare, .lp-section.cta-band {
    max-width: none; padding-inline: max(var(--gap), calc(50% - var(--page) / 2));
  }
  .lp-section > header { max-width: 42rem; margin-bottom: 1.25rem; }
  .lp-section > header.center { margin-inline: auto; text-align: center; }
  .lp h2, .lp h3 { font-family: var(--display); }
  .eyebrow {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--brand-600); background: var(--brand-50); border: 1px solid var(--brand-200);
    border-radius: 999px; padding: .3rem .75rem; margin-bottom: 1rem;
  }
  .lp h2 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); margin-top: 0; }
  .lp .sub { color: var(--muted); font-size: 1.05rem; }

  /* ---------------------------------------------------------------- hero */
  .hero-lp {
    position: relative; isolation: isolate; overflow: hidden; max-width: none;
    background:
      radial-gradient(85rem 42rem at 80% -12%, rgba(11, 163, 107, .55), transparent 62%),
      radial-gradient(48rem 30rem at 6% 106%, rgba(214, 242, 75, .16), transparent 64%),
      linear-gradient(168deg, var(--night-900) 0%, var(--night-800) 58%, var(--night-700) 100%);
    color: var(--on-night);
    /* The inner grid carries the side padding; without this the hero pads twice. */
    padding: clamp(1.75rem, 1rem + 2vw, 3rem) 0 clamp(2rem, 1.2rem + 2vw, 3.25rem);
  }
  .hero-lp::before {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
    background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(60rem 40rem at 50% 20%, #000 35%, transparent 78%);
  }
  .hero-lp::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4rem; z-index: -1;
    background: linear-gradient(to bottom, transparent, var(--surface-2));
  }
  .hero-inner {
    max-width: var(--page); margin-inline: auto; padding-inline: var(--gap);
    display: grid; gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: center;
    grid-template-columns: minmax(0, 1fr);
  }
  @media (min-width: 62rem) { .hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); } }
  .hero-lp .eyebrow { color: var(--volt); background: rgba(214,242,75,.12); border-color: rgba(214,242,75,.38); }
  .hero-lp h1 {
    font-family: var(--display); font-weight: 800;
    font-size: clamp(2.1rem, 1.2rem + 2.8vw, 3.4rem); line-height: 1.02;
    letter-spacing: -.04em; margin: 0 0 1rem; color: #fff; max-width: 18ch;
  }
  .hero-lp h1 .grad { color: #2fd08f; }
  .hero-lp .sub { color: var(--on-night-2); font-size: clamp(1.05rem, .95rem + .35vw, 1.25rem); max-width: 34rem; margin-bottom: 1.75rem; }
  .cta-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
  .hero-lp .button.xl { background: var(--brand-500); color: #04231a; }
  .hero-lp .button.xl:hover { background: #12b87a; color: #04231a; }
  .button.xl { padding: .95rem 1.6rem; font-size: 1.05rem; border-radius: 12px; box-shadow: 0 14px 34px -14px rgba(11,163,107,.9); }
  .button.on-dark, .hero-lp .button.xl.on-dark { background: rgba(255,255,255,.07); color: var(--on-night); border-color: rgba(255,255,255,.24); box-shadow: none; backdrop-filter: blur(6px); }
  .button.on-dark:hover, .hero-lp .button.xl.on-dark:hover { background: rgba(255,255,255,.15); color: #fff; }
  .trust-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1.75rem; color: var(--on-night-3); font-size: .9rem; }
  .trust-row span { display: inline-flex; align-items: center; gap: .45rem; }
  .trust-row .ico { color: var(--volt); }

  /* --------------------------------------------------- hero illustration */
  .hero-visual { position: relative; display: grid; place-items: center; }
  .device {
    width: min(17.5rem, 100%); filter: drop-shadow(0 30px 60px rgba(0,0,0,.55));
    animation: float 7s ease-in-out infinite;
  }
  .device .screen-code { font-family: var(--mono); font-weight: 700; letter-spacing: .12em; }
  .ping { transform-origin: center; animation: ping 2.6s ease-out infinite; }
  .ping.d2 { animation-delay: .7s; }
  .ping.d3 { animation-delay: 1.4s; }
  .sms-pop { animation: pop .6s cubic-bezier(.2,.9,.3,1.4) both; }
  .sms-pop.d1 { animation-delay: .7s; }
  .sms-pop.d2 { animation-delay: 1.5s; }
  .dash { stroke-dasharray: 6 8; animation: dash 1.6s linear infinite; }
  .blink { animation: blink 1.4s steps(2, jump-none) infinite; }
  @keyframes float { 0%, 100% { transform: translateY(-.5rem); } 50% { transform: translateY(.5rem); } }
  @keyframes ping { 0% { transform: scale(.5); opacity: .55; } 80%, 100% { transform: scale(1.7); opacity: 0; } }
  @keyframes pop { from { transform: translateY(10px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes dash { to { stroke-dashoffset: -28; } }
  @keyframes blink { 50% { opacity: .25; } }

  /* --------------------------------------------------------- stats band */
  .stats-band {
    max-width: none; background: var(--surface); border-block: 1px solid var(--line);
  }
  .stats-inner {
    max-width: var(--page); margin-inline: auto; padding: 1rem var(--gap);
    display: grid; gap: 1rem .75rem; grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  @media (min-width: 48rem) { .stats-inner { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-block: 1.25rem; } }
  .stat { display: grid; gap: .15rem; padding-inline: .25rem; border-left: 3px solid var(--brand-200); padding-left: .9rem; }
  .stat b { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
  .stat span { color: var(--muted); font-size: .85rem; }

  /* ------------------------------------------------------------- chips */
  .chip-rail { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
  .chip-track { display: flex; gap: .6rem; width: max-content; animation: rail 42s linear infinite; }
  .chip-rail:hover .chip-track { animation-play-state: paused; }
  .chip {
    display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
    padding: .5rem .95rem; font-weight: 600; font-size: .95rem; color: var(--ink-2);
    box-shadow: var(--shadow-sm); text-decoration: none;
  }
  .chip:hover { border-color: var(--brand-200); color: var(--brand-700); }
  .chip .price { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
  @keyframes rail { to { transform: translateX(-50%); } }

  /* ---------------------------------------------------------- features */
  .feature-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 40rem) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; } }
  @media (min-width: 64rem) { .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .feature-card {
    position: relative; background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; padding: 1.5rem; box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }
  .feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
  .feature-card h3 { margin: .9rem 0 .35rem; font-size: 1.1rem; }
  .feature-card p { color: var(--muted); margin: 0; font-size: .95rem; }
  .ico-badge {
    width: 2.9rem; height: 2.9rem; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--brand-50), color-mix(in srgb, var(--brand-200) 45%, transparent));
    border: 1px solid var(--brand-200); color: var(--brand-600);
  }
  .ico { width: 1.4rem; height: 1.4rem; flex: none; }
  .ico-badge .ico { width: 1.5rem; height: 1.5rem; }

  /* ------------------------------------------------------------- steps */
  .steps-lp { display: grid; gap: 1.6rem 1.25rem; grid-template-columns: minmax(0, 1fr); counter-reset: step; padding-top: 1rem; }
  @media (min-width: 48rem) { .steps-lp { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .step-card {
    position: relative; background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; padding: 1.75rem 1.5rem 1.5rem; box-shadow: var(--shadow-sm);
  }
  .step-card::before {
    counter-increment: step; content: counter(step);
    position: absolute; top: -1rem; left: 1.5rem;
    width: 2.1rem; height: 2.1rem; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700;
    background: linear-gradient(140deg, var(--brand-500), #065f3e); color: #fff;
    box-shadow: 0 6px 16px -6px rgba(11,163,107,.85);
  }
  .step-card h3 { margin: .4rem 0 .35rem; font-size: 1.05rem; }
  .step-card p { margin: 0; color: var(--muted); font-size: .95rem; }

  /* ----------------------------------------------------------- pricing */
  .price-grid { display: grid; gap: .9rem; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 56rem) { .price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; align-items: stretch; } }
  .price-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.5rem;
    box-shadow: var(--shadow-sm); display: grid; gap: .35rem; align-content: start;
  }
  .price-card p { margin: 0; color: var(--muted); font-size: .95rem; }
  .price-card .price-k { font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-600); }
  .price-card .price-v { font-family: var(--display); font-size: 1.35rem; color: var(--ink); letter-spacing: -.02em; margin-bottom: .35rem; }
  .price-card .price-v b { font-size: 2.1rem; font-weight: 800; letter-spacing: -.04em; }
  .price-card.featured {
    color: var(--on-night); border-color: transparent;
    background: radial-gradient(28rem 14rem at 100% 0%, rgb(11 163 107 / .5), transparent 70%), linear-gradient(150deg, var(--night-800), var(--night-700));
    box-shadow: 0 24px 44px -24px rgb(6 19 16 / .75);
  }
  .price-card.featured p { color: var(--on-night-2); }
  .price-card.featured .price-k { color: var(--volt); }
  .price-card.featured .price-v { color: #fff; }

  /* --------------------------------------------------------- use cases */
  .use-grid { display: grid; gap: .9rem; grid-template-columns: minmax(0, 1fr); }
  @media (min-width: 40rem) { .use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 64rem) { .use-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .use-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.35rem; box-shadow: var(--shadow-sm); }
  .use-card .ico { width: 1.6rem; height: 1.6rem; color: var(--brand-600); }
  .use-card h3 { margin: .75rem 0 .35rem; font-size: 1.05rem; }
  .use-card p { margin: 0; color: var(--muted); font-size: .93rem; }

  /* ------------------------------------------------------- comparison */
  .compare { background: var(--surface-3); max-width: none; }
  .compare-table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
  .compare-table th, .compare-table td { padding: .9rem 1.1rem; text-align: left; border-bottom: 1px solid var(--line); }
  .compare-table thead th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .compare-table thead th.us { color: var(--brand-700); background: var(--brand-50); }
  .compare-table td.us { font-weight: 600; background: color-mix(in srgb, var(--brand-50) 60%, transparent); }
  .compare-table tr:last-child td { border-bottom: 0; }
  .yes { color: var(--ok); font-weight: 700; }
  .no { color: var(--muted); }

  /* -------------------------------------------------------- CTA + FAQ */
  .cta-band {
    max-width: none; color: var(--on-night); text-align: center;
    background:
      radial-gradient(52rem 24rem at 50% -18%, rgba(11,163,107,.45), transparent 66%),
      linear-gradient(140deg, var(--night-800), var(--night-700));
  }
  .cta-band h2 { color: #fff; }
  .cta-band .sub { color: var(--on-night-2); }
  .cta-band .cta-row { justify-content: center; }
  .faq-grid { display: grid; gap: .6rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
  @media (min-width: 56rem) { .faq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .faq-grid details {
    background: var(--surface); border: 1px solid var(--line); border-bottom: 1px solid var(--line);
    border-radius: 12px; padding: 1rem 1.15rem; box-shadow: var(--shadow-sm);
  }
  .faq-grid details[open] { border-color: var(--brand-200); }
  .faq-grid summary { list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
  .faq-grid summary::-webkit-details-marker { display: none; }
  .faq-grid summary::after { content: "+"; color: var(--brand-600); font-weight: 700; }
  .faq-grid details[open] summary::after { content: "–"; }
  .faq-grid p { margin: .6rem 0 0; color: var(--muted); font-size: .95rem; }

  /* --------------------------------------------------------- prose SEO */
  .prose { max-width: 46rem; }
  .prose h2 { margin-top: 2.5rem; }
  .prose h3 { margin-top: 1.75rem; }
  .prose p, .prose li { color: var(--ink-2); }
  .prose ul { padding-left: 1.1rem; display: grid; gap: .4rem; }

  /* -------------------------------------------------------- entrances */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .reveal {
        animation: reveal linear both;
        animation-timeline: view();
        animation-range: entry 5% cover 22%;
      }
      @keyframes reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
    }
  }

  /* Phones: the promise and the button first, the illustration after them. */
  @media (max-width: 61.99rem) {
    .device { width: min(14rem, 62%); }
    .hero-visual { margin-top: .5rem; }
  }
  @media (max-width: 39.99rem) {
    .cta-row .button { flex: 1 1 100%; }
    .trust-row { display: grid; gap: .55rem; }
    .compare-table th, .compare-table td { padding: .7rem .75rem; font-size: .88rem; }
    /* Compact cards on phones: icon beside the text, not above it. */
    .feature-card { padding: 1.1rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .9rem; align-items: start; }
    .feature-card > .ico-badge { grid-row: span 2; width: 2.5rem; height: 2.5rem; }
    .feature-card h3 { margin: .15rem 0 .2rem; }
    .use-card { padding: 1.1rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .8rem; }
    .use-card > .ico { grid-row: span 2; margin-top: .1rem; }
    .use-card h3 { margin: 0 0 .2rem; }
    .price-card { padding: 1.25rem; }
  }
  @media (prefers-reduced-motion: reduce) {
    .device, .ping, .sms-pop, .dash, .blink, .chip-track { animation: none !important; }
    .sms-pop { opacity: 1; }
  }
}
