/* controls.css: what a hand operates on the public site (every page of
   it loads this file) besides the button itself: this site's mapping of
   the shared button's tokens, the action set as text, the email field, the
   joined field-and-button and the waiting-list form around it.

   THE BUTTON is button.css: square corners, the primary carries the mark's
   folded corner (read its header for the geometry, the states and how the
   file is shared with the app), so the miniature of the app in the hero
   (product.css) shows the real button, fold and all. This file is the one
   place the site says which of its tokens the button reads.

   Secondary actions here are text with a hairline underline and an arrow,
   not a second box.

   Load order and the rest of the site: style.css's header. Tokens are in
   style.css. */

/* --- the shared button's tokens, from this site's own ------------- */

:root{
  --btn-height:var(--control); --btn-height-sm:var(--control-s); --btn-height-lg:var(--control-l);
  --btn-pad:18px; --btn-pad-sm:12px; --btn-pad-lg:24px;
  --btn-label:var(--ink);
  --btn-action:var(--action); --btn-action-hover:var(--action-hover); --btn-on-action:var(--on-action);
  --btn-flap:var(--teal); --btn-danger:var(--danger-fg);
  --btn-quiet-bg:var(--surface); --btn-quiet-line:var(--line-strong); --btn-quiet-line-hover:var(--ink2); --btn-quiet-hover:var(--hover);
  --btn-disabled-bg:var(--sunken); --btn-disabled-fg:var(--mute); --btn-disabled-flap:var(--line-strong);
  --btn-ring:var(--focus); --btn-ring-offset:3px;
  --btn-ground:var(--bg)}   /* paper; a panel stands on white: */
.panel{--btn-ground:var(--surface)}

/* --- an action set as text ---------------------------------------- */

/* A hairline that thickens on hover, and an arrow that leans toward where
   the link goes. min-height keeps a 44px target on a phone. */
.text-action{display:inline-flex;align-items:center;gap:var(--space-1h);min-height:var(--control);color:var(--ink);font:500 var(--text-ui)/20px var(--font-sans);white-space:nowrap;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:5px;text-decoration-color:var(--line-strong);transition:text-decoration-color var(--dur-fast) var(--ease-out)}
.text-action:hover{text-decoration-color:var(--ink);text-decoration-thickness:2px}
.text-action .arrow{display:inline-block;transition:transform var(--dur-fast) var(--ease-out)}
.text-action:hover .arrow{transform:translateX(2px)}

/* --- fields ------------------------------------------------------- */

.lbl{display:block;font:500 var(--text-m)/18px var(--font-sans);color:var(--ink2);margin-bottom:6px}
.text{width:100%;height:var(--control);padding:0 12px;background:var(--surface);border:1px solid var(--field-line);border-radius:0;font:400 var(--input-font)/20px var(--font-sans);color:var(--ink);transition:border-color var(--dur-fast)}
.text:hover{border-color:var(--ink2)}
.text::placeholder{color:var(--mute)}
.text:focus{outline:2px solid var(--focus);outline-offset:2px}
.hint{display:block;margin-top:var(--space-2);font:400 var(--text-m)/18px var(--font-sans);color:var(--mute);max-width:56ch}

/* The email field and its button are one control: one frame, the button
   flush inside its right end (its edges cover the frame's), the fold at the
   control's own corner, and one focus ring around the whole while you type.
   The button keeps its own ring when the keyboard is on it. */
.join-row{display:flex;background:var(--surface);border:1px solid var(--field-line);transition:border-color var(--dur-fast)}
.join-row:hover{border-color:var(--ink2)}
.join-row:has(.text:focus){outline:2px solid var(--focus);outline-offset:2px}
.join-row .text{flex:1;min-width:0;height:var(--control-l);border:0;background:none;padding-inline:14px}
.join-row .text:focus{outline:0}
.join-row .btn{margin:-1px -1px -1px 0;height:auto}
/* shrinking would pull the button off the frame and show a sliver of it;
   inside the joined control the closing flap is the press */
.join-row .btn:active:not(:disabled){transform:none}

/* The waiting-list form around it: its width, its hint and the line that
   answers. Here, not in landing.css: the Agents page carries the form
   too, and loading the front pages' layout for three rules would restyle
   its footer on a phone. */
.join{max-width:520px}
.join .hint{margin-top:var(--space-3)}
.join-status{min-height:20px;margin-top:var(--space-2);font:500 var(--text-m)/20px var(--font-sans)}
.join-status[data-kind=ok]{color:var(--success-fg)}
.join-status[data-kind=error]{color:var(--danger-fg)}

/* At 390px the field would keep too little room for its placeholder
   beside the button ("you@studio.cor"); the button gives back its slack. */
@media (max-width:520px){
  .join-row .text{padding-inline:12px}
  .join-row .btn.lg{padding-left:16px;padding-right:calc(16px + var(--fold) / 2)}
}
