.mobile-phone-hero,
.mobile-phone-experience { display: none; }

/* Phone is an independent composition. Rules in this file never affect 521px+. */
@media (max-width: 520px) {
  .cloud-story { display: none; }
  .cloud-story-mobile > .mobile-tablet-layout { display: none; }

  .mobile-phone-hero,
  .mobile-phone-experience {
    --phone-bg: #080d0a;
    --phone-surface: #101713;
    --phone-raised: #151e18;
    --phone-soft: #1a261e;
    --phone-line: #2b3930;
    --phone-text: #f2f8f4;
    --phone-muted: #a8b7ad;
    --phone-accent: #45df85;
    --phone-accent-strong: #087a43;
    --phone-accent-soft: #163c26;
    --phone-blue: #82aaff;
    color: var(--phone-text);
    background: var(--phone-bg);
    font-family: Inter, "Avenir Next", "Segoe UI", sans-serif;
  }

  html[data-public-theme="light"] .mobile-phone-hero,
  html[data-public-theme="light"] .mobile-phone-experience {
    --phone-bg: #f5f7f6;
    --phone-surface: #fff;
    --phone-raised: #fff;
    --phone-soft: #edf2ef;
    --phone-line: #d5dfd9;
    --phone-text: #0b1710;
    --phone-muted: #53625a;
    --phone-accent: #087a43;
    --phone-accent-strong: #087a43;
    --phone-accent-soft: #def5e7;
    --phone-blue: #245fc7;
  }

  .mobile-phone-hero {
    position: relative;
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 6.5rem 1rem 2rem;
    isolation: isolate;
  }
  .mobile-phone-hero::before {
    position: absolute;
    z-index: -1;
    top: 1rem;
    right: -8rem;
    width: 22rem;
    height: 22rem;
    border: 1px solid color-mix(in srgb, var(--phone-accent) 18%, transparent);
    border-radius: 50%;
    box-shadow:
      0 0 0 4rem color-mix(in srgb, var(--phone-accent) 3.5%, transparent),
      0 0 0 8rem color-mix(in srgb, var(--phone-accent) 2%, transparent);
    content: '';
  }
  .mobile-phone-hero-copy { position: relative; z-index: 1; }
  .mobile-phone-hero-copy > span {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--phone-accent);
    font: 800 .75rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .mobile-phone-hero-copy > span::before {
    width: 1.35rem;
    height: 1px;
    background: currentColor;
    content: '';
  }
  .mobile-phone-hero h1 {
    max-width: 10ch;
    margin: .9rem 0 0;
    color: var(--phone-text);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    font-size: clamp(3rem, 14.2vw, 4.2rem);
    font-weight: 730;
    letter-spacing: -.025em;
    line-height: .88;
  }
  .mobile-phone-hero h1 em { color: var(--phone-accent); font-style: normal; }
  .mobile-phone-hero-copy > p {
    max-width: 31rem;
    margin: 1.15rem 0 0;
    color: var(--phone-muted);
    font-size: 1rem;
    line-height: 1.6;
  }
  .mobile-phone-hero-actions { display: grid; grid-template-columns: 1.15fr .85fr; gap: .55rem; margin-top: 1.35rem; }
  .mobile-phone-hero-actions a {
    display: inline-flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 1px solid var(--phone-line);
    border-radius: .85rem;
    color: var(--phone-text);
    background: color-mix(in srgb, var(--phone-surface) 88%, transparent);
    font-size: .81rem;
    font-weight: 820;
    text-align: center;
  }
  .mobile-phone-hero-actions a:first-child { border-color: var(--phone-accent-strong); color: #fff; background: var(--phone-accent-strong); }
  .mobile-phone-hero-actions svg { width: 1rem; height: 1rem; }

  .mobile-live-brief {
    position: relative;
    z-index: 1;
    overflow: hidden;
    margin-top: 1.4rem;
    border: 1px solid var(--phone-line);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--phone-surface) 94%, transparent);
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .22);
  }
  .mobile-live-brief > header {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    border-bottom: 1px solid var(--phone-line);
    padding: .65rem .75rem;
  }
  .mobile-live-brief > header span,
  .mobile-live-brief > header small { display: inline-flex; align-items: center; gap: .42rem; font-size: .75rem; font-weight: 780; }
  .mobile-live-brief > header span { min-width: 0; overflow: hidden; color: var(--phone-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-live-brief > header span i { width: .5rem; height: .5rem; flex: 0 0 auto; border-radius: 50%; background: var(--phone-accent); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--phone-accent) 12%, transparent); }
  .mobile-live-brief > header small { flex: 0 0 auto; color: var(--phone-accent); }
  .mobile-live-brief > header svg { width: .8rem; height: .8rem; }
  .mobile-live-primary { display: grid; min-height: 4.45rem; grid-template-columns: 2.5rem 1fr auto; align-items: center; gap: .7rem; margin: .75rem .75rem 0; border: 1px solid color-mix(in srgb, var(--phone-accent) 45%, var(--phone-line)); border-radius: .8rem; padding: .65rem; background: var(--phone-raised); }
  .mobile-live-primary > svg { width: 2.5rem; height: 2.5rem; border-radius: .7rem; padding: .65rem; color: var(--phone-accent); background: var(--phone-accent-soft); }
  .mobile-live-primary span,
  .mobile-live-primary small,
  .mobile-live-primary strong { display: block; }
  .mobile-live-primary small,
  .mobile-live-services small,
  .mobile-live-brief footer small { color: var(--phone-muted); font-size: .75rem; }
  .mobile-live-primary strong { margin-top: .12rem; color: var(--phone-text); font-size: .82rem; }
  .mobile-live-primary b { border-radius: 99px; padding: .3rem .5rem; color: var(--phone-accent); background: var(--phone-accent-soft); font-size: .75rem; }
  .mobile-live-links { position: relative; height: 1.25rem; margin: 0 2.1rem; }
  .mobile-live-links::before { position: absolute; top: 0; bottom: .55rem; left: 50%; width: 1px; background: var(--phone-line); content: ''; }
  .mobile-live-links::after { position: absolute; right: 24%; bottom: .55rem; left: 24%; height: 1px; background: var(--phone-line); content: ''; }
  .mobile-live-links i { position: absolute; bottom: .3rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--phone-accent); }
  .mobile-live-links i:first-child { left: calc(24% - .2rem); }
  .mobile-live-links i:nth-child(2) { left: calc(50% - .2rem); opacity: .45; }
  .mobile-live-links i:last-child { right: calc(24% - .2rem); }
  .mobile-live-services { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 .75rem; }
  .mobile-live-services > span { display: grid; min-width: 0; min-height: 4.2rem; grid-template-columns: 1.7rem 1fr; align-content: center; gap: .08rem .48rem; border: 1px solid var(--phone-line); border-radius: .75rem; padding: .6rem; background: var(--phone-raised); }
  .mobile-live-services svg { width: 1.7rem; height: 1.7rem; grid-row: 1 / span 2; border-radius: .5rem; padding: .4rem; color: var(--phone-blue); background: color-mix(in srgb, var(--phone-blue) 10%, var(--phone-surface)); }
  .mobile-live-services strong { overflow: hidden; color: var(--phone-text); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-live-brief footer { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: .75rem; border-top: 1px solid var(--phone-line); background: var(--phone-line); }
  .mobile-live-brief footer span { display: grid; gap: .12rem; padding: .65rem .75rem; background: var(--phone-soft); }
  .mobile-live-brief footer strong { color: var(--phone-text); font-size: .75rem; }
  .mobile-phone-hero-proof { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1rem; margin-top: .95rem; color: var(--phone-muted); font-size: .75rem; }
  .mobile-phone-hero-proof span { display: inline-flex; align-items: center; gap: .35rem; }
  .mobile-phone-hero-proof span::before { width: .32rem; height: .32rem; border-radius: 50%; background: var(--phone-accent); content: ''; }
  .mobile-phone-hero-next { display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; gap: .45rem; margin-top: .65rem; color: var(--phone-muted); font-size: .75rem; font-weight: 780; }
  .mobile-phone-hero-next svg { width: .95rem; height: .95rem; }

  .cloud-story-mobile { background: var(--phone-bg); }
  .mobile-phone-experience { display: block; overflow: clip; }
  .mobile-phone-experience > section { position: relative; padding: 4.5rem 1rem; scroll-margin-top: 4.75rem; }
  .mobile-phone-experience > section + section { border-top: 1px solid var(--phone-line); }
  .mobile-phone-heading > span,
  .mobile-phone-final > span {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--phone-accent);
    font: 820 .75rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .07em;
    text-transform: uppercase;
  }
  .mobile-phone-heading > span::before,
  .mobile-phone-final > span::before { width: 1.25rem; height: 1px; background: currentColor; content: ''; }
  .mobile-phone-heading h2,
  .mobile-phone-final h2 {
    max-width: 12ch;
    margin: .85rem 0 0;
    color: var(--phone-text);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    font-size: clamp(2.35rem, 11.5vw, 3.25rem);
    font-weight: 730;
    letter-spacing: -.02em;
    line-height: .96;
  }
  .mobile-phone-heading p,
  .mobile-phone-final p { max-width: 31rem; margin: 1rem 0 0; color: var(--phone-muted); font-size: .96rem; line-height: 1.65; }

  .mobile-outcome-list { display: grid; gap: .55rem; margin-top: 1.55rem; }
  .mobile-outcome-list a { display: grid; min-height: 4.5rem; grid-template-columns: 2.65rem 1fr 1rem; align-items: center; gap: .75rem; border: 1px solid var(--phone-line); border-radius: .9rem; padding: .7rem; color: var(--phone-text); background: var(--phone-surface); }
  .mobile-outcome-list a > svg:first-child { width: 2.65rem; height: 2.65rem; border-radius: .72rem; padding: .68rem; color: var(--phone-accent); background: var(--phone-accent-soft); }
  .mobile-outcome-list a > svg:last-child { width: 1rem; color: var(--phone-muted); }
  .mobile-outcome-list a span { display: grid; gap: .16rem; }
  .mobile-outcome-list a b { font-size: .84rem; }
  .mobile-outcome-list a small { color: var(--phone-muted); font-size: .75rem; line-height: 1.4; }
  .mobile-phone-proof { display: flex; align-items: flex-start; gap: .5rem; margin: .9rem .15rem 0; color: var(--phone-muted); font-size: .75rem; line-height: 1.5; }
  .mobile-phone-proof svg { width: .9rem; height: .9rem; flex: 0 0 auto; margin-top: .12rem; color: var(--phone-accent); }

  .mobile-phone-context { background: var(--phone-surface); }
  .mobile-project-thread { position: relative; display: grid; gap: .6rem; margin-top: 1.7rem; }
  .mobile-project-thread::before { position: absolute; z-index: 0; top: 3.85rem; bottom: 2rem; left: 1.35rem; width: 1px; background: var(--phone-line); content: ''; }
  .mobile-thread-root,
  .mobile-thread-context,
  .mobile-thread-resources article { position: relative; z-index: 1; border: 1px solid var(--phone-line); background: var(--phone-surface); }
  .mobile-thread-root { display: grid; min-height: 4rem; grid-template-columns: 2.5rem 1fr auto; align-items: center; gap: .7rem; border-color: color-mix(in srgb, var(--phone-accent) 52%, var(--phone-line)); border-radius: .9rem; padding: .7rem; }
  .mobile-thread-root > svg { width: 2.5rem; height: 2.5rem; border-radius: .7rem; padding: .65rem; color: var(--phone-accent); background: var(--phone-accent-soft); }
  .mobile-thread-root span { display: grid; gap: .12rem; }
  .mobile-thread-root small,
  .mobile-thread-context small { color: var(--phone-muted); font-size: .75rem; }
  .mobile-thread-root strong,
  .mobile-thread-context strong { color: var(--phone-text); font-size: .82rem; }
  .mobile-thread-root i { border-radius: 99px; padding: .35rem .5rem; color: var(--phone-accent); background: var(--phone-accent-soft); font-size: .75rem; font-style: normal; font-weight: 800; }
  .mobile-thread-context { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin-left: 1.35rem; border-radius: .75rem; background: var(--phone-line); }
  .mobile-thread-context span { display: grid; gap: .15rem; padding: .75rem; background: var(--phone-soft); }
  .mobile-thread-resources { display: grid; gap: .45rem; margin-left: 1.35rem; }
  .mobile-thread-resources article { display: grid; min-height: 4rem; grid-template-columns: 2.1rem 1fr .55rem; align-items: center; gap: .65rem; border-radius: .75rem; padding: .65rem .7rem; }
  .mobile-thread-resources article > svg { width: 2.1rem; height: 2.1rem; border-radius: .6rem; padding: .52rem; color: var(--phone-blue); background: color-mix(in srgb, var(--phone-blue) 10%, var(--phone-surface)); }
  .mobile-thread-resources article span { display: grid; gap: .12rem; }
  .mobile-thread-resources strong { color: var(--phone-text); font-size: .8rem; }
  .mobile-thread-resources small { color: var(--phone-muted); font-size: .75rem; }
  .mobile-thread-resources i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--phone-accent); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--phone-accent) 12%, transparent); }

  .mobile-space-directory { display: grid; gap: .55rem; margin-top: 1.55rem; }
  .mobile-space-directory details { overflow: hidden; border: 1px solid var(--phone-line); border-radius: .9rem; background: var(--phone-surface); }
  .mobile-space-directory summary { display: grid; min-height: 4.5rem; grid-template-columns: 1fr 2rem; align-items: center; gap: .75rem; padding: .75rem .85rem; color: var(--phone-text); cursor: pointer; list-style: none; }
  .mobile-space-directory summary::-webkit-details-marker { display: none; }
  .mobile-space-directory summary > span { display: grid; gap: .2rem; font-size: .86rem; font-weight: 820; }
  .mobile-space-directory summary small { color: var(--phone-muted); font-size: .75rem; font-weight: 500; line-height: 1.35; }
  .mobile-space-directory summary b { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; color: var(--phone-accent); background: var(--phone-accent-soft); font-size: .75rem; }
  .mobile-space-directory summary b::after { margin-left: .1rem; content: '+'; }
  .mobile-space-directory details[open] summary b::after { content: '−'; }
  .mobile-space-directory details > div { display: grid; gap: .4rem; border-top: 1px solid var(--phone-line); padding: .55rem; }
  .mobile-space-directory details > div > span { display: grid; min-height: 4rem; grid-template-columns: 2.25rem 1fr; align-items: center; gap: .7rem; border-radius: .7rem; padding: .6rem .65rem; background: var(--phone-soft); }
  .mobile-space-directory details svg { width: 2.25rem; height: 2.25rem; border-radius: .6rem; padding: .57rem; color: var(--phone-accent); background: var(--phone-surface); }
  .mobile-space-directory details i { display: grid; min-width: 0; gap: .12rem; font-style: normal; }
  .mobile-space-directory details i strong { color: var(--phone-text); font-size: .8rem; }
  .mobile-space-directory details i small { color: var(--phone-muted); font-size: .75rem; line-height: 1.4; }

  .mobile-phone-interfaces { background: var(--phone-surface); }
  .mobile-interface-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin-top: 1.5rem; }
  .mobile-interface-tabs button { min-height: 2.9rem; border: 1px solid var(--phone-line); border-radius: .72rem; padding: .55rem .35rem; color: var(--phone-muted); background: var(--phone-bg); font: inherit; font-size: .75rem; font-weight: 800; cursor: pointer; }
  .mobile-interface-tabs button[aria-selected="true"] { border-color: var(--phone-accent-strong); color: #fff; background: var(--phone-accent-strong); }
  .mobile-interface-panel { overflow: hidden; margin-top: .55rem; border: 1px solid #26382c; border-radius: .9rem; color: #e5f6ea; background: #07100b; box-shadow: 0 1.35rem 3rem rgba(0, 0, 0, .16); }
  .mobile-interface-panel > header { display: flex; min-height: 3rem; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #1e3024; padding: .7rem .85rem; }
  .mobile-interface-panel > header span { font-size: .8rem; font-weight: 820; }
  .mobile-interface-panel > header small { color: #90aa98; font: 650 .75rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
  .mobile-interface-panel > p { min-height: 4.2rem; margin: 0; padding: .85rem .85rem 0; color: #a9c1b0; font-size: .75rem; line-height: 1.55; }
  .mobile-interface-panel pre { min-height: 11rem; margin: 0; overflow-x: auto; padding: .9rem .85rem; color: #c6e3cf; font: 550 .75rem/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
  .mobile-interface-panel code { display: grid; }
  .mobile-inline-link { display: inline-flex; min-height: 3rem; align-items: center; gap: .45rem; margin-top: .75rem; color: var(--phone-accent); font-size: .78rem; font-weight: 820; }
  .mobile-inline-link svg { width: .95rem; height: .95rem; }

  .mobile-cost-ledger { overflow: hidden; margin-top: 1.55rem; border: 1px solid var(--phone-line); border-radius: .9rem; background: var(--phone-surface); }
  .mobile-cost-ledger > div { display: grid; min-height: 4.25rem; grid-template-columns: 1fr auto; align-items: center; gap: .65rem; border-bottom: 1px solid var(--phone-line); padding: .75rem .8rem; }
  .mobile-cost-ledger > div.is-active { background: var(--phone-accent-soft); }
  .mobile-cost-ledger > div span { display: inline-flex; min-width: 0; align-items: center; gap: .55rem; }
  .mobile-cost-ledger svg { width: 2rem; height: 2rem; flex: 0 0 auto; border-radius: .58rem; padding: .5rem; color: var(--phone-accent); background: var(--phone-soft); }
  .mobile-cost-ledger b { color: var(--phone-text); font-size: .75rem; }
  .mobile-cost-ledger > div > strong { color: var(--phone-text); font-size: .75rem; text-align: right; }
  .mobile-cost-ledger footer { display: flex; min-height: 3.7rem; align-items: center; justify-content: space-between; gap: .8rem; padding: .75rem .8rem; color: var(--phone-accent); background: var(--phone-soft); font-size: .75rem; font-weight: 800; }
  .mobile-cost-ledger footer strong { font-size: .9rem; }

  .mobile-phone-experience > .mobile-phone-final { overflow: hidden; padding-bottom: 5.5rem; color: var(--phone-text); background: var(--phone-surface); }
  .mobile-phone-final::after { position: absolute; right: -6rem; bottom: -8rem; width: 18rem; height: 18rem; border: 1px solid color-mix(in srgb, var(--phone-accent) 18%, transparent); border-radius: 50%; box-shadow: 0 0 0 3rem color-mix(in srgb, var(--phone-accent) 4%, transparent), 0 0 0 6rem color-mix(in srgb, var(--phone-accent) 2.5%, transparent); content: ''; pointer-events: none; }
  .mobile-phone-final > span { color: var(--phone-accent); }
  .mobile-phone-final h2 { max-width: 13ch; color: var(--phone-text); }
  .mobile-phone-final p { color: var(--phone-muted); }
  .mobile-phone-final > div { position: relative; z-index: 1; display: grid; gap: .55rem; margin-top: 1.45rem; }
  .mobile-phone-final a { display: inline-flex; min-height: 3.3rem; align-items: center; justify-content: center; gap: .45rem; border: 1px solid var(--phone-line); border-radius: .82rem; color: var(--phone-text); background: var(--phone-bg); font-size: .8rem; font-weight: 850; }
  .mobile-phone-final a:first-child { border-color: var(--phone-accent-strong); color: #fff; background: var(--phone-accent-strong); }
  .mobile-phone-final svg { width: 1rem; height: 1rem; }

  .mobile-phone-hero a:focus-visible,
  .mobile-phone-experience a:focus-visible,
  .mobile-phone-experience button:focus-visible,
  .mobile-phone-experience summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--phone-blue) 72%, #fff); outline-offset: 2px; }
}

@media (max-width: 350px) {
  .mobile-phone-hero { padding-inline: .85rem; }
  .mobile-phone-hero-actions { grid-template-columns: 1fr; }
  .mobile-phone-experience > section { padding-inline: .85rem; }
  .mobile-thread-root { grid-template-columns: 2.3rem 1fr; }
  .mobile-thread-root > i { display: none; }
  .mobile-interface-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-phone-hero *,
  .mobile-phone-experience * { scroll-behavior: auto; transition: none !important; }
}
