/* SpAIcely — marketing site. Colours and type come from brand/README.md. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --night: #1E2A78;
  --night-deep: #141C55;
  --moonlight: #F4F5FF;
  --ai: #4B5BD6;
  --ai-on-dark: #AEB7FF;
  --spark: #F5A524;
  --ink: #141C55;
  --ink-soft: #4A5285;
  --line-on-dark: rgba(174, 183, 255, 0.22);
  --line-on-light: rgba(30, 42, 120, 0.14);

  /* Light sections; redefined for dark mode below. */
  --page: var(--moonlight);
  --surface: #FFFFFF;
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --line: var(--line-on-light);
  --eyebrow: var(--ai);
  --marker: var(--night);
  --marker-text: #FFFFFF;
  --code: var(--ai);
  --code-bg: rgba(75, 91, 214, 0.08);
  --card-shadow: 0 1px 0 var(--line-on-light), 0 18px 40px -28px rgba(20, 28, 85, 0.35);

  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Instrument Sans", "Avenir Next", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1240px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 18px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--spark); outline-offset: 3px; border-radius: 6px; }

/* ---------- The orbit: one line across the whole page ---------- */
.orbit {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}
.orbit path { fill: none; stroke-linecap: round; }
.orbit__ahead { stroke: rgba(111, 125, 230, 0.35); stroke-width: 1.5; stroke-dasharray: 2 10; }
.orbit__trail { stroke: #6F7DE6; stroke-width: 2.5; }
.orbit__satellite { fill: var(--spark); filter: drop-shadow(0 0 10px rgba(245, 165, 36, 0.7)); }

main, .top, .bottom { position: relative; z-index: 2; }

/* ---------- Shared pieces ---------- */
.eyebrow {
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--eyebrow);
  margin-bottom: 18px;
}
.eyebrow--dark, .hero .eyebrow { color: var(--ai-on-dark); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font: 600 16px/1 var(--body);
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.button--spark { background: var(--spark); color: var(--night-deep); }
.button--spark:hover { transform: translateY(-2px); background: #FFB940; }
.button--ghost { color: #fff; box-shadow: inset 0 0 0 1.5px var(--line-on-dark); }
.button--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ai-on-dark); }
.button--big { padding: 20px 34px; font-size: 19px; }

section { padding: clamp(80px, 11vw, 150px) var(--gutter); }
section > * { max-width: var(--max); margin-inline: auto; }

.section-head { margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2 { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.02; font-weight: 700; max-width: 18ch; }
.section-head__lead { margin-top: 20px; max-width: 46ch; color: var(--text-soft); font-size: 19px; }

/* ---------- Header ---------- */
.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px var(--gutter);
  color: #fff;
  z-index: 4;
}
.top__logo img { width: 170px; }
.top__nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); font-weight: 500; font-size: 16px; }
.top__nav a:not(.button) { text-decoration: none; opacity: 0.85; }
.top__nav a:not(.button):hover { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 700px at 85% 10%, #2A3A9E 0%, var(--night) 45%, var(--night-deep) 100%);
  color: #fff;
  padding-top: clamp(140px, 16vw, 200px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
}
.hero > * { max-width: none; margin: 0; }
.hero__title {
  font-size: clamp(48px, 7.4vw, 112px);
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variation-settings: "wdth" 100;
}
.hero__title span { display: block; color: var(--ai-on-dark); font-weight: 500; }
.hero__lead { margin-top: 28px; max-width: 34ch; font-size: clamp(18px, 1.6vw, 21px); color: rgba(255, 255, 255, 0.82); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero__note { margin-top: 18px; font-size: 14px; color: rgba(255, 255, 255, 0.6); }

/* The chat: the hero's thesis, played out on load */
.chat {
  margin: 0;
  background: rgba(10, 15, 50, 0.55);
  border: 1px solid var(--line-on-dark);
  border-radius: 22px;
  padding: 0 0 18px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}
.chat__bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid var(--line-on-dark); }
.chat__bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(174, 183, 255, 0.3); }
.chat__bar em { margin-left: 10px; font: 500 12px/1 var(--mono); font-style: normal; color: rgba(174, 183, 255, 0.75); }
.chat__log { list-style: none; margin: 0; padding: 18px; display: grid; gap: 12px; font-size: 15.5px; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 16px; line-height: 1.45; }
.msg--you { justify-self: end; background: var(--ai); color: #fff; border-bottom-right-radius: 4px; }
.msg--short { padding-inline: 18px; }
.msg--ai { background: rgba(255, 255, 255, 0.08); border-bottom-left-radius: 4px; }
.msg--tool {
  font: 500 13px/1.4 var(--mono);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 12px;
  border: 1px dashed var(--line-on-dark);
  border-radius: 10px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.msg--tool code { color: var(--spark); font: inherit; font-weight: 700; }
.msg--tool b { color: #fff; font-weight: 600; }
.progress { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.progress i { display: block; height: 100%; width: 100%; background: var(--spark); transform-origin: left; }
.msg--live {
  display: flex; align-items: center; gap: 12px;
  background: rgba(245, 165, 36, 0.12);
  border: 1px solid rgba(245, 165, 36, 0.4);
  color: #fff;
}
.live__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--spark); box-shadow: 0 0 0 6px rgba(245, 165, 36, 0.2); flex: none; }
.chat__caption { padding: 4px 22px 0; font-size: 12.5px; color: rgba(174, 183, 255, 0.6); }

@media (prefers-reduced-motion: no-preference) {
  .js .msg { opacity: 0; transform: translateY(10px); animation: arrive 0.5s ease forwards; }
  .js .msg:nth-child(1) { animation-delay: 0.4s; }
  .js .msg:nth-child(2) { animation-delay: 1.4s; }
  .js .msg:nth-child(3) { animation-delay: 2.2s; }
  .js .msg:nth-child(4) { animation-delay: 3.3s; }
  .js .msg:nth-child(5) { animation-delay: 4.1s; }
  .js .msg:nth-child(6) { animation-delay: 4.8s; }
  .js .msg:nth-child(7) { animation-delay: 6.4s; }
  .js .progress i { transform: scaleX(0); animation: fill 1.4s ease-in-out 5s forwards; }
  .js .live__dot { animation: pulse 2.4s ease-in-out 7s infinite; }
}
@keyframes arrive { to { opacity: 1; transform: none; } }
@keyframes fill { to { transform: scaleX(1); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(245, 165, 36, 0); } }

/* ---------- Steps ---------- */
.steps__list {
  list-style: none; padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-top: 2px solid var(--marker);
  counter-reset: step;
}
.steps__list li { padding: 28px 22px 0 0; position: relative; }
.steps__list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; top: -15px; left: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--marker); color: var(--marker-text);
  font: 700 13px/1 var(--mono);
}
.steps__list h3 { font-size: 26px; font-weight: 700; margin: 14px 0 10px; }
.steps__list p { color: var(--text-soft); font-size: 16.5px; }
.steps__list code { display: inline-block; margin-top: 14px; font: 600 12.5px/1 var(--mono); color: var(--code); background: var(--code-bg); padding: 6px 9px; border-radius: 6px; }

/* ---------- Safe ---------- */
.safe { background: var(--night-deep); color: #fff; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 110px); align-items: start; }
.safe > * { max-width: none; margin: 0; }
.safe__statement h2 { font-size: clamp(40px, 5.6vw, 80px); line-height: 0.98; font-weight: 800; }
.safe__statement p:last-child { margin-top: 26px; max-width: 40ch; color: rgba(255, 255, 255, 0.78); font-size: 19px; }
.safe__facts { margin: 0; display: grid; gap: 0; }
.safe__facts div { padding: 24px 0; border-top: 1px solid var(--line-on-dark); display: grid; grid-template-columns: 9.5em 1fr; gap: 20px; }
.safe__facts div:last-child { border-bottom: 1px solid var(--line-on-dark); }
.safe__facts dt { font: 700 20px/1.2 var(--display); color: var(--spark); }
.safe__facts dd { margin: 0; color: rgba(255, 255, 255, 0.8); font-size: 17px; }

/* ---------- Mail ---------- */
.mail__options { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mail__options li { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--card-shadow); }
.mail__options h3 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.mail__options p { color: var(--text-soft); font-size: 16.5px; }
.mail__options .mail__example { margin-top: 16px; font: 500 13px/1.5 var(--mono); color: var(--code); background: var(--code-bg); padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; }

/* ---------- Together ---------- */
.roles { list-style: none; padding: 0; display: grid; gap: 12px; }
.roles li {
  display: grid;
  grid-template-columns: 12em 9em 1fr;
  align-items: center;
  gap: 20px;
  padding: 20px 26px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.roles__name { font: 700 20px/1.2 var(--display); }
.roles__role { font: 600 13px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--eyebrow); }
.roles__can { color: var(--text-soft); }

/* ---------- Designers ---------- */
.designers { background: var(--night); color: #fff; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(40px, 7vw, 100px); align-items: center; }
.designers > * { max-width: none; margin: 0; }
.designers h2 { font-size: clamp(36px, 4.8vw, 66px); line-height: 1; font-weight: 800; max-width: 16ch; }
.designers__text p { margin-top: 22px; max-width: 44ch; color: rgba(255, 255, 255, 0.8); }
.designers__text .eyebrow { margin-top: 0; }
.handover { display: grid; place-items: center; }
.handover__card {
  width: min(100%, 380px);
  background: var(--moonlight);
  color: var(--ink);
  border-radius: 22px;
  padding: 30px;
  transform: rotate(-3deg);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.55);
}
.handover__label { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ai); }
.handover__site { margin-top: 14px; font: 800 30px/1.1 var(--display); }
.handover__from { margin-top: 10px; color: var(--ink-soft); }
.handover__keep { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-on-light); font-size: 15px; }
.handover__button { margin-top: 22px; display: block; text-align: center; padding: 14px; border-radius: 999px; background: var(--night); color: #fff; font-weight: 600; }

/* ---------- Prices ---------- */
.prices__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.plan { background: var(--surface); border-radius: var(--radius); padding: 32px; box-shadow: var(--card-shadow); }
.plan h3 { font-size: 28px; font-weight: 700; }
.plan__price { margin-top: 18px; color: var(--text-soft); }
.plan__price span { font: 800 52px/1 var(--display); color: var(--text); letter-spacing: -0.03em; margin-right: 6px; }
.plan__for { margin-top: 8px; font-size: 15px; color: var(--eyebrow); font-weight: 600; }
.plan ul { margin: 24px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); list-style: none; display: grid; gap: 10px; font-size: 16px; }
.plan li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 12px; border-radius: 50%; background: var(--eyebrow); vertical-align: 2px; }
.plan--featured { background: var(--night); color: #fff; }
.plan--featured .plan__price, .plan--featured .plan__price span { color: #fff; }
.plan--featured .plan__for { color: var(--spark); }
.plan--featured ul { border-color: var(--line-on-dark); }
.plan--featured li::before { background: var(--spark); }

/* ---------- FAQ ---------- */
.faq { padding-top: 0; }
.faq h2 { font-size: clamp(34px, 4.4vw, 60px); font-weight: 700; margin-bottom: 28px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 24px 40px 24px 0; font: 600 21px/1.3 var(--display); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 20px; font: 400 28px/1 var(--body); color: var(--eyebrow); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 26px; max-width: 62ch; color: var(--text-soft); }

/* ---------- Last call ---------- */
.last { background: var(--night); color: #fff; text-align: center; }
.last h2 { font-size: clamp(40px, 6.4vw, 96px); line-height: 0.98; font-weight: 800; max-width: 14ch; margin-bottom: 40px; }

/* ---------- Footer ---------- */
.bottom { background: var(--night-deep); color: rgba(255, 255, 255, 0.7); padding: 48px var(--gutter); display: grid; gap: 10px; justify-items: center; text-align: center; font-size: 14.5px; }
.bottom img { margin-bottom: 8px; }

/* ---------- Header tools: language and theme ---------- */
.top__tools { display: flex; align-items: center; gap: 14px; margin-left: clamp(14px, 2vw, 28px); }
.languages { display: flex; gap: 2px; }
.languages a { padding: 8px 5px 9px; text-decoration: none; opacity: 0.55; transition: opacity 0.2s ease; }
.languages a:hover { opacity: 1; }
.languages a[aria-current="true"] { opacity: 1; box-shadow: inset 0 -2px 0 var(--spark); }
.flag { display: block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28); }
.theme {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; color: #fff; cursor: pointer;
  border: 1.5px solid var(--line-on-dark);
}
.theme:hover { border-color: var(--ai-on-dark); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme__moon { fill: currentColor; stroke: none; }
.theme__sun { display: none; }

/* ---------- Dark mode: system preference, or the visitor's own choice ---------- */
:root[data-theme="dark"] {
  --page: #0B1033;
  --surface: #161E5E;
  --text: #EEF0FF;
  --text-soft: #B3B9E8;
  --line: rgba(174, 183, 255, 0.16);
  --eyebrow: var(--ai-on-dark);
  --marker: var(--ai-on-dark);
  --marker-text: var(--night-deep);
  --code: #CDD3FF;
  --code-bg: rgba(174, 183, 255, 0.1);
  --card-shadow: 0 0 0 1px rgba(174, 183, 255, 0.12);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0B1033;
    --surface: #161E5E;
    --text: #EEF0FF;
    --text-soft: #B3B9E8;
    --line: rgba(174, 183, 255, 0.16);
    --eyebrow: var(--ai-on-dark);
    --marker: var(--ai-on-dark);
    --marker-text: var(--night-deep);
    --code: #CDD3FF;
    --code-bg: rgba(174, 183, 255, 0.1);
    --card-shadow: 0 0 0 1px rgba(174, 183, 255, 0.12);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .theme__moon { display: none; }
  :root:not([data-theme="light"]) .theme__sun { display: block; }
}
:root[data-theme="dark"] .theme__moon { display: none; }
:root[data-theme="dark"] .theme__sun { display: block; }
:root[data-theme="dark"] .plan--featured,
:root:not([data-theme="light"]) .plan--featured { box-shadow: 0 0 0 1px rgba(245, 165, 36, 0.45); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .plan--featured { box-shadow: var(--card-shadow); }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 960px) {
  .hero, .safe, .designers { grid-template-columns: minmax(0, 1fr); }
  .steps__list { grid-template-columns: 1fr; border-top: 0; border-left: 2px solid var(--night); padding-left: 28px; gap: 30px; }
  .steps__list li { padding: 0; }
  .steps__list li::before { top: 2px; left: -43px; }
  .steps__list h3 { margin-top: 0; }
  .prices__grid, .mail__options { grid-template-columns: minmax(0, 1fr); }
  .roles li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
@media (max-width: 720px) {
  .top__nav a:not(.button) { display: none; }
  .top { padding-block: 18px; }
  .top__logo img { width: 128px; }
  .top__nav .button { display: none; }
  .top__tools { margin-left: 0; gap: 8px; }
  .languages a { padding: 8px 3px 9px; }
  .flag { width: 20px; height: 14px; }
  .msg { max-width: 100%; }
  .msg--tool { font-size: 12px; }
  .safe__facts div { grid-template-columns: 1fr; gap: 6px; }
  .orbit { display: none; }
}
