/* ---------- Products: the hub and the tool pages under it ----------

   One stylesheet for /products and every /products/<tool>: the build hands
   a nested page its section's stylesheet when it has none of its own, so the
   six tool pages share this rather than carrying six copies.

   Mobile first, like site.css: the rules outside a media query are the phone
   layout and the min-width queries add to them. */

  /* Only what differs from .page-hero p in site.css — colour and size already
     come from there. */
  .page-hero p.lede{
    margin-top:22px;
    max-width:66ch;
    line-height:1.75;
  }
  .hero-actions{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    margin:24px 0 0;
  }

  /* Tighter than site.css's 56px either side of the hero's rule, on this page
     only, as 404.css also does. The section is named rather than matched as
     "the one after the hero": a positional selector would stop matching the
     day something is put between them, and stop silently — the spacing check
     asserts a 24px minimum, so too much padding still passes. */
  .page-hero{ padding-bottom:40px; }
  .downloads-account{ padding-top:40px; }

  /* ---------- The eyebrow a card opens with ---------- */
  .tag{
    font-size:11px;
    font-weight:700;
    letter-spacing:0.08em;
    text-transform:uppercase;
    color:var(--gen-teal-text);
  }

  /* ---------- Hairline grids ----------

     The same 1px-gap grid as .intent-grid on /contact: one column on a phone,
     more once there is room. Three of them here — the tools on the hub, the
     two ways in, and the other tools at the foot of a tool page — and nearly
     every page stylesheet carries its own copy, some hardcoding
     rgba(22,32,43,0.12) for the hairline instead of --gen-navy-line. It wants
     hoisting into site.css next to .gen-stat-grid, as its own PR; grep
     `gap:1px` for the callers rather than trusting a list here. */
  .tool-grid,
  .access-grid,
  .related-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:1px;
    background:var(--gen-navy-line);
    border:1px solid var(--gen-navy-line);
  }

  /* ---------- A tool, on the hub and in the related row ----------

     The whole card is the link, so it takes the page's own colour and the
     hover goes on the ground rather than the text. */
  .tool-card,
  .related-card{
    display:flex;
    flex-direction:column;
    gap:10px;
    padding:30px 26px;
    background:var(--gen-frost);
    color:var(--gen-navy);
    text-decoration:none;
    transition:background 0.15s ease;
  }
  a.tool-card:hover,
  .related-card:hover{ background:var(--gen-frost-2); }
  .tool-card h3{
    margin:0;
    font-size:1.25rem;
    line-height:1.2;
  }
  .tool-card p,
  .related-card p{
    margin:0;
    font-size:14.5px;
    line-height:1.7;
    color:var(--gen-text-dim);
  }
  .tool-card-more{
    margin-top:auto;
    padding-top:8px;
    font-size:14.5px;
    font-weight:700;
    color:var(--gen-teal-text);
  }
  .related-card{
    gap:8px;
    padding:22px 20px;
  }
  .related-name{
    font-size:15px;
    font-weight:700;
  }
  .related-card p{
    font-size:13.5px;
    line-height:1.55;
  }

  /* ---------- The hub's two audiences ---------- */
  .products-section-intro{
    margin:0 0 20px;
    max-width:74ch;
    font-size:16px;
    line-height:1.75;
    color:var(--gen-text-dim);
  }
  .products-account-panel{ padding:18px 20px; }
  .products-platforms{ border-top:1px solid var(--gen-navy-line); }
  .tool-card p.product-question{
    font-style:italic;
    font-size:15px;
    color:var(--gen-teal-text);
  }

  /* ---------- Choosing a way in ----------

     Column, so the action can be pushed to the bottom edge — the two cards
     hold different amounts of text and buttons at different heights read as a
     misalignment rather than as two equal choices. */
  .access-card{
    display:flex;
    flex-direction:column;
    padding:30px 26px;
    background:var(--gen-white);
  }
  .access-card h3{
    margin:12px 0 10px;
    font-size:1.25rem;
  }
  .access-intro{
    margin:0 0 24px;
    font-size:14.5px;
    line-height:1.7;
    color:var(--gen-text-dim);
  }
  /* The sign-in card holds two states and shows one. Each fills the card so
     that margin-top:auto on the button below still reaches the bottom edge.
     Any author `display` beats the browser's own `[hidden]{display:none}`,
     hence the second rule — without it both states are on screen at once. */
  .access-state{
    display:flex;
    flex-direction:column;
    flex:1;
  }
  .access-state[hidden]{ display:none; }
  /* Signed in, the way in for newcomers is noise beside your own downloads:
     the script marks the root, and the sign-in card takes the whole row. */
  .is-signed-in .access-request{ display:none; }
  .is-signed-in .access-grid{ grid-template-columns:1fr; }
  /* And the card's own invitation to sign in goes with it: signed in, the
     card opens with who you are. */
  .is-signed-in .access-card > .tag,
  .is-signed-in .access-card > h3{ display:none; }
  /* auto pushes the button down; flex-start stops it stretching the full
     width of the card, which would make both cards read as one banner.

     The two actions also resolved 7px apart in height, which side by side
     reads as two different sizes of button. Two causes, both fixed here:

       - a <button> defaults to line-height `normal`, an <a> inherits body's
         1.5, so the line box differed by ~4px. Stated below rather than
         inherited. inline-flex so both agree on the box model too.
       - .gen-btn-secondary carries a 1.5px border and .gen-btn-primary has
         none, for the remaining 3px. A transparent border on the primary
         makes the two variants the same size without changing how it looks.

     Both are really gen.css's to fix, since any page pairing a primary with
     a secondary hits them. Scoped here rather than changed house-wide from a
     tracer page. Only the card's own action takes margin-top:auto — a
     download row's button inside the signed-in state is laid out by the row. */
  .access-card > .gen-btn,
  .access-state > .gen-btn,
  .hero-actions .gen-btn,
  .product-feedback .gen-btn,
  .downloads-signin-row .gen-btn{
    display:inline-flex;
    align-items:center;
    line-height:1.2;
  }
  .access-card > .gen-btn,
  .access-state > .gen-btn{
    margin-top:auto;
    align-self:flex-start;
  }
  .gen-btn-primary{ border:1.5px solid transparent; }

  /* The hub's one line for a returning visitor: the full pair of cards lives
     on each tool's page, but the identity provider sends everyone back here. */
  .downloads-signin-row{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:10px 16px;
    margin:0;
    font-size:15px;
    color:var(--gen-text-dim);
  }
  .downloads-signin-row + .downloads-signin-row{ margin-top:12px; }

  /* Same two states, and the same reasoning, as .contact-form-status: the
     left border tells them apart and the sentence inside says which is which.
     The palette has no error colour and inventing one here would be a brand
     decision rather than a CSS one. .product-note is the same callout with
     nothing to report: how a tool ships, under the two ways in. */
  .downloads-status,
  .product-note{
    margin:18px 0 0;
    padding:12px 14px;
    font-size:14px;
    line-height:1.6;
    color:var(--gen-navy);
    background:var(--gen-white);
    border-left:3px solid var(--gen-teal);
  }
  .downloads-status.is-error{ border-left-color:var(--gen-gold); }

  /* ---------- Waiting ----------

     Signing in costs two round trips — the token exchange, then the API call —
     and the page sat empty through both. */

  .downloads-loading{
    display:flex;
    align-items:center;
    gap:10px;
    margin:22px 0 0;
    font-size:14.5px;
    color:var(--gen-text-dim);
  }
  /* Any author `display` beats the browser's own `[hidden]{display:none}`, so
     without this the spinner is on screen from first paint and never leaves.
     Every other element the script toggles is a plain block and needs no such
     rule, which is exactly why this one is easy to miss. */
  .downloads-loading[hidden]{ display:none; }
  /* A pseudo-element, so the sentence the script writes is the whole of the
     element's text and the ring cannot be announced or wiped by it.

     The words are the message and the ring is decoration on top of them:
     gen.css stops animation outright under prefers-reduced-motion, so this
     becomes a static ring for anyone who asked for that, which is fine because
     it was never the thing doing the telling.

     flex:none because a spinner that squashes into an ellipse while the
     sentence beside it wraps is worse than no spinner. */
  .downloads-loading::before{
    content:"";
    flex:none;
    width:18px;
    height:18px;
    border:2px solid var(--gen-navy-line);
    border-top-color:var(--gen-teal);
    border-radius:50%;
    animation:downloadsSpin 0.8s linear infinite;
  }
  @keyframes downloadsSpin{
    to{ transform:rotate(360deg); }
  }

  /* The two states the script reveals both offer a way out, and an inline link
     left at the browser default is the tell that markup arrived without its
     CSS. Same treatment as .thanks-next a in site.css: the gold underline is
     what distinguishes it, so the link is not signalled by colour alone. */
  #downloads-none,
  #downloads-error {
    font-size:14.5px;
    line-height:1.7;
    color:var(--gen-text-dim);
  }
  #downloads-none a,
  #downloads-error a{
    color:var(--gen-navy);
    text-decoration:none;
    border-bottom:1px solid var(--gen-gold);
  }
  #downloads-none a:hover,
  #downloads-none a:focus,
  #downloads-error a:hover,
  #downloads-error a:focus{ border-bottom-color:var(--gen-navy); }

  /* ---------- Signed in ---------- */

  .downloads-whoami{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:10px;
    margin:0;
    font-size:14px;
    color:var(--gen-text-dim);
  }
  /* A real button, styled down to look like a link: signing out is an action,
     not a destination, so it must not be an <a href="#">. */
  .downloads-signout{
    padding:0 4px;
    min-height:44px;
    font-family:var(--gen-font-reading);
    font-size:13.5px;
    color:var(--gen-navy);
    background:none;
    border:none;
    border-bottom:1px solid var(--gen-gold);
    cursor:pointer;
  }
  .downloads-signout:hover{ color:var(--gen-teal-text); }

  /* The terms every download is behind, between "Signed in as…" and the
     release; the row itself is .gen-consent in site.css. */
  .downloads-terms{ margin:18px 0 0; }

  /* ---------- A tool's release, on its own page ----------

     Laid straight into the sign-in card under "Signed in as…" rather than as
     a card of its own: boxing a box just adds a frame nobody reads. */
  .download-release-head{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:10px;
  }
  .download-release-label{
    font-size:14px;
    color:var(--gen-text-dim);
  }
  /* Says "this is not a real release" in a way that survives being screenshotted
     out of context. Not colour alone — it carries the word too. */
  .download-badge{
    padding:4px 10px;
    font-size:11px;
    font-weight:700;
    letter-spacing:0.08em;
    text-transform:uppercase;
    color:var(--gen-navy);
    background:var(--gen-gold-dim);
    border-radius:2px;
  }

  /* Compared against a file, not read, so it is the smallest type here. It
     cannot also be lighter: --gen-text-dim is 4.87:1 on frost-2 and the next
     step down the alpha, 0.64, is 4.59:1 — anything visibly paler fails AA at
     this size. break-all because one unbroken 64-character token is what makes
     a phone scroll sideways. */
  .download-sha{
    margin-bottom:6px;
    font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size:11px;
    color:var(--gen-text-dim);
    word-break:break-all;
  }

  /* Always a column, never the button beside its filename: a card is one grid
     track wide, so there is no width at which that reads well. */
  .download-row{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid var(--gen-navy-line);
  }
  /* Narrower than the site button, not shorter: 44px stays the tap target and
     min-height in gen.css keeps it. */
  .download-row .gen-btn{
    align-self:flex-start;
    display:inline-flex;
    align-items:center;
    padding:12px 18px;
    line-height:1.2;
  }
  .download-row .downloads-status{ margin:0; }
  .download-row-meta{
    font-size:13px;
    color:var(--gen-text-dim);
  }
  /* ---------- The two disclosures ----------

     A card folds away the checksum of the build it leads with, and the builds
     that aren't this visitor's. One treatment for both, so a chevron means the
     same thing wherever it turns up. */
  .download-more summary,
  .download-verify summary{
    display:flex;
    align-items:center;
    gap:8px;
    /* A summary gets no box from the browser, so the tap target is ours. */
    min-height:44px;
    font-weight:700;
    color:var(--gen-navy);
    cursor:pointer;
    /* Safari ignores this and draws its own marker, hence the next rule. */
    list-style:none;
  }
  .download-more summary::-webkit-details-marker,
  .download-verify summary::-webkit-details-marker{ display:none; }
  /* Shape rather than colour, so it reads for anyone who cannot tell the teal
     from the navy. Reduced motion loses the animation, not the turn. */
  .download-more summary::before,
  .download-verify summary::before{
    content:"";
    flex:none;
    width:7px;
    height:7px;
    border-right:2px solid var(--gen-teal);
    border-bottom:2px solid var(--gen-teal);
    transform:rotate(-45deg);
    transition:transform 0.15s ease;
  }
  .download-more[open] summary::before,
  .download-verify[open] summary::before{ transform:rotate(45deg); }
  .download-more summary:hover,
  .download-verify summary:hover{ color:var(--gen-teal-text); }

  /* The hairline the folded row used to draw, so a closed panel reads as the
     foot of the card rather than as something missing. */
  .download-more{
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid var(--gen-navy-line);
  }
  .download-more summary{ font-size:13px; }
  /* The summary is the divider above the first row in here, so that row
     doesn't draw a second one. (A :first-of-type rule never did this: in a
     card the first div is the head, not a row.) */
  .download-more summary + .download-row{
    border-top:none;
    padding-top:0;
  }

  /* A block rather than something tucked beside the filename: open, it has to
     give the hash the card's full width, and 64 characters in a column beside
     the filename wraps eight times. Measured at +5px per card against the two
     lines of hex it replaces — this buys a quiet card, not a shorter one. */
  .download-verify summary{
    /* Two identical bold controls stacked read as one repeated thing, and of
       the two this is the minor one. */
    font-weight:400;
    font-size:12px;
    letter-spacing:0.03em;
  }

  /* ---------- A tool's own page ---------- */

  /* The way back is the only control in the hero, so it keeps the thumb-sized
     target the inline-link exemption would otherwise let it drop. */
  .product-crumbs{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
    margin-bottom:8px;
    font-size:14px;
    color:var(--gen-text-light-dim);
  }
  .product-crumbs a{
    display:inline-flex;
    align-items:center;
    min-height:44px;
    color:var(--gen-text-light);
    text-decoration:none;
    border-bottom:1px solid var(--gen-gold);
  }
  .product-crumbs a:hover,
  .product-crumbs a:focus{ border-bottom-color:var(--gen-white); }
  .page-hero p.product-free{
    margin-top:18px;
    font-size:14.5px;
    font-weight:700;
    color:var(--gen-gold);
  }

  /* The prose and the workflow card side by side once there is room for two
     300px columns; the paragraphs take their measure from .prose-section. */
  .product-about-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap:32px;
  }
  .product-workflow{ padding:26px 24px; }
  .product-workflow h3{
    margin:0 0 12px;
    font-size:1.15rem;
  }
  /* On a page with a demo the video takes the prose's other column, so the
     workflow card drops below the pair and spreads its steps across the row. */
  .product-workflow.is-wide{ margin-top:32px; }
  .product-workflow.is-wide .product-steps{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap:0 32px;
  }

  /* ---------- The demo ----------

     One box, two faces: signed out it is a navy card offering the sign-in in
     the video's place, signed in it is the player. Both keep the 16:9 footprint
     so the prose beside them sits the same either way. */
  .product-demo{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
  .product-demo-locked{
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:12px;
    aspect-ratio:16 / 9;
    padding:28px;
    background:var(--gen-navy);
    border:1px solid var(--gen-navy-line);
    border-radius:3px;
    color:var(--gen-white);
  }
  .product-demo-locked[hidden]{ display:none; }
  .product-demo-locked .tag{ color:var(--gen-gold); }
  /* gen.css paints every h3 navy, which on this navy ground is invisible. */
  .product-demo-locked h3{
    margin:0;
    font-size:1.25rem;
    line-height:1.2;
    color:var(--gen-white);
  }
  .product-demo-locked .gen-btn{
    display:inline-flex;
    align-items:center;
    align-self:flex-start;
    margin-top:6px;
    line-height:1.2;
  }
  .product-demo video{
    display:block;
    width:100%;
    aspect-ratio:16 / 9;
    background:var(--gen-navy);
    border:1px solid var(--gen-navy-line);
    border-radius:3px;
  }
  .product-demo video[hidden]{ display:none; }
  .product-demo .downloads-status{ margin:0; }
  /* An ordered list, so the steps are announced in order; the gold node is
     the house's timeline marker rather than a numeral. */
  .product-steps{
    margin:0;
    padding:0;
    list-style:none;
  }
  .product-steps li{
    display:flex;
    gap:12px;
    padding:10px 0;
    border-top:1px solid var(--gen-navy-line);
    font-size:14px;
    line-height:1.6;
    color:var(--gen-text-dim);
  }
  .product-steps li::before{
    content:"";
    flex:none;
    width:12px;
    height:12px;
    margin-top:5px;
    border-radius:50%;
    background:var(--gen-gold);
    border:1px solid var(--gen-navy);
    box-shadow:0 0 0 2px var(--gen-frost-2);
  }

  .product-feedback{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:16px;
    margin-top:28px;
    padding-top:22px;
    border-top:1px solid var(--gen-navy-line);
  }
  .product-feedback p{
    margin:0;
    max-width:56ch;
    font-size:14.5px;
    line-height:1.7;
    color:var(--gen-text-dim);
  }

  @media (min-width:700px){
    .tool-grid,
    .access-grid,
    .related-grid{ grid-template-columns:repeat(2,1fr); }
    /* An odd last card in two columns leaves a hole the grid's own
       background paints grey, so it takes the whole last row. */
    .related-card:last-child:nth-child(odd),
    .tool-card:last-child:nth-child(odd){ grid-column:span 2; }
    .access-card{ padding:36px 32px; }
  }

  @media (min-width:860px){
    .tool-grid{ grid-template-columns:repeat(3,1fr); }
    /* Three columns: undo the two-column rule, which would push a third
       card onto a row of its own, and fill the gap a last card leaves
       when it starts a row after one full row plus one. */
    .tool-card:last-child:nth-child(odd){ grid-column:auto; }
    .tool-card:last-child:nth-child(3n+2){ grid-column:span 2; }
  }

  /* One row of however many other tools a page lists. Five across needs
     ~195px a cell before a tool's name stops breaking its arrow onto a line
     of its own — 1040px, measured, not the 860px step the rest of the page
     uses. */
  @media (min-width:1040px){
    .related-grid{ grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); }
    .related-card:last-child:nth-child(odd){ grid-column:auto; }
  }
