/* ============================================================================
   CrabDuino — marketing site.
   Built strictly from the product's five locked colors. Every other tone is
   *derived* from these via color-mix() (black/white are shading agents only).
   ========================================================================== */
:root {
  /* The only five colors. */
  --slate: #434959; /* darkest  — base surfaces      */
  --pale: #dcf2f2; /* lightest — text               */
  --mauve: #6c6466; /* neutral  — muted / borders    */
  --clay: #bf7e6f; /* warm     — secondary accent    */
  --red: #bf5050; /* accent   — primary action      */

  /* Derived surfaces (computed from the palette). */
  --bg: color-mix(in srgb, var(--slate) 58%, #000);
  --bg-2: color-mix(in srgb, var(--slate) 72%, #000);
  --surface: color-mix(in srgb, var(--slate) 90%, #fff);
  --surface-2: color-mix(in srgb, var(--slate) 80%, #000);
  --line: color-mix(in srgb, var(--mauve) 60%, transparent);
  --line-strong: color-mix(in srgb, var(--mauve) 85%, #000);
  --text: var(--pale);
  --muted: color-mix(in srgb, var(--pale) 52%, var(--mauve));
  --glass: color-mix(in srgb, var(--slate) 70%, transparent);
  --shadow: 0 24px 60px -20px color-mix(in srgb, #000 80%, transparent);
  --glow-red: 0 0 0 1px color-mix(in srgb, var(--red) 60%, transparent),
    0 14px 40px -10px color-mix(in srgb, var(--red) 55%, transparent);

  --mono: "Source Code Pro", ui-monospace, "SF Mono", "Cascadia Code", Menlo,
    monospace;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

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

::selection {
  background: color-mix(in srgb, var(--red) 70%, transparent);
  color: var(--pale);
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.12em 0.42em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--pale) 10%, transparent);
  color: var(--clay);
}

/* ---- animated background -------------------------------------------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  mix-blend-mode: screen;
  animation: drift 22s var(--ease) infinite alternate;
}
.blob-1 {
  background: var(--red);
  top: -12vw;
  left: -8vw;
}
.blob-2 {
  background: var(--clay);
  top: 20vw;
  right: -12vw;
  animation-delay: -7s;
}
.blob-3 {
  background: color-mix(in srgb, var(--pale) 70%, var(--slate));
  bottom: -18vw;
  left: 30vw;
  opacity: 0.28;
  animation-delay: -13s;
}
@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(6vw, 4vw) scale(1.25);
  }
}
.grid-lines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000, transparent 75%);
  opacity: 0.5;
}

/* pointer-following glow */
.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--clay) 30%, transparent),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}

/* ---- nav ------------------------------------------------------------------ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px clamp(18px, 5vw, 48px);
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--clay);
  background: color-mix(in srgb, var(--clay) 16%, transparent);
  border: 1px solid var(--line);
  transition: transform 0.4s var(--ease), color 0.3s;
}
.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.06);
  color: var(--red);
}
.brand-name {
  font-size: 19px;
}
.accent {
  color: var(--red);
}
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--pale) 8%, transparent);
}
.nav-cta {
  color: var(--pale) !important;
  background: var(--red);
  border: 1px solid color-mix(in srgb, var(--red) 60%, #000);
}
.nav-cta:hover {
  filter: brightness(1.1);
  background: var(--red) !important;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s var(--ease);
}
.nav.open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav.open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
.nav.open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- shared layout -------------------------------------------------------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(70px, 11vw, 140px) clamp(18px, 5vw, 40px);
}
.section-head {
  max-width: 680px;
  margin: 0 auto clamp(40px, 6vw, 72px);
  text-align: center;
}
.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 18px;
}
h1,
h2,
h3,
h4 {
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-weight: 700;
}
h2 {
  font-size: clamp(28px, 4.4vw, 46px);
}
.lede {
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 18px);
}
.grad {
  background: linear-gradient(100deg, var(--clay), var(--red) 55%, var(--pale));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  transition: transform 0.15s var(--ease), filter 0.2s, box-shadow 0.3s,
    background 0.2s;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn .ic {
  font-weight: 800;
}
.btn-primary {
  background: var(--red);
  color: var(--pale);
  border-color: color-mix(in srgb, var(--red) 55%, #000);
  box-shadow: var(--glow-red);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}
.btn-ghost {
  background: color-mix(in srgb, var(--pale) 6%, transparent);
  color: var(--text);
}
.btn-ghost:hover {
  background: color-mix(in srgb, var(--pale) 12%, transparent);
  border-color: var(--clay);
  transform: translateY(-2px);
}
.btn-lg {
  padding: 16px 28px;
  font-size: 16px;
}

/* ---- hero ----------------------------------------------------------------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(130px, 17vw, 190px) clamp(18px, 5vw, 40px) 60px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(30px, 5vw, 64px);
  align-items: center;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--clay);
  margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(38px, 6.4vw, 70px);
  letter-spacing: -0.04em;
}
.hero-sub {
  margin-top: 22px;
  max-width: 30em;
  color: var(--muted);
  font-size: clamp(15px, 1.7vw, 18px);
}
.hero-sub em {
  color: var(--text);
  font-style: italic;
}
.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.hero-actions.center {
  justify-content: center;
}
.hero-trust {
  margin-top: 26px;
  font-size: 13px;
  color: var(--muted);
}
.hero-trust.center {
  text-align: center;
}
.hero-trust b {
  color: var(--clay);
  font-weight: 600;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--red);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 70%, transparent);
  animation: pulse 2.4s infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 60%, transparent);
  }
  70% {
    box-shadow: 0 0 0 9px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---- window / code mockups ------------------------------------------------ */
.hero-app {
  position: relative;
}
.window {
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.tl-1 {
  background: var(--red);
}
.tl-2 {
  background: var(--clay);
}
.tl-3 {
  background: color-mix(in srgb, var(--pale) 60%, var(--mauve));
}
.window-title {
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
}
.code {
  margin: 0;
  padding: 20px 22px;
  font-size: clamp(12px, 1.25vw, 14px);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  color: var(--pale);
  tab-size: 4;
}
.code code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* palette-only syntax highlighting */
.c-com {
  color: var(--mauve);
  font-style: italic;
}
.c-kw {
  color: var(--red);
  font-weight: 600;
}
.c-mac,
.c-at {
  color: var(--clay);
  font-weight: 600;
}
.c-fn {
  color: color-mix(in srgb, var(--clay) 55%, var(--pale));
}
.c-ty {
  color: var(--clay);
}
.c-str {
  color: color-mix(in srgb, var(--pale) 75%, var(--clay));
}
.c-num {
  color: color-mix(in srgb, var(--clay) 80%, var(--pale));
}
.c-ok {
  color: var(--pale);
  font-weight: 700;
}
.caret {
  color: var(--clay);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* terminal under the hero editor */
.terminal {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--slate) 55%, #000);
}
.terminal-head {
  padding: 8px 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--clay);
  border-bottom: 1px solid var(--line);
}
.terminal-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clay);
  margin-right: 7px;
}
.terminal-body {
  padding: 12px 16px;
  min-height: 86px;
  font-size: 12.5px;
  line-height: 1.7;
}
.terminal-body .t-line {
  opacity: 0;
  transform: translateY(4px);
  animation: termIn 0.4s var(--ease) forwards;
}
.t-info {
  color: var(--clay);
}
.t-out {
  color: var(--pale);
}
.t-ok {
  color: var(--pale);
  font-weight: 700;
}
.t-ok::before {
  content: "✓ ";
  color: var(--clay);
}
@keyframes termIn {
  to {
    opacity: 1;
    transform: none;
  }
}

/* the little board with a blinking LED */
.board {
  position: absolute;
  right: -14px;
  bottom: -22px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.board-led {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--red) 40%, #000);
  transition: background 0.1s, box-shadow 0.1s;
}
.board-led.on {
  background: var(--red);
  box-shadow: 0 0 12px 2px color-mix(in srgb, var(--red) 80%, transparent);
}

/* ---- marquee -------------------------------------------------------------- */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  gap: 28px;
  width: max-content;
  animation: scroll 26s linear infinite;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.marquee-track span:not(:nth-child(2n)) {
  color: var(--clay);
}
@keyframes scroll {
  to {
    transform: translateX(-50%);
  }
}

/* ---- feature cards -------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  position: relative;
  padding: 28px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--slate) 82%, #000);
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--clay) 16%, transparent),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover {
  border-color: color-mix(in srgb, var(--clay) 60%, transparent);
  background: color-mix(in srgb, var(--slate) 88%, #000);
}
.card:hover::before {
  opacity: 1;
}
.card-ic {
  font-size: 26px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 18px;
  background: color-mix(in srgb, var(--red) 14%, transparent);
  border: 1px solid var(--line);
}
.card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.card p {
  color: var(--muted);
  font-size: 14.5px;
}

/* ---- steps ---------------------------------------------------------------- */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}
.step {
  padding: 30px 26px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--slate) 80%, #000);
  position: relative;
}
.step-no {
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.1em;
}
.step h3 {
  font-size: 22px;
  margin: 10px 0 8px;
}
.step p {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 16px;
}
.snippet {
  background: color-mix(in srgb, var(--slate) 55%, #000);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  color: var(--pale);
}
.snippet code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ---- split showcase ------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: center;
}
.split-copy .kicker {
  margin-bottom: 16px;
}
.ticks {
  list-style: none;
  margin: 24px 0 28px;
  display: grid;
  gap: 12px;
}
.ticks li {
  position: relative;
  padding-left: 30px;
  color: var(--muted);
  font-size: 15px;
}
.ticks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  color: var(--pale);
  background: color-mix(in srgb, var(--red) 80%, #000);
}

/* ---- CTA ------------------------------------------------------------------ */
.cta {
  padding: clamp(40px, 7vw, 90px) clamp(18px, 5vw, 40px);
}
.cta-inner {
  max-width: 840px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(44px, 7vw, 80px) clamp(24px, 5vw, 60px);
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  background: radial-gradient(
      120% 140% at 50% 0%,
      color-mix(in srgb, var(--red) 20%, transparent),
      transparent 60%
    ),
    color-mix(in srgb, var(--slate) 86%, #000);
  position: relative;
  overflow: hidden;
}
.cta-inner h2 {
  font-size: clamp(28px, 4.6vw, 48px);
}
.cta-inner p {
  margin-top: 14px;
  color: var(--muted);
}
.cta-inner .hero-actions {
  margin-top: 30px;
}

/* ---- footer --------------------------------------------------------------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px clamp(18px, 5vw, 40px) 48px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
}
.footer-brand p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.footer-cols h4 {
  font-size: 13px;
  color: var(--clay);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-cols a {
  display: block;
  color: var(--muted);
  font-size: 14px;
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-cols a:hover {
  color: var(--text);
}
.footer-fine {
  grid-column: 1 / -1;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

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

/* ---- responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .hero,
  .split {
    grid-template-columns: 1fr;
  }
  .hero {
    text-align: center;
  }
  .hero-sub {
    margin-inline: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .cards,
  .steps {
    grid-template-columns: 1fr 1fr;
  }
  .board {
    right: 10px;
  }
  .nav-links {
    position: fixed;
    inset: 64px 12px auto 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s var(--ease);
  }
  .nav.open .nav-links {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a {
    padding: 12px 14px;
  }
  .nav-toggle {
    display: flex;
    margin-left: auto;
  }
}
@media (max-width: 560px) {
  .cards,
  .steps,
  .footer,
  .footer-cols {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
