/* QR Teky — marketing landing page.
 *
 * Self-contained on purpose: no CDN, no web fonts, no framework. The whole
 * page is three files so it loads in one round trip on a phone, which is the
 * device most people will arrive on from a scanned code.
 *
 * The palette is lifted from lib/theme/app_palette.dart (Deep Emerald) so the
 * site and the app read as one product.
 */

:root {
  --bg:        #030b0a;
  --bg-2:      #061311;
  --surface:   #0e1817;
  --surface-2: #111b1a;
  --line:      rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);

  --text:   #eaf6f4;
  --muted:  #9db3ac;
  --dim:    #6f8580;

  --accent:   #2ad6b5;   /* scanTint      */
  --accent-2: #11c18d;   /* generateTint  */
  --rose:     #ff6b8a;   /* experienceTint*/
  --blue:     #5c9dff;   /* digiCardTint  */
  --amber:    #e59a43;   /* historyTint   */

  --radius:    18px;
  --radius-lg: 28px;
  --shell:     1140px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.025em; margin: 0; }
p { margin: 0; }
a { color: inherit; }

.shell {
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------
   Ambient background: an aurora that drifts, and a perspective floor
   grid. Both are decorative and sit behind everything at z-index 0.
   --------------------------------------------------------------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.aurora--1 {
  width: 620px; height: 620px;
  top: -260px; left: -160px;
  background: radial-gradient(circle, rgba(42, 214, 181, 0.55), transparent 68%);
  animation: drift-a 26s var(--ease) infinite alternate;
}

.aurora--2 {
  width: 520px; height: 520px;
  top: 120px; right: -200px;
  background: radial-gradient(circle, rgba(92, 157, 255, 0.38), transparent 68%);
  animation: drift-b 32s var(--ease) infinite alternate;
}

.aurora--3 {
  width: 460px; height: 460px;
  top: 1200px; left: 30%;
  background: radial-gradient(circle, rgba(255, 107, 138, 0.28), transparent 70%);
  animation: drift-a 38s var(--ease) infinite alternate-reverse;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(120px, 90px, 0) scale(1.18); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-140px, 60px, 0) scale(0.92); }
}

/* The floor grid is a flat plane rotated back in 3D — the cheapest way to
   give the page real depth without a canvas or a library. */
.grid-floor {
  position: absolute;
  left: 50%;
  bottom: -30vh;
  width: 260vw;
  height: 80vh;
  margin-left: -130vw;
  background-image:
    linear-gradient(rgba(42, 214, 181, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 214, 181, 0.16) 1px, transparent 1px);
  background-size: 70px 70px;
  transform: perspective(340px) rotateX(64deg);
  mask-image: linear-gradient(to top, #000 5%, transparent 72%);
  -webkit-mask-image: linear-gradient(to top, #000 5%, transparent 72%);
  animation: floor-run 9s linear infinite;
  opacity: 0.55;
}

@keyframes floor-run {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 70px, 70px 0; }
}

main, .nav, .foot { position: relative; z-index: 1; }

/* ---------------------------------------------------------------
   Navigation
   --------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(3, 11, 10, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.nav.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(3, 11, 10, 0.9);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 17px;
}

.brand img {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: block;
}

.nav__links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 15px;
}

.nav__links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--text); }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04231d;
  box-shadow: 0 12px 34px -12px rgba(42, 214, 181, 0.8);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px -12px rgba(42, 214, 181, 0.95);
}

.btn--ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}
.btn--ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.07);
}

.btn--sm { padding: 10px 18px; font-size: 15px; }

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */

.hero {
  padding: clamp(48px, 8vw, 96px) 0 clamp(60px, 9vw, 120px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(158, 232, 211, 0.24);
  background: rgba(212, 255, 244, 0.06);
  font-size: 13.5px;
  font-weight: 500;
  color: #c6e8de;
  margin-bottom: 22px;
}

.badge__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(42, 214, 181, 0.7);
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(42, 214, 181, 0.7); }
  70%  { box-shadow: 0 0 0 9px rgba(42, 214, 181, 0); }
  100% { box-shadow: 0 0 0 0 rgba(42, 214, 181, 0); }
}

.hero h1 {
  font-size: clamp(40px, 6.4vw, 72px);
  font-weight: 800;
}

.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent) 0%, #7ef0d6 40%, var(--blue) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 7s linear infinite;
}

@keyframes sheen {
  to { background-position: 220% center; }
}

.hero__lead {
  margin-top: 22px;
  font-size: clamp(17px, 2vw, 19.5px);
  color: var(--muted);
  max-width: 52ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 30px;
  font-size: 14.5px;
  color: var(--dim);
  list-style: none;
  padding: 0;
}

.hero__trust li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero__trust svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

/* ---------------------------------------------------------------
   The 3D stage: a phone, a QR card and a floating chip, all on one
   shared perspective. JS feeds --px/--py from the pointer.
   --------------------------------------------------------------- */

.stage3d {
  position: relative;
  perspective: 1400px;
  perspective-origin: 50% 40%;
  --px: 0;
  --py: 0;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage3d__glow {
  position: absolute;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 214, 181, 0.3), transparent 65%);
  filter: blur(50px);
}

.device {
  position: relative;
  width: 290px;
  flex: none;
  border-radius: 42px;
  padding: 9px;
  background: linear-gradient(155deg, #263634, #0b1413 45%, #1c2b29);
  box-shadow:
    0 60px 120px -40px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.07) inset,
    0 0 70px -30px rgba(42, 214, 181, 0.5);
  transform-style: preserve-3d;
}

.stage3d .device {
  transform:
    rotateY(calc(-16deg + var(--px) * 12deg))
    rotateX(calc(7deg + var(--py) * -9deg));
  transition: transform 0.5s var(--ease);
  animation: hover-bob 7s ease-in-out infinite;
}

@keyframes hover-bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -16px; }
}

.device__screen {
  position: relative;
  border-radius: 34px;
  overflow: hidden;
  background: linear-gradient(180deg, #030b0a, #061311 55%, #040708);
  aspect-ratio: 9 / 19;
  display: flex;
  flex-direction: column;
}

.device__notch {
  position: absolute;
  top: 9px; left: 50%;
  transform: translateX(-50%);
  width: 78px; height: 20px;
  border-radius: 999px;
  background: #05100e;
  z-index: 5;
}

/* Floating satellites around the phone, pushed forward in Z so the
   parallax actually reads as depth rather than a slide. */
.satellite {
  position: absolute;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(14, 24, 23, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  padding: 14px;
  transform: translate3d(calc(var(--px) * -26px), calc(var(--py) * -20px), 90px);
  transition: transform 0.5s var(--ease);
}

.satellite--qr {
  right: -6px;
  bottom: 44px;
  width: 176px;
  text-align: center;
  animation: hover-bob 8.5s ease-in-out infinite 0.6s;
}

.satellite--chip {
  left: -30px;
  top: 62px;
  width: 194px;
  display: flex;
  align-items: center;
  gap: 11px;
  animation: hover-bob 9.5s ease-in-out infinite 1.2s;
}

.satellite__label {
  margin-top: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
}

.satellite__icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(42, 214, 181, 0.14);
  color: var(--accent);
  flex: none;
}
.satellite__icon svg { width: 20px; height: 20px; }

.satellite__text b { display: block; font-size: 14px; }
.satellite__text span { font-size: 12.5px; color: var(--dim); }

/* ---------------------------------------------------------------
   The QR itself. Bands fade in diagonally the first time it is seen,
   then a scan line sweeps it on a loop.
   --------------------------------------------------------------- */

.qr {
  width: 100%;
  display: block;
  border-radius: 10px;
  overflow: hidden;
}

.qr__bg     { fill: #ffffff; }
.qr__finder { fill: #061311; }
.qr__band   { fill: #061311; }

.qr-wrap { position: relative; }

.qr-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, transparent 42%, rgba(42, 214, 181, 0.55) 50%, transparent 58%);
  animation: qr-scan 3.6s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes qr-scan {
  0%, 100% { transform: translateY(-52%); opacity: 0; }
  12%      { opacity: 1; }
  88%      { opacity: 1; }
  50%      { transform: translateY(52%); }
}

.is-in .qr__finder,
.is-in .qr__band {
  animation: qr-in 0.5s var(--ease) both;
}
.is-in .qr__band { animation-delay: calc(0.16s + var(--i) * 0.075s); }

@keyframes qr-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mini-qr { width: 100%; display: block; border-radius: 6px; }

/* ---------------------------------------------------------------
   Recreated app UI, used inside every device frame.
   These are faithful rebuilds of the real screens in HTML/CSS —
   same palette, same copy, so what the page promises is what ships.
   --------------------------------------------------------------- */

.ui {
  flex: 1;
  padding: 34px 13px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  overflow: hidden;
}

.ui__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #eaf6f4;
}

.ui__label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #afbdc0;
}

.ui__hero {
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(135deg, #0a5a4c, #08644d);
  border: 1px solid #1d7d68;
  box-shadow: 0 14px 30px -16px rgba(6, 155, 122, 0.9);
}

.ui__hero b {
  display: block;
  font-size: 15px;
  line-height: 1.2;
  color: #f1f7f6;
  letter-spacing: -0.02em;
}

.ui__hero span {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  color: #a5ccc0;
}

.ui__herobtn {
  margin-top: 9px;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eaf3ef;
  color: #095948;
  font-weight: 700;
  font-size: 10.5px;
}

.ui__tile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 13px;
  padding: 7px 10px;
  background: linear-gradient(160deg, #111b1a, #0d1514);
  border: 1px solid #1e2e2b;
}

.ui__tile-icon {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(42, 214, 181, 0.14);
  color: var(--accent);
}
.ui__tile-icon svg { width: 16px; height: 16px; }

.ui__tile--gen  .ui__tile-icon { background: rgba(17, 193, 141, 0.15); color: #11c18d; }
.ui__tile--hist .ui__tile-icon { background: rgba(229, 154, 67, 0.15);  color: #e59a43; }
.ui__tile--exp  .ui__tile-icon { background: rgba(255, 107, 138, 0.15); color: #ff6b8a; }
.ui__tile--card .ui__tile-icon { background: rgba(92, 157, 255, 0.15);  color: #5c9dff; }

.ui__tile-text b {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #f2f5f6;
  letter-spacing: -0.01em;
}
.ui__tile-text span { font-size: 9.5px; color: #a8b6c6; }

.ui__chev {
  margin-left: auto;
  width: 20px; height: 20px;
  border-radius: 7px;
  background: #1a2627;
  color: #82979f;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 10px;
}

.ui__privacy {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 12px;
  padding: 9px;
  background: #101a1a;
  border: 1px solid #1e2f2c;
  color: #b7c9c5;
  font-size: 9.5px;
  line-height: 1.35;
}

.ui__privacy .ui__tile-icon {
  width: 26px; height: 26px;
  background: #143932;
  color: #40cba6;
}

/* QR Studio variant */

.ui__preview {
  border-radius: 16px;
  padding: 16px;
  background: #101a1a;
  border: 1px solid #1e2f2c;
  display: grid;
  place-items: center;
}
.ui__preview .mini-qr { width: 108px; }

.ui__tabs {
  display: flex;
  gap: 5px;
  font-size: 9.5px;
}

.ui__tab {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #1e2e2b;
  color: #a8b6c6;
}
.ui__tab[data-on] {
  background: rgba(42, 214, 181, 0.16);
  border-color: rgba(42, 214, 181, 0.4);
  color: #7ef0d6;
  font-weight: 600;
}

.ui__swatches { display: flex; gap: 7px; }

.ui__swatch {
  width: 26px; height: 26px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.ui__swatch[data-on] { outline: 2px solid var(--accent); outline-offset: 2px; }

.ui__slider {
  height: 5px;
  border-radius: 999px;
  background: #1a2627;
  position: relative;
}
.ui__slider::after {
  content: "";
  position: absolute;
  inset: 0 38% 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}
.ui__slider::before {
  content: "";
  position: absolute;
  left: 62%; top: 50%;
  width: 13px; height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: #eaf3ef;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

/* Secret Letter lock screen — Midnight Rose, mirroring experience.css */

.ui--letter {
  background: linear-gradient(180deg, #1b0d18, #120a13 60%, #0d0710);
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 44px 20px 22px;
}

.ui--letter .seal {
  width: 62px; height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: radial-gradient(circle at 32% 28%, #ff4d6d, #93213c);
  box-shadow: 0 14px 34px -12px rgba(255, 77, 109, 0.95);
  animation: seal-beat 3.4s ease-in-out infinite;
}

@keyframes seal-beat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}

.ui--letter .prompt {
  font-size: 13px;
  font-weight: 600;
  color: #fce4ec;
  letter-spacing: -0.01em;
}

.ui--letter .field {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(252, 228, 236, 0.22);
  background: rgba(252, 228, 236, 0.06);
  padding: 10px;
  color: #ff4d6d;
  letter-spacing: 0.4em;
  font-size: 13px;
}

.ui--letter .unlock {
  width: 100%;
  border-radius: 999px;
  padding: 9px;
  background: #ff4d6d;
  color: #2a0713;
  font-weight: 700;
  font-size: 11.5px;
}

.ui--letter .hint {
  font-size: 9.5px;
  color: rgba(252, 228, 236, 0.5);
  line-height: 1.4;
}

/* DigiCard screen */

.ui--card { background: linear-gradient(180deg, #061a2e, #03101d 60%, #020a12); }

.ui__avatar {
  width: 58px; height: 58px;
  border-radius: 50%;
  margin: 6px auto 0;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 700;
  color: #0a2340;
  background: linear-gradient(135deg, #8fc0ff, #5c9dff);
  box-shadow: 0 14px 30px -14px rgba(92, 157, 255, 0.95);
}

.ui__person { text-align: center; }
.ui__person b { display: block; font-size: 13.5px; letter-spacing: -0.02em; }
.ui__person span { font-size: 10px; color: #8fb0d6; }

.ui__row {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(92, 157, 255, 0.08);
  border: 1px solid rgba(92, 157, 255, 0.18);
  font-size: 10px;
  color: #cfe2ff;
}
.ui__row svg { width: 14px; height: 14px; color: #5c9dff; flex: none; }

.ui__nfc {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 9px;
  background: rgba(92, 157, 255, 0.16);
  border: 1px solid rgba(92, 157, 255, 0.35);
  color: #cfe2ff;
  font-size: 10.5px;
  font-weight: 600;
}

/* Scanner screen */

.ui--scan {
  background: #04100e;
  padding: 38px 15px 15px;
  position: relative;
}

.ui__viewfinder {
  position: relative;
  flex: 1;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(42, 214, 181, 0.08), transparent 60%),
    repeating-linear-gradient(45deg, #08201c 0 8px, #061916 8px 16px);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.ui__reticle {
  width: 62%;
  aspect-ratio: 1;
  position: relative;
}

.ui__reticle span {
  position: absolute;
  width: 24px; height: 24px;
  border: 2.5px solid var(--accent);
}
.ui__reticle span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.ui__reticle span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.ui__reticle span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.ui__reticle span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }

.ui__scanline {
  position: absolute;
  left: 8%; right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 16px 3px rgba(42, 214, 181, 0.7);
  animation: scanline 2.8s ease-in-out infinite;
}

@keyframes scanline {
  0%, 100% { top: 22%; }
  50%      { top: 78%; }
}

.ui__sheet {
  margin-top: 11px;
  border-radius: 14px;
  padding: 11px;
  background: #101a1a;
  border: 1px solid #1e2f2c;
}
.ui__sheet b { font-size: 11px; }
.ui__sheet p { font-size: 9.5px; color: #a8b6c6; word-break: break-all; margin-top: 3px; }

.ui__sheetbtns { display: flex; gap: 6px; margin-top: 9px; }
.ui__sheetbtns span {
  flex: 1;
  text-align: center;
  border-radius: 999px;
  padding: 6px;
  font-size: 9.5px;
  font-weight: 600;
  background: rgba(42, 214, 181, 0.16);
  color: #7ef0d6;
}
.ui__sheetbtns span:last-child { background: #1a2627; color: #a8b6c6; }

/* ---------------------------------------------------------------
   Sections
   --------------------------------------------------------------- */

section { padding: clamp(64px, 9vw, 118px) 0; }

/* Landing on /guides must not park the heading under the sticky nav. */
section[id] { scroll-margin-top: 84px; }

.sec-head { max-width: 660px; margin-bottom: clamp(36px, 5vw, 58px); }

.sec-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.sec-head h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 800;
}

.sec-head p {
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 18px);
}

/* ---------------------------------------------------------------
   Feature cards — tilt toward the pointer, glow in their own tint.
   --------------------------------------------------------------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(17, 27, 26, 0.9), rgba(9, 17, 16, 0.85));
  padding: 28px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s;
  --tint: var(--accent);
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%),
              color-mix(in srgb, var(--tint) 22%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.card:hover {
  border-color: color-mix(in srgb, var(--tint) 42%, transparent);
  box-shadow: 0 30px 70px -40px color-mix(in srgb, var(--tint) 80%, transparent);
}
.card:hover::before { opacity: 1; }

.card__icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--tint) 15%, transparent);
  color: var(--tint);
  margin-bottom: 20px;
  transform: translateZ(30px);
}
.card__icon svg { width: 24px; height: 24px; }

.card h3 {
  font-size: 20px;
  font-weight: 700;
  transform: translateZ(18px);
}

.card p {
  margin-top: 11px;
  color: var(--muted);
  font-size: 15.5px;
  transform: translateZ(10px);
}

.card__meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
}

.card--scan { --tint: var(--accent); }
.card--gen  { --tint: var(--accent-2); }
.card--hist { --tint: var(--amber); }
.card--exp  { --tint: var(--rose); }
.card--card { --tint: var(--blue); }
.card--nfc  { --tint: #a78bfa; }

/* ---------------------------------------------------------------
   Showcase rows
   --------------------------------------------------------------- */

.show {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
  margin-bottom: clamp(60px, 8vw, 110px);
}

.show:last-child { margin-bottom: 0; }

.show--flip .show__art { order: -1; }

.show__art {
  display: flex;
  justify-content: center;
  perspective: 1300px;
}

.show__art .device {
  width: 268px;
  transform: rotateY(var(--ry, -14deg)) rotateX(5deg);
  transition: transform 0.6s var(--ease);
}
.show--flip .show__art .device { --ry: 14deg; }
.show__art .device:hover { transform: rotateY(0deg) rotateX(0deg) scale(1.03); }

.show h3 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.show p { margin-top: 16px; color: var(--muted); }

.show ul {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.show li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 15.5px;
  color: var(--muted);
}

.show li svg {
  width: 19px; height: 19px;
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

/* ---------------------------------------------------------------
   Live Secret Letter demo
   --------------------------------------------------------------- */

.demo {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 107, 138, 0.22);
  background:
    radial-gradient(700px circle at 20% 0%, rgba(255, 107, 138, 0.14), transparent 60%),
    linear-gradient(160deg, rgba(27, 13, 24, 0.9), rgba(12, 8, 13, 0.92));
  padding: clamp(26px, 4vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 54px);
  align-items: center;
}

.demo__panel {
  border-radius: 22px;
  border: 1px solid rgba(252, 228, 236, 0.16);
  background: rgba(18, 10, 19, 0.85);
  padding: 26px;
  min-height: 290px;
  display: grid;
  place-items: center;
  text-align: center;
}

.demo__lock { display: grid; justify-items: center; gap: 14px; width: 100%; }

.demo__seal {
  width: 74px; height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: radial-gradient(circle at 32% 28%, #ff4d6d, #93213c);
  box-shadow: 0 18px 44px -14px rgba(255, 77, 109, 0.9);
  animation: seal-beat 3.4s ease-in-out infinite;
}

.demo__prompt { font-size: 18px; font-weight: 700; color: #fce4ec; }

.demo__form { display: flex; gap: 9px; width: 100%; max-width: 330px; }

.demo__input {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(252, 228, 236, 0.24);
  background: rgba(252, 228, 236, 0.06);
  padding: 12px 15px;
  color: #fce4ec;
  font: inherit;
  font-size: 16px;
  letter-spacing: 0.18em;
}
.demo__input::placeholder { color: rgba(252, 228, 236, 0.35); letter-spacing: normal; }
.demo__input:focus { outline: 2px solid #ff4d6d; outline-offset: 1px; }

.demo__go {
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  background: #ff4d6d;
  color: #2a0713;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.demo__go:hover { transform: translateY(-2px); }

.demo__error {
  font-size: 14px;
  color: #ff90a6;
  min-height: 21px;
}

.is-wrong { animation: shake 0.42s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-9px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}

.demo__letter {
  display: none;
  text-align: left;
  width: 100%;
  font-size: 17px;
  line-height: 1.75;
  color: #fce4ec;
  white-space: pre-wrap;
  min-height: 200px;
}

.demo__letter .caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: #ff4d6d;
  vertical-align: -0.16em;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.demo__sign {
  display: block;
  margin-top: 18px;
  font-size: 14px;
  color: rgba(252, 228, 236, 0.6);
}

/* `display: block` above would otherwise beat the UA's [hidden] rule and
   reveal the sign-off before the letter has finished typing. */
.demo__sign[hidden] { display: none; }

.demo[data-open] .demo__lock { display: none; }
.demo[data-open] .demo__letter { display: block; }

/* The lock screen is centred; an opened letter reads from the top-left. */
.demo[data-open] .demo__panel {
  place-items: start stretch;
  text-align: left;
}

.demo__note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--dim);
}

.demo__note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255, 107, 138, 0.16);
  color: #ffb3c2;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13.5px;
}

/* ---------------------------------------------------------------
   Guides
   --------------------------------------------------------------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 30px;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 11px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.tab:hover { color: var(--text); transform: translateY(-1px); }

.tab[aria-selected="true"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #04231d;
}

.steps { display: none; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.steps[data-on] { display: grid; animation: step-in 0.5s var(--ease) both; }

@keyframes step-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.step {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(14, 24, 23, 0.7);
  padding: 24px;
}

.step__n {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #04231d;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin-bottom: 15px;
}

.step h4 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.step p { margin-top: 8px; color: var(--muted); font-size: 15px; }

/* ---------------------------------------------------------------
   FAQ — plain <details>, no JavaScript involved.
   --------------------------------------------------------------- */

.faq {
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.faq__item {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(14, 24, 23, 0.7);
  overflow: hidden;
  transition: border-color 0.25s, background 0.25s;
}

.faq__item:hover { border-color: rgba(42, 214, 181, 0.32); }

.faq__item[open] {
  border-color: rgba(42, 214, 181, 0.35);
  background: rgba(17, 27, 26, 0.9);
}

.faq__item summary {
  cursor: pointer;
  padding: 20px 54px 20px 22px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  position: relative;
  list-style: none;
}

.faq__item summary::-webkit-details-marker { display: none; }

/* The chevron rotates to a minus when the answer is open. */
.faq__item summary::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease);
}

.faq__item[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.faq__item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.faq__a {
  padding: 0 24px 22px;
  animation: faq-in 0.35s var(--ease) both;
}

.faq__a p {
  color: var(--muted);
  font-size: 15.5px;
  max-width: 68ch;
}

@keyframes faq-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------
   Security rail
   --------------------------------------------------------------- */

.secure {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(800px circle at 80% 0%, rgba(42, 214, 181, 0.12), transparent 60%),
    linear-gradient(160deg, rgba(14, 24, 23, 0.92), rgba(6, 12, 11, 0.92));
  padding: clamp(28px, 4vw, 54px);
}

.rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-top: 34px;
  counter-reset: rail;
}

.rail__item {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  padding: 22px;
}

.rail__item::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  width: 10px; height: 10px;
  border-top: 2px solid rgba(42, 214, 181, 0.5);
  border-right: 2px solid rgba(42, 214, 181, 0.5);
  transform: translateY(-50%) rotate(45deg);
}
.rail__item:last-child::after { display: none; }

.rail__icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(42, 214, 181, 0.14);
  color: var(--accent);
  margin-bottom: 14px;
}
.rail__icon svg { width: 20px; height: 20px; }

.rail__item b { font-size: 16px; display: block; }
.rail__item p { margin-top: 7px; font-size: 14.5px; color: var(--muted); }

.secure__foot {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  font-size: 14.5px;
  color: var(--dim);
}

.secure__foot b { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------
   Download CTA
   --------------------------------------------------------------- */

.cta {
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(42, 214, 181, 0.24);
  background:
    radial-gradient(600px circle at 50% 0%, rgba(42, 214, 181, 0.18), transparent 62%),
    linear-gradient(160deg, rgba(14, 24, 23, 0.92), rgba(5, 12, 11, 0.94));
  padding: clamp(40px, 6vw, 76px) clamp(20px, 4vw, 60px);
}

/* A slow 3D tumble on the real launcher icon. */
.coin {
  width: 96px;
  height: 96px;
  margin: 0 auto 26px;
  perspective: 700px;
}

.coin img {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  display: block;
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.9);
  animation: tumble 9s var(--ease) infinite;
  transform-style: preserve-3d;
}

@keyframes tumble {
  0%, 62%  { transform: rotateY(0deg); }
  80%      { transform: rotateY(360deg); }
  100%     { transform: rotateY(360deg); }
}

.cta h2 { font-size: clamp(30px, 4.6vw, 48px); font-weight: 800; }
.cta p { margin: 16px auto 0; color: var(--muted); max-width: 46ch; }

.cta__row {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

.cta__qr {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 18px 12px 12px;
  text-align: left;
}

/* 41 modules plus a quiet zone: below ~110px a phone camera struggles. */
.cta__qr .qr-wrap { width: 116px; flex: none; }
.cta__qr b { display: block; font-size: 14.5px; }
.cta__qr span { font-size: 13px; color: var(--dim); }

.cta__meta {
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--dim);
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 38px 0;
  color: var(--dim);
  font-size: 14.5px;
}

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
}

/* House credit: brighter than the surrounding footer text, underlined on
   hover so it is unmistakably a link. */
.powered {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color 0.2s, color 0.2s;
}

.powered:hover { border-bottom-color: currentColor; }

.foot__links { display: flex; flex-wrap: wrap; gap: 22px; margin-left: auto; }
.foot__links a { text-decoration: none; transition: color 0.2s; }
.foot__links a:hover { color: var(--text); }

/* ---------------------------------------------------------------
   Consent bar
   --------------------------------------------------------------- */

.consent {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 60;
  width: min(100% - 32px, 680px);
  transform: translate(-50%, calc(100% + 32px));
  transition: transform 0.42s var(--ease), opacity 0.42s var(--ease);
  opacity: 0;
}

.consent.is-up { transform: translate(-50%, 0); opacity: 1; }

.consent__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(42, 214, 181, 0.28);
  background: rgba(9, 17, 16, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.95);
}

.consent__text b { display: block; font-size: 15.5px; margin-bottom: 4px; }

.consent__text p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.consent__actions {
  display: flex;
  gap: 9px;
  flex: none;
}

/* A footer control that has to look like the links beside it. */
.foot__link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.2s;
}

.foot__link-btn:hover { color: var(--text); }

@media (max-width: 620px) {
  .consent__inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .consent__actions button { flex: 1; }
}

/* ---------------------------------------------------------------
   Scroll reveal
   --------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0s);
}

.reveal.is-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */

@media (max-width: 940px) {
  .hero__grid,
  .show,
  .demo { grid-template-columns: 1fr; }

  .show--flip .show__art { order: 0; }
  .nav__links { display: none; }
  .stage3d { min-height: 520px; }

  /* Narrower viewport, shorter parallax throw: at the full 26px the chip
     slides past the left edge of the page when the pointer is far right. */
  .satellite {
    transform: translate3d(calc(var(--px) * -10px), calc(var(--py) * -8px), 60px);
  }

  .satellite--chip { left: 12px; }
  .satellite--qr { right: -12px; }
  .rail__item::after { display: none; }
}

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

  /* The mockups keep their full width here on purpose: shrinking the frame
     reflows the recreated app UI (tile labels wrap onto two lines) and the
     screen no longer matches what the app actually looks like. */
  .show__art .device { width: 290px; }
  .satellite--chip { display: none; }

  /* Tucked into the bottom corner so it overlaps the frame, not the
     screen content behind it. */
  .satellite--qr { width: 132px; bottom: -14px; right: -10px; }
  .demo__form { flex-direction: column; }
  .foot__links { margin-left: 0; }
}

/* ---------------------------------------------------------------
   Motion preferences: keep the layout, drop the movement.
   --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal { opacity: 1; transform: none; }
  .stage3d .device,
  .show__art .device { transform: none; }
  .satellite { transform: none; }
  .grid-floor { display: none; }
}
