/* Inter, self-hosted by the site (same file as src/styles/app.css). The
 * variable font carries the opsz axis, so optical sizing matches Google Fonts. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-variable.woff2") format("woff2");
}

/* ------------------------------------------------------------------ *
 * Manicode brand tokens, mirrored from the live surfaces:
 *   website/src/styles/app.css
 *   context-registry/src/styles/theme.css + globals.css
 *   docs/portal/src/css/custom.css
 * Brand = Rose · Neutrals = Zinc · Type = Inter · Mono = system stack
 * ------------------------------------------------------------------ */
:root {
  color-scheme: dark;

  /* Brand: Rose */
  --brand: #be123c; /* rose-700 */
  --brand-hover: #9f1239; /* rose-800 */
  --brand-active: #881337; /* rose-900 */

  /* Backgrounds: Zinc */
  --canvas: #09090b; /* zinc-950 */
  --surface: #18181b; /* zinc-900 */
  --elevated: #27272a; /* zinc-800 */
  --raised: #3f3f46; /* zinc-700 */

  /* Text: Zinc */
  --content: #fafafa; /* zinc-50  */
  --dim: #d4d4d8; /* zinc-300 */
  --subtle: #a1a1aa; /* zinc-400 */
  --muted: #71717a; /* zinc-500 */

  /* Borders: Zinc */
  --divide: #27272a; /* zinc-800 */
  --edge: #52525b; /* zinc-600 */

  /* Status */
  --green-mid: #34d399; /* emerald-400 */
  --green-strong: #10b981; /* emerald-500 */
  --green-deep: #047857; /* emerald-700 */
  --green-subtle: #022c22; /* emerald-950 */
  --red-mid: #f87171; /* red-400   */
  --red-strong: #f43f5e; /* rose-500  */
  --red-deep: #9f1239; /* rose-800  */
  --red-subtle: #4c0519; /* rose-950  */

  /* Links */
  --link: #60a5fa; /* blue-400 */

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--edge) var(--surface);
}

body {
  background-color: var(--canvas);
  background-image: radial-gradient(
    60% 45% at 50% -8%,
    rgb(190 18 60 / 0.18),
    transparent 70%
  );
  color: var(--content);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 32px 120px;
}

/* ---- Eyebrow / caps labels (shared util from the codebase) ---- */
.label-caps {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 500;
  font-size: 12px;
}

/* ---- Header ---- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  border-bottom: 1px solid var(--divide);
}
.logo {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--content);
  text-decoration: none;
}
.logo svg {
  height: 18px;
  width: auto;
  fill: var(--brand);
  transform: translateY(1.25px);
}
.logo .accent {
  color: var(--brand);
}
header .meta {
  font-size: 13px;
  color: var(--subtle);
  text-align: right;
}

/* ---- Hero ---- */
.hero {
  padding: 96px 0 72px;
  max-width: 720px;
}
.hero .label-caps {
  color: var(--brand);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
.hero h1 .accent {
  color: var(--brand);
}
.hero p {
  font-size: 20px;
  color: var(--dim);
  line-height: 1.6;
}

/* ---- Sections ---- */
section {
  padding-top: 72px;
}
.section-head {
  margin-bottom: 32px;
}
.section-head .num {
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}
.section-head h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
}
.section-head p {
  color: var(--subtle);
  font-size: 15px;
  margin-top: 10px;
  max-width: 620px;
}

/* ---- Section links ---- */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .anchor {
    transition: none;
  }
}
section[id] {
  scroll-margin-top: 24px;
}
.anchor {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.6em;
  font-weight: 500;
  letter-spacing: 0;
  vertical-align: middle;
  color: var(--muted);
  text-decoration: none;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.section-head h2:hover .anchor,
.anchor:focus-visible,
.anchor.copied {
  opacity: 1;
}
.anchor:hover {
  color: var(--brand);
}
.anchor.copied {
  color: var(--green-mid);
}
.anchor:focus-visible,
.toc a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
@media (hover: none) {
  .anchor {
    opacity: 0.6;
  }
}
.toc ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.toc a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--dim);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--divide);
  border-radius: 8px;
}
.toc a:hover {
  color: var(--content);
  border-color: var(--edge);
}
.toc .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brand);
}

/* ---- Cards / grids ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--divide);
  border-radius: 16px;
  padding: 28px;
}
.grid {
  display: grid;
  gap: 20px;
}

/* ---- Color swatches ---- */
.swatch-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.swatch {
  border: 1px solid var(--divide);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.swatch .chip {
  height: 84px;
}
.swatch .info {
  padding: 12px 14px 14px;
}
.swatch .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--content);
}
.swatch .token {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--subtle);
  margin-top: 3px;
}
.swatch .hex {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
}
.swatch .chip.bordered {
  box-shadow: inset 0 0 0 1px var(--divide);
}

/* ---- Type specimens ---- */
.type-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--divide);
}
.type-row:last-child {
  border-bottom: 0;
}
.type-row .spec {
  width: 150px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.6;
}
.type-row .sample {
  color: var(--content);
}
.weights {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 8px;
}
.weights div {
  font-size: 22px;
}
.weights span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.mono-sample {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--dim);
  background: var(--canvas);
  border: 1px solid var(--divide);
  border-radius: 8px;
  padding: 16px 18px;
  margin-top: 16px;
  white-space: pre;
  overflow-x: auto;
}
.mono-sample .k {
  color: var(--red-strong);
}
.mono-sample .s {
  color: var(--green-mid);
}
.mono-sample .c {
  color: var(--muted);
}

/* ---- Logo showcase ---- */
.logo-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.logo-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 180px;
  border-radius: 16px;
  border: 1px solid var(--divide);
}
.logo-tile.on-canvas {
  background: var(--canvas);
}
.logo-tile.on-surface {
  background: var(--surface);
}
.logo-tile.on-brand {
  background: var(--brand);
  border-color: var(--brand);
}
.logo-tile.on-light {
  background: var(--content);
  border-color: var(--content);
}
.logo-tile .caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
/* Lockup matches manicode.ai and docs: 20px wordmark, 18px mark,
 * 4px gap, mark nudged down 1.25px to sit on the capitals. */
.logo-lockup {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
}
.logo-lockup svg {
  height: 18px;
  width: auto;
  transform: translateY(1.25px);
}

.file-list {
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.file-list code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--subtle);
}
code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* ---- Light mode ---- */
.light-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.light-tile {
  border-radius: 16px;
  padding: 28px;
  border: 1px solid var(--divide);
}
.light-tile.light {
  background: #ffffff;
  color: var(--canvas);
  border-color: #e4e4e7;
}
.light-tile.dark {
  background: var(--canvas);
  color: var(--content);
}
.light-tile .caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 16px;
}

/* ---- Buttons / components ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-hover);
}
.btn-secondary {
  border-color: var(--raised);
  color: var(--content);
  background: transparent;
}
.btn-secondary:hover {
  border-color: var(--edge);
}
.component-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--dim);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge-brand {
  background: var(--brand);
  color: #fff;
}
.badge-pass {
  background: var(--green-subtle);
  color: var(--green-mid);
  border: 1px solid var(--green-deep);
}
.badge-fail {
  background: var(--red-subtle);
  color: var(--red-mid);
  border: 1px solid var(--red-deep);
}
a.link {
  color: var(--link);
  text-decoration: none;
}
a.link:hover {
  text-decoration: underline;
}

/* ---- Radius / spacing scale ---- */
.radius-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.radius-tile {
  text-align: center;
}
.radius-box {
  height: 72px;
  background: var(--elevated);
  border: 1px solid var(--raised);
}
.radius-tile .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--subtle);
  margin-top: 10px;
}

/* ---- Do / Don't ---- */
.principles {
  grid-template-columns: 1fr;
}
.principle {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--divide);
}
.principle:last-child {
  border-bottom: 0;
}
.principle .mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.mark.do {
  background: var(--green-subtle);
  color: var(--green-mid);
}
.mark.dont {
  background: var(--red-subtle);
  color: var(--red-mid);
}
.principle .body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.principle .body span {
  font-size: 14px;
  color: var(--subtle);
}

footer {
  margin-top: 96px;
  padding-top: 28px;
  border-top: 1px solid var(--divide);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- Copy controls ---- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--subtle);
  background: transparent;
  border: 1px solid var(--raised);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}
.copy-btn[hidden] {
  display: none;
}
.copy-btn:hover {
  color: var(--content);
  border-color: var(--edge);
}
.copy-btn.copied {
  color: var(--green-mid);
  border-color: var(--green-deep);
}
/* Swatch captions become buttons that keep their caption look. */
.copy-value {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 3px;
}
.copy-value:hover {
  color: var(--content);
}
.copy-value.copied {
  color: var(--green-mid);
}
.copy-btn:focus-visible,
.copy-value:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.swatch .chip.copyable {
  cursor: pointer;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
}
.card-note {
  color: var(--subtle);
  font-size: 13px;
  margin-top: 4px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.file-list .copy-btn {
  margin-left: auto;
}
.file-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.stack-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--divide);
}
.stack-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.stack-row .spec {
  width: 150px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--subtle);
}
.stack-row code {
  flex: 1;
  min-width: 0;
  color: var(--dim);
  overflow-wrap: anywhere;
}
.code-block {
  position: relative;
  margin-top: 16px;
}
.code-block .mono-sample {
  margin-top: 0;
  padding-right: 84px;
}
.code-block > .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--canvas);
}
.prompt-sample {
  white-space: pre-wrap;
  line-height: 1.6;
}
.token-css {
  max-height: 320px;
  overflow-y: auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 40px;
  }
  .stack-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .stack-row .spec {
    width: 100%;
  }
  .type-row {
    flex-direction: column;
    gap: 8px;
  }
  .type-row .spec {
    width: auto;
  }
}

/* ---- Utilities ----
 * These replace inline style attributes, which CSP style-src 'self' blocks.
 * !important keeps the precedence an inline style had over class rules. */
.mt-20 {
  margin-top: 20px !important;
}
.mt-24 {
  margin-top: 24px !important;
}
.mb-4 {
  margin-bottom: 4px !important;
}
.mb-8 {
  margin-bottom: 8px !important;
}
.mb-12 {
  margin-bottom: 12px !important;
}
.fw-400 {
  font-weight: 400 !important;
}
.fw-500 {
  font-weight: 500 !important;
}
.fw-600 {
  font-weight: 600 !important;
}
.fw-700 {
  font-weight: 700 !important;
}
.fw-900 {
  font-weight: 900 !important;
}
.fs-13 {
  font-size: 13px !important;
}
.type-display {
  font-size: 44px !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.05 !important;
}
.type-h1 {
  font-size: 30px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}
.type-h2 {
  font-size: 20px !important;
  font-weight: 600 !important;
}
.type-lead {
  font-size: 16px !important;
  color: var(--dim) !important;
  max-width: 560px !important;
}
.card-label {
  font-size: 13px !important;
  font-weight: 600 !important;
}
.fill-brand {
  fill: var(--brand) !important;
}
.fill-content {
  fill: var(--content) !important;
}
.fill-white {
  fill: #fff !important;
}
.c-muted {
  color: var(--muted) !important;
}
.c-content {
  color: var(--content) !important;
}
.c-canvas {
  color: var(--canvas) !important;
}
.c-brand {
  color: var(--brand) !important;
}
.c-subtle {
  color: var(--subtle) !important;
}
.c-white-75 {
  color: rgba(255, 255, 255, 0.75) !important;
}
.c-white {
  color: #fff !important;
}
.c-rose-800 {
  color: #9f1239 !important;
}
.c-zinc-500 {
  color: #71717a !important;
}
.radius-pill {
  border-radius: 999px !important;
}
.h-72 {
  height: 72px !important;
}
.radius-6 {
  border-radius: 6px !important;
}
.radius-8 {
  border-radius: 8px !important;
}
.radius-12 {
  border-radius: 12px !important;
}
.radius-16 {
  border-radius: 16px !important;
}
.bg-rose-800 {
  background: #9f1239 !important;
}
.bg-brand {
  background: var(--brand) !important;
}
.bg-brand-hover {
  background: var(--brand-hover) !important;
}
.bg-brand-active {
  background: var(--brand-active) !important;
}
.bg-canvas {
  background: var(--canvas) !important;
}
.bg-surface {
  background: var(--surface) !important;
}
.bg-elevated {
  background: var(--elevated) !important;
}
.bg-raised {
  background: var(--raised) !important;
}
.bg-divide {
  background: var(--divide) !important;
}
.bg-edge {
  background: var(--edge) !important;
}
.bg-muted {
  background: var(--muted) !important;
}
.bg-subtle {
  background: var(--subtle) !important;
}
.bg-dim {
  background: var(--dim) !important;
}
.bg-content {
  background: var(--content) !important;
}
.bg-green-mid {
  background: var(--green-mid) !important;
}
.bg-green-strong {
  background: var(--green-strong) !important;
}
.bg-green-deep {
  background: var(--green-deep) !important;
}
.bg-green-subtle {
  background: var(--green-subtle) !important;
}
.bg-red-mid {
  background: var(--red-mid) !important;
}
.bg-red-strong {
  background: var(--red-strong) !important;
}
.bg-red-deep {
  background: var(--red-deep) !important;
}
.bg-red-subtle {
  background: var(--red-subtle) !important;
}
.bg-link {
  background: var(--link) !important;
}
.copy-scratch {
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0;
}
