/* Carbon Labs: the experiments marketplace, after the Mac App Store's Discover page (macOS dark, and its light twin).
   Measured from the App Store window: a 216px frosted sidebar; a main column of a wide editorial hero, three story
   cards, and shelves of three rows that scroll sideways; small type in the system face; one accent, carbon blue. */
:root, html[data-theme="dark"] {
  --ms-bg: #1e1e1e; --ms-side: rgba(43,43,45,.78); --ms-side-line: rgba(255,255,255,.08); --ms-panel: #323234; --ms-panel-2: #2a2a2c;
  --ms-ink: #f5f5f7; --ms-ink-2: #a1a1a6; --ms-ink-3: #6e6e73; --ms-line: rgba(255,255,255,.1); --ms-hover: rgba(255,255,255,.06); --ms-sel: rgba(255,255,255,.12);
  --ms-accent: #4fd8e8; --ms-pill: #e8e8ed; --ms-pill-ink: #007a87; --ms-field: rgba(255,255,255,.08);
}
html[data-theme="light"] {
  --ms-bg: #ffffff; --ms-side: rgba(240,240,242,.82); --ms-side-line: rgba(0,0,0,.08); --ms-panel: #f2f2f5; --ms-panel-2: #ececf0;
  --ms-ink: #1d1d1f; --ms-ink-2: #6e6e73; --ms-ink-3: #8e8e93; --ms-line: rgba(0,0,0,.1); --ms-hover: rgba(0,0,0,.04); --ms-sel: rgba(0,0,0,.08);
  --ms-accent: #007a87; --ms-pill: #ececf1; --ms-pill-ink: #007a87; --ms-field: rgba(0,0,0,.06);
}
html, body.ms { background: var(--ms-bg); }
body.ms { margin: 0; color: var(--ms-ink); font: 400 13px/1.35 "Raleway", "Raleway Fallback", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
.ms h1, .ms h2, .ms h3 { font-family: "Raleway", "Raleway Fallback", system-ui, sans-serif; color: var(--ms-ink); margin: 0; }
.ms-app { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }

/* the sidebar */
.ms-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 14px 10px 12px; box-sizing: border-box;
  background: var(--ms-side); border-right: 1px solid var(--ms-side-line); backdrop-filter: blur(30px) saturate(1.8); -webkit-backdrop-filter: blur(30px) saturate(1.8); }
.ms-brand { display: flex; align-items: center; height: 22px; padding: 2px 8px 0; color: var(--ms-ink); }
.ms-brand .cl-logo { height: 15px; width: auto; }
.ms-field { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 7px; background: var(--ms-field); }
.ms-field svg { width: 13px; height: 13px; color: var(--ms-ink-2); flex: none; }
.ms-field input { all: unset; flex: 1; min-width: 0; font-size: 13px; color: var(--ms-ink); }
.ms-field input::placeholder { color: var(--ms-ink-2); }
.ms-nav { display: grid; gap: 2px; }
.ms-nav button, .ms-nav a { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 9px; border-radius: 7px; font-size: 14.5px; font-weight: 500; color: var(--ms-ink); cursor: pointer; }
.ms-nav button:hover, .ms-nav a:hover { background: var(--ms-hover); }
.ms-nav button[aria-current="true"] { background: var(--ms-sel); }
.ms-nav svg { width: 17px; height: 17px; color: var(--ms-accent); flex: none; }
.ms-nav button:focus-visible, .ms-nav a:focus-visible { outline: 2px solid var(--ms-accent); outline-offset: -2px; }
.ms-side__foot { margin-top: auto; display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--ms-side-line); }
.ms-side__foot .ms-nav button, .ms-side__foot a { font-size: 13.5px; }

/* the main column */
.ms-main { min-width: 0; padding: 22px 26px 60px; }
.ms-main > * + * { margin-top: 18px; }

/* the editorial hero: a blurred panel of the same picture carries the words, the picture fills the rest */
.ms-hero { position: relative; display: grid; grid-template-columns: minmax(300px, 30%) 1fr; height: clamp(300px, 27vw, 450px); border-radius: 12px; overflow: hidden; background: #000; isolation: isolate; }
.ms-hero__copy { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 28px 28px 26px; color: #fff; overflow: hidden; }
.ms-hero__copy::before { content: ""; position: absolute; inset: -40px; z-index: -1; background: var(--bgimg) center / cover; filter: blur(40px) saturate(1.5) brightness(.5); transform: scale(1.2); }
.ms-hero__txt small { display: block; font: 700 11px/1 "Raleway", "Raleway Fallback", system-ui, sans-serif; letter-spacing: .03em; text-transform: uppercase; opacity: .78; margin-bottom: 8px; }
.ms-hero__txt h2 { color: #fff; font-size: clamp(24px, 2.2vw, 32px); font-weight: 600; letter-spacing: -.01em; line-height: 1.12; }
.ms-hero__foot { display: grid; gap: 14px; justify-items: start; }
.ms-hero__foot p { margin: 0; font-size: 14px; line-height: 1.4; opacity: .92; max-width: 34ch; }
.ms-hero__art { position: relative; overflow: hidden; }
.ms-hero__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 0 0; }

/* the story cards */
.ms-stories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ms-story { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 196px; padding: 22px 22px 22px 24px; border-radius: 12px; background: var(--ms-panel); color: inherit; text-decoration: none; transition: background .2s; }
.ms-story:hover { background: var(--ms-panel-2); }
.ms-story small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ms-ink-2); margin-bottom: 6px; }
.ms-story h3 { font-size: clamp(19px, 1.6vw, 24px); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.ms-story p { margin: 8px 0 0; font-size: 13px; color: var(--ms-ink-2); max-width: 30ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ms-story__art { width: clamp(96px, 9vw, 136px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--ms-panel-2); box-shadow: 0 10px 26px rgba(0,0,0,.25); }
.ms-story__art img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 0; display: block; }

/* the shelves: three rows that scroll sideways, a hairline between rows */
.ms-sec { padding-top: 14px; border-top: 1px solid var(--ms-line); margin-top: 26px; }
.ms-sec__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.ms-sec__head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.ms-all { all: unset; cursor: pointer; font-size: 13px; color: var(--ms-accent); }
.ms-all:hover { text-decoration: underline; }
.ms-shelf-wrap { position: relative; }
.ms-shelf { display: grid; grid-template-rows: repeat(3, auto); grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 20px) / 5); column-gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
.ms-shelf::-webkit-scrollbar { display: none; }
.ms-shelf .ms-row { scroll-snap-align: start; }
.ms-next { all: unset; position: absolute; right: -20px; top: 50%; transform: translateY(-50%); width: 20px; height: 40px; display: grid; place-items: center; color: var(--ms-ink-2); cursor: pointer; }
.ms-next:hover { color: var(--ms-ink); }
.ms-next svg { width: 16px; height: 16px; }
@media (max-width: 1500px) { .ms-shelf { grid-auto-columns: calc((100% - 3 * 20px) / 4); } }
@media (max-width: 1180px) { .ms-shelf { grid-auto-columns: calc((100% - 2 * 20px) / 3); } }

/* an app row: icon, two lines, and the Open pill with a small caption, the App Store's Get */
.ms-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 11px 0; position: relative; }
.ms-row::after { content: ""; position: absolute; left: 56px; right: 0; bottom: 0; height: 1px; background: var(--ms-line); }
.ms-shelf .ms-row:nth-child(3n)::after, .ms-list .ms-row:last-child::after { display: none; }
.ms-row__t { min-width: 0; display: grid; gap: 2px; }
.ms-row__t b { font-size: 13.5px; font-weight: 500; line-height: 1.22; color: var(--ms-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ms-row__t small { font-size: 12px; color: var(--ms-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-row__act { display: grid; justify-items: center; gap: 3px; }
.ms-row__act i { font-style: normal; font-size: 9px; color: var(--ms-ink-3); white-space: nowrap; }
.ms-get { display: inline-grid; place-items: center; min-width: 58px; height: 24px; padding: 0 12px; border-radius: 999px; box-sizing: border-box; background: var(--ms-pill); color: var(--ms-pill-ink); font: 700 12.5px/1 "Raleway", "Raleway Fallback", system-ui, sans-serif; text-decoration: none; transition: filter .15s; }
.ms-get:hover { filter: brightness(.94); }
.ms-get--light { background: rgba(255,255,255,.92); color: #00707c; height: 28px; min-width: 68px; font-size: 13px; }

/* the icon squircle */
.ms-ico { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--cv, #123); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.18); flex: none; }
.ms-ico img, .ms-ico svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-ico b { font: 700 15px/1 "Raleway", "Raleway Fallback", system-ui, sans-serif; color: #fff; letter-spacing: -.02em; }

/* a list: a category, a search, or See All */
.ms-back { all: unset; display: inline-flex; align-items: center; gap: 2px; cursor: pointer; font-size: 13.5px; color: var(--ms-accent); }
.ms-back svg { width: 15px; height: 15px; }
.ms-title h1 { font-size: 28px; font-weight: 700; letter-spacing: -.015em; }
.ms-title p { margin: 4px 0 0; font-size: 14px; color: var(--ms-ink-2); }
.ms-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 26px; border-top: 1px solid var(--ms-line); }
.ms-list .ms-row::after { left: 56px; }
.ms-empty { color: var(--ms-ink-2); font-size: 14px; padding: 30px 0; }

@media (max-width: 900px) {
  .ms-app { grid-template-columns: minmax(0, 1fr); }
  .ms-side { position: static; height: auto; flex-direction: column; border-right: 0; border-bottom: 1px solid var(--ms-side-line); }
  .ms-nav { grid-auto-flow: column; overflow-x: auto; } .ms-side__foot { display: none; }
  .ms-main { padding: 18px 16px 40px; }
  .ms-hero { grid-template-columns: minmax(0, 1fr); height: auto; } .ms-hero__art { height: 220px; } .ms-hero__copy { min-height: 200px; }
  .ms-stories { grid-template-columns: minmax(0, 1fr); }
  .ms-shelf { grid-auto-columns: 82%; }
}

/* story art: a soft blur of the app's screen in a circle, the icon large in the middle */
.ms-story__art { position: relative; display: grid; place-items: center; isolation: isolate; }
.ms-story__art::before { content: ""; position: absolute; inset: -20%; z-index: -1; background: var(--bgimg) 30% 0 / cover; filter: blur(14px) saturate(1.6) brightness(.85); }
.ms-ico--xl { width: 46%; height: 46%; border-radius: 22%; box-shadow: 0 8px 22px rgba(0,0,0,.35), inset 0 0 0 .5px rgba(255,255,255,.25); }
.ms-ico--xl b { font-size: 22px; }

/* a category banner */
.ms-cat { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 180px; padding: 28px 32px; border-radius: 12px; overflow: hidden; color: #fff; background: var(--cv); isolation: isolate; }
.ms-cat::before { content: ""; position: absolute; right: -60px; top: -80px; width: 340px; height: 340px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: rgba(255,255,255,.12); z-index: -1; }
.ms-cat small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; opacity: .8; margin-bottom: 6px; }
.ms-cat h1 { color: #fff; font-size: clamp(28px, 3vw, 40px); font-weight: 700; letter-spacing: -.015em; }
.ms-cat p { margin: 6px 0 0; font-size: 15px; opacity: .9; max-width: 46ch; }
.ms-cat__ico { width: 92px; height: 92px; border-radius: 22px; display: grid; place-items: center; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); flex: none; }
.ms-cat__ico svg { width: 46px; height: 46px; color: #fff; }
.ms-sec--list .ms-sec__head small { font-size: 13px; color: var(--ms-ink-2); }
.ms-sec--list .ms-list { border-top: 0; }
