/*
Theme Name: AI Index Site
Theme URI: https://gencite.net
Author: Developable
Author URI: https://gencite.net
Description: Product website for AI Index, the WordPress plugin by Developable.
Version: 0.9.17
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gencite
*/

/* ---- Fonts (self-hosted variable woff2 — no external calls) ---------- */
@font-face {
  font-family: 'Fjalla One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/fjalla-one.woff2') format('woff2');
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/karla.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/sora.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('fonts/jetbrains-mono.woff2') format('woff2');
}

/* ---- Tokens ---------------------------------------------------------- */
:root {
  --ink: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --accent: #4f46e5;
  --accent-d: #4338ca;
  --accent-soft: #eef2ff;
  --ok: #0d9488;
  --radius: 14px;
  --container: 1080px;
  --font: 'Karla', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --serif: 'Fjalla One', "Arial Narrow", system-ui, sans-serif; /* display / headings */
  --logo: 'Sora', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---- Base ------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.1; letter-spacing: -0.005em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 .75rem; }
h3 { font-size: 1.18rem; margin: 0 0 .4rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
code, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--bg-soft); border: 1px solid var(--line); padding: .1em .4em; border-radius: 6px; }
pre { background: var(--ink); color: #e2e8f0; padding: 1rem 1.1rem; border-radius: var(--radius); overflow: auto; }
pre code { background: none; border: 0; color: inherit; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }

/* ---- Buttons --------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: .72rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .04s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.35); }
.btn-primary:hover { background: var(--accent-d); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--faint); color: var(--ink); }
.btn-sm { padding: .5rem .9rem; font-size: .9rem; }

/* ---- Header ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: .48rem; font-family: var(--logo); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--ink); }
.brand-mark { display: inline-flex; flex: none; }
.brand-mark svg { width: 1.15em; height: 1.15em; border-radius: .28em; display: block; box-shadow: 0 1px 3px rgba(49,46,129,.35); }
.brand:hover { text-decoration: none; }
.brand .dot { display: inline-block; width: .17em; height: .17em; margin-left: .05em; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #7c3aed); vertical-align: baseline; }
.nav { margin-left: auto; }
.nav-menu { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0; align-items: center; }
.nav-menu a { color: var(--muted); font-weight: 500; font-size: .96rem; }
.nav-menu a:hover { color: var(--ink); text-decoration: none; }
.header-cta { margin-left: .25rem; }
.skip-link { position: fixed; top: .5rem; left: .5rem; transform: translateY(-200%); z-index: 100; background: #fff; color: #312e81; padding: .7rem 1rem; border: 2px solid currentColor; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid #4f46e5; outline-offset: 3px; }
main { scroll-margin-top: 8rem; }
main [id] { scroll-margin-top: 8rem; }
.prose { overflow-wrap: anywhere; }
.prose img, .prose video { max-width: 100%; height: auto; }
.prose pre { overflow-x: auto; }

/* ---- Hero ------------------------------------------------------------ */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  background:
    radial-gradient(60% 120% at 50% -10%, var(--accent-soft) 0%, rgba(238,242,255,0) 60%),
    var(--bg);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  color: var(--accent-d); background: var(--accent-soft);
  border: 1px solid #dfe3ff; border-radius: 999px;
  padding: .35rem .85rem; margin-bottom: 1.1rem;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent) 10%, #7c3aed 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--muted); max-width: 42rem; margin: .75rem auto 1.6rem; }
.hero-note { color: var(--muted); font-size: .875rem; margin: .75rem 0 0; }
.hero-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.hero-summary { max-width: 40rem; margin: 1.25rem auto 1.75rem; }
.product-note { max-width: 46rem; margin: 1.75rem auto 0; color: var(--muted); font-size: .9rem; text-align: center; }
#install .section-head { margin-bottom: 0; }

/* ---- Sections -------------------------------------------------------- */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section.soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 40rem; margin: 0 auto 2.5rem; }
.section-head p { color: var(--muted); margin: 0; }

/* ---- Feature grid ---------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.card:hover { box-shadow: 0 8px 30px rgba(15,23,42,.07); border-color: #d6dbe6; transform: translateY(-2px); }
.card .ico {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: .9rem;
  background: var(--accent-soft); color: var(--accent-d);
}
.card .ico svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: .3rem; }
.card p { color: var(--muted); font-size: .96rem; margin: 0; }

/* ---- Steps ----------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; counter-reset: step; }
.step { padding-top: .4rem; }
.step .n {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 700; font-size: .9rem; margin-bottom: .7rem;
}
.step h3 { font-size: 1.05rem; }
.step p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---- Dogfood callout ------------------------------------------------- */
.callout {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(180deg, #fff, var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
}
.callout .badge { font-size: 1.5rem; }
.callout p { margin: 0; color: var(--muted); }
.callout strong { color: var(--ink); }
.callout .spacer { margin-left: auto; }

/* ---- CTA band -------------------------------------------------------- */
.cta-band { text-align: center; }
.cta-band .box {
  background: linear-gradient(120deg, #1e1b4b, #312e81);
  color: #e0e7ff; border-radius: 20px; padding: clamp(2rem,5vw,3.2rem);
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #c7d2fe; max-width: 36rem; margin: 0 auto 1.4rem; }
.cta-band .btn-ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.16); }

/* ---- Prose (pages / docs) ------------------------------------------- */
.page { padding-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.prose { max-width: 760px; margin: 0 auto; }
.prose.wide { max-width: 880px; }
.page-title { margin-bottom: 1.5rem; }
.prose h2 { margin-top: 2.4rem; padding-top: .4rem; }
.prose h3 { margin-top: 1.6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .3rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--faint); font-weight: 600; }
.prose blockquote { margin: 1.2rem 0; padding: .2rem 1.1rem; border-left: 3px solid var(--accent); color: var(--muted); }
.lead-in { font-size: 1.15rem; color: var(--muted); }
/* ---- Footer ---------------------------------------------------------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 3rem 0 2rem; margin-top: 2rem; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 1.5rem; }
.footer-grid h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 0 .7rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: .35rem 0; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--ink); }
.footer-brand .brand { font-size: 1.2rem; }
.footer-brand p { color: var(--faint); max-width: 22rem; margin: .6rem 0 0; }
.footer-bottom { margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--faint); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bottom a { color: var(--faint); }

/* ---- Optional email sign-up ------------------------------------------ */
.signup {
  max-width: 34rem; margin: 2rem auto 0; padding: 1.25rem 1.3rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-align: left;
}
.prose .signup h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.signup p { margin: 0 0 .8rem; color: var(--muted); font-size: .95rem; }
.signup-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.signup-row input[type="email"] {
  flex: 1 1 14rem; min-width: 0; padding: .7rem .85rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.signup-row input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.signup-consent { display: flex; align-items: flex-start; gap: .55rem; margin-top: .8rem; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.signup-consent input { flex: none; margin-top: .3rem; }
.signup-msg { padding: .6rem .8rem; border-radius: 10px; background: var(--accent-soft); color: var(--accent-d); font-weight: 600; }
.signup-msg.is-error { background: #fef2f2; color: #b91c1c; }
.signup-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
  .site-header .bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; padding-block: .75rem; }
  .site-header .brand { font-size: 1.15rem; }
  .nav { grid-column: 1 / -1; grid-row: 2; margin: 0; min-width: 0; }
  .nav-menu { flex-wrap: wrap; justify-content: center; gap: .5rem 1rem; }
  .nav-menu a { display: inline-block; padding: .3rem 0; overflow-wrap: anywhere; }
  .header-cta { margin: 0; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav-menu { gap: .9rem; }
  .nav-menu .hide-sm { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Keep the email request button compact on small screens. */
@media (max-width: 640px) {
  .header-cta .cta-long { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
  .btn:active, .card:hover { transform: none; }
}
