/* ==========================================================================
   IQ Xchange — the front page (iqdrates.com/).
   Three blocks sit under one header: the hero that points at the television
   board, the archive that used to live on /iqd, and the API offer. Everything
   shares style.css: this file only adds the landing furniture.
   ========================================================================== */

.is-home .page { gap: clamp(2rem, 4vw, 3.4rem); }

/* an in-page jump must not land under the sticky-looking top edge */
#archive,
#api { scroll-margin-block-start: 1.1rem; }

/* --------------------------------------------------------------- header */
.is-home .topbar { flex-wrap: wrap; row-gap: 0.5rem; }

/* five links plus the language and accent controls do not fit a phone, so the
   nav takes a row of its own there and keeps scrolling sideways if it must */
.is-home .topnav {
  order: 3;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.is-home .topnav::-webkit-scrollbar { display: none; }

@media (min-width: 940px) {
  .is-home .topnav { order: 0; width: auto; }
}

/* ----------------------------------------------------------------- hero */
.home-hero {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 64rem;
  padding-block-start: clamp(0.4rem, 1.6vw, 1.4rem);
}

.home-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.07;
  letter-spacing: -0.035em;
  color: #fff;
  text-wrap: balance;
}

.home-lead {
  max-width: 46rem;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.12rem);
  line-height: 1.7;
}

.home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-block-start: 0.5rem;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.25rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--gold);
  color: #131313;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.home-btn:hover { transform: translateY(-1px); }
.home-btn:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }

.home-btn.is-ghost {
  background: transparent;
  border-color: color-mix(in srgb, var(--line) 85%, transparent);
  color: var(--gold);
}

.home-btn.is-ghost:hover { border-color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .home-btn { transition: none; }
  .home-btn:hover { transform: none; }
}

/* four facts, each riding its own rule — no card needed to read them */
.home-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  margin-block-start: 1.1rem;
}

.home-facts li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-block-start: 0.7rem;
  border-block-start: 2px solid color-mix(in srgb, var(--gold) 38%, transparent);
}

.home-facts strong {
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.home-facts span {
  color: var(--muted);
  font-size: 0.78rem;
  opacity: 0.82;
}

/* --------------------------------------------------------- the tv screen */
.home-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(1rem, 2.6vw, 2.6rem);
  padding: var(--pad);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.home-screen-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}

.home-screen-art {
  margin: 0;
  display: grid;
  place-items: center;
  color: var(--gold);
}

.home-screen-art svg { width: 100%; max-width: 380px; height: auto; }

/* ------------------------------------------------------- shared headings */
.home-h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.35rem, 2.5vw, 2.05rem);
  line-height: 1.16;
  letter-spacing: -0.022em;
  color: #fff;
  text-wrap: balance;
}

.home-h3 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.home-text {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.home-text.is-small { font-size: 0.84rem; }

.home-text a { color: var(--gold); text-underline-offset: 3px; }

/* -------------------------------------------------------- the archive */
.home-archive {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-block-start: clamp(0.4rem, 1.4vw, 1rem);
  border-block-start: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}

/* ------------------------------------------------------------ the api */
.home-api {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.6rem);
  padding-block-start: clamp(1.2rem, 2.4vw, 2rem);
  border-block-start: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
}

.home-api-head {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 52rem;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  align-items: stretch;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: var(--pad);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.plan.is-featured {
  border-color: var(--gold);
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--gold) 9%, var(--panel-2)) 0%,
      var(--panel-2) 60%);
}

.plan-badge {
  position: absolute;
  inset-block-start: -0.72rem;
  inset-inline-start: var(--pad);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--gold);
  color: #131313;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.plan-name {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.plan-price {
  font-family: var(--font-head);
  font-size: clamp(1.45rem, 2.3vw, 1.95rem);
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plan-per {
  margin-inline-start: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.plan-limit {
  color: var(--gold-soft);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plan-desc {
  flex: 1;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

/* The agent line sits between the allowance and the prose: it is a feature of
   every package, so it is styled as a quiet caption rather than a badge. */
.plan-agent {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* The line is filled from /api/plans; a package without agent access leaves it
   empty, and an empty flex box would still draw the dot. */
.plan-agent:empty {
  display: none;
}

.plan-agent::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up-neon, #38f58c);
  box-shadow: 0 0 8px currentColor;
}

.plan-cta {
  display: inline-flex;
  justify-content: center;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--gold);
  color: #131313;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.plan-cta.is-ghost {
  background: transparent;
  border-color: color-mix(in srgb, var(--line) 85%, transparent);
  color: var(--gold);
}

.plan-cta:hover { border-color: var(--gold); }
.plan-cta:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }

/* -------------------------------------------------- code + capabilities */
.api-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(1rem, 2.2vw, 2.2rem);
  align-items: start;
}

.api-sample-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.api-sample {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: 12px;
  background: #0d0d0d;
  color: var(--gold-soft);
  font: 500 0.8rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  direction: ltr;
  text-align: left;
  overflow-x: auto;
}

.api-features {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.api-features li {
  position: relative;
  padding-inline-start: 1.05rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.api-features li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.55em;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.75;
}

.api-features code,
.api-sample-wrap code,
.home-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--gold-soft);
}

/* ----------------------------------------------------------- footer */
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.9rem;
  font-size: 0.78rem;
}

.foot-links a {
  color: var(--muted);
  text-decoration: none;
  border-block-end: 1px solid transparent;
}

.foot-links a:hover {
  color: var(--text);
  border-block-end-color: color-mix(in srgb, var(--gold) 55%, transparent);
}

/* ------------------------------------------------------- small screens */
@media (max-width: 1080px) {
  .home-screen { grid-template-columns: minmax(0, 1fr); }
  .home-screen-art { display: none; }
  .api-split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .home-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .home-btn { padding: 0.65rem 1rem; font-size: 0.86rem; }
  .plan-badge { inset-inline-start: var(--pad); }
}
