/* Lace website. Dark by design, like the apps it builds; --accent follows the theme picker. */
:root {
  --bg: #08090f;
  --bg-2: #0c0e16;
  --surface: #11131d;
  --surface-2: #161927;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eaf2;
  --muted: #9aa1b8;
  --faint: #6b7189;
  --accent: #7aa2f7;
  --accent-2: #ff3d9a;
  --radius: 14px;
  --radius-lg: 22px;
  --wrap: 1180px;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 0.9em; }
p code, li code, h4 code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05em 0.35em;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.bg-glow {
  position: fixed; inset: -20vh -10vw auto; height: 90vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 70% 30%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(35% 40% at 20% 10%, color-mix(in oklab, var(--accent-2) 14%, transparent), transparent 70%);
  transition: background 0.8s ease;
}

.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand.small { font-size: 15px; gap: 8px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color 0.15s; }
.nav-links a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 11px;
  font-weight: 600; font-size: 15px; transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 28px -8px color-mix(in oklab, var(--accent-2) 60%, transparent);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 32px -8px color-mix(in oklab, var(--accent-2) 75%, transparent); }
.btn-ghost { border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.06); }

/* Hero */
.hero { padding: 84px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 5px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.03);
  color: var(--muted); font-size: 13.5px; font-weight: 500;
}
.pill:hover { color: var(--text); }
.pill-tag {
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
}
h1 { font-size: clamp(38px, 4.4vw, 58px); font-weight: 800; margin: 22px 0 20px; letter-spacing: -0.035em; }
.lede { color: var(--muted); font-size: 18px; max-width: 34em; margin: 0 0 28px; }

.install {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface); padding: 4px 4px 4px 16px;
}
.install code { font-size: 14.5px; white-space: nowrap; overflow-x: auto; padding: 8px 0; }
.install.center { display: flex; width: fit-content; margin: 0 auto; padding-right: 16px; }
.prompt { color: var(--faint); margin-right: 8px; user-select: none; }
.copy {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.copy:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.copy.done { color: #5ee0a0; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.cta.center { justify-content: center; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 26px 0 0; color: var(--faint); font-size: 13.5px; }
.meta li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 2px; }

/* Screenshots are 1500x1000 and the window in them has an 8px corner: the
   percentages keep the clip at exactly that radius at any rendered size. */
.shot-frame {
  position: relative; border-radius: 0.534% / 0.8%; overflow: hidden;
  background: var(--surface);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.shot-frame img { display: block; width: 100%; height: auto; }
.hero-shot { margin: 0; position: relative; }
.hero-shot .shot-frame {
  box-shadow:
    0 40px 120px -30px color-mix(in oklab, var(--accent) 45%, transparent),
    0 30px 80px -30px rgba(0, 0, 0, 0.9);
  transition: box-shadow 0.8s ease;
}
.hero-shot img, .theme-stage img { transition: opacity 0.45s ease; }
.hero-shot img.fading, .theme-stage img.fading { opacity: 0; }
.hero-shot figcaption {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  margin-top: 18px; color: var(--muted); font-size: 13.5px;
}
.swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 0 1px var(--line-strong); }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: 60px; margin-bottom: 20px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--line); padding: 0;
  width: calc(100% - 48px); max-width: calc(var(--wrap) - 48px);
}
.stats div { background: var(--bg-2); padding: 26px 24px; display: flex; flex-direction: column; gap: 2px; }
.stats strong { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; }
.stats span { color: var(--muted); font-size: 14px; }

/* Sections */
.section { padding: 100px 0; }
.section-head { max-width: 700px; margin-bottom: 48px; }
.section-head h2, .dialogs-grid h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; letter-spacing: -0.03em; }
.section-head p:not(.eyebrow), .section-lede { color: var(--muted); font-size: 17.5px; margin: 16px 0 0; }
.eyebrow {
  margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); transition: color 0.8s ease;
}

/* Feature cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  position: relative; padding: 26px; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: color-mix(in oklab, var(--accent) 45%, transparent); transform: translateY(-2px); }
.card h3 { font-size: 18px; margin: 18px 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  color: var(--accent);
}
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon svg .fill { fill: currentColor; stroke: none; }

/* Showcase */
.showcase { display: flex; flex-direction: column; gap: 96px; margin-top: 110px; }
.showcase-row { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: center; }
.showcase-row.flip .showcase-copy { order: 2; }
.showcase-copy h3 { font-size: 28px; font-weight: 750; letter-spacing: -0.025em; margin-bottom: 14px; }
.showcase-copy p:not(.eyebrow) { color: var(--muted); margin: 0; font-size: 16.5px; }

/* Themes */
.themes { background: linear-gradient(180deg, transparent, var(--bg-2) 30%, var(--bg-2) 70%, transparent); }
.theme-picker { display: grid; gap: 10px; margin-bottom: 26px; }
.picker-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.picker-label {
  flex: 0 0 136px; color: var(--faint); font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.theme-chip {
  display: inline-flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 14px 0 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font: 500 14px var(--sans); transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.theme-chip:hover { color: var(--text); border-color: var(--line-strong); }
.theme-chip[aria-selected="true"] { color: var(--text); border-color: var(--chip-accent); background: color-mix(in oklab, var(--chip-accent) 12%, var(--surface)); }
.chip-dot {
  width: 22px; height: 22px; border-radius: 7px; position: relative; flex: none;
  background: var(--chip-bg); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.chip-dot::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 8px; height: 8px; border-radius: 3px; background: var(--chip-accent); }
.theme-stage { box-shadow: 0 40px 120px -40px color-mix(in oklab, var(--accent) 40%, transparent), 0 30px 80px -30px rgba(0, 0, 0, 0.8); transition: box-shadow 0.8s ease; }
.theme-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 44px; }
.theme-notes h4 { font-size: 16px; margin-bottom: 8px; }
.theme-notes p { margin: 0; color: var(--muted); font-size: 15px; }

/* Dialogs */
.dialogs-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: center; }
.checks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; color: var(--text); font-size: 15.5px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 6px;
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
}
.checks li::after {
  content: ""; position: absolute; left: 6px; top: 7px; width: 6px; height: 9px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.dialog-stack { position: relative; padding: 0 0 15% 12%; }
.dialog-stack .back { position: absolute; top: 0; left: 0; width: 82%; opacity: 0.55; filter: saturate(0.8); }
.dialog-stack .front { position: relative; width: 88%; margin-left: auto; margin-top: 15%; }

/* Code */
.code-card {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line-strong); background: #0b0d15;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}
.code-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.code-tabs [role="tab"] {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: 500 14px var(--sans); padding: 10px 14px 12px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.code-tabs [role="tab"]:hover { color: var(--text); }
.code-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.code-copy { margin-left: auto; margin-bottom: 6px; }
.code { margin: 0; padding: 24px 26px 28px; overflow-x: auto; font: 14px/1.7 var(--mono); color: #c9cee0; tab-size: 4; }
.code .k { color: #c792ea; }
.code .s { color: #a5e17a; }
.code .c { color: #636b88; font-style: italic; }
.code .n { color: #f7a76c; }
.code .f { color: #82aaff; }
.code .b { color: #ffcb6b; }

/* Docs */
.doc-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.doc-links a {
  position: relative; padding: 22px 48px 22px 22px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); transition: border-color 0.2s, background 0.2s;
}
.doc-links a:hover { border-color: color-mix(in oklab, var(--accent) 45%, transparent); background: var(--surface-2); }
.doc-links h4 { font-size: 16px; margin-bottom: 6px; }
.doc-links p { margin: 0; color: var(--muted); font-size: 14.5px; }
.doc-links span { position: absolute; right: 20px; top: 22px; color: var(--faint); transition: transform 0.2s, color 0.2s; }
.doc-links a:hover span { transform: translateX(3px); color: var(--accent); }

/* Final */
.final { padding-top: 40px; }
.final-card {
  text-align: center; padding: 72px 24px; border-radius: 28px;
  width: calc(100% - 48px); max-width: calc(var(--wrap) - 48px);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(60% 90% at 50% 0%, color-mix(in oklab, var(--accent) 20%, transparent), transparent 70%),
    var(--bg-2);
}
.final-card h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; letter-spacing: -0.03em; }
.final-card p { color: var(--muted); font-size: 17.5px; margin: 14px 0 28px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; margin-top: 60px; }
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; color: var(--faint); font-size: 13.5px; }
.footer-inner p { margin: 0; }
.footer-inner p a { color: var(--muted); }
.footer-inner nav { display: flex; gap: 18px; margin-left: auto; }
.footer-inner nav a:hover, .footer-inner p a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .showcase-row, .dialogs-grid { grid-template-columns: 1fr; gap: 40px; }
  .showcase-row.flip .showcase-copy { order: 0; }
  .cards, .doc-links { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .theme-notes { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .nav-links { display: none; }
  .nav-inner .btn { margin-left: auto; }
  .hero { padding-top: 52px; }
  .section { padding: 72px 0; }
  .cards, .doc-links { grid-template-columns: 1fr; }
  .stats { width: calc(100% - 32px); }
  .picker-label { flex-basis: 100%; margin-top: 6px; }
  .stats div { padding: 20px 18px; }
  .stats strong { font-size: 26px; }
  .install code { font-size: 13px; }
  .code { font-size: 12.5px; padding: 18px; }
  .footer-inner nav { margin-left: 0; }
  .final-card { padding: 52px 18px; width: calc(100% - 32px); }
  .final-card .install code { white-space: normal; overflow-wrap: anywhere; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
