/* Site rules for apps/marketing-site.
   The first block is the <helmet> <style> of docs/design/gevie-website.dc.html
   — the design's own keyframes and media queries, unchanged in effect and
   reflowed only by this repository's prettier hook. Everything after the marked
   divider is what a real, multi-page, works-without-JavaScript site needs and a
   single-canvas prototype does not. */

body {
  margin: 0;
}
a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover {
  color: var(--color-accent-400);
}
@keyframes gv-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}
@keyframes gv-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes gv-dot {
  0%,
  60%,
  100% {
    opacity: 0.25;
  }
  30% {
    opacity: 1;
  }
}
/* Media queries are the one thing inline styles cannot express. */
@media (max-width: 1180px) {
  [data-gv-hero] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 44px !important;
  }
}
@media (max-width: 900px) {
  [data-gv-split] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 32px !important;
  }
}
@media (max-width: 760px) {
  [data-gv-phone] {
    display: none !important;
  }
  [data-gv-stage] {
    padding: 0 !important;
  }
}
@media (max-width: 720px) {
  [data-gv-navlinks] {
    display: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Below here is implementation, not design. */

/* Phosphor glyphs ship as inline <svg> rather than the 144 KiB webfont
   (scripts/build.mjs). The design sizes every icon with `font-size` and colours
   it with `color`, so the SVG has to answer to both the way the font did. */
.ph {
  width: 1em;
  height: 1em;
  fill: currentColor;
  display: inline-block;
  vertical-align: -0.125em;
  flex: none;
}

/* The design is one canvas whose buttons call navigation functions. Here they
   are real links, which need the button styling not to be undone by the
   global `a` rule. */
a.btn:hover {
  color: var(--color-text);
}
a.btn-primary,
a.btn-primary:hover {
  color: var(--color-accent);
}
a.btn-ghost,
a.btn-ghost:hover {
  color: var(--color-accent);
}

/* The capability tabs are radio inputs, so switching panels needs no
   JavaScript and arrow keys move between them for free. The input is hidden
   from sight but not from the keyboard or a screen reader; the billing toggle
   needs none of this because nocturne.css's own `.seg` already hides its. */
.gv-control {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.gv-control:focus-visible + label {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Capabilities — seven panels, one visible. */
.cap-tab {
  text-align: left;
  font: inherit;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  margin-left: -1px;
  padding: 13px 16px;
  cursor: pointer;
  color: var(--color-neutral-400);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.gv-control:checked + .cap-tab {
  border-left-color: var(--color-accent);
  color: var(--color-text);
}
.cap-panel {
  display: none;
}
body:has(#cap-0:checked) #cap-panel-0,
body:has(#cap-1:checked) #cap-panel-1,
body:has(#cap-2:checked) #cap-panel-2,
body:has(#cap-3:checked) #cap-panel-3,
body:has(#cap-4:checked) #cap-panel-4,
body:has(#cap-5:checked) #cap-panel-5,
body:has(#cap-6:checked) #cap-panel-6 {
  display: block;
}

/* Monthly / annual. Both figures are in the document; the toggle picks one. */
[data-billing="annual"] {
  display: none;
}
.gv-billing:has([data-gv-annual]:checked) [data-billing="annual"] {
  display: inline;
}
.gv-billing:has([data-gv-annual]:checked) [data-billing="monthly"] {
  display: none;
}

/* Conditional blocks.
   The design expresses these as <sc-if>, and the elements inside carry inline
   `display:` in their own style attribute — which an author stylesheet cannot
   override without !important. So each conditional block is wrapped in a bare
   <div> that this sheet owns: `display:contents` when shown, so the wrapper
   itself is invisible to layout and the element inside stays the flex or grid
   item the design made it. */
[data-gv-when] {
  display: contents;
}
/* `data-gv-off` switches a block off on its own, wherever it appears. It was
   written as `[data-gv-when][data-gv-off]`, which made the pair load-bearing:
   dropping `data-gv-when` from a wrapper left `data-gv-off` matching no rule at
   all, so the block it names came back — silently, with the build accepted and
   the suite green. site.js toggles this attribute at runtime (the demo
   placeholders, the billing-address block) on markup that must not have to
   remember a second attribute for the first one to mean anything. */
[data-gv-off] {
  display: none;
}

/* The landing demo. Without JavaScript, and for anyone who has asked for less
   motion, the conversation shows its finished frame instead of replaying. */
[data-gv-demo] [data-gv-phase] {
  display: none;
}
[data-gv-demo][data-gv-at="0"] [data-gv-phase~="0"],
[data-gv-demo][data-gv-at="1"] [data-gv-phase~="1"],
[data-gv-demo][data-gv-at="2"] [data-gv-phase~="2"],
[data-gv-demo][data-gv-at="3"] [data-gv-phase~="3"] {
  display: contents;
}

/* One story at a time. Without JavaScript every story is readable, stacked,
   and the arrows that would move between them are not shown at all. */
.js .gv-story {
  display: none;
}
.js .gv-story[data-current] {
  display: contents;
}
.gv-story-nav {
  display: none;
}
.js .gv-story-nav {
  display: flex;
}
.gv-story-dots {
  display: none;
}
.js .gv-story-dots {
  display: flex;
}
.gv-story + .gv-story {
  margin-top: 16px;
}
.js .gv-story + .gv-story {
  margin-top: 0;
}

/* The sign-up steps. Without JavaScript all five are shown in order, which is
   a long page but a complete one. */
.js .gv-step {
  display: none;
}
.js .gv-step[data-current] {
  display: contents;
}
.gv-step-bar {
  display: none;
}
.js .gv-step-bar {
  display: flex;
}
/* The pre-GA gate (Screen 0) is not a step of account creation, so it draws no
   progress bar. Needed because the rule above beats the user-agent `[hidden]`
   one; the build guard in `scripts/guards.mjs` requires this rule, and the
   `hidden` assignment is in `assets/site.js`. Delete with the gate. */
.gv-step-bar[hidden] {
  display: none;
}

html:has([data-gv-checkout-dialog][open]) {
  overflow: hidden;
}
[data-gv-checkout-dialog] {
  box-sizing: border-box;
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  height: min(860px, calc(100dvh - 32px));
  max-height: none;
  margin: auto;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--color-divider);
  border-radius: 18px;
  background: var(--color-bg);
  color: var(--color-text);
  overflow: auto;
  box-shadow: 0 24px 80px rgb(0 0 0 / 40%);
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 200ms ease-out,
    transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    display 240ms ease-out allow-discrete,
    overlay 240ms ease-out allow-discrete;
}
[data-gv-checkout-dialog][open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}
@starting-style {
  [data-gv-checkout-dialog][open] {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
}
[data-gv-checkout-dialog]::backdrop {
  background-color: transparent;
  backdrop-filter: blur(0);
  transition:
    background-color 240ms ease-out,
    backdrop-filter 240ms ease-out,
    display 240ms ease-out allow-discrete,
    overlay 240ms ease-out allow-discrete;
}
[data-gv-checkout-dialog][open]::backdrop {
  background-color: rgb(9 10 22 / 80%);
  backdrop-filter: blur(4px);
}
@starting-style {
  [data-gv-checkout-dialog][open]::backdrop {
    background-color: transparent;
    backdrop-filter: blur(0);
  }
}
[data-gv-checkout-layout] {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
[data-gv-checkout-dialog] [data-gv-checkout-container] {
  width: 100%;
  min-height: 560px;
}
[data-gv-checkout-loading][hidden] {
  display: none;
}
/* `.btn` is `display: inline-flex` in nocturne.css, which BEATS the user-agent
   `[hidden] { display: none }` — so a button marked `hidden` renders anyway.
   The Verify screen shipped all three of its primaries at once this way
   ("Confirm and continue to payment", "Try again", "Try payment again"), which
   no test here could see: jsdom applies no stylesheets, so `.hidden` was `true`
   while the button was on screen. scripts/guards.mjs now fails the build on a
   hidden element whose class sets `display` and has no rule like this one. */
.btn[hidden] {
  display: none;
}
@media (max-width: 900px) {
  [data-gv-checkout-dialog] {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  [data-gv-checkout-layout] {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  *::backdrop {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Controls for a surface that does not exist yet (ACCOUNT_URL unset). The
   element keeps the design's position and shape but must not look like it
   navigates: an <a> with no href is already inert to keyboard and click, so
   the only remaining lie is visual. */
[data-gv-inert] {
  opacity: 0.55;
  cursor: default;
}
