/* Cuttlefish Vault marketing site. Colours follow the app's dark theme and its icon. */
:root {
  --bg: #080b11;
  --bg-raised: #0f141d;
  --surface: #131924;
  --line: #1f2735;
  --text: #e8edf4;
  --muted: #9aa7b8;
  --accent: #7cc4ff;
  --accent-strong: #4fa8f5;
  --on-accent: #04233f;
  --max: 1120px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(8 11 17 / 0.94);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header nav a {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.2s;
}

.site-header nav a:hover {
  color: var(--text);
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a9daff, var(--accent-strong));
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 10px 30px -10px rgb(79 168 245 / 0.6);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

a.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -10px rgb(79 168 245 / 0.75);
}

.button svg {
  width: 20px;
  height: 20px;
}

.hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 40px;
  /* The glow and the fanned-out phones reach past the sides; clip them here so the page itself
     is never wider than the screen and can't be nudged sideways. */
  overflow-x: clip;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -200px -20% auto;
  height: 900px;
  background:
    radial-gradient(closest-side, rgb(79 168 245 / 0.22), transparent 70%) 62% 30% / 760px 760px no-repeat,
    radial-gradient(closest-side, rgb(36 64 106 / 0.5), transparent 70%) 20% 0 / 900px 700px no-repeat;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(19 25 36 / 0.7);
  color: var(--muted);
  font-size: 14px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgb(124 196 255 / 0.18);
}

.hero h1 {
  font-size: clamp(38px, 5.6vw, 66px);
  font-weight: 700;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #cfe9ff, var(--accent-strong));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  margin: 22px 0 32px;
  max-width: 34em;
  color: var(--muted);
  font-size: 19px;
}

/* Three phones: the home screen in front, lock and folder fanned out behind it. */
.stage {
  position: relative;
  height: 620px;
  perspective: 1400px;
}

.phone {
  position: absolute;
  top: 0;
  left: 50%;
  width: 280px;
  margin-left: -140px;
  padding: 9px;
  border-radius: 40px;
  background: linear-gradient(160deg, #2a3342, #0d1118 40%);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.06) inset,
    0 30px 50px -28px rgb(0 0 0 / 0.9);
}

.phone img {
  width: 100%;
  aspect-ratio: 720 / 1432;
  border-radius: 31px;
  background: #111318;
}

.stage .phone {
  animation: rise 1s var(--ease) both;
}

.stage .phone.left {
  --x: -150px;
  --r: -9deg;
  top: 46px;
  z-index: 1;
  animation-delay: 0.12s;
}

.stage .phone.right {
  --x: 150px;
  --r: 9deg;
  top: 46px;
  z-index: 1;
  animation-delay: 0.2s;
}

.stage .phone.front {
  --x: 0px;
  --r: 0deg;
  z-index: 2;
}

.stage .phone {
  will-change: transform;
}

.stage .phone.left::after,
.stage .phone.right::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgb(8 11 17 / 0.32);
}

.stage .phone > div {
  animation: float 7s ease-in-out infinite;
}

.stage .phone.left > div {
  animation-delay: -2.3s;
}

.stage .phone.right > div {
  animation-delay: -4.6s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 60px, 0) rotate(0deg) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate3d(var(--x), 0, 0) rotate(var(--r)) scale(1);
  }
}

@keyframes float {
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

/* ---------- Sections ---------- */
section {
  padding: 96px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head h2,
.feature h2,
.closing h2 {
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
}

.section-head p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
}

/* Feature rows: a phone on one side, words on the other. */
.feature {
  padding: 72px 0;
}

.feature .wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 72px;
}

.feature.flip .shot {
  order: 2;
}

.feature .shot {
  position: relative;
  display: flex;
  justify-content: center;
}

.feature .shot::before {
  content: "";
  position: absolute;
  inset: 8% 6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(79 168 245 / 0.2), transparent);
}

.feature .phone {
  position: relative;
  left: auto;
  margin: 0;
  width: min(300px, 78vw);
}

.feature .kicker {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feature p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
}

.feature ul {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.feature li {
  position: relative;
  margin-top: 12px;
  padding-left: 30px;
  color: var(--text);
}

.feature li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.42em;
  width: 16px;
  height: 9px;
  border: solid var(--accent);
  border-width: 0 0 2.5px 2.5px;
  border-radius: 1px;
  transform: rotate(-45deg) scale(0.8);
}

/* The app icon turning into its calculator disguise and back. */
.disguise {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.disguise .icons {
  position: relative;
  flex: none;
  width: 60px;
  height: 60px;
}

.disguise img {
  position: absolute;
  inset: 0;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  backface-visibility: hidden;
  animation: swap 6s var(--ease) infinite;
}

.disguise img + img {
  animation-name: swap-back;
}

.disguise span {
  color: var(--muted);
  font-size: 15px;
}

@keyframes swap {
  0%,
  40% {
    transform: rotateY(0deg);
  }
  50%,
  90% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}

@keyframes swap-back {
  0%,
  40% {
    transform: rotateY(-180deg);
  }
  50%,
  90% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}

/* The fingerprint scan: a dim print, a lit copy uncovered by the beam, then the match badge. */
.scan {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #16233a, #0c121d 72%);
  box-shadow: 0 40px 80px -40px rgb(79 168 245 / 0.45);
  overflow: hidden;
}

.scan .print {
  position: absolute;
  top: 21%;
  left: 27%;
  width: 46%;
  height: auto;
}

.scan .print g {
  fill: none;
  stroke-width: 4.2;
  stroke-linecap: round;
}

.scan .lit {
  clip-path: inset(0 0 100% 0);
  animation: scan-print 4.8s var(--ease) infinite;
}

.scan .beam {
  position: absolute;
  top: 17%;
  left: 20%;
  right: 20%;
  height: 14%;
  border-bottom: 2px solid #9dd3ff;
  background: linear-gradient(180deg, transparent, rgb(124 196 255 / 0.28));
  opacity: 0;
  animation: scan-beam 4.8s var(--ease) infinite;
}

.scan .matched {
  position: absolute;
  bottom: 11%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: rgb(79 168 245 / 0.16);
  color: #cfe9ff;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateX(-50%);
  animation: scan-matched 4.8s var(--ease) infinite;
}

.scan .matched svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan::after {
  content: "";
  position: absolute;
  inset: 22%;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: scan-ring 4.8s var(--ease) infinite;
}

/* Only animate while it is on screen (main.js toggles .playing). */
.js .scan:not(.playing) .lit,
.js .scan:not(.playing) .beam,
.js .scan:not(.playing) .matched,
.js .scan:not(.playing)::after {
  animation-play-state: paused;
}

@keyframes scan-print {
  0%, 8% { clip-path: inset(0 0 100% 0); opacity: 1; }
  52%, 86% { clip-path: inset(0 0 0 0); opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 0; }
}

@keyframes scan-beam {
  0%, 6% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: 1; }
  52% { transform: translate3d(0, 400%, 0); opacity: 1; }
  58%, 100% { transform: translate3d(0, 400%, 0); opacity: 0; }
}

@keyframes scan-matched {
  0%, 54% { opacity: 0; transform: translate3d(-50%, 6px, 0); }
  60%, 86% { opacity: 1; transform: translate3d(-50%, 0, 0); }
  100% { opacity: 0; transform: translate3d(-50%, 0, 0); }
}

@keyframes scan-ring {
  0%, 52% { opacity: 0; transform: scale(0.9); }
  56% { opacity: 0.7; transform: scale(1); }
  74%, 100% { opacity: 0; transform: scale(1.32); }
}

/* ---------- Feature tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 14px;
}

.tile {
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s, background-color 0.3s;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: #2e3b50;
  background-color: #151d2a;
}

.tile .ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 13px;
  background: rgb(124 196 255 / 0.1);
  color: var(--accent);
  transition: transform 0.3s var(--ease), background-color 0.3s;
}

.tile:hover .ico {
  transform: scale(1.08) rotate(-4deg);
  background: rgb(124 196 255 / 0.17);
}

.tile .ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile h3 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.tile p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

/* Tiles arrive one after another, and each icon draws itself in. The entrance is a backwards-filling
   animation rather than a transition, so it never holds back the hover lift. */
.js .tile.reveal {
  transform: none;
  transition: transform 0.3s var(--ease), border-color 0.3s, background-color 0.3s;
}

.js .tile.reveal.in {
  animation: tile-in 0.55s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.js .tile .ico svg > * {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1s var(--ease);
}

.js .tile.in .ico svg > * {
  stroke-dashoffset: 0;
  transition-delay: calc(var(--i, 0) * 70ms + 0.2s);
}

@keyframes tile-in {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to { opacity: 1; transform: none; }
}

/* ---------- Questions ---------- */
.faq .list {
  display: grid;
  gap: 10px;
  max-width: 820px;
}

.faq details {
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

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

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--accent);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.faq details p {
  padding-bottom: 20px;
  color: var(--muted);
}

/* ---------- Details grid ---------- */
.details {
  background: linear-gradient(180deg, transparent, var(--bg-raised) 20%, var(--bg-raised) 80%, transparent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}

.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #2e3b50;
}

.card svg {
  width: 26px;
  height: 26px;
  margin-bottom: 18px;
  color: var(--accent);
}

.card h3 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15.5px;
}

/* ---------- Closing ---------- */
.closing .panel {
  position: relative;
  overflow: hidden;
  padding: 64px 32px;
  border: 1px solid #24406a;
  border-radius: 32px;
  background: linear-gradient(150deg, #1a2f4f, #0d1524 60%);
  text-align: center;
}

.closing .panel::before {
  content: "";
  position: absolute;
  inset: -40% 20% auto;
  height: 420px;
  background: radial-gradient(closest-side, rgb(124 196 255 / 0.22), transparent);
  pointer-events: none;
}

.closing img {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 26px;
  border-radius: 20px;
  box-shadow: 0 20px 40px -16px rgb(0 0 0 / 0.8);
}

.closing h2,
.closing p,
.closing .button {
  position: relative;
}

.closing p {
  max-width: 36em;
  margin: 18px auto 32px;
  color: #b9c8dc;
  font-size: 18px;
}

/* ---------- Long-form pages ---------- */
.prose {
  max-width: 720px;
  padding: 56px 24px 96px;
}

.prose h1 {
  font-size: clamp(32px, 4.4vw, 44px);
}

.prose h2 {
  margin-top: 44px;
  font-size: 22px;
}

.prose p,
.prose ul {
  margin-top: 14px;
  color: var(--muted);
}

.prose li {
  margin-top: 8px;
}

.prose strong {
  color: var(--text);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 28px;
  padding-bottom: 40px;
}

.site-footer a {
  margin-left: 20px;
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- Reveal on scroll (only when the script is running) ---------- */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Smaller screens ---------- */
@media (max-width: 900px) {
  .hero {
    padding-top: 40px;
  }

  .hero .wrap,
  .feature .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .hero .copy {
    text-align: center;
  }

  .hero .lede {
    margin-inline: auto;
  }

  .feature.flip .shot {
    order: 0;
  }

  .stage {
    height: 520px;
  }

  .stage .phone {
    width: 232px;
    margin-left: -116px;
    border-radius: 34px;
  }

  .stage .phone img {
    border-radius: 26px;
  }

  .stage .phone.left {
    --x: -96px;
  }

  .stage .phone.right {
    --x: 96px;
  }

  section {
    padding: 64px 0;
  }

  .feature {
    padding: 48px 0;
  }
}

@media (max-width: 520px) {
  .site-header nav a:not(.keep) {
    display: none;
  }

  .stage {
    height: 450px;
  }

  .stage .phone {
    width: 196px;
    margin-left: -98px;
  }

  .stage .phone.left {
    --x: -70px;
  }

  .stage .phone.right {
    --x: 70px;
  }
}

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

  .stage .phone,
  .stage .phone > div,
  .disguise img,
  .scan .beam,
  .scan::after,
  .js .tile.reveal.in {
    animation: none;
  }

  .scan .lit {
    animation: none;
    clip-path: none;
  }

  .scan .matched {
    animation: none;
    opacity: 1;
  }

  .js .tile .ico svg > * {
    stroke-dashoffset: 0;
    transition: none;
  }

  .stage .phone {
    transform: translate3d(var(--x), 0, 0) rotate(var(--r));
  }

  .disguise img + img {
    display: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
