/* CepelCode — landing page.
 *
 * Combo: Midnight Glass with the palette swapped for the product's own —
 * a warm near-black and the sand of the mark, one accent, glass as chrome
 * on top of an aurora that only lives in the hero. The site is the app's
 * chrome, so it uses the app's type stack (Segoe UI Variable on Windows,
 * the platform face elsewhere) rather than a downloaded one.
 */

:root {
  --bg: #0b0a09;
  --bg-2: #12100e;
  --ink: #f2ede6;
  --ink-2: #b5ab9d;
  --ink-3: #8a8072;
  --accent: #e6c9a3;
  --accent-2: #f3dcbb;
  --accent-ink: #1a1410;
  --line: rgba(255, 255, 255, 0.10);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-hi: rgba(255, 255, 255, 0.14);
  --focus: #f3dcbb;

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;

  --r-card: 20px;
  --r-btn: 10px;
  --r-shot: 14px;
  --wrap: 1180px;
  --t: 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 8px 12px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), calc(100% - 40px)); margin: 0 auto; }

/* --- Glass ---------------------------------------------------------------- */

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 8px 32px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}

@supports not (backdrop-filter: blur(1px)) {
  .glass { background: rgba(20, 18, 16, 0.92); }
}

@media (prefers-reduced-transparency: reduce) {
  .glass { background: rgba(20, 18, 16, 0.96); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* --- Nav ------------------------------------------------------------------ */

.top { position: sticky; top: 0; z-index: 50; padding: 14px 0 0; }

.nav {
  width: min(var(--wrap), calc(100% - 40px));
  margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand img { border-radius: 6px; }

.nav-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-links a { text-decoration: none; color: var(--ink-2); padding: 8px 12px; border-radius: 999px; font-size: 15px; transition: color var(--t), background var(--t); }
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav-links .btn { margin-left: 6px; color: var(--accent-ink); }

.nav-toggle { display: none; margin-left: auto; width: 40px; height: 40px; border: 0; background: transparent; border-radius: 999px; cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; margin: 4px auto; background: var(--ink); border-radius: 2px; transition: transform var(--t), opacity var(--t); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }

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

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 18px; height: 42px;
  border-radius: var(--r-btn); border: 1px solid transparent;
  font: 600 15px/1 var(--font); text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform var(--t), background var(--t), border-color var(--t), color var(--t);
}
.btn:active { transform: translateY(1px); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }

.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 24px rgba(230, 201, 163, 0.18); }
.btn-primary:hover { background: var(--accent-2); }

.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); }

/* --- Type ----------------------------------------------------------------- */

h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(38px, 6.2vw, 72px); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.1; font-weight: 700; }
h3 { font-size: 19px; line-height: 1.3; font-weight: 650; }

.kicker { margin: 0 0 12px; font: 600 12px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.sub { max-width: 62ch; margin: 14px 0 0; color: var(--ink-2); font-size: 17px; }
.muted { color: var(--ink-3); }
em { font-style: normal; color: var(--accent-2); }

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

.hero { position: relative; padding: 96px 0 40px; isolation: isolate; }

.aurora { position: absolute; inset: -20% 0 auto; height: 120%; z-index: -1; overflow: hidden; pointer-events: none;
  mask-image: linear-gradient(180deg, #000 55%, transparent); -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); }
.bloom { position: absolute; border-radius: 50%; filter: blur(90px) saturate(1.3); opacity: 0.9; will-change: transform; }
.bloom-a { width: 48vw; height: 48vw; left: 8%; top: 4%; background: rgba(230, 201, 163, 0.26); animation: drift-a 22s ease-in-out infinite alternate; }
.bloom-b { width: 42vw; height: 42vw; right: 4%; top: -6%; background: rgba(196, 122, 56, 0.14); animation: drift-b 26s ease-in-out infinite alternate; }
.bloom-c { width: 36vw; height: 36vw; left: 40%; top: 26%; background: rgba(90, 140, 235, 0.20); animation: drift-c 30s ease-in-out infinite alternate; }

@keyframes drift-a { to { transform: translate(4%, 5%) rotate(6deg); } }
@keyframes drift-b { to { transform: translate(-5%, 4%) rotate(-5deg); } }
@keyframes drift-c { to { transform: translate(3%, -4%) rotate(4deg); } }

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

.hero-copy { max-width: 780px; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 6px 12px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--ink-2); font: 500 13px/1 var(--font-mono); letter-spacing: 0.02em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(230, 201, 163, 0.18); }

.lede { max-width: 60ch; margin: 22px 0 0; color: var(--ink-2); font-size: clamp(17px, 1.6vw, 19px); }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.fineprint { margin: 14px 0 0; color: var(--ink-3); font-size: 13.5px; }

.shot { margin: 56px auto 0; }
.shot picture, .shot img {
  border-radius: var(--r-shot);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.10) inset, 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 120px rgba(230, 201, 163, 0.08);
  background: #0e0d0c;
}
.shot figcaption { margin-top: 12px; text-align: center; color: var(--ink-3); font-size: 13.5px; }

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

.section { padding: 84px 0; scroll-margin-top: 84px; }

.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }

.card { padding: 14px; border-radius: var(--r-card); transition: border-color var(--t), transform var(--t); }
.card:hover { border-color: rgba(255, 255, 255, 0.18); transform: translateY(-2px); }
.card picture, .card img { border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08); }
.card h3 { margin: 16px 6px 6px; }
.card p { margin: 0 6px 6px; color: var(--ink-2); font-size: 15px; }

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }
.cell { padding: 22px; border-radius: var(--r-card); transition: border-color var(--t); }
.cell:hover { border-color: rgba(255, 255, 255, 0.18); }
.bento > .cell { grid-column: span 2; }
.bento > .cell-wide { grid-column: span 3; }
.cell-media { margin: -8px -8px 18px; }
.cell-media picture, .cell-media img { border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08); }
.cell h3 { margin-bottom: 8px; }
.cell p { margin: 0; color: var(--ink-2); font-size: 15px; }
.cell-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 12px;
  color: var(--accent); background: rgba(230, 201, 163, 0.10); border: 1px solid rgba(230, 201, 163, 0.18); }

.section-agents { background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.025) 30%, rgba(255, 255, 255, 0.025) 70%, transparent); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.facts { list-style: none; margin: 0; padding: 10px 6px; border-radius: var(--r-card); }
.facts li { padding: 14px 18px; color: var(--ink-2); font-size: 15px; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; }
.facts strong { color: var(--ink); font-weight: 650; }

.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }

.section-download { padding-top: 40px; }
.download { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 40px; border-radius: 28px; }
.reqs { display: grid; gap: 14px; margin: 0; }
.reqs div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: baseline; }
.reqs dt { margin: 0; color: var(--ink-3); font: 600 12px/1.5 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.reqs dd { margin: 0; color: var(--ink-2); font-size: 15px; }

.foot { padding: 30px 0 40px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; }
.foot-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-row p { margin: 0; flex: 1; }
.foot nav { display: flex; gap: 16px; }
.foot nav a { text-decoration: none; color: var(--ink-2); }
.foot nav a:hover { color: var(--ink); }

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

@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > .cell { grid-column: span 1; }
  .bento > .cell-wide { grid-column: span 2; }
  .split, .download { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hero { padding-top: 64px; }
  .section { padding: 60px 0; }
  .modes { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .bento > .cell, .bento > .cell-wide { grid-column: auto; }
  .download { padding: 26px; }
  .reqs div { grid-template-columns: 1fr; gap: 2px; }

  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; left: 20px; right: 20px; top: 68px; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px; border-radius: 18px; background: rgba(18, 16, 14, 0.96); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-links .btn { margin: 6px 0 0; justify-content: center; }
}

@media (max-width: 420px) {
  .btn-lg { width: 100%; justify-content: center; }
  h1 { font-size: 36px; }
}

/* --- Material: grain, spotlight, glass edges, reveals ---------------------- */

/* A whisper of grain over everything, so the glass has a material to sit on
   rather than a flat colour. SVG noise, not a texture file: no request, no
   LCP cost. Fixed and inert. */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.045; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Spotlight: a soft pool of the accent that follows the cursor across a card.
   The position comes from two custom properties script.js sets on pointer
   move; with no pointer (touch, keyboard) the pool sits centred and faint. */
.spot { position: relative; overflow: hidden; --mx: 50%; --my: 40%; }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(230, 201, 163, 0.13), transparent 42%);
  opacity: 0; transition: opacity 260ms var(--t);
}
.spot:hover::before, .spot:focus-within::before { opacity: 1; }
.spot > * { position: relative; z-index: 1; }

/* Glass edge: on hover the border becomes a slow conic sweep of sand, white
   and the cool blue, drawn under a padding-box background so it reads as the
   lit rim of a pane rather than an outline. */
@property --edge { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.cell, .card {
  border-color: transparent;
  background-image:
    linear-gradient(var(--glass), var(--glass)),
    linear-gradient(var(--line), var(--line));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.cell:hover, .card:hover, .cell:focus-within, .card:focus-within {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.055)),
    conic-gradient(from var(--edge), rgba(230, 201, 163, 0.55), rgba(255, 255, 255, 0.10) 30%, rgba(90, 140, 235, 0.35) 55%, rgba(255, 255, 255, 0.10) 80%, rgba(230, 201, 163, 0.55));
  animation: edge-turn 6s linear infinite;
}
@keyframes edge-turn { to { --edge: 360deg; } }

/* The hero shot sits in a glass bezel, tilted back a few degrees and
   flattening as you scroll into it — transform only, driven by --tilt. */
.bezel { padding: 10px; border-radius: calc(var(--r-shot) + 10px); }
.shot-hero { perspective: 1600px; --tilt: 7deg; }
.shot-hero .bezel {
  transform: rotateX(var(--tilt));
  transform-origin: 50% 0;
  transition: transform 120ms linear;
  will-change: transform;
}
.shot-hero picture, .shot-hero img { border-radius: var(--r-shot); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.10) inset; }

/* The measured-facts strip under the hero. Numbers in the accent, tabular. */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 40px 0 0; padding: 6px; list-style: none; border-radius: 18px;
}
.stats li { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-left: 1px solid var(--line); }
.stats li:first-child { border-left: 0; }
.stats strong { font: 700 28px/1.1 var(--font-display); letter-spacing: -0.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.stats span { color: var(--ink-2); font-size: 14px; }

/* One word in the headline lit from behind. Static: a gradient, not a
   shimmer. */
.glow-word {
  background: linear-gradient(100deg, var(--accent-2), #fff6e8 45%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
}

/* Reveals: content settles into place as it enters the viewport. Gated on
   the `js` class so a page with no script — or no observer — shows
   everything at once, and motion-reduced users see it already settled. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 620ms var(--t), transform 620ms var(--t); }
.js .reveal.in { opacity: 1; transform: none; }
.js .modes .reveal:nth-child(2), .js .bento .reveal:nth-child(2) { transition-delay: 70ms; }
.js .modes .reveal:nth-child(3), .js .bento .reveal:nth-child(3) { transition-delay: 140ms; }

/* Primary button: a light sweep on hover, moved rather than repainted. */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: -40%; bottom: -40%; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg) translateX(0);
  transition: transform 520ms var(--t);
}
.btn-primary:hover::after { transform: skewX(-18deg) translateX(420%); }

/* The nav frosts harder once there is content behind it. */
.top.scrolled .nav { background: rgba(18, 16, 14, 0.62); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li:nth-child(3) { border-left: 0; }
}
@media (max-width: 760px) {
  .shot-hero { --tilt: 0deg; perspective: none; }
  .stats { grid-template-columns: 1fr; }
  .stats li { border-left: 0; border-top: 1px solid var(--line); }
  .stats li:first-child { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cell:hover, .card:hover { animation: none; }
  .shot-hero { --tilt: 0deg; }
  .shot-hero .bezel { transition: none; }
  .btn-primary::after { display: none; }
}
