/* InsightsKit landing page and articles. Colours, spacing, radii and type
   come from graphite/tokens.css and graphite/components.css; this file holds
   the layout and the few things that are the site's own. It started as
   landingpage_waitlist/waitlist.css.

   The only hue is the InsightsKit orange, for the wordmark — the same values
   as the sign-in page (internal/dash/templates/signin.html). Green is the
   live dot.

   Graphite's tokens.css defines global type classes (.hero, .section, .title,
   .body, .button, .label, .nav, .tag, .quote, .stat). Do not use those names
   for layout here. */

:root, [data-theme="light"] { --logo-accent: #c2610c; }
[data-theme="dark"] { --logo-accent: #f0a04b; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-size: 16px; line-height: 24px; font-weight: 500; overflow-x: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 30; padding: 10px 16px; border-radius: var(--radius-full);
  background: var(--primary); color: var(--primary-foreground); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; outline: 2px solid transparent; box-shadow: var(--focus-ring); }

.wordmark { font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -.54px; color: var(--foreground); text-decoration: none; }
.wordmark span { color: var(--logo-accent); }

:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }

/* ---- nav: Graphite's floating pills, plus log in ---------------------------- */
.topnav { position: sticky; top: 0; z-index: 20; display: flex; justify-content: center; padding: 14px 16px; pointer-events: none; }
.topnav .gr-nav { pointer-events: auto; position: relative; }
.topnav .wordmark { padding: 9px 18px; border-radius: var(--radius-full); background: var(--surface); font-size: 15px; line-height: 22px; }
.gr-nav-cta { background: var(--primary); color: var(--primary-foreground); }
.navauth { display: flex; gap: 4px; align-items: center; }
.navlogin { padding: 9px 16px; border-radius: var(--radius-full); background: var(--surface); color: var(--foreground);
  font-size: 13px; line-height: 22px; font-weight: 600; text-decoration: none; transition: background-color .3s cubic-bezier(.76,0,.24,1); }
.navlogin:hover { background: var(--surface-muted); }
.navmenu { display: none; width: 40px; height: 40px; border: 0; border-radius: var(--radius-full); background: var(--surface);
  color: var(--foreground); cursor: pointer; place-items: center; }
@media (max-width: 820px) {
  .navmenu { display: grid; }
  .gr-nav-cta { display: none; }
  /* The links become a panel under the pills, opened by the menu button. */
  .gr-nav-links { display: none; position: absolute; top: calc(100% + 8px); right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; border-radius: 24px; background: var(--surface);
    /* The one shadow on the site: the panel floats over a white card and
       would vanish into it without one. */
    box-shadow: 0 0 0 1px var(--border), 0 16px 40px rgba(0, 0, 0, .14); }
  .gr-nav-links.is-open { display: flex; }
  .gr-nav-links .gr-nav-link { padding: 12px 16px; border-radius: 16px; }
}
@media (max-width: 380px) { .topnav .wordmark { padding: 9px 14px; } .navlogin { padding: 9px 12px; } }

/* ---- hero: the sign-in card, with the demo on the right --------------------- */
.herowrap { padding: 4px 18px 18px; }
.herocard {
  max-width: 1280px; margin: 0 auto;
  height: min(760px, calc(100vh - 96px)); min-height: 640px;
  display: grid; grid-template-columns: minmax(360px, 4.7fr) 7.3fr;
  border-radius: var(--radius-panel); overflow: hidden; background: var(--surface); padding: 10px;
}
.side { display: flex; flex-direction: column; padding: 30px 32px; }
.side .sidebody { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 430px; width: 100%; margin: 0 auto; }
.side .gr-status { align-self: flex-start; background: var(--background); margin-bottom: 22px; }
.side h1 { font-size: 46px; line-height: 1.07; font-weight: 700; letter-spacing: -1.4px; color: var(--foreground-strong); margin-bottom: 16px; }
.lede { color: var(--muted-foreground); font-size: 16px; line-height: 25px; margin-bottom: 28px; }
.herocta { display: flex; flex-wrap: wrap; gap: 8px; }
.herocta .gr-btn-secondary { background: var(--background); }
.note { margin-top: 14px; font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.note a { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--ring); text-underline-offset: 2px; }

.art { position: relative; background: var(--background); border-radius: 28px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; padding: 18px 18px 14px; }

@media (max-width: 960px) {
  .herowrap { padding: 4px 10px 10px; }
  .herocard { grid-template-columns: 1fr; height: auto; min-height: 0; border-radius: 28px; }
  .side { padding: 30px 14px 28px; }
  .side h1 { font-size: 36px; letter-spacing: -1px; }
  .art { border-radius: 22px; padding: 14px 10px 12px; }
}

/* ---- sections -------------------------------------------------------------- */
.band { max-width: 1112px; margin: 0 auto; padding: var(--space-80) 18px; }
.panel { margin: 0 18px; }
.panel > * { max-width: 1076px; margin-left: auto; margin-right: auto; }
.gr-sechead-title { color: var(--foreground-strong); text-wrap: balance; }
.gr-sechead-sub { max-width: 460px; }
@media (max-width: 720px) {
  .band { padding: 56px 16px; }
  .panel { margin: 0 8px; }
  .gr-panel { padding: 56px 16px; border-radius: 28px; }
  .gr-sechead-title { font-size: 30px; line-height: 36px; letter-spacing: -.9px; }
}

/* Features: one feature per row, so the reader takes in one idea at a time.
   Text on one side, the picture on the other; every second row swaps sides.
   The pictures themselves are in features.css. */
.frows { display: flex; flex-direction: column; gap: 112px; margin-top: 72px; }
.frow { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; align-items: center; }
.frow:nth-child(even) .ftext { order: 2; }
.ftext { max-width: 460px; }
.frow:nth-child(even) .ftext { justify-self: end; }
.feyebrow { display: inline-block; padding: 5px 12px; border-radius: var(--radius-full); background: var(--surface);
  font-size: 12px; line-height: 16px; font-weight: 700; color: var(--muted-foreground); }
.ftext h3 { margin-top: 18px; font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -1.2px; color: var(--foreground-strong); text-wrap: balance; }
.ftext p { margin-top: 16px; font-size: 17px; line-height: 27px; color: var(--muted-foreground); }
.fchecks { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fchecks li { position: relative; padding-left: 30px; font-size: 15px; line-height: 22px; color: var(--foreground); }
/* A check mark in a dark circle, drawn with two borders. */
.fchecks li::before { content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); }
.fchecks li::after { content: ""; position: absolute; left: 6.5px; top: 6px; width: 7px; height: 4px; border-left: 2px solid var(--primary-foreground);
  border-bottom: 2px solid var(--primary-foreground); transform: rotate(-45deg); }
.flink { display: inline-block; margin-top: 24px; font-size: 15px; font-weight: 700; color: var(--foreground); text-decoration: underline;
  text-decoration-color: var(--ring); text-underline-offset: 4px; }
.flink:hover { text-decoration-color: currentColor; }

/* Each row comes into view as you reach it (landing.js adds .in). Without
   JavaScript, or with "reduce motion", the rows simply show. */
@media (prefers-reduced-motion: no-preference) {
  .fx-on .frow .ftext, .fx-on .frow .fart { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.65,0,.35,1), transform .7s cubic-bezier(.65,0,.35,1); }
  .fx-on .frow .fart { transition-delay: .1s; }
  .fx-on .frow.in .ftext, .fx-on .frow.in .fart { opacity: 1; transform: none; }
}

/* The two smaller features under the rows. */
.falso-h { margin: 112px 0 20px; text-align: center; font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -.6px; color: var(--foreground-strong); }
.falso { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 860px; margin: 0 auto; }
.feature { display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: var(--radius-feature); background: var(--surface); }

@media (max-width: 900px) {
  .frows { gap: 72px; margin-top: 48px; }
  .frow { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  /* On one column the picture always comes first, then its text. */
  .frow .fart { order: -1; }
  .frow:nth-child(even) .ftext { order: 0; justify-self: start; }
  .ftext h3 { font-size: 30px; letter-spacing: -.8px; }
  .falso-h { margin-top: 72px; }
}
@media (max-width: 600px) { .falso { grid-template-columns: 1fr; } }

/* How it works: steps next to the real code, then the ways to connect. */
.how { display: grid; grid-template-columns: 1fr 1.1fr; gap: 12px; margin-top: 40px; align-items: stretch; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; padding: 18px 20px;
  border-radius: var(--radius-card); background: var(--background); }
.steps li::before { content: counter(step); grid-row: span 2; width: 32px; height: 32px; border-radius: var(--radius-full);
  display: grid; place-items: center; background: var(--surface); font-size: 13px; font-weight: 700; }
.steps b { font-size: 16px; line-height: 22px; color: var(--foreground); }
.steps span { font-size: 14px; line-height: 22px; color: var(--muted-foreground); }
/* The code block stays dark in both themes, like an editor. */
.code { margin: 0; padding: 18px 22px 22px; border-radius: var(--radius-card); background: #232323; color: #efefef; overflow-x: auto; }
[data-theme="dark"] .code { background: #1b1b1b; }
.code figcaption { font-size: 12px; font-weight: 600; color: #9d9d9d; margin-bottom: 12px; }
.code pre { margin: 0; font: 13.5px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.code .k { color: #efefef; font-weight: 700; }
.code .t { color: #f0a04b; }
.code .s { color: #b4b4b4; }
.code .c { color: #8a8a8a; }
.ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.way { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; border-radius: var(--radius-card); background: var(--background); }
.way p { font-size: 14px; line-height: 22px; color: var(--muted-foreground); }
.way .gr-tag { align-self: flex-start; background: var(--primary); color: var(--primary-foreground); margin-bottom: 4px; }
.way .gr-tag.is-soon { background: var(--surface); color: var(--foreground); }
@media (max-width: 860px) { .how, .ways { grid-template-columns: 1fr; } }

/* Pricing, on a dark panel. In the dark theme the page is already #232323, so
   the panel steps one fill darker to stay a separate block. */
[data-theme="dark"] .gr-panel-dark[data-theme="dark"] { background: #1b1b1b; }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px 12px; margin-top: 48px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 26px 24px 24px; border-radius: var(--radius-feature); background: var(--surface); }
/* The tag sits on the card's top edge, so it never covers the title. */
/* Lifetime's tags sit on the card's top edge: "Best value" in the brand
   colour, "First 100 customers" as a plain chip. */
.plan .plan-tags { position: absolute; top: -12px; right: 22px; gap: 6px; flex-wrap: nowrap; }
.plan .gr-tag.is-best { background: var(--primary); color: var(--primary-foreground); }
.plan .price { font-size: 38px; line-height: 44px; font-weight: 700; letter-spacing: -1.2px; color: var(--foreground); margin-top: 6px; }
.plan .price small { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted-foreground); }
.plan .for { font-size: 14px; line-height: 22px; color: var(--muted-foreground); min-height: 44px; }
.plan ul { list-style: none; margin: 10px 0 18px; padding: 16px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.plan li { font-size: 14px; line-height: 21px; color: var(--foreground); display: flex; gap: 8px; }
.plan li::before { content: "→"; color: var(--muted-foreground); }
.plan .gr-btn-secondary { background: var(--surface-muted); }
.fine { margin: 24px auto 0; max-width: 640px; text-align: center; font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
@media (max-width: 1060px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .plans { grid-template-columns: 1fr; } .plan .for { min-height: 0; } }

/* FAQ: Graphite FaqItem on <details>. */
.faqs { max-width: 600px; margin: 40px auto 0; display: flex; flex-direction: column; gap: var(--space-8); }
.gr-faq { padding: var(--space-18) 22px; }
.gr-faq-q { list-style: none; }
.gr-faq-q::-webkit-details-marker { display: none; }
.gr-faq[open] .gr-chevron { transform: rotate(180deg); }
.gr-faq-a { max-width: 520px; }

/* Contact: the heading on the left, the form on the right. */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contactform { padding: 24px; border-radius: var(--radius-lg); background: var(--background); display: flex; flex-direction: column; gap: 14px; }
.field2 { display: flex; flex-direction: column; gap: 6px; }
.field2 label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--foreground); }
.field2 input, .field2 select, .field2 textarea {
  width: 100%; border: 0; border-radius: 14px; background: var(--surface); color: var(--foreground);
  font: inherit; font-size: 15px; padding: 13px 14px; }
.field2 textarea { resize: vertical; min-height: 120px; line-height: 22px; }
.field2 :is(input, select, textarea)[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--destructive); }
.field2 ::placeholder { color: var(--muted-foreground); }
.formmsg { font-size: 14px; line-height: 20px; color: var(--destructive); }
.formmsg.is-info { color: var(--muted-foreground); }
.contactform .note { margin-top: 0; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; gap: 28px; } .contactform { padding: 18px; } }

.final { padding-bottom: 64px; }
.final-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 28px; }

/* ---- footer: the same on every page ------------------------------------------ */
.site-foot { margin: 0 18px 18px; padding: 48px 40px 24px; border-radius: var(--radius-panel); background: var(--surface); }
.foot-grid { max-width: 1076px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr .8fr 1.5fr .9fr; gap: 32px; }
.foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.foot-brand p { font-size: 14px; line-height: 22px; color: var(--muted-foreground); max-width: 280px; }
.foot-col h2 { font-size: 13px; line-height: 18px; font-weight: 700; color: var(--foreground); margin-bottom: 14px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.foot-col a { font-size: 14px; line-height: 20px; color: var(--muted-foreground); text-decoration: none; }
.foot-col a:hover { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }
.foot-col a.more { color: var(--foreground); font-weight: 600; }
.foot-bottom { max-width: 1076px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
/* Consent banner for Google Analytics (landing.js). Decline and Accept look
   the same on purpose: declining must be as easy as accepting. */
.consent { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin: 0 auto;
  padding: 18px 20px; border-radius: var(--radius-card); background: var(--surface); color: var(--foreground);
  box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 12px 32px rgba(0,0,0,.16); border: 1px solid var(--border); }
.consent p { font-size: 14px; line-height: 22px; }
.consent a { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.consent-actions .gr-btn { min-width: 104px; background: var(--background); color: var(--foreground); }
.consent-actions .gr-btn:hover { background: var(--border); }
.consentbtn { margin-left: auto; padding: 6px 14px; border: 0; border-radius: var(--radius-full); background: var(--background);
  color: var(--foreground); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.consentbtn + .themebtn { margin-left: 0; }
.themebtn { margin-left: auto; padding: 6px 14px; border: 0; border-radius: var(--radius-full); background: var(--background);
  color: var(--foreground); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
@media (max-width: 960px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) {
  .site-foot { margin: 0 8px 8px; padding: 36px 18px 18px; border-radius: 28px; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---- articles ---------------------------------------------------------------- */
.page { max-width: 1112px; margin: 0 auto; padding: 8px 18px 64px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; line-height: 20px; color: var(--muted-foreground); margin: 18px 0 18px; }
.crumbs a { color: var(--muted-foreground); text-decoration: none; }
.crumbs a:hover { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }
.pagehead { padding: 48px 40px; border-radius: var(--radius-panel); background: var(--surface); }
.pagehead h1 { font-size: 44px; line-height: 1.1; font-weight: 700; letter-spacing: -1.3px; color: var(--foreground-strong); max-width: 780px; }
.pagehead p { margin-top: 14px; font-size: 17px; line-height: 27px; color: var(--muted-foreground); max-width: 640px; }
.pagehead .meta { margin-top: 18px; font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.articlelist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.articlelist a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 26px; border-radius: var(--radius-feature);
  background: var(--surface); text-decoration: none; transition: background-color .3s cubic-bezier(.76,0,.24,1); }
.articlelist a:hover { background: var(--surface-muted); }
.articlelist h2 { font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -.5px; color: var(--foreground); }
.articlelist p { font-size: 14px; line-height: 22px; color: var(--muted-foreground); }
.articlelist .readmore { margin-top: auto; padding-top: 8px; font-size: 13px; font-weight: 700; color: var(--foreground); }
@media (max-width: 760px) { .articlelist { grid-template-columns: 1fr; } }

.prose { margin: 12px auto 0; padding: 48px 40px; border-radius: var(--radius-panel); background: var(--surface); }
.prose > * { max-width: 680px; margin-left: auto; margin-right: auto; }
.prose h2 { font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -.7px; color: var(--foreground-strong); margin-top: 40px; margin-bottom: 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; line-height: 24px; font-weight: 700; color: var(--foreground); margin-top: 28px; margin-bottom: 8px; }
.prose p, .prose li { font-size: 16px; line-height: 27px; color: var(--foreground); }
.prose p + p { margin-top: 14px; }
.prose ul, .prose ol { padding-left: 22px; margin-top: 12px; margin-bottom: 12px; }
.prose li + li { margin-top: 6px; }
.prose a { text-decoration: underline; text-decoration-color: var(--ring); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose code { font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 6px; border-radius: 6px; background: var(--background); }
.prose .code { margin-top: 18px; margin-bottom: 18px; }
.prose .code code { padding: 0; background: none; font-size: 13.5px; }
.prose table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px; line-height: 21px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-weight: 700; }
.prose .callout { margin-top: 28px; padding: 22px 24px; border-radius: var(--radius-card); background: var(--background); }
.prose .callout p { font-size: 15px; line-height: 24px; }
.prose .callout .gr-btn { margin-top: 14px; }
.prose .tablewrap { overflow-x: auto; margin-top: 16px; }
.prose .tablewrap table { margin-top: 0; min-width: 620px; }
.prose .tablewrap td:last-child { min-width: 120px; }
.prose .toc { columns: 2; column-gap: 32px; }
.prose .toc li { break-inside: avoid; }
.prose .summary li + li { margin-top: 4px; }
.prose > .callout:first-child { margin-top: 0; }
.related { margin-top: 12px; }
.related h2 { font-size: 13px; font-weight: 700; color: var(--muted-foreground); margin: 28px 0 10px 4px; }
.draftnote { margin: 0 0 16px; padding: 14px 18px; border-radius: var(--radius-card); background: var(--destructive); color: #fff; font-size: 14px; line-height: 22px; font-weight: 600; }
@media (max-width: 720px) {
  .page { padding: 4px 8px 40px; }
  .pagehead { padding: 32px 18px; border-radius: 28px; }
  .pagehead h1 { font-size: 32px; letter-spacing: -.9px; }
  .prose { padding: 30px 18px; border-radius: 28px; }
  .prose .toc { columns: 1; }
}
