/* Phone layer (760px and under), loaded after every page's own stylesheets.
 * Oliver, 19 Oct 2026: "the mobile website is shocking ... look at Notion and Linear's mobile".
 * Measured on their phone sites the same day: a fixed 56 to 65px header with the name beside the
 * mark and a plain menu icon; headlines of 38 to 42px at weight 500 to 600 with tight tracking;
 * 15 to 16px body on 24px lines; 20 to 24px side gutters; 40 to 48px buttons with soft corners;
 * a full-screen menu; one plan at a time in the pricing comparison. Wide screens are unchanged. */

@media (max-width: 760px) {
  :root { --nav-height: 56px; --gutter: 20px; }

  /* ---------- Header: fixed, in the page's own colour ----------
   * Oliver, 20 Oct 2026, on his phone: the top did not look right. Translucent and blurred, the
   * header let the hero's marks and the words beneath show through and sat on the page as a band
   * with a shadow under it. Solid, it reads as the top of the page; once the page moves, words
   * fade out under it instead of being cut at an edge. */
  html { background: var(--bg); }
  .site-header { position: fixed; background: var(--bg); }
  .site-header::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; pointer-events: none;
    background: linear-gradient(var(--bg), transparent); opacity: 0; transition: opacity var(--motion); }
  .site-header[data-scrolled="true"]::after { opacity: 1; }
  .site-header[data-open="true"]::after { opacity: 0; }
  .site-header .wrap { gap: 12px; }
  .brand { gap: 10px; letter-spacing: 0; font-size: 15px; font-weight: 500; }
  .brand-name { display: inline; }
  .menu-button { width: 44px; height: 44px; margin-right: -10px; border: 0; border-radius: var(--radius); color: var(--text); }
  .menu-button .icon-close { display: none; }
  .site-header[data-open="true"] .menu-button .icon-open { display: none; }
  .site-header[data-open="true"] .menu-button .icon-close { display: block; }

  /* ---------- Menu: a full-screen sheet under the header ---------- */
  .site-header[data-open="true"] { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .site-header[data-open="true"] .wrap { flex-wrap: nowrap; padding-bottom: 0; }
  .site-header[data-open="true"] .site-nav {
    position: fixed; inset: var(--nav-height) 0 0 0; z-index: 39; order: 0;
    display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    padding: 12px var(--gutter) calc(32px + env(safe-area-inset-bottom));
    background: var(--bg); overflow-y: auto; animation: sheet-in 180ms ease-out;
  }
  .site-header[data-open="true"] .site-nav a {
    padding: 14px 0; border-radius: 0; background: none;
    font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; color: var(--text);
  }
  .site-header[data-open="true"] .site-nav a:hover, .site-header[data-open="true"] .site-nav a:focus-visible { background: none; color: #fff; }
  .site-header[data-open="true"] .site-nav a[aria-current="page"] { color: var(--text-dim); }
  html[data-menu-open="true"], html[data-menu-open="true"] body { overflow: hidden; }

  /* ---------- Buttons: one height and a thumb-sized target. Square, as on the wide site (Oliver, 29 Oct
   * 2026: "make sure the links are square"); the soft corners of 19 Oct were the phone alone. ---------- */
  .button { min-height: 48px; border-radius: 0; font-size: 15px; }
  .button-small { min-height: 40px; }

  /* ---------- Home hero: the marks above, the words below, nothing clipped ---------- */
  .hero { padding: calc(var(--nav-height) + 84vw) 0 48px; }
  .hero-cluster { top: calc(var(--nav-height) + 2vw); right: -3vw; left: auto; width: 76vw;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 52%, rgba(0, 0, 0, 0.35) 74%, transparent 92%);
    mask-image: linear-gradient(180deg, #000 0%, #000 52%, rgba(0, 0, 0, 0.35) 74%, transparent 92%); }
  .hero-title { top: 0; font-size: clamp(32px, 9.2vw, 38px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.12; }
  .hero-line { margin-top: 0.08em; letter-spacing: -0.02em; }
  .rotator { border-width: 1.5px; border-radius: 0.24em; }
  .wordmark { margin-top: 32px; font-size: 18px; letter-spacing: 0.24em; }
  .tagline { margin-top: 6px; font-size: 11px; letter-spacing: 0.16em; }
  .hero-links { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; width: 100%; margin-top: 24px; }
  .hero-download, .hero-link {
    display: flex; align-items: center; justify-content: center; width: auto; height: 48px; padding: 0 16px;
    border-radius: 0; font-size: 15px; font-weight: 500; letter-spacing: 0; text-decoration: none;
  }
  .hero-download { background: var(--chip); color: var(--chip-text); }
  .hero-link { background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text); }
  .hero-link:hover { text-decoration: none; background: rgba(255, 255, 255, 0.1); }

  /* ---------- Sections: Linear's rhythm ---------- */
  .section { padding: 64px 0; }
  /* Headings wrap in balanced lines, so no word is left alone on the last one (the hero headline
   * is excluded: its rotating word sets its own width). */
  h1:not(.hero-title), h2, h3, .page-title { text-wrap: balance; }
  /* Section headings sit on the same left edge as everything else on a phone. */
  .features .section-head { justify-items: start; text-align: left; margin-inline: 0; }
  .section-head h2, .features .section-head h2, .pricing .section-head h2 { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
  .lede { font-size: 15px; line-height: 1.6; }

  /* ---------- Capabilities, as Oliver's phone mock (20 Oct 2026): the illustration, then the
   * tab row, then the words. The row stays outside the panels in the markup (reading order and
   * the tabs pattern are unchanged); a subgrid places the open panel's illustration above it and
   * its words below, and the panel keeps its role and focus. ---------- */
  .tabs { display: grid; grid-template-rows: auto auto auto; }
  .tab-list { grid-row: 2; grid-column: 1; z-index: 1; position: relative; display: flex; width: auto; max-width: none;
    margin: 22px calc(-1 * var(--gutter)) 28px; padding: 4px var(--gutter); gap: 4px; border-radius: 0; background: none;
    overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 28px), transparent 100%); }
  .tab { flex: 0 0 auto; min-height: 34px; padding: 0 14px; border-radius: var(--radius-pill); background: #161616;
    font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
    color: var(--text-dim); scroll-snap-align: start; }
  .tab[aria-selected="true"] { background: #2a2a2a; color: #fff; box-shadow: none; }
  .tab-panel:not([hidden]) { grid-row: 1 / span 3; grid-column: 1; display: grid; grid-template-rows: subgrid; gap: 0; }
  .tab-panel .stage { grid-row: 1; }
  .tab-panel .tab-copy { grid-row: 3; }
  .tab-copy h3 { font-size: 30px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.12; }
  .feature-grid-short { grid-template-columns: repeat(3, max-content); column-gap: 28px; }
  /* The illustration keeps its stage and its floating marks, smaller, inside the page edges, and
   * in front of the illustration: behind it, the marks at the sides were cut in half. */
  .stage { padding: 22px 16px; border-radius: 20px; background: radial-gradient(120% 120% at 100% 0%, #1b1b1b 0%, #121212 55%, #0f0f0f 100%); }
  .floats { display: inline; }
  .floats img { z-index: 2; width: 28px; }
  .floats .float-1 { top: -12px; } .floats .float-2 { left: -4px; } .floats .float-3 { right: -4px; }
  .mock-lines li:nth-child(n+3) { display: grid; }

  /* ---------- How It Works, as the mock: the white band set to the right, the dark steps
   * hanging off its left edge, the providers' marks back on "Onboard your agents". ---------- */
  .how-band { position: relative; padding: 22px 0 24px; background: none; border-radius: 0; }
  /* The white runs the band's full height (Oliver, 20 Oct 2026: it stopped 72px short, so with a
   * list open the last steps hung out below it). home.js holds the band at its tallest state. */
  .how-band::before { content: ""; position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; left: 26%;
    border-radius: 0; background: #fff; }
  .how-title { position: relative; z-index: 1; margin: 0 0 22px calc(26% + 18px); font-size: 28px; letter-spacing: -0.03em; color: #0b0b0b; }
  /* The band keeps the height of its tallest state (home.js); the steps stay at its top. */
  .how-band { align-content: start; }
  .how-steps { position: relative; z-index: 2; width: 74%; gap: 10px; align-content: start; }
  .how-art { display: block; }
  .how-button { justify-content: space-between; height: 50px; padding: 0 16px; border-radius: 0; font-size: 14.5px; font-weight: 400; letter-spacing: 0.01em;
    box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.75); }
  .how-button:hover, .how-step[data-open="true"] .how-button { transform: none; }
  /* A step below the white band still reads as a button on the dark page. */
  .how-button { background: #171717; }
  /* The providers' marks sit where the other steps keep their icon: a row of four at the right,
   * inside the button, so none spills over its edges or the label. */
  .how-art { position: absolute; inset: 0 14px 0 auto; display: flex; align-items: center; }
  .how-art img[class] { position: static; width: 22px; height: 22px; margin-left: -5px; padding: 4px; border-radius: 50%;
    background: #262626; box-shadow: 0 0 0 2px #171717; object-fit: contain; opacity: 1; }
  .how-art .a2, .how-art .a5 { display: none; }
  /* The open list is a drawer under its step, set in by the same amount on both sides. */
  .how-drop { width: auto; margin: 0 8px 2px; border-radius: 0 0 6px 6px; padding: 14px 16px; font-size: 13.5px; letter-spacing: 0.02em; }
  /* A long line ("Your Mind stays on your machine") wraps inside the drawer instead of running past it. */
  .how-drop li { white-space: normal; }

  /* ---------- Ownership illustration: phone-sized type, tags aligned beside each agent ---------- */
  /* The three cards are one swipe, as the plans are, rather than a stack a screen and a half tall (Oliver,
   * 29 Oct 2026: "on phone there's too much text"); each shows most of the screen and the next one peeks. */
  .own-art { display: flex; gap: 10px; width: auto; margin: 8px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter);
    overflow: auto hidden; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; font-size: 1em; }
  .own-art::-webkit-scrollbar { display: none; }
  .own-art:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .own-art .own-card { flex: 0 0 88%; scroll-snap-align: start; }
  /* In the swipe each agent's permissions start under its mark, so the three stay on one row. */
  .own-art .own-perms li > span:nth-of-type(2) { margin-left: 0; }
  .own-art .own-card { padding: 16px; font-size: 13px; }
  .own-art .own-label { margin-bottom: 12px; font-size: 11.5px; }
  .own-art .own-tag, .own-art .own-pill, .own-art .own-btn { font-size: 12px; }
  .own-art .own-cmd { margin: 10px 0; padding: 9px 11px; font-size: 12.5px; }
  .own-art .own-log time { font-size: 12px; }
  .own-art .own-avatar { width: 24px; height: 24px; padding: 4px; }
  /* Each agent on its own line, its three permissions on one row beneath its name. */
  .own-perms ul { gap: 14px; }
  .own-perms li { gap: 8px 6px; }
  .own-perms li > span:first-of-type { flex: 1 0 calc(100% - 34px); min-width: 0; }
  .own-perms li > span:nth-of-type(2) { margin-left: 34px; }
  .own-log li { grid-template-columns: 48px minmax(0, 1fr); }

  /* ---------- Release sign-up: the bar stacks into filled fields and a full-width button, the
   * same 48px square shapes as the hero's buttons ---------- */
  .updates-copy h2 { font-size: 28px; }
  .updates-bar { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0; border-radius: 0; background: none; }
  .updates-bar:focus-within { box-shadow: none; }
  .updates-input { height: 48px; padding: 0 14px; border-radius: 0; background: #161616; }
  .updates-input:focus { background: #1c1c1c; box-shadow: 0 0 0 2px rgba(111, 180, 255, 0.45); }
  .updates-input[aria-invalid="true"], .updates-input[aria-invalid="true"]:focus { box-shadow: inset 0 0 0 1.5px var(--danger); }
  .updates-submit { width: 100%; height: 48px; border-radius: 0; }

  /* ---------- Questions, answered: each answer drops down from its question ---------- */
  /* Ruled rows, the same as the folds below (29 Oct 2026), rather than rounded panels. */
  .faq-grid { gap: 0; border-bottom: 1px solid var(--border); }
  .faq-item { border-top: 1px solid var(--border); }
  .faq-item > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px;
    min-height: 56px; padding: 14px 0; cursor: pointer; }
  .faq-item > summary h3 { margin: 0; font-size: 16px; line-height: 1.35; text-wrap: pretty; }
  .faq-item > summary::after { content: ""; flex: none; width: 10px; height: 10px; margin-top: -4px;
    border-right: 1.6px solid var(--text-dim); border-bottom: 1.6px solid var(--text-dim); transform: rotate(45deg);
    transition: transform var(--motion), margin var(--motion); }
  .faq-item[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
  .faq-item > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .faq-item > p { padding: 0 0 18px; font-size: 15px; }

  /* ---------- Folds (assets/js/shared/fold.js): long text drops down from its title, like the questions
   * (Oliver, 29 Oct 2026: "on phone there's too much text, it needs to be drop downs") ---------- */
  .fold-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 52px;
    margin: 0; padding: 12px 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
  .fold-toggle::after { content: ""; flex: none; width: 9px; height: 9px; margin: -4px 2px 0 0;
    border-right: 1.6px solid var(--text-dim); border-bottom: 1.6px solid var(--text-dim); transform: rotate(45deg);
    transition: transform var(--motion), margin var(--motion); }
  .fold-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 4px; }
  .fold-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  .rows > div[data-fold] { padding: 0; gap: 0; }
  .rows > div[data-fold] > dd { padding-bottom: 18px; }
  .timeline > li[data-fold] { gap: 0; }
  .timeline > li[data-fold] > p { padding-bottom: 14px; }
  .contrast > div[data-fold] { gap: 0; }
  .contrast > div[data-fold] > :not(h3) { padding-bottom: 16px; }

  /* ---------- Pricing comparison: one plan at a time, as on Linear ---------- */
  .compare-wrap { overflow: visible; }
  .compare-pick { display: flex; gap: 4px; margin: 12px 12px 4px; padding: 4px; border-radius: 0; background: #111; overflow-x: auto; scrollbar-width: none; }
  .compare-pick::-webkit-scrollbar { display: none; }
  .compare-pick button { flex: 1 1 auto; min-height: 40px; padding: 0 8px; border: 0; border-radius: 0; background: none;
    color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compare tbody tr:first-child > * { border-top: 0; }
  .compare-pick button[aria-pressed="true"] { background: #2a2a2a; color: var(--text); }
  .compare { min-width: 0; table-layout: fixed; }
  .compare [data-off] { display: none; }
  .compare th:first-child { position: static; box-shadow: none; width: 52%; }
  .compare thead th { letter-spacing: 0.06em; }

  /* ---------- Download, policies and forms: phone-width type ---------- */
  .page-title { font-size: 34px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.12; }
  .doc-section { padding: 20px 0; border-radius: 0; }
  .doc-section h2 { margin-bottom: 14px; font-size: 17px; letter-spacing: -0.01em; }
  .doc-section h3 { margin-top: 20px; font-size: 15px; font-weight: 500; color: var(--text); }
  .doc-section p { font-size: 15px; line-height: 1.6; }
  .doc-table table { font-size: 14px; }
  .doc-table td::before { font-size: 12.5px; }
}

/* Wide screens: the picker is not needed and the name stays hidden beside the mark. */
@media (min-width: 761px) {
  .compare-pick { display: none; }
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.menu-button .icon-close { display: none; }

@keyframes sheet-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .site-header[data-open="true"] .site-nav { animation: none; } }

/* The narrowest phones (360px): three marks on "Onboard your agents" so the label stays clear of
 * them, and each agent's permissions start under its mark so the three stay on one row. */
@media (max-width: 380px) {
  .how-art .a4 { display: none; }
  .how-button { padding: 0 14px; font-size: 14px; }
  .own-perms li > span:nth-of-type(2) { margin-left: 0; }
}
