/* Kvanta homepage, G8 design (admin-previews/g8.html). Loaded after main.css,
   whose G8 skin supplies the tokens (--pa, --pa2, --ink, --ink2, --ru) and
   the header and footer. Everything here is scoped to .g8-home. */
.g8-home {
  --g8-ease: cubic-bezier(.22, 1, .36, 1);
  --g8-press: cubic-bezier(.3, .7, .4, 1);
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 32px 96px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.g8-home *, .g8-home *::before, .g8-home *::after { box-sizing: border-box; }

/* Entrance for the hero, and scroll reveal for the rest (only once the
   script has run, so visitors without JavaScript see everything). */
@keyframes g8-rise { from { opacity: 0; transform: translate3d(0, 22px, 0) scale(.98); } to { opacity: 1; transform: none; } }
.g8-rise { animation: g8-rise .9s var(--g8-ease) backwards; }
.js .g8-home [data-reveal] { opacity: 0; transform: translate3d(0, 12px, 0); transition: opacity .75s ease-out, transform .75s var(--g8-ease); }
.js .g8-home [data-reveal].is-in { opacity: 1; transform: none; }

/* Hero: a big grey panel with the sign-up field. */
.g8-hero { background: var(--pa2); border-radius: 40px; padding: 56px 56px 48px; display: flex; flex-direction: column; gap: 24px; }
.g8-hero h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 4.5rem; line-height: 1; letter-spacing: -0.04em; max-width: 15ch; color: var(--ink); }
.g8-hero h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 1; letter-spacing: -0.04em; color: var(--ink); }
.g8-hero p { margin: 0; font-size: 1.25rem; line-height: 1.45; color: var(--ink2); max-width: 40ch; }
.g8-field { display: flex; gap: 10px; flex-wrap: wrap; max-width: 560px; margin: 0; }
.g8-field input { flex: 1 1 280px; min-height: 56px; padding: 0 22px; background: var(--pa); color: var(--ink); border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: 1rem; }
.g8-field input:focus-visible { outline: none; border-color: var(--ink); }
.g8-field input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.g8-status { margin: 0; font-size: .875rem; color: var(--ink2); min-height: 20px; }
.g8-status[data-kind="error"] { color: var(--ink); font-weight: 700; }
.g8-fine { margin: 0; font-size: .8125rem; color: var(--ink2); }

/* Buttons: ink pills with a spring lift. */
.g8-btn {
  position: relative; overflow: hidden; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem;
  min-height: 56px; padding: 0 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ink); color: var(--pa); text-decoration: none;
  transition: transform .5s var(--g8-ease), box-shadow .5s ease, background-color .25s ease;
}
@media (hover: hover) { .g8-btn:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -12px var(--lift-shadow, rgba(0,0,0,.45)); background: var(--ink-hover, var(--ink)); color: var(--pa); } }
.g8-btn:active { transform: scale(.96); box-shadow: none; }
.g8-btn:disabled { opacity: .6; cursor: progress; }
.g8-btn.is-done { background: var(--pa); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.g8-arrow { display: inline-block; transition: transform .35s var(--g8-ease); }
@media (hover: hover) { .g8-btn:hover .g8-arrow { transform: translateX(5px); } }

/* Sections of cards. */
.g8-label { margin: 8px 0 0; font-family: var(--font-body); font-size: .875rem; font-weight: 400; letter-spacing: 0; color: var(--ink2); }
.g8-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.g8-card { background: var(--pa2); border-radius: 28px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 200px; color: var(--ink); text-decoration: none; transition: transform .6s var(--g8-ease), box-shadow .6s var(--g8-ease); }
a.g8-card:hover { color: var(--ink); }
@media (hover: hover) { a.g8-card:hover, .g8-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -12px var(--lift-shadow, rgba(0,0,0,.45)); } }
.g8-card .g8-kicker { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink2); }
.g8-card h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.625rem; line-height: 1.08; letter-spacing: -0.03em; color: var(--ink); }
.g8-card p { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--ink2); }
.g8-bullets { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 1rem; line-height: 1.4; }
.g8-source { display: inline-block; font-size: 1rem; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 4px; }
/* One full-width line in place of a grid: a message and at most one action. */
.g8-note { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px 32px; padding: 28px 32px; }
.g8-note .g8-copy { display: flex; flex-direction: column; gap: 10px; }
.g8-note h3 { font-size: 1.375rem; }
.g8-note .g8-btn { min-height: 52px; flex: none; }

.g8-legal { margin: 0; font-size: .8125rem; line-height: 1.6; color: var(--ink2); max-width: 70ch; }

/* Ripple on press: colour follows the text, so it reads on both themes. */
.g8-ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; pointer-events: none; transform: scale(0); animation: g8-ripple .6s var(--g8-ease) forwards; }
@keyframes g8-ripple { to { transform: scale(1); opacity: 0; } }

@media (max-width: 760px) {
  .g8-home { padding: 24px 16px 72px; gap: 24px; }
  .g8-hero { padding: 36px 24px; border-radius: 32px; }
  .g8-hero h1 { font-size: 3rem; }
  .g8-hero h2 { font-size: 2.25rem; }
  .g8-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .g8-cards::-webkit-scrollbar { display: none; }
  .g8-cards > * { scroll-snap-align: start; }
  .g8-note { grid-column: auto; flex-direction: column; align-items: flex-start; }
  /* A lone note is a full-width line, not a card in a side-scrolling row. */
  .g8-cards:has(> .g8-note:only-child) { grid-auto-columns: 100%; overflow-x: visible; }
  .g8-note .g8-btn { white-space: nowrap; }
}
@media (prefers-contrast: more) {
  .g8-card, .g8-hero { box-shadow: inset 0 0 0 2px var(--ink); }
  .g8-field input { box-shadow: inset 0 0 0 2px var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .g8-rise { animation: none !important; }
  .js .g8-home [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .g8-btn, .g8-card, .g8-arrow { transition: none !important; }
  .g8-btn:hover, .g8-card:hover, a.g8-card:hover { transform: none !important; }
  .g8-ripple { display: none; }
}

/* ------------------------------ Ask Kai page ------------------------------ */
.g8-answer { min-height: 200px; justify-content: flex-start; gap: 16px; }
.g8-answer[hidden] { display: none; }
.g8-answer h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1.3; letter-spacing: -0.02em; white-space: pre-line; color: var(--ink); }
.g8-examples { display: flex; flex-wrap: wrap; gap: 10px; }
.g8-example { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 999px; background: var(--pa2); color: var(--ink); font: inherit; font-size: .9375rem; font-weight: 700; text-align: left; cursor: pointer; transition: transform .5s var(--g8-ease), box-shadow .5s ease; }
@media (hover: hover) { .g8-example:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -14px var(--lift-shadow, rgba(0,0,0,.45)); } }
.g8-example:active { transform: scale(.96); }
.g8-field input.is-filling { box-shadow: inset 0 0 0 2px var(--ink); }
.g8-dialog { border: 0; border-radius: 32px; padding: 36px; background: var(--pa2); color: var(--ink); width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.g8-dialog::backdrop { background: rgba(0,0,0,.45); }
.g8-dialog h2 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1.1; letter-spacing: -0.03em; }
.g8-dialog p { margin: 0 0 24px; color: var(--ink2); font-size: 1.0625rem; line-height: 1.5; }
.g8-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.g8-quiet { background: transparent; color: var(--ink); border: 0; min-height: 56px; padding: 0 20px; font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { .g8-example { transition: none !important; } .g8-example:hover { transform: none !important; } }
