/* Manifold marketing site — design tokens & base styles */

/* Self-hosted IBM Plex (SIL Open Font License 1.1).
   See /fonts/LICENSE-IBM-Plex.txt for the full license text. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/IBMPlexSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/IBMPlexSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


:root {
  /* Brand palette */
  --amber: #F2B43A;
  --amber-deep: #C68918;
  --cream: #FBE8B5;
  --sand: #F5EFE3;
  --sand-deep: #ECE3D0;
  --parchment: #FBF8F1;
  --ink: #141413;
  --ink-2: #3A332A;
  --ink-3: #6B6155;
  --ink-4: #A89E91;
  --hairline: rgba(20, 20, 19, 0.10);
  --hairline-strong: rgba(20, 20, 19, 0.18);
  --dusk: #15110A;
  --parchment-dark: #FAF9F5;
  --brick: #B5462C;
  --sage: #7A8763;
  /* Theme-aware translucent washes for zebra rows, hover, etc */
  --row-zebra: rgba(255, 255, 255, 0.5);
  --chip-bg: rgba(20, 20, 19, 0.06);
  --chip-bg-soft: rgba(20, 20, 19, 0.025);
  --chip-bg-strong: rgba(20, 20, 19, 0.05);

  /* Vendor dot colors (for Claude/Codex identification — text only, no logos) */
  --claude-dot: #D97757;     /* warm coral, distinct from brick */
  --codex-dot: #6F5BD0;      /* indigo violet */

  /* Type */
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --max-w: 1200px;
  --gutter: 24px;
}

[data-theme="dark"] {
  --parchment: #15110A;
  --sand: #1C1A17;
  --sand-deep: #232120;
  --ink: #FAF9F5;
  --ink-2: #C9C0B0;
  --ink-3: #8A8273;
  --ink-4: #5A5347;
  --hairline: rgba(250, 249, 245, 0.10);
  --hairline-strong: rgba(250, 249, 245, 0.18);
  --cream: #3A2F18;
  /* Theme-aware translucent washes for zebra rows, hover, etc */
  --row-zebra: rgba(250, 249, 245, 0.04);
  --chip-bg: rgba(250, 249, 245, 0.10);
  --chip-bg-soft: rgba(250, 249, 245, 0.05);
  --chip-bg-strong: rgba(250, 249, 245, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 200ms ease, color 200ms ease;
}

body { overflow-x: hidden; }

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

img { max-width: 100%; display: block; }

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

/* Type scale */
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.h-display {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

.h-section {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.h-card {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}

.lede {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 56ch;
  margin: 0;
}

.body { font-size: 17px; line-height: 1.55; color: var(--ink-2); margin: 0; text-wrap: pretty; }
.body-sm { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0; }
.caption { font-size: 13px; color: var(--ink-3); margin: 0; }
.mono { font-family: var(--font-mono); font-size: 13px; }
.label-caps { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }

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

.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }

@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .section-tight { padding: 48px 0; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--amber);
  color: #1F1605;
  border-color: var(--amber);
}
.btn-primary:hover { background: var(--amber-deep); border-color: var(--amber-deep); color: #FFFDF6; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}
.btn-ghost:hover { background: rgba(20, 20, 19, 0.04); border-color: var(--ink-3); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(250, 249, 245, 0.05); }

/* Pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  white-space: nowrap;
}

/* Vendor dot */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-claude { background: var(--claude-dot); }
.dot-codex  { background: var(--codex-dot); }
.dot-amber  { background: var(--amber); }
.dot-sage   { background: var(--sage); }

/* Section background variants */
.bg-parchment { background: var(--parchment); }
.bg-sand      { background: var(--sand); }
.bg-dusk      { background: var(--dusk); color: var(--parchment-dark); }

/* Utility */
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.stack-32 > * + * { margin-top: 32px; }
.stack-48 > * + * { margin-top: 48px; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.divider { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* macOS-ish device frame for screenshots */
.macframe {
  border-radius: 14px;
  overflow: hidden;
  background: #1d1a13;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 24px 48px -16px rgba(20, 17, 10, 0.28),
    0 8px 18px -10px rgba(20, 17, 10, 0.20);
  border: 1px solid var(--hairline-strong);
}
.macframe-bar {
  height: 28px;
  background: #1d1a13;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}
.macframe-bar .tl { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.macframe-bar .tl:nth-child(2) { background: #febc2e; }
.macframe-bar .tl:nth-child(3) { background: #28c840; }
.macframe-screenshot { display: block; width: 100%; }

/* Theme toggle button */
.theme-toggle {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 150ms ease;
}
.theme-toggle:hover { background: rgba(20,20,19,0.05); }
[data-theme="dark"] .theme-toggle:hover { background: rgba(250,249,245,0.05); }

/* Brand mark "{ | }" */
.brandmark {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--amber);
}

/* Live brand mark — { /typing| }, IBM Plex Sans Bold */
.brandmark-live {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink);
  font-feature-settings: "ss01", "ss02";
}
.brandmark-live .bm-brace {
  color: var(--ink);
  font-weight: 700;
}
/* The pipe is the type-cursor itself — always present, always blinking,
   sits between the slot content and the closing brace. */
/* Symmetric padding around the pipe — same gap on both sides at rest. */
.brandmark-live .bm-pipe {
  display: inline-block;
  color: var(--ink);
  font-weight: 700;
  width: 1ch;
  text-align: center;
  animation: bm-caret-blink 1.05s steps(1, end) infinite;
}
.brandmark-live[data-done="true"] .bm-pipe {
  animation: none;
  opacity: 1;
}
/* Slot sits to the LEFT of the pipe; at rest its width is 1ch to mirror the pipe's right-side space. */
.brandmark-live .bm-slot {
  display: inline-flex;
  align-items: baseline;
  overflow: hidden;
  max-width: 1ch;
  transition: max-width 520ms cubic-bezier(0.22, 0.61, 0.36, 1);
  white-space: nowrap;
  justify-content: flex-end;
}
.brandmark-live[data-phase="open"] .bm-slot {
  max-width: 14ch;
}
.brandmark-live .bm-word {
  color: var(--ink);
  font-weight: 700;
  white-space: pre;
}
.brandmark-live .bm-slash {
  color: var(--ink);
  font-weight: 700;
  margin-right: 0.04ch;
}
@keyframes bm-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
/* Rolodex per-character flip */
.brandmark-live .bm-rolodex {
  display: inline-flex;
  align-items: baseline;
}
.brandmark-live .bm-roll {
  display: inline-grid;
  grid-template-areas: "stack";
  perspective: 320px;
  position: relative;
}
.brandmark-live .bm-roll > * {
  grid-area: stack;
  display: inline-block;
  backface-visibility: hidden;
  transform-origin: 50% 50%;
}
.brandmark-live .bm-roll-static { transform: none; }
.brandmark-live .bm-roll-out {
  animation: bm-roll-out 520ms cubic-bezier(0.5, 0, 0.55, 1) var(--bm-roll-delay, 0ms) both;
}
.brandmark-live .bm-roll-in {
  animation: bm-roll-in 520ms cubic-bezier(0.45, 0, 0.5, 1) var(--bm-roll-delay, 0ms) both;
}
@keyframes bm-roll-out {
  0%   { transform: rotateX(0deg);   opacity: 1; }
  60%  { transform: rotateX(-90deg); opacity: 0; }
  100% { transform: rotateX(-90deg); opacity: 0; }
}
@keyframes bm-roll-in {
  0%   { transform: rotateX(90deg);  opacity: 0; }
  40%  { transform: rotateX(90deg);  opacity: 0; }
  100% { transform: rotateX(0deg);   opacity: 1; }
}
[data-theme="dark"] .brandmark-live .bm-brace,
[data-theme="dark"] .brandmark-live .bm-slash,
[data-theme="dark"] .brandmark-live .bm-pipe,
[data-theme="dark"] .brandmark-live .bm-word { color: var(--ink); }

/* Inline (smaller, used in section headings) */
.brandmark-live.is-inline {
  font-size: inherit;
  vertical-align: baseline;
}

/* Subtle vertical-bar gradient backdrop for hero icon */
.icon-backdrop {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 28px 80px;
}
.icon-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    transparent 35%,
    var(--cream) 49%,
    var(--cream) 51%,
    transparent 65%,
    transparent 100%);
  opacity: 0.55;
  filter: blur(2px);
  z-index: 0;
}
.icon-backdrop > img { position: relative; z-index: 1; }

/* Tab strip */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--hairline);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  background: none;
  border: 0;
  font-family: inherit;
  white-space: nowrap;
  transition: color 150ms ease;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px; bottom: -1px;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}

/* Accordion */
.accordion {
  border-top: 1px solid var(--hairline);
}
.accordion-item {
  border-bottom: 1px solid var(--hairline);
}
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 4px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: left;
}
.accordion-chevron {
  flex-shrink: 0;
  width: 14px; height: 14px;
  margin-top: 6px;
  color: var(--ink-3);
  transition: transform 200ms ease;
}
.accordion-item.open .accordion-chevron { transform: rotate(180deg); color: var(--ink); }
.accordion-content {
  padding: 0 4px 24px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.6;
  max-width: 70ch;
}

/* Link underline */
.link-amber {
  color: var(--amber-deep);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
[data-theme="dark"] .link-amber { color: var(--amber); }

/* Tags / chip with vendor colors used in screenshots' visual vocabulary */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  background: rgba(20, 20, 19, 0.04);
  border: 1px solid var(--hairline);
}
[data-theme="dark"] .chip { background: rgba(250, 249, 245, 0.04); }

/* Card surfaces */
.card {
  background: var(--sand);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 28px;
}
.card-amber-edge { border-color: rgba(242, 180, 58, 0.45); }

/* Number numeral for steps */
.numeral {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 48px;
  line-height: 1;
  color: var(--amber-deep);
  letter-spacing: -0.03em;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ----------------------------------------------------------------- */
/* Aurora hero — dynamic gradient background with blobs + film grain */
/* ----------------------------------------------------------------- */

.aurora {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Base wash — warm parchment at the edges so it blends into the page */
  background:
    radial-gradient(ellipse 110% 70% at 50% 0%, #FBE8B5 0%, rgba(251, 232, 181, 0) 60%),
    radial-gradient(ellipse 90% 60% at 50% 100%, var(--parchment) 0%, var(--parchment) 100%);
}

/* Soft animated blobs — three layers, each drifting on a different cycle */
.aurora::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 20% 30%, rgba(242, 180, 58, 0.55), rgba(242, 180, 58, 0) 70%),
    radial-gradient(closest-side at 78% 22%, rgba(217, 119, 87, 0.42), rgba(217, 119, 87, 0) 68%),
    radial-gradient(closest-side at 60% 70%, rgba(251, 232, 181, 0.85), rgba(251, 232, 181, 0) 70%),
    radial-gradient(closest-side at 30% 80%, rgba(198, 137, 24, 0.30), rgba(198, 137, 24, 0) 72%),
    radial-gradient(closest-side at 88% 65%, rgba(122, 135, 99, 0.22), rgba(122, 135, 99, 0) 70%);
  filter: blur(40px) saturate(115%);
  animation: aurora-drift 28s ease-in-out infinite alternate, aurora-breathe 9s ease-in-out infinite;
}

/* Wispy second layer for depth */
.aurora::after {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 70% 10%, rgba(255, 248, 224, 0.55), transparent 70%),
    radial-gradient(50% 35% at 15% 60%, rgba(242, 180, 58, 0.20), transparent 75%),
    radial-gradient(45% 30% at 85% 90%, rgba(217, 119, 87, 0.18), transparent 70%);
  filter: blur(30px);
  mix-blend-mode: soft-light;
  animation: aurora-drift-2 36s ease-in-out infinite alternate, aurora-breathe-2 13s ease-in-out infinite;
}

/* Film grain overlay (SVG turbulence inlined as a background) */
.aurora-grain {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0 0.04 0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

[data-theme="dark"] .aurora {
  background:
    radial-gradient(ellipse 110% 70% at 50% 0%, #2A1F0D 0%, rgba(42, 31, 13, 0) 60%),
    radial-gradient(ellipse 90% 60% at 50% 100%, var(--parchment) 0%, var(--parchment) 100%);
}
[data-theme="dark"] .aurora::before {
  background:
    radial-gradient(closest-side at 20% 30%, rgba(242, 180, 58, 0.35), rgba(242, 180, 58, 0) 70%),
    radial-gradient(closest-side at 78% 22%, rgba(217, 119, 87, 0.30), rgba(217, 119, 87, 0) 68%),
    radial-gradient(closest-side at 60% 70%, rgba(251, 232, 181, 0.20), rgba(251, 232, 181, 0) 70%),
    radial-gradient(closest-side at 30% 80%, rgba(198, 137, 24, 0.40), rgba(198, 137, 24, 0) 72%),
    radial-gradient(closest-side at 88% 65%, rgba(122, 135, 99, 0.20), rgba(122, 135, 99, 0) 70%);
}
[data-theme="dark"] .aurora-grain {
  opacity: 0.55;
  mix-blend-mode: overlay;
}

/* Hero content sits above the grain */
.aurora > .container,
.aurora > * {
  position: relative;
  z-index: 1;
}

@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1);   }
  50%  { transform: translate3d(2%, -1%, 0) scale(1.05); }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.02); }
}

@keyframes aurora-drift-2 {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg);   }
  100% { transform: translate3d(-2%, 2%, 0) rotate(8deg); }
}

/* Gentle breathing pulse — layered onto the drift for life */
@keyframes aurora-breathe {
  0%, 100% { opacity: 0.85; filter: blur(40px) saturate(110%); }
  50%      { opacity: 1;    filter: blur(48px) saturate(125%); }
}

@keyframes aurora-breathe-2 {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1;   }
}

@media (prefers-reduced-motion: reduce) {
  .aurora::before, .aurora::after { animation: none !important; }
}
