/* =========================================================
   GEXI — gx-ui.css  (the shared "Gemini-grade, GEXI-green" UI kit)

   A small set of modern component primitives shared by the homepage + create page.
   It CONSUMES the brand tokens from styles.css (--brand-*, --accent, --ink, --card,
   --line, --shadow-*, --ease-*, --grad-creative) — no parallel token system — and renders
   the chat page's modern qualities (generous whitespace, soft radius, gradient-text heroes,
   pill inputs, smooth rises) in the gecko-green brand. Classes are namespaced .gx-* so this
   is purely additive (does not touch chat / studio / feed CSS). Respects dark mode (via the
   brand tokens) + prefers-reduced-motion.
   ========================================================= */

:root {
  --gx-grad: var(--grad-creative);   /* P2 — collapse onto the single canonical brand gradient */
  --gx-ease: cubic-bezier(.2, .7, .3, 1);
  --gx-r:    18px;   /* generous, chat-grade radius */
  --gx-maxw: 1040px; /* desktop content canvas */
}

/* ---- layout ---- */
.gx-wrap { max-width: var(--gx-maxw); margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.gx-section { margin: clamp(40px, 7vw, 88px) 0; }
.gx-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
.gx-section-title { font-size: clamp(18px, 2.4vw, 22px); font-weight: 750; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
.gx-section-link { font-size: 14px; font-weight: 650; color: var(--brand-500); text-decoration: none; white-space: nowrap; }
.gx-section-link:hover { text-decoration: underline; }

/* ---- hero (gradient-text heading) ---- */
.gx-hero { text-align: center; padding: clamp(24px, 8vh, 72px) 0 8px; }
.gx-hero-title {
  font-size: clamp(32px, 6.4vw, 60px); font-weight: 800; line-height: 1.05; letter-spacing: -0.025em;
  margin: 0 0 10px; background: var(--gx-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gx-hero-sub { font-size: clamp(16px, 2.6vw, 21px); font-weight: 500; color: var(--muted); margin: 0 auto 28px; max-width: 30ch; }

/* ---- prompt (pill input → hands off to create) ---- */
.gx-prompt {
  display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-pill);
  padding: 7px 7px 7px 20px; box-shadow: var(--shadow-md); transition: border-color .16s, box-shadow .16s;
}
.gx-prompt:focus-within { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.gx-prompt input {
  /* transparent !important: the pill (.gx-prompt) is the surface — beat the broad
     global `input[type=text]` dark fill that would otherwise paint a square inside it. */
  flex: 1; border: 0; background: transparent !important; outline: none; color: var(--ink);
  font: inherit; font-size: 16px; padding: 10px 0; min-width: 0;
}
.gx-prompt input::placeholder { color: var(--muted); }
.gx-prompt-go {
  flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border: 0; cursor: pointer;
  border-radius: 50%; background: var(--gx-grad); color: #fff; font-size: 18px; box-shadow: var(--shadow);
  transition: transform .12s var(--gx-ease), filter .16s;
}
.gx-prompt-go:hover { filter: brightness(1.06); }
.gx-prompt-go:active { transform: scale(.94); }

/* ---- prompt CARD (the multi-line describe-it card) — ONE definition collapsing the driver
   prompt cards (.fd-promptcard + .gd-promptcard); the on-ramp + every driver consume it. Distinct
   from the single-line hero pill .gx-prompt above. max-width is parameterized via --gx-pc-maxw. ---- */
.gx-promptcard {
  position: relative; width: 100%; max-width: var(--gx-pc-maxw, 600px); margin: 2px auto 0; box-sizing: border-box;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow-md); transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.gx-promptcard:focus-within { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.gx-promptcard-input {
  width: 100%; box-sizing: border-box; border: 0; background: transparent !important; resize: none;
  color: var(--ink); font-family: inherit; font-size: 16px; line-height: 1.55;
  padding: 16px 64px 16px 18px; min-height: 92px; outline: none; text-align: left;
}
.gx-promptcard-input::placeholder { color: var(--muted); }
.gx-promptcard-go {
  position: absolute; right: 10px; bottom: 10px; width: 46px; height: 46px; border: 0; padding: 0;
  border-radius: 50%; background: var(--grad-creative); color: #fff; font-size: 21px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow);
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}
.gx-promptcard-go:hover { filter: brightness(1.06); }
.gx-promptcard-go:active { transform: scale(.93); }
.gx-promptcard-go:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(.25); box-shadow: none; }
.gx-promptcard-go:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---- chips (output-type quick picks) ---- */
.gx-chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin: 16px auto 0; max-width: 680px; }
.gx-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--radius-pill); background: var(--card);
  color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: border-color .16s, background .16s, transform .1s var(--gx-ease);
}
.gx-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.gx-chip-ico { font-size: 16px; line-height: 1; }
/* Rich chip: a type tab that tells you the direction it takes you (label + path hint). */
.gx-chip-rich { align-items: center; padding: 8px 15px; }
.gx-chip-text { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.2; text-align: left; }
.gx-chip-label { font-size: 14px; font-weight: 650; }
.gx-chip-dir { font-size: 11px; font-weight: 500; opacity: .6; white-space: nowrap; }
.gx-chip:hover .gx-chip-dir { opacity: .8; }

/* ---- cards (capability / recipe / showcase) ---- */
.gx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.gx-card {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  gap: 10px; padding: 22px; text-decoration: none; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--gx-r); color: var(--ink);
  box-shadow: var(--shadow); transition: transform .2s var(--gx-ease), box-shadow .2s, border-color .2s;
  animation: gx-rise .42s var(--gx-ease) both;
}
.gx-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.gx-card-ico {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; font-size: 23px;
  background: var(--grad-brand-soft, rgba(34,197,94,0.12)); color: var(--brand-500);
}
.gx-card-ico.is-grad { background: var(--gx-grad); color: #fff; box-shadow: var(--shadow); }
.gx-card-title { font-size: 16.5px; font-weight: 730; margin: 2px 0 0; letter-spacing: -0.01em; }
.gx-card-desc { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0; }
.gx-card-meta { margin-top: auto; padding-top: 6px; font-size: 12.5px; font-weight: 650; color: var(--brand-500); display: flex; align-items: center; gap: 6px; }

/* ---- "Choose your path" cards: a distinct, vibrant icon badge per path gives the four
   options visual POP while the cards stay clean (Gemini-grade). Order is fixed:
   1 guide · 2 make-it (keeps the brand is-grad) · 3 studio · 4 chat. ---- */
.gx-paths .gx-card:nth-child(1) .gx-card-ico { background: linear-gradient(135deg, #8b5cf6, #ec4899); color: #fff; box-shadow: 0 4px 14px rgba(139, 92, 246, 0.28); }
.gx-paths .gx-card:nth-child(3) .gx-card-ico { background: linear-gradient(135deg, #0ea5e9, #22d3ee); color: #fff; box-shadow: 0 4px 14px rgba(14, 165, 233, 0.28); }
.gx-paths .gx-card:nth-child(4) .gx-card-ico { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28); }

/* ---- type cards: small "start by format" cards (name + flow), 2-up on mobile ---- */
.gx-typegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .gx-typegrid { grid-template-columns: repeat(4, 1fr); } }
.gx-type-card {
  display: flex; flex-direction: column; gap: 5px; min-width: 0;
  padding: 12px 13px; border-radius: var(--radius-md, 14px);
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  text-decoration: none; box-shadow: var(--shadow);
  transition: transform .16s var(--gx-ease, ease), box-shadow .16s, border-color .16s;
}
.gx-type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.gx-type-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.gx-type-ico { font-size: 16px; line-height: 1; flex: 0 0 auto; }
.gx-type-name { font-size: 14px; font-weight: 720; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-type-tag { font-size: 11.5px; font-weight: 500; color: var(--muted); line-height: 1.3; }
.gx-type-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; margin-top: 3px; }
.gx-type-step { font-size: 10px; font-weight: 650; color: var(--ink); opacity: .8;
  padding: 2px 6px; border-radius: var(--radius-pill); background: var(--card-alt); border: 1px solid var(--line); white-space: nowrap; }
.gx-type-arrow { font-size: 11px; color: var(--muted); }

/* ---- buttons ---- */
.gx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 13px 22px; border-radius: var(--radius-pill); border: 1.5px solid transparent;
  font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; transition: transform .1s var(--gx-ease), filter .16s, border-color .16s;
}
.gx-btn:active { transform: translateY(1px); }
.gx-btn-primary { background: var(--gx-grad); color: #fff; box-shadow: var(--shadow-md); }
.gx-btn-primary:hover { filter: brightness(1.05); }
.gx-btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.gx-btn-ghost:hover { border-color: var(--accent); }
.gx-btn-lg { padding: 15px 28px; font-size: 16px; }

/* ---- showcase strip (horizontal snap row of real examples) ---- */
.gx-strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.gx-strip::-webkit-scrollbar { height: 6px; }
.gx-strip::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.gx-tile {
  flex: 0 0 auto; width: 220px; scroll-snap-align: start; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--card-alt);
  transition: transform .18s var(--gx-ease), box-shadow .18s;
}
.gx-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

@keyframes gx-rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  .gx-card, .gx-tile, .gx-chip, .gx-btn, .gx-prompt-go { animation: none !important; transition: none !important; }
}

/* P2 a11y — ONE tokenized keyboard-focus ring across the kit's interactive primitives (the kit had
   none; keyboard users got nothing on the most-used surfaces). box-shadow not outline, so it
   survives overflow:hidden on cards/tiles; brand-tinted via --focus-ring so it reads as design. */
.gx-btn:focus-visible,
.gx-chip:focus-visible,
.gx-card:focus-visible,
.gx-tile:focus-visible,
.gx-prompt-go:focus-visible,
.gx-prompt input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* =========================================================
   Distinct MOBILE feel (≤ 700px): app-like, not a shrunk desktop.
   Tighter rhythm, full-bleed cards, left-aligned punchy hero, scroll chips.
   ========================================================= */
@media (max-width: 700px) {
  .gx-wrap { padding: 0 16px; }
  .gx-hero { text-align: left; padding: 18px 0 4px; }
  .gx-hero-title { font-size: clamp(28px, 9vw, 40px); }
  .gx-hero-sub { margin-left: 0; max-width: none; }
  .gx-prompt { margin: 0; max-width: none; }
  .gx-chips { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; margin-left: 0; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .gx-chips::-webkit-scrollbar { display: none; }
  .gx-chip { flex: 0 0 auto; scroll-snap-align: start; }
  .gx-section { margin: 32px 0; }
  .gx-grid { grid-template-columns: 1fr; gap: 12px; }
  .gx-card { padding: 18px; }
  .gx-card:hover { transform: none; }   /* touch: no hover lift */

  /* "Choose your path" — a compact 2x2 of punchy action tiles instead of four tall,
     full-width cards. Drops the long paragraph (the titles + meta are self-explanatory)
     so the four options stop eating the screen, while the colored icon badges pop. */
  .gx-grid.gx-paths { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gx-paths .gx-card { padding: 14px 12px; gap: 9px; border-radius: 16px; }
  .gx-paths .gx-card-desc { display: none; }
  .gx-paths .gx-card-ico { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
  .gx-paths .gx-card-title { font-size: 14.5px; line-height: 1.2; }
  .gx-paths .gx-card-meta { padding-top: 2px; font-size: 11.5px; }
}
