/* gui.farm — theme ported from dotgui.org (gui-landing) v3.
   Tokens, nav, footer, and the examples-library layout mirror the site's
   /examples page so the farm reads as the same product. */

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

:root {
  --primary: #101010;
  --primary-active: #2a2a26;
  --primary-disabled: #e8e6df;
  --ink: #101010;
  --body: #4a4a44;
  --body-strong: #1a1a18;
  --muted: #8a867c;
  --muted-soft: #a8a49a;
  --hairline: #e8e6df;
  --hairline-soft: #f0eee7;
  --canvas: #fafaf7;
  --surface-soft: #f4f2ec;
  --surface-card: #f0eee7;
  --surface-strong: #e6e3da;
  --surface-dark: #151512;
  --surface-dark-elevated: #2a2a24;
  --on-primary: #ffffff;
  --on-dark: #fafaf7;
  --on-dark-soft: #9a968b;
  --surface: var(--surface-card);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: Fraunces, Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display-weight: 400;

  --radius-xs: 6px;
  --radius-pill: 9999px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

html { background: var(--canvas); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

code { font-family: var(--mono); font-size: 13px; background: var(--surface-card); border-radius: var(--radius-xs); padding: 2px 7px; color: var(--ink); }

/* ─── nav ─── */
.site-nav {
  background: var(--canvas);
  height: 68px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--hairline);
}
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-logo { display: flex; align-items: center; gap: 10px; padding-right: 24px; font-family: var(--display); font-size: 23px; font-weight: var(--display-weight); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  color: var(--body);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 180ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav-links a:not(.nav-cta):hover { color: var(--ink); }
}
.nav-links a.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 500;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  transition: background 180ms var(--ease-out);
}
.nav-links a.nav-cta svg { display: block; }
.nav-links a.nav-cta:hover { background: var(--primary-active); }

/* ─── examples index ─── */
.ex-index { padding: 56px 24px 96px; }

.ex-header { max-width: 640px; margin-bottom: 32px; }
.ex-eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
  margin: 0 0 10px;
}
.ex-title {
  font-family: var(--display);
  font-size: clamp(36px, 6vw, 52px);
  font-weight: var(--display-weight);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}
.ex-desc { font-size: 16px; line-height: 1.6; color: var(--body); margin: 0; }
.ex-desc strong { color: var(--ink); font-weight: 600; }

.ex-filters { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.ex-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.ex-filter:hover { border-color: var(--muted-soft); }
.ex-filter.active { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.ex-filter-count { font-size: 11px; opacity: 0.6; }

.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.ex-empty { color: var(--muted-soft); font-size: 14px; padding: 40px 0; }

.ex-card { text-decoration: none; display: flex; flex-direction: column; gap: 12px; cursor: pointer; border: 0; background: none; padding: 0; text-align: left; font: inherit; }
.ex-thumb { transition: transform 180ms var(--ease-out); }
.ex-card:hover .ex-thumb { transform: translateY(-2px); }
.ex-card:hover .gui-thumb { border-color: var(--muted-soft); }

.ex-card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ex-card-title { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink); }
.ex-card-cat {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

/* ─── thumbnail (ported from GuiThumb.vue) ─── */
.gui-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 375 / 263;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.gui-thumb.is-web { padding: 5% 5% 0; }
.gui-thumb.is-web img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 9px 9px 0 0;
  border: 1px solid var(--hairline);
  border-bottom: none;
  box-shadow: 0 8px 24px rgba(20, 19, 15, 0.16);
}
.gui-thumb.is-mobile img {
  width: 43%;
  height: auto;
  margin-top: 7%;
  display: block;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(20, 19, 15, 0.18);
  border: 1px solid var(--hairline);
}
.gui-thumb.is-mobile.is-landscape { align-items: center; }
.gui-thumb.is-mobile.is-landscape img { width: 86%; margin-top: 0; }
.gui-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-family: var(--display);
  font-weight: var(--display-weight);
  font-size: 18px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* ─── detail overlay (ported from examples/[slug].vue) ─── */
.exd-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 19, 15, 0.42);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 40px 24px;
}
.exd-panel {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  width: 100%;
  max-width: 1000px;
  overflow: hidden;
}
.exd-related { margin: 8px 0 48px; }
.exd-related .exd-h2 { margin-bottom: 20px; }

/* shared breadcrumb — consistent across example, facet, color, platform pages */
.crumbs { font-size: 12px; color: var(--muted-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; cursor: pointer; }
.crumbs a:hover { color: var(--ink); }
.crumbs-sep { color: var(--muted-soft); }
.crumbs-current { color: var(--body); }
.ex-header .crumbs { margin-bottom: 16px; }
.exd > .crumbs { padding: 18px 24px 22px; }
.exd-close { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.exd-close:hover { border-color: var(--muted-soft); }

.exd { padding: 28px 24px 96px; }

/* Full-width live preview, then a two-column block below:
   left = name / description / palette, right = actions / metadata. */
.exd-preview {
  position: relative;
  width: 100%;
  height: 620px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  overflow: hidden;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* The <gui-embed> custom element renders the live file and keeps its own
   centered, scaled canvas — fill the panel with it. Until it upgrades, the
   fallback img/label inside is what shows. */
.exd-embed { display: block; width: 100%; height: 100%; }
.exd-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.exd-preview-empty { color: var(--muted-soft); font-size: 13px; }
.exd-embed-credit { display: inline-block; font-size: 12px; color: var(--muted-soft); text-decoration: none; margin: 12px 0 40px; }
.exd-embed-credit code { font-family: var(--mono); }
.exd-embed-credit:hover { color: var(--ink); }

/* card preview skeleton — shimmer until the image loads, then fade out */
.gui-thumb-skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(100deg, #e8e4dc 30%, #f4f1ea 50%, #e8e4dc 70%);
  background-size: 200% 100%;
  animation: guiShimmer 1.4s ease-in-out infinite;
  transition: opacity 0.45s ease;
}
.gui-thumb.is-loaded .gui-thumb-skeleton { opacity: 0; pointer-events: none; }
@keyframes guiShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* live-embed render loader — covers the preview until <gui-embed> renders */
.exd-preview-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--canvas);
  transition: opacity 0.4s ease;
}
.exd-preview-loader.is-hidden { opacity: 0; pointer-events: none; }
.exd-spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--hairline);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: guiSpin 0.8s linear infinite;
}
.exd-loader-text { font-size: 13px; color: var(--muted); }
@keyframes guiSpin { to { transform: rotate(360deg); } }

/* slim top progress bar shown during page navigation */
.route-loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--ink);
  box-shadow: 0 0 8px rgba(16, 16, 16, 0.5);
  z-index: 9999;
  opacity: 0;
  transition: width 0.18s ease, opacity 0.3s ease;
  pointer-events: none;
}
.route-loader.active { opacity: 1; }

/* body: title/description/palette left, actions/facts right */
.exd-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: start; }
.exd-body-right { display: flex; flex-direction: column; gap: 28px; }

.exd-body-left { display: flex; flex-direction: column; gap: 22px; }
.exd-cat { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-soft); }
.exd-title { font-family: var(--display); font-size: clamp(26px, 4vw, 36px); font-weight: var(--display-weight); letter-spacing: -0.02em; margin: -8px 0 0; color: var(--ink); }
.exd-desc { font-size: 16px; line-height: 1.7; color: var(--body); margin: 0; max-width: 46ch; }

.exd-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.exd-tag {
  font-size: 12px;
  color: var(--body);
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 5px 13px;
}

.exd-mini-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-soft); }
.exd-palette-group { display: flex; flex-direction: column; gap: 12px; }
.exd-palette { display: flex; gap: 8px; flex-wrap: wrap; }
.exd-swatch { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.08); }

/* Facet links: the chips, swatches and font names link to their taxonomy pages. */
a.exd-tag { text-decoration: none; color: var(--body); transition: background 140ms, color 140ms, border-color 140ms; }
a.exd-tag:hover { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
a.exd-swatch { display: inline-block; transition: transform 140ms; }
a.exd-swatch:hover { transform: scale(1.08); }
.exd-spec dd a:not(.exd-tag) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.facet-swatch { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 6px; margin-right: 0.35em; border: 1px solid rgba(0, 0, 0, 0.1); vertical-align: baseline; }
.ex-eyebrow a { color: inherit; text-decoration: none; }
.ex-eyebrow a:hover { color: var(--ink); }

/* colors index */
.colors-index { display: flex; flex-direction: column; gap: 30px; }
.color-family-head { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 22px; margin-bottom: 12px; }
.color-family-head .facet-swatch { width: 0.85em; height: 0.85em; margin: 0; }
.color-family-head:hover .color-family-name { text-decoration: underline; text-underline-offset: 3px; }
.color-family-count { font-family: var(--mono, monospace); font-size: 12px; color: var(--muted); }
.color-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px; border: 1px solid var(--hairline); border-radius: var(--radius-pill); text-decoration: none; color: var(--body); font-size: 13px; background: var(--surface-card); transition: border-color 140ms; }
.color-chip:hover { border-color: var(--ink); }
.color-chip-sw { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.1); }
.color-chip-n { color: var(--muted); font-size: 11px; }

/* flat facet index (fonts / roles / tags) */
.facet-index { display: flex; flex-wrap: wrap; gap: 8px; }
.facet-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--hairline); border-radius: var(--radius-pill); text-decoration: none; color: var(--body); font-size: 14px; background: var(--surface-card); transition: border-color 140ms; }
.facet-chip:hover { border-color: var(--ink); }
.facet-chip-n { color: var(--muted); font-size: 11px; }
.facet-spec-link { margin: -6px 0 0; }
.facet-spec-link a { font-size: 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--muted-soft); padding-bottom: 1px; }
.facet-spec-link a:hover { border-color: var(--ink); }

.exd-share { display: flex; flex-direction: column; gap: 12px; }
.exd-share-row { display: flex; gap: 10px; flex-wrap: wrap; }
.exd-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 160ms var(--ease-out);
}
.exd-share-btn:hover { border-color: var(--muted-soft); }
.exd-share-btn svg { display: block; }

.exd-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.exd-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 11px 20px; border-radius: var(--radius-pill);
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--hairline); color: var(--ink); background: var(--surface);
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.exd-btn:hover { border-color: var(--muted-soft); }
.exd-btn--primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.exd-btn--primary:hover { background: var(--primary-active); border-color: var(--primary-active); }

.exd-facts { display: flex; flex-direction: column; gap: 10px; margin: 0; border-top: 1px solid var(--hairline); padding-top: 18px; }
.exd-facts > div { display: flex; justify-content: space-between; gap: 16px; }
.exd-facts dt { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-soft); margin: 0; }
.exd-facts dd { font-size: 13px; color: var(--body); margin: 0; }

/* ─── bottom: AI-readable / SEO content ─── */
.exd-more { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--hairline); }
.exd-more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.exd-h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: var(--display-weight);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 16px;
}
.exd-p { font-size: 15px; line-height: 1.7; color: var(--body); margin: 0 0 14px; max-width: 52ch; }
.exd-more-link { font-size: 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--muted-soft); padding-bottom: 1px; }
.exd-more-link:hover { border-color: var(--ink); }

.exd-spec { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 0; }
.exd-spec > div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: start; }
.exd-spec dt { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-soft); margin: 0; padding-top: 3px; }
.exd-spec dd { font-size: 14px; color: var(--body); margin: 0; }
.exd-spec dd a { color: var(--ink); }
.exd-roles { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── quality (CCAC) score ─── */
.exd-quality { margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--hairline); }
.exd-score { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 40px; margin-top: 22px; max-width: 720px; }
.exd-score-item { display: flex; flex-direction: column; gap: 7px; }
.exd-score-head { display: flex; justify-content: space-between; align-items: baseline; }
.exd-score-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.exd-score-val { font-family: var(--mono, monospace); font-size: 14px; color: var(--ink); }
.exd-bar { height: 6px; border-radius: 999px; background: var(--surface-card); overflow: hidden; border: 1px solid var(--hairline); }
.exd-bar > i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.exd-score-desc { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .exd-score { grid-template-columns: 1fr; } }

/* ─── home FAQ (site-level, one place) ─── */
.home-faq { margin-top: 80px; padding-top: 48px; border-top: 1px solid var(--hairline); max-width: 760px; }
.home-faq-title { font-family: var(--display); font-size: clamp(24px, 4vw, 30px); font-weight: var(--display-weight); letter-spacing: -0.02em; color: var(--ink); margin: 0 0 12px; }
.home-faq-item { padding: 20px 0; border-top: 1px solid var(--hairline-soft); }
.home-faq-item h3 { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.home-faq-item p { font-size: 14px; line-height: 1.7; color: var(--body); margin: 0; }

/* ─── footer ─── */
footer { background: var(--surface-soft); padding: 48px 0; margin-top: 40px; }
footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-logo { font-family: var(--display); font-size: 14px; font-weight: var(--display-weight); color: var(--ink); }
.footer-note { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .exd-body { grid-template-columns: 1fr; gap: 28px; }
  .exd-more-grid { grid-template-columns: 1fr; gap: 40px; }
  .exd-preview { height: 460px; }
}
@media (max-width: 600px) {
  .nav-links { gap: 16px; }
  .nav-links a:not(.nav-cta) { display: none; }
}
