/* Aegis website. Colors follow the app's Theme.kt. */
:root {
  --bg: #050506;
  --bg-raised: #0b0b0d;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-3: #232327;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-2: #9a9aa2;
  --text-3: #5e5e66;
  --cream: #efe7de;
  --mint: #7adba9;
  --ice: #8ccbff;
  --warn: #f2b65a;
  --titanium: linear-gradient(135deg, #fafafc 0%, #c9c9cf 40%, #9c9ca4 70%, #e6e6ea 100%);
  --radius: 28px;
  --radius-sm: 18px;
  --max: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }
p { margin: 0; }

/* ---------- strip + nav ---------- */
.strip {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px var(--gutter);
  font-size: 13px; color: var(--text-2); text-align: center;
  background: var(--bg-raised); border-bottom: 1px solid var(--line);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; box-shadow: 0 0 10px var(--warn); }

.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  padding: 14px var(--gutter);
  background: rgba(5, 5, 6, 0.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 20px; letter-spacing: 0.01em; }
.brand img { width: 46px; height: auto; }
.brand span { background: var(--titanium); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 28px; margin-left: auto; font-size: 15px; color: var(--text-2); }
.nav-links a:hover { color: var(--text); }
.menu { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 600; font-size: 16px; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, border-color .2s;
}
.btn:active { transform: scale(0.97); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-light { background: var(--titanium); color: #0a0a0b; }
.btn-light:hover { filter: brightness(1.06); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: rgba(255,255,255,.35); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.cta-row.center { justify-content: center; }

/* ---------- type helpers ---------- */
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); margin-bottom: 16px; }
.eyebrow-mint { color: var(--mint); }
h1 { font-size: clamp(44px, 7.4vw, 96px); letter-spacing: -0.035em; }
h2 { font-size: clamp(34px, 5vw, 64px); letter-spacing: -0.03em; }
h3 { font-size: clamp(22px, 2.2vw, 28px); }
h4 { font-size: 18px; letter-spacing: -0.01em; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); max-width: 560px; margin-top: 24px; }
.sub { font-size: clamp(16px, 1.4vw, 19px); color: var(--text-2); margin-top: 16px; max-width: 640px; }
.muted { color: var(--text-2); font-size: 14px; margin-top: 12px; }
.tag { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--mint); background: rgba(122, 219, 169, .1); vertical-align: 2px; }

/* ---------- layout ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 11vw, 140px) var(--gutter) 0; }
.section-head { margin-bottom: clamp(36px, 5vw, 64px); }
.section-head.center { text-align: center; }
.section-head.center .sub { margin-left: auto; margin-right: auto; }

/* ---------- asset slots ---------- */
.asset {
  position: relative; width: 100%;
  aspect-ratio: var(--ratio, 16/9);
  border-radius: inherit; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1b1b20 0%, #0d0d10 60%, #08080a 100%);
}
.asset > img, .asset > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.asset.is-empty {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1px dashed var(--line-2);
}
.asset.is-empty::after {
  content: attr(data-label) "\A" attr(data-src);
  white-space: pre-line; padding: 20px;
  font-size: 13px; line-height: 1.6; color: var(--text-3);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--gutter) 0;
  text-align: center;
}
.hero-copy { display: flex; flex-direction: column; align-items: center; }
.hero h1 { background: linear-gradient(180deg, #fff 30%, #a8a8b0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.hero .lede { margin-left: auto; margin-right: auto; }
.hero .cta-row { justify-content: center; }
.hero-media { margin-top: clamp(48px, 7vw, 88px); border-radius: var(--radius); position: relative; }
.hero-media::before {
  content: ""; position: absolute; inset: -12% -8% auto; height: 70%; z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(140, 203, 255, .12), transparent 70%);
  filter: blur(20px);
}

/* ---------- feature grid ---------- */
.grid-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform .5s var(--ease), border-color .3s;
}
.feature:hover { border-color: var(--line-2); }
.feature .asset { border-radius: 0; flex: 1 1 auto; aspect-ratio: auto; min-height: clamp(300px, 30vw, 400px); }
.feature.f-wide { grid-column: span 2; }
.feature-copy { padding: 26px 28px 30px; }
.feature-copy p { color: var(--text-2); margin-top: 10px; font-size: 16px; }
.feature .asset > img { transition: transform 1.2s var(--ease); }
.feature:hover .asset > img { transform: scale(1.035); }

/* ---------- how it works ---------- */
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.step {
  display: flex; gap: 18px; padding: 20px 22px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; outline: none;
  transition: background .3s, border-color .3s, opacity .3s;
  opacity: .45;
}
.step:hover, .step:focus-visible { opacity: .8; }
.step.is-active { opacity: 1; background: var(--surface); border-color: var(--line); }
.step-n {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--text-2);
}
.step.is-active .step-n { background: var(--titanium); color: #0a0a0b; border-color: transparent; }
.step p { color: var(--text-2); font-size: 15px; margin-top: 6px; }
.step .bar { display: block; height: 2px; margin-top: 14px; background: var(--line); border-radius: 2px; overflow: hidden; }
.step .bar::after { content: ""; display: block; height: 100%; width: 0; background: var(--text); }
.step.is-active .bar::after { animation: fill var(--dur, 3.6s) linear forwards; }
@keyframes fill { to { width: 100%; } }

.demo {
  position: relative; height: 560px; border-radius: var(--radius);
  background: radial-gradient(70% 60% at 50% 40%, #16161b, #08080a 75%);
  border: 1px solid var(--line); overflow: hidden;
}
.demo-phone {
  position: absolute; left: 50%; top: 50%; width: 236px; height: 480px;
  transform: translate(-50%, -50%);
  border-radius: 40px; background: #0a0a0c;
  border: 6px solid #1d1d22; box-shadow: 0 30px 80px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.06);
  z-index: 2;
}
.dp-notch { position: absolute; top: 12px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #000; box-shadow: 0 0 0 2px #151518; }
.dp-screen { position: absolute; inset: 0; border-radius: 34px; overflow: hidden; background: linear-gradient(180deg, #121215, #070708); }
.dp-s {
  position: absolute; inset: 0; padding: 70px 22px 30px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px;
  opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.demo[data-stage="0"] .dp-s0, .demo[data-stage="1"] .dp-s1, .demo[data-stage="2"] .dp-s2, .demo[data-stage="3"] .dp-s3 { opacity: 1; transform: none; }
.dp-label { font-size: 15px; font-weight: 500; }
.dp-amount { font-size: 46px; font-weight: 600; letter-spacing: -0.03em; }
.dp-amount small { font-size: 18px; color: var(--text-2); font-weight: 500; }
.dp-to { color: var(--text-2); font-size: 14px; }
.dp-hint { color: var(--text-2); font-size: 13px; }
.dp-btn { margin-top: 26px; width: 100%; padding: 12px; border-radius: 999px; background: var(--titanium); color: #0a0a0b; font-weight: 600; font-size: 14px; }
.ripple { position: relative; width: 120px; height: 120px; margin-bottom: 10px; }
.ripple i { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--ice); opacity: 0; animation: ripple 2.1s var(--ease) infinite; }
.ripple i:nth-child(2) { animation-delay: .7s; }
.ripple i:nth-child(3) { animation-delay: 1.4s; }
@keyframes ripple { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.fp { width: 76px; height: 76px; color: var(--ice); margin-bottom: 12px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { filter: drop-shadow(0 0 14px rgba(140,203,255,.7)); transform: scale(1.04); } }
.check { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: rgba(122,219,169,.12); color: var(--mint); margin-bottom: 12px; }
.check svg { width: 40px; height: 40px; }
.demo[data-stage="3"] .check svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .6s .2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.demo-card {
  position: absolute; left: 50%; top: 50%; width: 300px; height: 189px;
  border-radius: 18px; padding: 20px 22px;
  background: linear-gradient(135deg, #3a3a42, #1c1c21 45%, #2a2a31);
  box-shadow: 0 30px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.12);
  transform: translate(-8%, -62%) rotate(-8deg);
  transition: transform 1s var(--ease), opacity .6s;
  z-index: 1;
}
.demo-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, rgba(255,255,255,.14), transparent 45%, rgba(255,255,255,.05)); pointer-events: none; }
.demo[data-stage="1"] .demo-card { transform: translate(-50%, 38%) rotate(0deg); z-index: 3; }
.dp-s1 { justify-content: flex-start; padding-top: 96px; }
.demo[data-stage="2"] .demo-card, .demo[data-stage="3"] .demo-card { transform: translate(-8%, -62%) rotate(-8deg); opacity: .5; }
.dc-top { display: flex; justify-content: space-between; align-items: center; }
.dc-top img { width: 52px; }
.nfc { color: var(--text-2); font-weight: 600; letter-spacing: -2px; transform: scaleY(1.2); }
.dc-chip { width: 46px; height: 36px; margin-top: 26px; border-radius: 7px; background: linear-gradient(135deg, #f1dfa6, #b8995a); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.dc-num { margin-top: 22px; letter-spacing: .18em; color: #c9c9cf; font-size: 15px; }

/* ---------- security ---------- */
.security-art { border-radius: var(--radius); margin-bottom: clamp(40px, 6vw, 72px); }
.points { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.point { padding: 26px 24px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.point p { color: var(--text-2); font-size: 15px; margin-top: 10px; }

/* ---------- plan ---------- */
.plan-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.plan-media { border-radius: var(--radius); overflow: hidden; }
.spec { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 0; }
.spec li { padding: 22px 0; border-top: 1px solid var(--line); color: var(--text-2); }
.spec li b { color: var(--text); font-weight: 600; }

/* ---------- app ---------- */
.app-hero { border-radius: var(--radius); margin-bottom: 40px; }
.screens {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.screen { margin: 0; }
.screen img, .screen .asset { display: block; width: 100%; height: auto; aspect-ratio: 540/1050; object-fit: cover; border-radius: 26px; border: 1px solid var(--line); }
.screen figcaption { margin-top: 14px; font-size: 14px; color: var(--text-2); }
.screen figcaption b { display: block; color: var(--text); font-size: 16px; font-weight: 600; }
.chips { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chips li { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; color: var(--text-2); }

/* ---------- open + status ---------- */
.open-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.open-card { padding: clamp(28px, 4vw, 44px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.open-card > p:not(.eyebrow) { color: var(--text-2); margin-top: 14px; }
.link { display: inline-block; margin-top: 22px; font-weight: 600; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.status { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; font-size: 15px; color: var(--text-2); }
.status li { display: flex; gap: 12px; align-items: flex-start; }
.status li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; }
.status .ok::before { background: rgba(122,219,169,.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237ADBA9' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center/12px no-repeat; }
.status .todo::before { border: 1.5px dashed var(--text-3); }
.status .todo { color: var(--text-3); }

/* ---------- faq ---------- */
.faq-list { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 26px 48px 26px 0; position: relative;
  font-size: clamp(17px, 1.6vw, 21px); font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  background: linear-gradient(var(--text-2), var(--text-2)) center/14px 1.5px no-repeat, linear-gradient(var(--text-2), var(--text-2)) center/1.5px 14px no-repeat;
  transition: transform .3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-2); padding: 0 48px 28px 0; max-width: 820px; }

/* ---------- download ---------- */
.download { padding-bottom: clamp(72px, 10vw, 120px); }
.download-card {
  text-align: center; padding: clamp(56px, 8vw, 96px) var(--gutter);
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(60% 80% at 80% 0%, rgba(110, 91, 176, .28), transparent 70%),
    radial-gradient(50% 70% at 10% 100%, rgba(176, 110, 140, .2), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
}
.download-mark { width: 120px; margin: 0 auto 32px; }
.download .sub { margin-left: auto; margin-right: auto; }
.apk-meta { margin-top: 18px; font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.apk-meta + .apk-meta { margin-top: 6px; }
.apk-meta code { font-size: 12px; }
.apk-meta a { color: var(--text-2); text-decoration: underline; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px var(--gutter) 40px; }
.foot-grid { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h5 { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.foot-grid a:not(.brand) { display: block; color: var(--text-2); font-size: 15px; padding: 4px 0; }
.foot-grid a:not(.brand):hover { color: var(--text); }
.fine { max-width: var(--max); margin: 48px auto 0; font-size: 13px; color: var(--text-3); }

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .ripple i, .fp { animation: none; }
  .ripple i { opacity: .5; }
  .step.is-active .bar::after { animation: none; width: 100%; }
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .grid-features { grid-template-columns: 1fr 1fr; }
  .feature.f-wide { grid-column: auto; }
  .points { grid-template-columns: 1fr 1fr; }
  .screens { grid-template-columns: repeat(4, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .screen { scroll-snap-align: start; }
}
@media (max-width: 820px) {
  .nav { gap: 16px; }
  .nav-links {
    position: fixed; inset: 0 0 auto; top: 0; padding: 88px var(--gutter) 28px; margin: 0;
    flex-direction: column; gap: 4px; font-size: 22px; color: var(--text);
    background: rgba(5,5,6,.97); border-bottom: 1px solid var(--line);
    transform: translateY(-12px); opacity: 0; visibility: hidden; z-index: -1;
    transition: transform .4s var(--ease), opacity .3s, visibility 0s .4s;
  }
  .nav-links a { padding: 10px 0; }
  .nav.open .nav-links { transform: none; opacity: 1; visibility: visible; transition: transform .4s var(--ease), opacity .3s; }
  .nav .btn-sm { margin-left: auto; }
  .menu { display: grid; gap: 6px; width: 40px; height: 40px; place-content: center; background: none; border: 0; padding: 0; cursor: pointer; }
  .menu span { display: block; width: 20px; height: 1.5px; background: var(--text); transition: transform .3s var(--ease); }
  .nav.open .menu span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav.open .menu span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .how-grid, .plan-grid, .open-grid { grid-template-columns: 1fr; }
  .demo { height: 520px; order: -1; }
  .plan-media { max-width: 420px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .strip { font-size: 12px; }
  .grid-features, .points { grid-template-columns: 1fr; }
  .feature.f-wide { grid-column: auto; }
  .feature .asset { min-height: 0; aspect-ratio: 4 / 3; }
  .hero-media .asset { aspect-ratio: 1 / 1; --pos: 60% 58%; }
  .screens { grid-template-columns: repeat(4, 74%); }
  .demo { height: 480px; }
  .demo-phone { width: 210px; height: 430px; }
  .demo-card { width: 250px; height: 158px; padding: 16px 18px; }
  .dc-chip { margin-top: 18px; }
  .dc-num { margin-top: 14px; }
  .cta-row .btn { flex: 1 1 100%; }
}
