/* Cadence Cloud — design tokens and shared shell */
:root {
  --bg: #f5f4ef;
  --bg-soft: #eeede6;
  --surface: #ffffff;
  --surface-2: #fbfaf5;
  --surface-3: #f2f1ea;
  --ink: #12141a;
  --ink-soft: #2b2e37;
  --muted: #5d626f;
  --dim: #8b8f9b;
  --line: rgba(18, 20, 26, 0.1);
  --line-strong: rgba(18, 20, 26, 0.18);
  --accent: #4b3ff0;
  --accent-soft: #ece9ff;
  --accent-ink: #ffffff;
  --lime: #d9f26b;
  --lime-ink: #1d2405;
  --teal: #109a86;
  --rose: #e5567f;
  --shadow-sm: 0 1px 2px rgba(18, 20, 26, 0.05), 0 4px 14px rgba(18, 20, 26, 0.05);
  --shadow-md: 0 18px 50px rgba(18, 20, 26, 0.12);
  --shadow-lg: 0 40px 120px rgba(18, 20, 26, 0.16);
  --radius: 18px;
  --wrap: 1200px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grid-line: rgba(18, 20, 26, 0.055);
}

[data-theme="dark"] {
  --bg: #0a0c11;
  --bg-soft: #0d1017;
  --surface: #13161e;
  --surface-2: #171b24;
  --surface-3: #1d2130;
  --ink: #f2f4f9;
  --ink-soft: #dce0ea;
  --muted: #a0a7b7;
  --dim: #767e90;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.19);
  --accent: #9a92ff;
  --accent-soft: rgba(154, 146, 255, 0.14);
  --accent-ink: #0c0a1f;
  --lime: #d6f36a;
  --lime-ink: #161d02;
  --teal: #4fd6c0;
  --rose: #ff86a6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 40px 120px rgba(0, 0, 0, 0.55);
  --grid-line: rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; }

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

html, body { margin: 0; background: var(--bg); color: var(--ink); }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

body.is-locked { overflow: hidden; }

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; }

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(20px, 4vw, 40px); }

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s, background 0.4s;
}

.topbar.is-stuck { border-bottom-color: var(--line); }

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.logo svg { width: 26px; height: 26px; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.2s, background 0.3s;
}

.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.top-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.25s, background 0.3s;
}

.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; position: absolute; transition: transform 0.5s var(--ease), opacity 0.4s; }
.theme-toggle .sun { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle .moon { opacity: 0; transform: rotate(-60deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .sun { opacity: 0; transform: rotate(60deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .moon { opacity: 1; transform: rotate(0) scale(1); }

.burger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
}

.burger span { width: 15px; height: 1.5px; background: currentColor; position: relative; transition: transform 0.3s, opacity 0.3s; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; width: 15px; height: 1.5px; background: currentColor; transition: transform 0.3s, top 0.3s; }
.burger span::before { top: -5px; }
.burger span::after { top: 5px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.burger[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

.drawer {
  display: none;
  position: fixed;
  inset: 68px 0 auto 0;
  z-index: 45;
  max-height: calc(100dvh - 68px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px clamp(20px, 4vw, 40px) 26px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  flex-direction: column;
}

.drawer.is-open { display: flex; box-shadow: 0 28px 60px rgba(10, 12, 17, 0.18); }

/* dim the page behind the open menu so the panel reads as a menu, and tapping
   the page dismisses it */
.menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(10, 12, 17, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.menu-scrim.is-on { opacity: 1; pointer-events: auto; }
.drawer a { padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
/* the drawer CTA is a .btn too: keep its pill padding instead of inheriting the
   flat link padding, which used to clip the label */
.drawer a.btn {
  margin-top: 18px;
  align-self: flex-start;
  width: fit-content;
  padding: 0 22px;
  border-bottom: 0;
  font-size: 15px;
  line-height: 1;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s, border-color 0.3s, color 0.3s;
}

.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.btn-lime { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); font-weight: 600; }
.btn-sm { min-height: 38px; padding: 0 15px; font-size: 13px; }
.btn-ghost { background: transparent; }

/* ---------- typography ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
}

.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

.h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5.6vw, 4.5rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.h2 {
  font-family: var(--display);
  font-size: clamp(1.85rem, 3.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.h3 {
  font-family: var(--display);
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.lede { font-size: clamp(1rem, 1.2vw, 1.12rem); line-height: 1.65; color: var(--muted); }

.h1 em, .h2 em {
  font-style: normal;
  background: linear-gradient(96deg, var(--accent), #8f7bff 60%, var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- section ---------- */
.section { padding: clamp(56px, 8vw, 108px) 0; }
.section-tight { padding: clamp(40px, 5vw, 70px) 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 20px 40px;
  margin-bottom: clamp(30px, 4vw, 50px);
}

.section-head .h2 { max-width: 20ch; }
.section-head .lede { max-width: 44ch; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-soft); padding: clamp(44px, 6vw, 72px) 0 28px; }

.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot-brand p { margin-top: 14px; max-width: 32ch; color: var(--muted); font-size: 14px; }
.foot-col h3 { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); font-weight: 500; margin-bottom: 14px; }
.foot-col a { display: block; font-size: 14px; color: var(--muted); padding-block: 5px; transition: color 0.2s; }
.foot-col a:hover { color: var(--ink); }

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(32px, 4vw, 52px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--dim);
}

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); margin-bottom: 7px; }
.field label span { color: var(--dim); font-weight: 400; }

.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea { min-height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--rose); }
.field-error { display: none; margin-top: 6px; font-size: 12.5px; color: var(--rose); }
.field.has-error .field-error { display: block; }

.form-success { display: none; text-align: center; padding: 22px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.form-success.is-on { display: block; animation: pop 0.5s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.98) translateY(8px); } to { opacity: 1; transform: none; } }

.success-mark { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.success-mark svg { width: 21px; height: 21px; }
.form-success h3 { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.form-success p { margin-top: 7px; font-size: 14px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .burger { display: inline-flex; }
  .top-actions .btn:not(.btn-sm) { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
  .topbar-inner { height: 62px; }
  .top-actions .btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
