/* ============================================================================
   Scanly — landing page
   Palette and type are derived from the app icon: navy document, cyan arrow,
   white tile with a soft halo.
   ========================================================================== */

:root {
  /* Colour */
  --ink:        #0A1633;   /* headings, near-black navy */
  --ink-soft:   #33415F;   /* body text */
  --slate:      #64748B;   /* captions, meta */
  --doc:        #1B3FA0;   /* document blue from the mark */
  --cyan:       #2FA8E0;   /* arrow / accent */
  --halo:       #8FD8F7;   /* glow */
  --mist:       #EEF3FA;   /* page background */
  --paper:      #FFFFFF;
  --line:       #DBE4F0;

  /* Type */
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body:    'Instrument Sans', system-ui, -apple-system, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;

  /* Rhythm */
  --shell: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(72px, 10vw, 128px);
  --radius: 18px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

::selection { background: var(--halo); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  transition: top .18s ease;
}
.skip-link:focus { top: 16px; }

/* ── Shared type ─────────────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 14px;
}

.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1.14;
  letter-spacing: -.025em;
  color: var(--ink);
  margin: 0 0 18px;
  text-wrap: balance;
}

.section { padding-block: var(--section-y); }

.section-head {
  max-width: 46ch;
  margin-bottom: clamp(36px, 5vw, 56px);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 16px;
  padding: 14px 26px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 22px rgba(10, 22, 51, .18);
}
.btn-primary:hover {
  background: var(--doc);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(27, 63, 160, .28);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  background: var(--paper);
  transform: translateY(-2px);
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(238, 243, 250, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(238, 243, 250, .94);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -.03em;
  color: var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  position: relative;
  padding-block: 4px;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

/* Language switcher */
.lang {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.lang-btn {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--slate);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active {
  background: var(--ink);
  color: #fff;
}

.menu-toggle {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  cursor: pointer;
  padding: 0;
}
/* Absolute bars share one centre point, so the open state crosses cleanly */
.menu-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 2px;
  margin-left: -8.5px;
  margin-top: -1px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .22s ease;
}
.menu-bar:first-of-type { transform: translateY(-3.5px); }
.menu-bar:last-of-type  { transform: translateY(3.5px); }

.menu-toggle[aria-expanded='true'] .menu-bar:first-of-type { transform: rotate(45deg); }
.menu-toggle[aria-expanded='true'] .menu-bar:last-of-type  { transform: rotate(-45deg); }

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  padding-block: clamp(44px, 6vw, 80px) clamp(28px, 4vw, 48px);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -40% 0 auto 0;
  height: 720px;
  background: radial-gradient(50% 50% at 72% 58%, rgba(47,168,224,.16), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.3rem, 5.6vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  color: var(--ink);
  margin: 0 0 20px;
  text-wrap: balance;
}

.hero-body {
  font-size: clamp(1.02rem, 1.6vw, 1.16rem);
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-note {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--slate);
  margin: 18px 0 0;
}

/* ── Signature: capture frame ────────────────────────────────────────────── */

.hero-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding-block: 18px;
}

.stage-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -54%);
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143,216,247,.45), transparent 68%);
  filter: blur(14px);
  pointer-events: none;
}

.capture {
  position: relative;
  width: min(268px, 74vw);
  aspect-ratio: 5 / 7;
}

/* The brackets are the device: they're what an edge detector draws. */
.bracket {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid var(--cyan);
  opacity: 0;
  animation: bracket-in .5s cubic-bezier(.22,1,.36,1) forwards;
}
.bracket.tl { top: -14px; left: -14px;  border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; animation-delay: .15s; }
.bracket.tr { top: -14px; right: -14px; border-left: 0;  border-bottom: 0; border-radius: 0 6px 0 0; animation-delay: .25s; }
.bracket.bl { bottom: -14px; left: -14px;  border-right: 0; border-top: 0; border-radius: 0 0 0 6px; animation-delay: .35s; }
.bracket.br { bottom: -14px; right: -14px; border-left: 0;  border-top: 0; border-radius: 0 0 6px 0; animation-delay: .45s; }

@keyframes bracket-in {
  from { opacity: 0; transform: scale(1.7); }
  to   { opacity: 1; transform: scale(1); }
}

.doc {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 26px 60px rgba(10,22,51,.16), 0 2px 6px rgba(10,22,51,.06);
  padding: 26px 22px;
  overflow: hidden;
  opacity: 0;
  animation: doc-in .6s ease forwards .1s;
}
@keyframes doc-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.doc-fold {
  position: absolute;
  top: 0; right: 0;
  width: 40px; height: 40px;
  background: linear-gradient(225deg, var(--mist) 50%, transparent 50%);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.doc-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.doc-photo {
  flex-shrink: 0;
  width: 58px;
  height: 72px;
  border-radius: 6px;
  background: linear-gradient(160deg, #DCE7F5, #BFD2EB);
  border: 1px solid var(--line);
}

/* Portrait silhouette, so the block reads as a photo rather than a placeholder */
.doc-photo::after {
  content: '';
  display: block;
  width: 22px;
  height: 34px;
  margin: 22px auto 0;
  border-radius: 11px 11px 3px 3px;
  background: rgba(27, 63, 160, .17);
}

.doc-fields {
  display: grid;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.doc-line {
  height: 7px;
  border-radius: 4px;
  background: #E4EBF5;
}
.doc-line.w85 { width: 85%; }
.doc-line.w80 { width: 80%; }
.doc-line.w70 { width: 70%; }
.doc-line.w65 { width: 65%; }
.doc-line.w55 { width: 55%; }
.doc-line.w50 { width: 50%; }
.doc-line.w40 { width: 40%; }
.doc-line.accent { background: var(--doc); opacity: .26; }

.doc-rule {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.doc-mrz {
  position: absolute;
  left: 22px; right: 22px; bottom: 22px;
  display: grid;
  gap: 6px;
}
.doc-mrz span {
  height: 7px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, #CBD8EA 0 7px, transparent 7px 11px);
}
.doc-mrz span:last-child { width: 82%; }

.scanbeam {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 16px 5px rgba(47,168,224,.35);
  animation: sweep 2.6s cubic-bezier(.45,0,.55,1) .7s 2 forwards;
  opacity: 0;
}
@keyframes sweep {
  0%   { top: 0;    opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.lock-badge {
  position: absolute;
  right: -18px;
  bottom: 26px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 26px rgba(10,22,51,.3);
  opacity: 0;
  animation: lock-in .5s cubic-bezier(.22,1.4,.4,1) forwards 1.9s;
}
@keyframes lock-in {
  from { opacity: 0; transform: scale(.4) rotate(-12deg); }
  to   { opacity: 1; transform: none; }
}

.stage-caption {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .05em;
  color: var(--slate);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 999px;
  margin: 0;
  opacity: 0;
  animation: fade-up .5s ease forwards 1.1s;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(47,168,224,.6);
  animation: pulse 2.4s ease-out infinite 2s;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(47,168,224,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(47,168,224,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,168,224,0); }
}

/* ── Feature cards ───────────────────────────────────────────────────────── */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px 26px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #C2D6EC;
  box-shadow: 0 16px 36px rgba(10,22,51,.09);
}

/* Echo of the hero brackets, quiet until hover */
.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--cyan);
  opacity: 0;
  transition: opacity .22s ease;
}
.card::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.card::after  { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.card:hover::before,
.card:hover::after { opacity: .75; }

.card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(47,168,224,.11);
  color: var(--doc);
  margin-bottom: 18px;
}

.card-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 8px;
}

.card-body {
  font-size: 14.8px;
  line-height: 1.6;
  color: var(--slate);
  margin: 0;
}

/* ── Privacy ─────────────────────────────────────────────────────────────── */

.privacy {
  background: var(--paper);
  border-block: 1px solid var(--line);
}

.privacy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.privacy-body {
  font-size: 1.02rem;
  max-width: 52ch;
  margin: 0;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px 18px;
  font-size: 15px;
  color: var(--ink);
}
.checklist svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--cyan);
}

/* ── Download CTA ────────────────────────────────────────────────────────── */

.cta {
  background:
    radial-gradient(60% 90% at 50% 0%, rgba(47,168,224,.22), transparent 62%),
    var(--ink);
  color: #fff;
  text-align: center;
}

.cta-inner {
  display: grid;
  justify-items: center;
}

.cta-mark {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 22px;
  filter: drop-shadow(0 0 22px rgba(143,216,247,.45));
}

.cta-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #fff;
  margin: 0 0 12px;
  text-wrap: balance;
}

.cta-body {
  color: #A9BCDC;
  margin: 0 0 32px;
  font-size: 1.02rem;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 22px;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform .16s ease, box-shadow .2s ease;
}
.store-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
}
.store-btn svg { flex-shrink: 0; }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--mist);
  padding-block: 46px 26px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand img { width: 30px; height: 30px; object-fit: contain; }
.footer-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}
.footer-tagline {
  font-size: 13.5px;
  color: var(--slate);
  margin: 2px 0 0;
}

.footer-links {
  display: flex;
  gap: 26px;
}
.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14.5px;
}
.footer-links a:hover { color: var(--cyan); }

.footer-legal {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.footer-legal p {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
  margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* 4 cards across only when there's room; otherwise 2x2 beats an orphan row */
@media (min-width: 721px) and (max-width: 1040px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero-grid,
  .privacy-grid {
    grid-template-columns: 1fr;
  }
  .hero-grid { gap: 52px; }
  .hero-stage { order: -1; min-height: 340px; }
  .hero-body { max-width: none; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .menu-toggle { display: block; }

  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    box-shadow: 0 18px 40px rgba(10,22,51,.1);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav a {
    padding: 14px 2px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }
  .nav a::after { display: none; }

  .lang { align-self: flex-start; margin-top: 16px; }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .stores { flex-direction: column; align-items: stretch; }
  .store-btn { justify-content: center; }
}

/* ── Motion preferences ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .bracket, .doc, .lock-badge, .stage-caption { opacity: 1; }
  .scanbeam { display: none; }
}
