/* Garlic platform: "Sprout and ink" (v2, after critiques 0 and 1)
   Scope: www.garlic.lol platform pages (landing, join, login, pricing, studio, inbox, domain).
   The operator site keeps "Midnight kitchen" (static/css/style.css). Tenant sites keep their own looks.
   Fonts: Archivo (OFL 1.1, Omnibus-Type; fonts/OFL.txt), self-hosted: two variable woff2 subsets
   (latin, latin-ext) cut by Google Fonts at wdth 100..125 and wght 400..800. No third-party request.
   contrast.py reads the :root block below; keep one token per line. */

@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 100% 125%; font-display: swap;
  src: url("fonts/archivo-latin.2f7ea45bad3a.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 100% 125%; font-display: swap;
  src: url("fonts/archivo-latin-ext.cde95d2797df.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Colour: white paper, black ink, one sprout-green block. Three hues total. */
  --paper:   #ffffff;   /* page ground, chat column, drawers, inputs */
  --paper-2: #eff1ec;   /* bulb skin: canvas behind the site frame, chips, user bubbles */
  --paper-3: #e2e6dd;   /* pressed / toggled secondary */
  --ink:     #121412;   /* text, primary buttons, selection outline, focus ring */
  --ink-2:   #50564f;   /* secondary text (7.5:1 on paper) */
  --line:    #d6dad1;   /* region dividers only (decorative, never the only edge of a control) */
  --line-strong: #767d72; /* control borders: 4.25:1 on paper, 3.73:1 on paper-2, 3.36:1 on paper-3 */
  --sprout:  #b2dd8f;   /* the colour block: a garlic-leaf green, hue 93 (lime-400 is 83). Always ink text. */
  --sprout-2: #dbefcb;  /* sprout tint: selection chip, selected-section wash */
  --sprout-ink: #33521a; /* deep green text on sprout (".garlic.lol" in the join panel) */
  --scape:   #2d6a2e;   /* success text: "Available", Live dot (6.5:1 on paper) */
  --err:     #b42318;   /* errors (6.6:1 on paper) */
  --err-bg:  #fdeceb;
  --on-ink:  #ffffff;   /* text on ink */

  /* Type */
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-display: clamp(2.5rem, 6vw, 5rem); /* landing h1 only */
  --t-h1: 2rem;         /* 32 */
  --t-h2: 1.5rem;       /* 24 */
  --t-h3: 1.125rem;     /* 18 */
  --t-body: 1rem;       /* 16, also the minimum for inputs */
  --t-small: .875rem;   /* 14, metadata only */
  --t-micro: .75rem;    /* 12, badge counts only */

  /* Space: 4-based, 8 rhythm */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  /* Shape */
  --r-ctl: 6px;         /* buttons, inputs, segmented controls */
  --r-surface: 10px;    /* chat cards, composer, menus */
  --r-frame: 4px;       /* site frames and screenshots */
  --r-pill: 999px;      /* chips and badges only */
  --shadow-frame: 0 1px 2px rgba(18,20,18,.08), 0 18px 40px -18px rgba(18,20,18,.35);
  --shadow-pop: 0 8px 24px -8px rgba(18,20,18,.28);

  /* Control sizes: exactly two */
  --h-md: 44px;
  --h-sm: 32px;

  --ease: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--t-body)/1.55 var(--font); font-stretch: 100%;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Type ---------- */
.display, h1, h2, h3 { margin: 0; font-weight: 800; text-wrap: balance; letter-spacing: -.01em; }
.display { font-size: var(--t-display); line-height: 1; font-stretch: 125%; letter-spacing: -.025em; }
h1 { font-size: var(--t-h1); line-height: 1.1; font-stretch: 112%; }
h2 { font-size: var(--t-h2); line-height: 1.2; font-stretch: 112%; font-weight: 750; }
h3 { font-size: var(--t-h3); line-height: 1.3; font-weight: 650; letter-spacing: 0; }
p { margin: 0; }
.lede { font-size: 1.25rem; line-height: 1.45; max-width: 40ch; }
.meta { font-size: var(--t-small); line-height: 1.45; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Links ---------- */
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px;
    text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; } }
a.quiet { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { a.quiet:hover { text-decoration: underline; } }

/* ---------- Focus ---------- */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Buttons: two kinds x two sizes ---------- */
.btn {
  --spin: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: var(--h-md); padding: 0 18px; border-radius: var(--r-ctl);
  font-size: 1rem; font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background-color .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sm { height: var(--h-sm); padding: 0 12px; font-size: .9375rem; gap: 6px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.icon { width: var(--h-md); padding: 0; }
.btn.sm.icon { width: var(--h-sm); }
.btn.full { width: 100%; }
.btn .lbl { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.btn.primary { --spin: var(--on-ink); background: var(--ink); color: var(--on-ink); }
.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
@media (hover: hover) and (pointer: fine) {
  .btn.primary:not(:disabled):hover { background: #2b302b; }
  .btn.secondary:not(:disabled):hover { background: var(--paper-2); border-color: var(--ink); }
}
.btn.primary:not(:disabled):active { background: #000; }
.btn.secondary:not(:disabled):active { background: var(--paper-3); border-color: var(--ink); }
/* Toggled on: a pressed toggle or the control whose menu or drawer is open */
.btn.secondary[aria-pressed="true"], .btn.secondary[aria-expanded="true"] {
  background: var(--paper-3); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink);
}
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; }
.btn.primary:disabled, .btn.primary[aria-disabled="true"] { background: #c9cec4; color: #4b5149; }
.btn.secondary:disabled, .btn.secondary[aria-disabled="true"] { background: var(--paper); color: #6d736a; border-color: var(--line); }
/* Busy: label and icon hidden, a ring in the button's own text colour */
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy > * { visibility: hidden; }
.btn.busy::after { content: ""; position: absolute; left: calc(50% - 8px); top: calc(50% - 8px); width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid var(--spin); border-right-color: transparent; border-bottom-color: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .btn.busy::after { animation: spin .8s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tooltip for icon-only buttons: on hover (fine pointers) and keyboard focus */
.tip { position: relative; }
.tip > .tip-label {
  position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%);
  background: var(--ink); color: var(--on-ink); font-size: var(--t-small); font-weight: 500;
  padding: 4px 8px; border-radius: var(--r-ctl); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .12s var(--ease); z-index: 40;
}
.tip:focus-visible > .tip-label { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .tip:hover > .tip-label { opacity: 1; } }

/* Segmented control and tool cluster: one bordered group. Holds Desktop/Phone,
   Chat/Site, and in the studio bar also Select (a toggle). 32px total, 44px with .lg. */
.seg { display: inline-flex; align-items: center; gap: 2px; height: var(--h-sm); padding: 2px;
       background: var(--paper); border-radius: var(--r-ctl); border: 1px solid var(--line-strong); }
.seg button { height: 26px; min-width: 26px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent;
  font-size: .9375rem; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; white-space: nowrap; }
.seg button svg { width: 16px; height: 16px; flex: none; }
.seg button[aria-pressed="true"] { background: var(--paper-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.seg .div { width: 1px; align-self: stretch; margin: 3px 2px; background: var(--line); }
@media (hover: hover) and (pointer: fine) { .seg button:hover { color: var(--ink); background: var(--paper-2); }
  .seg button[aria-pressed="true"]:hover { background: var(--paper-3); } }
.seg.lg { height: var(--h-md); }
.seg.lg button { height: 38px; }

/* ---------- Inputs ---------- */
.field { display: grid; gap: 6px; }
.label { font-weight: 600; font-size: 1rem; }
.help { font-size: var(--t-small); color: var(--ink-2); }
.input, .textarea, .select {
  width: 100%; min-height: var(--h-md); padding: 10px 12px; font-size: 16px; line-height: 1.4;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
}
.input::placeholder, .textarea::placeholder, .addr input::placeholder { color: #6d736a; }
@media (hover: hover) and (pointer: fine) { .input:hover, .textarea:hover, .select:hover, .addr:hover { border-color: var(--ink-2); } }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.input:disabled, .textarea:disabled { background: var(--paper-2); color: var(--ink-2); border-color: var(--line); }
.field.error .input, .input[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.error-text { color: var(--err); font-size: var(--t-small); font-weight: 600; }
.ok-text { color: var(--scape); font-size: var(--t-small); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.ok-text svg { width: 16px; height: 16px; }
.textarea { resize: none; }

/* Address group: one box; the suffix hugs the typed name (JS sizes the input from a
   hidden mirror span); a click anywhere in the box focuses the input. */
.addr { display: flex; align-items: center; background: var(--paper); border: 1px solid var(--line-strong);
        border-radius: var(--r-ctl); min-height: var(--h-md); padding: 0 12px; cursor: text; position: relative; overflow: hidden; }
.addr input { flex: 0 1 auto; width: 9ch; min-width: 4ch; max-width: 100%; border: 0; background: transparent;
              padding: 0; height: 42px; font-size: 16px; outline: none; }
.addr .suffix { color: var(--ink-2); white-space: nowrap; flex: none; }
.addr .mirror { position: absolute; visibility: hidden; white-space: pre; pointer-events: none; }
.addr:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field.error .addr { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }

/* Choice rows (radio list, used on join) */
.choices { display: grid; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); overflow: hidden; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; background: var(--paper); }
.choice + .choice { border-top: 1px solid var(--line); }
.choice input { margin: 4px 0 0; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.choice b { display: block; font-weight: 600; }
.choice span { color: var(--ink-2); font-size: var(--t-small); }
.choice:has(input:checked) { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--ink); }
.choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .choice:hover { background: var(--paper-2); } }

/* Checkbox rows (settings) */
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ink); flex: none; }

/* ---------- Chips and badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 2px 0 10px;
        background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: var(--r-pill);
        font-size: var(--t-small); font-weight: 600; max-width: 100%; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex: none; }
.chip.selection { background: var(--sprout-2); border-color: var(--ink); }
.chip .x { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
           display: inline-flex; align-items: center; justify-content: center; color: var(--ink); flex: none; }
.chip .x svg { width: 12px; height: 12px; }
@media (hover: hover) and (pointer: fine) { .chip .x:hover { background: var(--paper-3); } }
.chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A section chip names what the owner pointed at, so it wraps between words instead of
   cutting one; the server already shortens long names on a word boundary with an ellipsis. */
.chip.selection { height: auto; min-height: 28px; padding-top: 2px; padding-bottom: 2px; border-radius: 14px; }
.chip.selection .t { white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.3; padding: 2px 0; }

.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
         padding: 0 6px; border-radius: var(--r-pill); font-size: var(--t-micro); font-weight: 700; line-height: 1; white-space: nowrap; }
.badge.count { background: var(--ink); color: var(--on-ink); }
.badge.live { background: var(--sprout); color: var(--ink); gap: 5px; padding: 0 8px; }
.badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--scape); }
.badge.draft { background: var(--paper-3); color: var(--ink); padding: 0 8px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.badge.setup { background: var(--paper); color: var(--ink); padding: 0 8px; box-shadow: inset 0 0 0 1px var(--line-strong); gap: 5px; }

/* ---------- Surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-surface); padding: var(--s4); }
.frame { background: var(--paper); border-radius: var(--r-frame); box-shadow: var(--shadow-frame); overflow: hidden; }
.frame img { width: 100%; height: auto; }
/* Placeholder frame: a shot that has not been captured yet. lint.py --ship fails on it. */
.shot-slot { display: grid; place-content: center; gap: 6px; text-align: center; padding: var(--s5);
  background: repeating-linear-gradient(135deg, var(--paper-2) 0 14px, #e8ebe4 14px 28px);
  border: 2px dashed var(--line-strong); color: var(--ink-2); font-size: var(--t-small); }

/* ---------- Drawer ---------- */
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--paper);
          border-left: 1px solid var(--line); box-shadow: -24px 0 48px -24px rgba(18,20,18,.35);
          display: flex; flex-direction: column; z-index: 20; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
               height: 56px; padding: 0 var(--s3) 0 var(--s5); border-bottom: 1px solid var(--line); flex: none; }
.drawer-head h2 { font-size: 1.25rem; }
.drawer-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.drawer-foot { flex: none; display: flex; justify-content: flex-end; align-items: center; gap: var(--s2); padding: var(--s3) var(--s5);
               border-top: 1px solid var(--line); }
.drawer-foot .meta { margin-right: auto; }
.scrim { position: absolute; inset: 0; background: rgba(18,20,18,.18); z-index: 19; }

/* Menu (account, site name, page picker). Rows 40px; 44px on touch. */
.menu { position: absolute; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-surface);
        box-shadow: var(--shadow-pop); padding: 6px; min-width: 240px; z-index: 30; }
.menu a, .menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
        min-height: 40px; padding: 0 10px; border: 0; background: none; border-radius: 4px; text-decoration: none;
        cursor: pointer; text-align: left; font-size: 1rem; }
.menu a svg, .menu button svg { width: 16px; height: 16px; color: var(--ink-2); }
.menu [aria-current="page"], .menu [aria-checked="true"] { font-weight: 700; box-shadow: inset 3px 0 0 var(--ink); background: var(--paper-2); }
@media (hover: hover) and (pointer: fine) { .menu a:hover, .menu button:hover { background: var(--paper-2); } }
@media (pointer: coarse) { .menu a, .menu button { min-height: 44px; } }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-head { padding: 8px 10px 10px; display: grid; gap: 2px; }

/* ---------- The mark ---------- */
.mark { width: 28px; height: 28px; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand .word { font-weight: 800; font-stretch: 125%; font-size: 1.375rem; letter-spacing: -.02em; line-height: 1; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--s5); }
@media (max-width: 640px) { .wrap { padding: 0 var(--s4); } }
.on-sprout { background: var(--sprout); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
