/* ============================================================
   Crewnyx — Twilight Ops design system
   Version: 1.0 (2026-07-11)
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand-primary:    #1E1B4B;
  --brand-primary-hi: #312E81;
  --brand-primary-lo: #0F0D2E;
  --brand-accent:     #F97066;
  --brand-accent-hi:  #FDA29B;
  --brand-accent-lo:  #B42318;
  --brand-mint:       #4ADE80;
  --brand-amber:      #FBBF24;

  /* Surface */
  --surface-cream:    #FEF9F5;
  --surface-white:    #FFFFFF;

  /* Ink */
  --ink-900: #0F0D2E;
  --ink-700: #3B3A5C;
  --ink-500: #6B6A87;
  --ink-300: #C4C3D4;
  --ink-100: #F1F0F7;

  /* Radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 2px 0 rgb(15 13 46 / .05);
  --shadow-md:   0 4px 12px -2px rgb(15 13 46 / .08);
  --shadow-lg:   0 12px 32px -8px rgb(15 13 46 / .15);
  --shadow-glow: 0 0 32px -4px rgb(249 112 102 / .35);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --dur-slow: 400ms;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);

  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--surface-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 {
  color: var(--ink-900);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.875rem, 3.5vw, 2.75rem); letter-spacing: -0.015em; }
h3 { font-size: clamp(1.375rem, 2.2vw, 1.75rem); font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }
p  { margin: 0 0 1em; }
a.link { color: var(--brand-accent-lo); text-decoration: underline; text-underline-offset: 3px; }
a.link:hover { color: var(--brand-primary); }
code, pre { font-family: var(--font-mono); font-size: 0.9em; }
pre { background: var(--ink-100); padding: 16px 20px; border-radius: var(--r-md); overflow-x: auto; }
hr { border: 0; border-top: 1px solid var(--ink-300); margin: 48px 0; }

/* ---------- Container ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(254 249 245 / .85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ink-100);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { width: 36px; height: 36px; }
.nav-brand-text { font-weight: 700; font-size: 1.1rem; color: var(--ink-900); letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  color: var(--ink-700);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.nav-links a:hover { color: var(--ink-900); background: var(--ink-100); }
.nav-links a.nav-cta { background: var(--brand-primary); color: var(--surface-cream); }
.nav-links a.nav-cta:hover { background: var(--brand-primary-hi); }
.nav-toggle { display: none; background: transparent; border: 0; padding: 8px; color: var(--ink-900); }
.nav-toggle svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; padding: 12px var(--gutter) 20px; background: var(--surface-cream);
    border-bottom: 1px solid var(--ink-100); gap: 4px; align-items: stretch; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; }
  .nav-toggle { display: block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              background var(--dur-fast) var(--ease);
  text-align: center;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--brand-accent);
  color: var(--brand-primary-lo);
  box-shadow: var(--shadow-md);
}
.btn--primary:hover {
  background: var(--brand-accent-hi);
  box-shadow: var(--shadow-glow);
}

.btn--dark {
  background: var(--brand-primary);
  color: var(--surface-cream);
}
.btn--dark:hover { background: var(--brand-primary-hi); }

.btn--ghost {
  background: transparent;
  color: var(--ink-900);
  border: 1px solid var(--ink-300);
}
.btn--ghost:hover { background: var(--ink-100); border-color: var(--ink-500); }

.btn--large { padding: 18px 32px; font-size: 1.05rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--tight { padding: clamp(40px, 5vw, 64px) 0; }
.section--dark {
  background: linear-gradient(160deg, var(--brand-primary-hi), var(--brand-primary-lo));
  color: var(--ink-300);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--surface-cream); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-accent-lo);
  margin-bottom: 12px;
}
.section--dark .eyebrow { color: var(--brand-accent-hi); }

.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.5;
  color: var(--ink-700);
  max-width: 680px;
}
.section--dark .lede { color: var(--ink-300); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(72px, 10vw, 128px) 0 clamp(64px, 8vw, 96px);
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgb(249 112 102 / .10), transparent 60%),
    radial-gradient(ellipse 70% 60% at 10% 100%, rgb(49 46 129 / .08), transparent 60%),
    var(--surface-cream);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: 20px; }
.hero .lede { margin-bottom: 32px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.hero-note { font-size: 0.9rem; color: var(--ink-500); }
.hero-note strong { color: var(--brand-primary); font-weight: 600; }

.hero-visual {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--brand-primary-hi), var(--brand-primary-lo));
  box-shadow: var(--shadow-lg);
  padding: 32px;
  color: var(--surface-cream);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.hero-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 200px at 90% 10%, rgb(249 112 102 / .28), transparent 70%),
    radial-gradient(circle 260px at 10% 90%, rgb(74 222 128 / .12), transparent 70%);
  pointer-events: none;
}
.hero-visual > * { position: relative; z-index: 1; }

.mock-card {
  background: rgb(15 13 46 / .6);
  border: 1px solid rgb(196 195 212 / .15);
  border-radius: var(--r-md);
  padding: 16px 18px;
  backdrop-filter: blur(6px);
}
.mock-card + .mock-card { margin-top: 0; }
.mock-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand-accent-hi); margin-bottom: 6px; }
.mock-value { font-size: 1.5rem; font-weight: 700; color: var(--surface-cream); }
.mock-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid rgb(196 195 212 / .1); }
.mock-row:last-child { border-bottom: 0; }
.mock-label { color: var(--ink-300); font-size: 0.9rem; }
.mock-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-full); font-size: 0.75rem; font-weight: 600; background: rgb(74 222 128 / .18); color: var(--brand-mint); }
.mock-pill.warn { background: rgb(251 191 36 / .18); color: var(--brand-amber); }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.feature {
  background: var(--surface-white);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--ink-300);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-hi));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--brand-accent-hi);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 8px; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--ink-500); font-size: 0.95rem; }

/* ---------- Security section ---------- */
.security-callout {
  background: linear-gradient(160deg, var(--brand-primary-hi), var(--brand-primary-lo));
  color: var(--ink-300);
  border-radius: var(--r-lg);
  padding: clamp(32px, 5vw, 56px);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.security-callout::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: radial-gradient(circle 400px at 90% 10%, rgb(249 112 102 / .15), transparent 60%);
  pointer-events: none;
}
.security-callout > * { position: relative; }
.security-callout h2 { color: var(--surface-cream); margin-bottom: 12px; }
.security-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 32px; }
.security-item { display: flex; gap: 12px; align-items: flex-start; }
.security-check {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  border-radius: var(--r-full);
  background: var(--brand-mint);
  color: var(--brand-primary-lo);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.security-item strong { color: var(--surface-cream); display: block; margin-bottom: 2px; }
.security-item p { margin: 0; font-size: 0.9rem; color: var(--ink-300); }

/* ---------- Pricing ---------- */
.pricing-toggle {
  display: inline-flex;
  padding: 4px;
  background: var(--ink-100);
  border-radius: var(--r-full);
  margin-bottom: 40px;
}
.pricing-toggle button {
  padding: 8px 20px;
  border: 0;
  background: transparent;
  color: var(--ink-500);
  font-weight: 600;
  border-radius: var(--r-full);
  transition: all var(--dur-base) var(--ease);
}
.pricing-toggle button.active {
  background: var(--brand-primary);
  color: var(--surface-cream);
  box-shadow: var(--shadow-sm);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.plan {
  background: var(--surface-white);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.plan--featured {
  border: 2px solid var(--brand-accent);
  background: linear-gradient(180deg, var(--surface-white), var(--surface-cream));
}
.plan--featured::before {
  content: 'Most popular';
  position: absolute;
  top: -13px;
  right: 24px;
  background: var(--brand-accent);
  color: var(--brand-primary-lo);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--r-full);
  letter-spacing: 0.02em;
}
.plan h3 { font-size: 1.25rem; margin-bottom: 4px; }
.plan-tag { font-size: 0.85rem; color: var(--ink-500); margin-bottom: 20px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 20px; }
.plan-price-amount { font-size: 2.75rem; font-weight: 800; color: var(--ink-900); letter-spacing: -0.02em; }
.plan-price-suffix { color: var(--ink-500); font-size: 0.95rem; }
.plan-features { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.plan-features li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0;
  font-size: 0.95rem;
}
.plan-features li::before {
  content: '';
  flex: 0 0 20px;
  width: 20px; height: 20px;
  border-radius: var(--r-full);
  background: var(--brand-mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%230F0D2E'%3E%3Cpath d='M7.5 13.5l-3-3 1-1 2 2 5-5 1 1z'/%3E%3C/svg%3E") center/14px no-repeat;
  margin-top: 2px;
}
.plan .btn { width: 100%; }

/* ---------- Footer ---------- */
.footer {
  background: var(--brand-primary-lo);
  color: var(--ink-300);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 { color: var(--surface-cream); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { padding: 5px 0; }
.footer ul a { color: var(--ink-300); font-size: 0.95rem; transition: color var(--dur-fast) var(--ease); }
.footer ul a:hover { color: var(--brand-accent-hi); }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.footer-brand img { width: 36px; height: 36px; }
.footer-brand-text { font-weight: 700; font-size: 1.1rem; color: var(--surface-cream); }
.footer-tag { font-size: 0.9rem; color: var(--ink-300); max-width: 320px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid rgb(196 195 212 / .12);
  font-size: 0.85rem;
  color: var(--ink-500);
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom a { color: var(--ink-300); }
.footer-bottom a:hover { color: var(--brand-accent-hi); }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-680 { max-width: 680px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Print ---------- */
@media print {
  .nav, .footer, .hero-ctas { display: none; }
  body { background: white; color: black; }
}
