/* ==========================================================================
   DeepDrillStudio — shared styles
   Each page sets its accent colours on <body> via a theme class:
   .theme-studio, .theme-crateflux, .theme-dropsight
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0a0a12;
  --bg-raised: #15151f;
  --bg-sunken: #06060c;
  --line: #24243a;
  --line-strong: #363650;
  --text: #ecebe6;
  --text-muted: #9a99a3;
  --text-faint: #6b6a74;

  --accent: #c9f24a;
  --accent-2: #7ee0c3;
  --accent-ink: #0a0a12;
  --glow: color-mix(in srgb, var(--accent) 16%, transparent);

  /* Suite colours shared by both apps */
  --magenta: #ff2bd6;
  --cyan: #00e5ff;
  --keep: #00e676;
  --bin: #ff1744;
  --pro: #ffc400;
  --indigo: #24126b;
  --violet: #4b1592;

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1160px;
  --gutter: clamp(16px, 4vw, 40px);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Both apps share the suite look: magenta + cyan on ink, gold for Pro.
   CrateFlux leads with magenta, DropSight with cyan. */
.theme-crateflux {
  --accent: var(--magenta);
  --accent-2: var(--cyan);
  --accent-ink: #14000f;
}

.theme-dropsight {
  --accent: var(--cyan);
  --accent-2: var(--magenta);
  --accent-ink: #001519;
}

.theme-crateflux, .theme-dropsight {
  --glow: color-mix(in srgb, var(--violet) 55%, transparent);
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

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

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 6.5vw, 4.75rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 40em; }

.muted { color: var(--text-muted); }

.gradient-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- Header / nav ---------- */

.site-header {
  top: env(safe-area-inset-top, 0px);
  position: sticky; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .brand-sub { color: var(--text-faint); font-weight: 500; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  text-decoration: none; color: var(--text-muted); font-size: 0.95rem;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--bg-raised); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong); color: var(--text);
  width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
}
.nav-toggle svg { margin: auto; }

@media (max-width: 900px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 8px; border-radius: 8px; }
}

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

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 88%, white); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn svg { width: 18px; height: 18px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.status-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px;
  border: 1px dashed var(--line-strong);
  color: var(--text-muted); font-size: 0.92rem;
}
.status-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.chips li {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-muted);
}

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

section { padding: clamp(64px, 10vw, 120px) 0; }
section + section { border-top: 1px solid var(--line); }

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

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

.hero { padding-top: clamp(48px, 8vw, 96px); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  pointer-events: none; z-index: -1;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero-copy .lede { margin-bottom: 2rem; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* ---------- Cards / grids ---------- */

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--text-muted); margin: 0; font-size: 0.97rem; }

.feature-icon {
  width: 42px; height: 42px; border-radius: 11px; margin-bottom: 18px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.feature-icon svg { width: 22px; height: 22px; }

/* Studio app cards */
.app-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-raised);
  padding: clamp(26px, 4vw, 40px);
  display: flex; flex-direction: column; gap: 18px;
  text-decoration: none; min-height: 420px;
  transition: border-color .2s ease, transform .2s ease;
}
.app-card:hover { border-color: var(--card-accent); transform: translateY(-3px); color: var(--text); }
.app-card::after {
  content: ""; position: absolute; right: -30%; bottom: -40%; width: 80%; aspect-ratio: 1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--card-accent) 30%, transparent), transparent);
  pointer-events: none;
}
.app-card .app-name { font-family: var(--font-display); font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.app-card p { color: var(--text-muted); margin: 0; max-width: 28em; }
.app-card .card-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--card-accent); }
.app-card .app-art { position: relative; z-index: 1; height: 120px; }
.app-card--crateflux { --card-accent: var(--magenta); }
.app-card--dropsight { --card-accent: var(--cyan); }

/* Numbered steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 26px 26px 26px 84px; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 26px; top: 24px;
  font-family: var(--font-mono); font-size: 1.05rem; color: var(--accent);
}
.steps h3 { margin-bottom: 0.25em; }

/* Principles list */
.principles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.principles li { padding: 28px 28px 28px 0; border-bottom: 1px solid var(--line); }
.principles li:nth-child(odd) { padding-right: 40px; border-right: 1px solid var(--line); }
.principles li:nth-child(even) { padding-left: 40px; }
.principles h3 { margin-bottom: 0.3em; }
.principles p { color: var(--text-muted); margin: 0; }
@media (max-width: 720px) {
  .principles { grid-template-columns: 1fr; }
  .principles li, .principles li:nth-child(odd), .principles li:nth-child(even) { padding: 24px 0; border-right: 0; }
}

/* ---------- Comparison table ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.compare { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 0.97rem; }
.compare th, .compare td { text-align: left; padding: 15px 20px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare tr:last-child td { border-bottom: 0; }
.compare thead th { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; }
.compare thead th.pro { color: var(--pro); }
.compare td:not(:first-child), .compare th:not(:first-child) { width: 22%; }
.compare .yes { color: var(--text); }
.compare .no { color: var(--text-faint); }
.compare .yes::before { content: "✓ "; color: var(--accent); }
.compare .no::before { content: "— "; }
.pricing-note { margin-top: 16px; color: var(--text-muted); }

/* ---------- Small print / notices ---------- */

.small-print { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.small-print li { position: relative; padding-left: 22px; color: var(--text-muted); }
.small-print li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 8px; height: 2px; background: var(--accent); }

.notice {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid color-mix(in srgb, #ffcc4d 45%, var(--line));
  background: color-mix(in srgb, #ffcc4d 7%, var(--bg-raised));
  border-radius: var(--radius); padding: 20px 22px; margin-top: 28px;
}
.notice svg { width: 24px; height: 24px; flex: none; color: #ffcc4d; margin-top: 2px; }
.notice h3 { font-size: 1.05rem; margin-bottom: 0.3em; }
.notice p { margin: 0; color: var(--text-muted); font-size: 0.97rem; }

/* ---------- FAQ ---------- */

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 22px 0; font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--font-mono); font-weight: 400; font-size: 1.4rem; color: var(--accent);
  transition: transform .2s ease;
}
.faq details[open] > summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-muted); margin: 0 0 22px; max-width: 46em; }
.faq-group-title { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin: 40px 0 8px; }
.faq-group-title:first-child { margin-top: 0; }

/* ---------- Closing band ---------- */

.closing { text-align: center; }
.closing h2 { max-width: 18em; margin: 0 auto 0.6em; }
.closing .btn-row { justify-content: center; }

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

.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; color: var(--text-muted); font-size: 0.93rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 0; margin: 0; }
.footer-links a { text-decoration: none; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer-social { margin-top: 24px; }
.footer-bottom { margin-top: 24px; color: var(--text-faint); font-size: 0.85rem; }

/* ---------- Device mockup ---------- */

.phone {
  position: relative; width: min(300px, 78vw); aspect-ratio: 9 / 19; margin: 0 auto;
  border-radius: 42px; padding: 12px;
  background: linear-gradient(160deg, #2a2a33, #111116);
  box-shadow: 0 0 0 1px #3a3a44, 0 40px 80px -20px rgba(0,0,0,.7), 0 0 120px -30px color-mix(in srgb, var(--accent) 50%, transparent);
}
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 31px; overflow: hidden; background: #050506; }
.phone-screen::before { /* camera punch-hole */
  content: ""; position: absolute; top: 12px; left: 50%; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: #000; box-shadow: 0 0 0 1px #1d1d22; z-index: 5;
}

/* ---------- App screenshots ---------- */

.hero-shot {
  width: min(360px, 82vw); max-width: 100%; margin: 0 auto; height: auto;
  border-radius: 28px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 40px 80px -24px rgba(0,0,0,.75), 0 0 140px -30px var(--glow);
}

.shots {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 4px 18px; margin: 0 -4px;
  scrollbar-color: var(--line-strong) transparent;
}
.shots figure { flex: 0 0 auto; width: min(240px, 62vw); margin: 0; scroll-snap-align: start; }
.shots img { width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--line); background: var(--bg-raised); }
.shots-hint { color: var(--text-faint); font-size: 0.88rem; margin-top: 4px; }

.brand img { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.app-card .app-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 10px 40px -10px var(--card-accent); }

/* ---------- DropSight mockup ---------- */

.ds-screen { background: #040308; }
.ds-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ds-hud { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px 18px; font-size: 11px; color: #cfd0e6; background: linear-gradient(transparent, rgba(4,3,8,.92) 40%); z-index: 2; }
.ds-hud strong { display: block; font-family: var(--font-display); font-size: 13px; color: #fff; }
.ds-hud .ds-key { font-family: var(--font-mono); font-size: 9px; color: #9fa2c4; }
.ds-progress { margin-top: 10px; height: 6px; border-radius: 3px; display: flex; overflow: hidden; gap: 2px; }
.ds-progress i { display: block; height: 100%; }
.ds-countdown {
  position: absolute; top: 9%; left: 0; right: 0; text-align: center; z-index: 2; text-shadow: 0 2px 12px rgba(0,0,0,.9);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; color: #fff;
  opacity: 0; transition: opacity .3s ease;
}
.ds-countdown b { display: block; font-family: var(--font-display); font-size: 40px; letter-spacing: 0; font-weight: 600; }
.ds-countdown.show { opacity: 1; }

/* Visualiser packs */
.pack { position: relative; overflow: hidden; min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; }
.pack::before { content: ""; position: absolute; inset: 0; opacity: .55; background: var(--pack-bg); }
.pack > * { position: relative; }
.pack .pack-count { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.pack--festival { --pack-bg: radial-gradient(120% 80% at 50% 120%, #ff2bd6 0%, transparent 55%), repeating-conic-gradient(from 200deg at 50% 110%, rgba(0,229,255,.35) 0 2deg, transparent 2deg 14deg); }
.pack--warp { --pack-bg: repeating-radial-gradient(circle at 30% 40%, #7a3dff 0 8px, #ff2bd6 8px 16px, transparent 16px 30px); }
.pack--warp::before { filter: blur(1px); opacity: .3; }
.pack--immersive { --pack-bg: radial-gradient(circle at 60% 35%, #00e5ff 0 6%, transparent 30%), radial-gradient(circle at 60% 35%, transparent 0 18%, rgba(122,61,255,.6) 19% 22%, transparent 23% 34%, rgba(0,229,255,.4) 35% 37%, transparent 38%); }
.pack--cinematic { --pack-bg: radial-gradient(60% 90% at 15% 0%, rgba(255,204,77,.55), transparent 60%), linear-gradient(160deg, transparent 40%, rgba(122,61,255,.35)), repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 4px); }
.packs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.packs > :nth-child(-n+3) { grid-column: span 2; }
.packs > :nth-child(n+4) { grid-column: span 3; }
@media (max-width: 960px) {
  .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .packs > :nth-child(n) { grid-column: span 1; }
  .packs > :last-child { grid-column: span 2; }
}
@media (max-width: 620px) {
  .packs { grid-template-columns: 1fr; }
  .packs > :nth-child(n), .packs > :last-child { grid-column: auto; }
}
.pack--dj { --pack-bg: repeating-radial-gradient(circle at 80% 50%, #1b1b22 0 2px, #26262f 2px 4px), linear-gradient(90deg, transparent 40%, #04030800 40%); }
.pack--dj::after { content: ""; position: absolute; left: 0; right: 0; top: 14%; height: 40px; opacity: .6; background: repeating-linear-gradient(90deg, #00e5ff 0 2px, transparent 2px 5px); mask: linear-gradient(transparent, #000 30%, #000 70%, transparent); -webkit-mask: linear-gradient(transparent, #000 30%, #000 70%, transparent); }

/* Story timeline (DropSight) */
.story-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.story { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); min-width: 780px; }
.story > div { padding: 16px 16px 22px; border-right: 1px solid var(--line); background: var(--bg-raised); display: flex; flex-direction: column; gap: 12px; }
.story > div:last-child { border-right: 0; }
.story img { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: #000; }
.story .phase { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .12em; text-transform: uppercase; display: block; }
.story p { color: var(--text-muted); margin: 0; font-size: 0.93rem; }
.story-caption { color: var(--text-faint); font-size: 0.88rem; margin: 10px 0 0; }

/* Cue legend (CrateFlux) */
.cue-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 18px 0 0; font-size: 0.9rem; color: var(--text-muted); }
.cue-legend li { display: inline-flex; align-items: center; gap: 8px; }
.cue-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1040px) { .brand .brand-sub { display: none; } }

/* Animated frame: a light runs round a box's border while it is hovered */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin-border { to { --spin: 360deg; } }
.card, .app-card { position: relative; isolation: isolate; }
.card:not(.pack):not(.steps > li)::before, .app-card::before, .steps > li.card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1; pointer-events: none;
  background: conic-gradient(from var(--spin), transparent 0 70%, var(--accent) 80%, var(--accent-2) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity .3s ease;
}
.card:not(.pack):not(.steps > li):hover::before, .app-card:hover::before, .steps > li.card:hover::after { opacity: 1; animation: spin-border 2.4s linear infinite; }
.app-card--crateflux { --accent: var(--magenta); --accent-2: var(--cyan); }
.app-card--dropsight { --accent: var(--cyan); --accent-2: var(--magenta); }
.app-card:hover { border-color: var(--line); }
.app-card::before { inset: 0; }   /* app cards clip to their inside edge, so draw the frame there */

/* FAQ: the top questions show first; the rest sit behind "More questions" */
.faq .faq-more { border-bottom: 0; }
.faq .faq-more > summary { justify-content: flex-start; gap: 10px; color: var(--accent); font-size: 0.95rem; padding: 20px 0; }
.faq .faq-more > summary::after { content: "↓"; font-family: var(--font-body); font-size: 1rem; transition: transform .2s ease; }
.faq .faq-more[open] > summary::after { transform: rotate(180deg); }
.faq .faq-more > summary .when-open, .faq .faq-more[open] > summary .when-closed { display: none; }
.faq .faq-more[open] > summary .when-open { display: inline; }
.faq .faq-more[open] > summary { border-bottom: 1px solid var(--line); }

/* Feature videos (CrateFlux): phone-shaped, silent, looping */
.videos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.vid { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.vid video { width: 100%; height: auto; aspect-ratio: 540 / 1202; border-radius: 22px; background: #000; border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); }
.vid figcaption { color: var(--text-muted); font-size: 0.95rem; }
.vid figcaption strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 2px; }
@media (max-width: 760px) {
  .videos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; padding-bottom: 16px; }
  .vid { flex: 0 0 min(260px, 70vw); scroll-snap-align: start; }
}

/* Colour theme strip */
.theme-strip figure { width: min(180px, 44vw); }
.theme-strip figcaption { margin-top: 10px; font-size: 0.92rem; color: var(--text); display: flex; justify-content: space-between; gap: 8px; }
.theme-strip figcaption span { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); align-self: center; }

/* "How it works" steps on the CrateFlux page: a small app shot above each step */
.steps li.card:has(.step-shot) { padding: 26px; }
.steps li.card:has(.step-shot)::before { position: static; display: block; margin-bottom: 6px; }
.step-shot { position: relative; width: min(190px, 62%); aspect-ratio: 360 / 801; margin: 0 auto 24px; }
.step-shot img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 16px; border: 1px solid var(--line-strong); box-shadow: 0 20px 40px -24px rgba(0,0,0,.9); }
/* Swipe step: KEEP, BIN and ENERGY take turns */
.step-cycle img:not(:first-child) { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .step-cycle img { animation: step-cycle 7.5s infinite; }
  .step-cycle img:first-child { animation-name: step-cycle-first; }
  .step-cycle img:nth-child(2) { animation-delay: 2.5s; }
  .step-cycle img:nth-child(3) { animation-delay: 5s; }
}
@keyframes step-cycle { 0% { opacity: 0; } 8%, 33% { opacity: 1; } 41%, 100% { opacity: 0; } }
@keyframes step-cycle-first { 0%, 33% { opacity: 1; } 41%, 92% { opacity: 0; } 100% { opacity: 1; } }

/* Share-card flyers (CrateFlux) */
.card-strip figure { width: min(260px, 66vw); }
.card-strip img { border-radius: 14px; }
.card-strip figcaption { margin-top: 10px; font-size: 0.9rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 10px; }
.card-strip figcaption span { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }

/* Prep sheet beside the Pro table */
.prep { margin-top: clamp(40px, 6vw, 64px); align-items: center; }
.prep-sheet { margin: 0; justify-self: center; width: min(380px, 100%); }
.prep-sheet img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.9), 0 0 0 1px var(--line-strong); transform: rotate(-1.5deg); }
.prep-title { font-family: var(--font-display); font-size: clamp(1.4rem, 2.8vw, 2rem); margin-bottom: .5em; }

/* ==========================================================================
   3D phone (CrateFlux hero). Pure CSS: a stack of thin layers gives the
   metal edge real depth; the screen plays the app's own screen recording.
   --rx/--ry come from the pointer (main.js); the float div idles on its own.
   ========================================================================== */
.phone3d {
  --w: min(300px, 70vw);
  --h: calc(var(--w) * 2.12);
  --r: calc(var(--w) * 0.14);
  --depth: 14px;
  --rx: 0deg; --ry: 0deg;
  --turn: -18deg;   /* resting angle; variants change it */
  --dur: 9s;
  position: relative; width: var(--w); height: var(--h); margin: 20px auto 40px;
  perspective: 1400px;
}
.phone3d-float {
  width: 100%; height: 100%; transform-style: preserve-3d;
  animation: phone-idle var(--dur) ease-in-out infinite;
}
.phone3d-body {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s cubic-bezier(.2,.7,.1,1);
}
@keyframes phone-idle {
  0%, 100% { transform: translateY(0) rotateX(8deg) rotateY(calc(var(--turn) - 6deg)) rotateZ(calc(var(--turn) / -9)); }
  50%      { transform: translateY(-14px) rotateX(4deg) rotateY(calc(var(--turn) + 6deg)) rotateZ(0deg); }
}
/* metal frame: stacked slices behind the front glass */
.phone3d-edge i {
  position: absolute; inset: 0; border-radius: var(--r);
  transform: translateZ(calc(var(--z) * var(--depth) / -14));
  background: linear-gradient(135deg, #5a5a66, #24242b 30%, #3a3a44 55%, #15151a 80%, #4a4a55);
}
.phone3d-back {
  position: absolute; inset: 0; border-radius: var(--r);
  transform: translateZ(calc(var(--depth) * -1)) rotateY(180deg);
  background: radial-gradient(120% 80% at 30% 20%, #3b2a66, #1a1230 55%, #0d0a18);
  box-shadow: inset 0 0 0 2px #2c2c34;
}
/* side buttons on the right edge */
.phone3d-btn {
  position: absolute; right: -2px; width: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #2a2a31, #6a6a76); transform: translateZ(calc(var(--depth) / -2)) rotateY(90deg);
  transform-origin: right center;
}
.phone3d-btn--power { top: 22%; height: 9%; }
.phone3d-btn--vol { top: 34%; height: 15%; }
/* front: black glass bezel + screen */
.phone3d-front {
  position: absolute; inset: 0; border-radius: var(--r); padding: calc(var(--w) * 0.035);
  background: #050507;
  box-shadow: inset 0 0 0 1.5px #3a3a44, inset 0 0 0 3px #0b0b0f;
  transform: translateZ(1px);
}
.phone3d-screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: calc(var(--r) * 0.82); background: #0b0716;
}
.phone3d-screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone3d-cam {
  position: absolute; top: 1.6%; left: 50%; width: 3.4%; aspect-ratio: 1; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #2c3550, #000 60%); box-shadow: 0 0 0 1.5px #111;
}
/* a light sweep that follows the tilt */
.phone3d-glare {
  position: absolute; inset: -40%; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.16) 47%, rgba(255,255,255,.04) 53%, transparent 62%);
  transform: translateX(calc(var(--ry) * -1.5)) translateY(calc(var(--rx) * 1.5));
  animation: glare var(--dur) ease-in-out infinite;
}
@keyframes glare { 0%, 100% { translate: -12% 0; } 50% { translate: 10% 0; } }
.phone3d-shadow {
  position: absolute; left: 12%; right: 12%; bottom: -38px; height: 30px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,.65), transparent);
  filter: blur(6px); animation: phone-shadow var(--dur) ease-in-out infinite;
}
@keyframes phone-shadow { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(.86); opacity: .6; } }
.phone3d::before { /* soft glow behind the phone */
  content: ""; position: absolute; inset: 10% -30%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent);
}
@media (prefers-reduced-motion: reduce) {
  .phone3d-float { transform: rotateX(6deg) rotateY(var(--turn)); }
  .phone3d-body { transition: none; }
}

/* Phone variants */
.phone3d--sm { --w: min(230px, 60vw); --depth: 11px; margin: 10px auto 34px; }
.phone3d--right { --turn: 18deg; }
.phone3d--front { --turn: 0deg; }
.phone3d--slow { --dur: 11s; }

/* CrateFlux "See it move": three phones fanned out */
.videos .vid { align-items: center; text-align: center; }
.videos .vid figcaption { max-width: 22em; }
.videos .phone3d .phone3d-screen video { aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; }

/* Home hero: a pair of phones, one per app */
.phone-duo { position: relative; height: calc(min(250px, 40vw) * 2.12 + 90px); }
.phone-duo .phone3d { --w: min(250px, 40vw); position: absolute; margin: 0; }
.phone-duo .phone3d:first-child { left: 2%; top: 0; --turn: 16deg; }
.phone-duo .phone3d:last-child { right: 2%; top: 60px; --turn: -16deg; --dur: 10s; }
.phone-duo .phone3d:last-child .phone3d-float { animation-delay: -4s; }
.phone-duo figcaption { position: absolute; bottom: -6px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
@media (max-width: 900px) { .phone-duo { margin-top: 24px; } }

/* "How it works": the small screens sit at an angle and straighten on hover */
.step-shot { transform: perspective(900px) rotateY(-16deg) rotateX(5deg); transition: transform .6s cubic-bezier(.2,.7,.1,1); }
.steps li:nth-child(2) .step-shot { transform: perspective(900px) rotateY(0deg) rotateX(6deg); }
.steps li:nth-child(3) .step-shot { transform: perspective(900px) rotateY(16deg) rotateX(5deg); }
.steps li:hover .step-shot { transform: perspective(900px) translateY(-6px); }
.videos .phone3d { --w: min(230px, 24vw); }
@media (max-width: 760px) { .videos .phone3d { --w: min(230px, 62vw); } }
#watch, .hero { overflow-x: clip; }

/* CrateFlux: Join the beta */
.btn-beta .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); opacity: .7; }
.beta-steps li.card { display: flex; flex-direction: column; }
.beta-steps li.card p { margin-bottom: 18px; }
.beta-steps .btn { margin-top: auto; align-self: flex-start; }
.beta-notes { margin-top: 28px; }
.beta-steps .btn, .btn-beta { white-space: nowrap; }
