/* The studio header is shared with the workspace, gallery, and in-page editors. */
.studio-brand-group,
.studio-brand { display: flex; align-items: center; }
.studio-brand img { display: block; width: 34px; height: 32px; }
.studio-header nav svg { display: none; }
.home-header-search { display: none; }

body:has(.studio-home) {
  --home-edge: var(--studio-edge);
  --home-paper: var(--pm-surface);
  --home-ink: #222327;
  --home-muted: #5b5e64;
  --home-line: #dfe1e3;
  background: var(--home-paper);
  color: var(--home-ink);
}
body:has(.studio-home) .studio-header {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 380px) auto;
  gap: 14px;
  align-items: center;
  height: auto;
  min-height: 64px;
  padding: 8px var(--home-edge);
  background: var(--home-paper);
  border: 0;
}
body:has(.studio-home) .studio-brand { gap: 9px; }
body:has(.studio-home) .home-header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #d4d6d9;
  border-radius: 9px;
  color: var(--home-muted);
}
.home-header-search:focus-within { outline: 2px solid #646973; outline-offset: 1px; }
.home-header-search svg,
body:has(.studio-home) .studio-header nav svg { display: block; width: 18px; height: 18px; flex: none; }
.home-header-search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  outline: 0;
  font: 14px/1.4 var(--pm-font);
  color: var(--home-ink);
}
.home-header-search input::-webkit-search-cancel-button { appearance: none; }
.home-header-search kbd {
  min-width: 20px;
  border: 1px solid #dedfe1;
  border-radius: 4px;
  font: 12px/19px system-ui, sans-serif;
  text-align: center;
}
.home-header-search button { min-width: 29px; min-height: 30px; padding: 0; border: 0; font: 20px/1 system-ui; }
.home-header-search:has(button:not([hidden])) kbd { display: none; }
body:has(.studio-home) .studio-header nav { justify-content: flex-end; align-items: center; }
body:has(.studio-home) .studio-header nav a:not([href="#workspace"]) { display: none; }
body:has(.studio-home) .studio-header nav a[href="#workspace"] {
  display: inline-flex;
  gap: 8px;
  min-height: 39px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #26272a;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}
#studio-main:has(> .studio-home) { padding: 0 var(--home-edge) 24px; }
.studio-home [hidden], .home-header-search [hidden] { display: none !important; }
.home-nav {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--home-line);
}
.home-nav a {
  display: inline-grid;
  place-items: center;
  min-height: 46px;
  padding-inline: 17px;
  border-bottom: 2px solid transparent;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--home-muted);
}
.home-nav a:hover, .home-nav a[aria-current="page"] { color: var(--home-ink); }
.home-nav a[aria-current="page"] { border-bottom-color: currentColor; }
.home-banner {
  --ring-width: 146px;
  --ring-inset: clamp(16px, 4%, 46px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 12px calc(var(--ring-width) + var(--ring-inset) + 8px) 12px 24px;
  overflow: hidden;
  border: 1px solid var(--home-line);
  border-radius: 10px;
  background: radial-gradient(ellipse at 76% 110%, rgba(247,230,236,.42), transparent 56%),
    linear-gradient(105deg, #fdfcfc 4%, #faf9f8 65%, #f1f6f3 100%);
}
.home-banner h1 { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.065em; }
.home-banner p { margin: 0; color: #53555b; font-size: 16px; line-height: 1.45; font-weight: 500; letter-spacing: -.025em; }
.home-banner p span { display: inline-block; }
.home-banner-art {
  position: absolute;
  top: 50%;
  right: var(--ring-inset);
  width: var(--ring-width);
  transform: translateY(-50%);
  pointer-events: none;
}
.home-banner-art::before {
  content: "";
  position: absolute;
  inset: auto 10% 9% 18%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(76,59,66,.18), rgba(92,75,79,.06) 45%, transparent 73%);
  filter: blur(1.3px);
}
.home-banner-art img { position: relative; display: block; width: 100%; height: auto; }
body:has(.studio-home) .studio-header nav a[href="#workspace"]:hover { background: #424044; }
.home-making, .home-playing { margin-top: 22px; scroll-margin-top: 14px; }
.home-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; margin-bottom: 9px; }
.home-section-heading :is(h1, h2) { font-size: 22px; line-height: 1.3; letter-spacing: -.055em; }
.studio-home .home-file { min-height: 32px; padding: 4px 10px; border-radius: 7px; background: #fff; font-size: 12px; }
.studio-home .creation-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.5vw, 22px); }
.studio-home .creation-card {
  display: flex;
  background: transparent;
  box-shadow: none;
  border: 0;
  border-radius: 6px;
  overflow: visible;
}
.studio-home .creation-stage {
  aspect-ratio: 5 / 4;
  grid-template: minmax(0,1fr) / minmax(0,1fr);
  overflow: hidden;
  background: color-mix(in srgb, var(--paper) 56%, white);
  border: 1px solid var(--home-line);
  border-radius: 6px;
}
.studio-home .creation-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.studio-home .creation-copy { padding: 9px 0 0; }
.studio-home .creation-copy :is(h2, h3) { margin: 0; font-size: 17px; line-height: 1.4; letter-spacing: -.037em; }
.studio-home .creation-copy p { margin-top: 3px; color: var(--home-muted); font-size: 13px; line-height: 1.5; }
.studio-home .creation-card:is(:hover, :focus-visible) .creation-stage, .studio-home .picky-banner:hover { border-color: #93979e; }
.studio-home .picky-banner { margin: 0; min-height: 50px; border-color: var(--home-line); border-radius: 10px; }
.home-empty, .home-search-results { margin: 16px 0; }
.home-empty { margin-top: 8px; }
.home-search-results { font-size: 15px; font-weight: 600; }
#studio-main:has(> .studio-home) + .studio-footer { padding-inline: var(--home-edge); background: #f2f3f4; border-color: var(--home-line); }

@media (max-width: 820px) {
  .studio-home .creation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  body:has(.studio-home) { --home-edge: 12px; }
  body:has(.studio-home) .studio-header { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding-block: 6px 10px; }
  body:has(.studio-home) .studio-header nav { grid-column: 2; grid-row: 1; }
  body:has(.studio-home) .studio-brand { gap: 6px; }
  .home-header-search { grid-column: 1 / -1; grid-row: 2; }
  .home-header-search input { font-size: 16px; }
  .home-banner { --ring-width: 82px; --ring-inset: 4px; min-height: 90px; padding-left: 14px; }
  .home-banner h1 { font-size: 25px; }
  .home-banner p { font-size: 14px; }
  .home-making, .home-playing { margin-top: 18px; }
  .home-section-heading :is(h1, h2) { font-size: 20px; }
  .home-nav { gap: 2px; margin-bottom: 12px; }
  .home-nav a { min-height: 44px; padding-inline: 13px; font-size: 14px; }
  .studio-home .creation-grid { gap: 16px 12px; }
  .studio-home .creation-copy { padding-top: 6px; }
  .studio-home .creation-copy :is(h2, h3) { font-size: 16px; }
  .studio-home .creation-copy p { font-size: 13px; }
}
@media (pointer: coarse) {
  body:has(.studio-home) .home-header-search, .home-header-search input, .home-header-search button,
  .studio-home .home-file,
  body:has(.studio-home) .studio-header nav a[href="#workspace"] { min-height: 44px; }
  .home-header-search button { min-width: 44px; }
  .home-header-search kbd { display: none; }
}
