/* MADEBYEYAD — hub pages (home, projects, settings, help). Scoped to .studio-app. */

.studio-app .studio-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--st-accent); color: #fff; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.studio-app .studio-skip:focus { left: 8px; }
.studio-app.is-hub { font-size: 13.5px; }
.studio-app.is-hub { isolation: isolate; }
.studio-app.is-hub::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--st-accent) 9%, transparent), transparent 60%);
}

.hub-hero { padding: 26px 0 8px; max-width: 900px; }
.studio-app .hub-title { font-size: clamp(56px, 11vw, 132px); letter-spacing: -.005em; margin: 6px 0 14px; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hub-pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.hub-pagehead .hub-actions { margin-top: 0; }

.hub-notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding: 12px 14px; border-radius: 8px; border: 1px solid rgba(226, 169, 59, .4); background: rgba(226, 169, 59, .08); color: var(--st-warn); }
.hub-notice span { flex: 1; color: var(--st-text); }

.hub-apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 38px; }
.hub-app {
  display: flex; flex-direction: column; gap: 10px; min-height: 230px; padding: 18px; border-radius: 12px; text-decoration: none; color: var(--st-text);
  background: var(--st-panel); border: 1px solid var(--st-line); position: relative; overflow: hidden;
  transition: border-color .2s, transform .25s var(--st-ease), background .2s;
}
.hub-app::after { content: ''; position: absolute; right: -40px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--st-accent); opacity: 0; filter: blur(30px); transition: opacity .3s; }
.hub-app:hover { border-color: var(--st-accent); transform: translateY(-3px); }
.hub-app:hover::after { opacity: .35; }
.hub-app-top { display: flex; justify-content: space-between; align-items: center; }
.hub-app-icon { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; background: var(--st-raised); border: 1px solid var(--st-line-2); }
.hub-app-go { color: var(--st-faint); transition: color .2s, transform .2s; }
.hub-app:hover .hub-app-go { color: var(--st-accent-hi); transform: translate(2px, -2px); }
.hub-app-name { font-family: var(--st-display); font-weight: 700; font-size: 28px; letter-spacing: .03em; line-height: 1; margin-top: auto; }
.hub-app-name span { color: var(--st-accent-hi); font-weight: 500; }
.hub-app-desc { color: var(--st-dim); font-size: 12.5px; }
.hub-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.hub-tag { font-size: 10.5px; padding: 2px 7px; border-radius: 8px; border: 1px solid var(--st-line-2); color: var(--st-dim); }

.hub-recent > .studio-empty, .hub-grid > .studio-empty { grid-column: 1 / -1; }
.hub-recent, .hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.hub-card { position: relative; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--st-panel); border: 1px solid var(--st-line); text-decoration: none; color: var(--st-text); transition: border-color .15s, transform .2s var(--st-ease); }
.hub-card:hover { border-color: var(--st-line-2); transform: translateY(-2px); }
.hub-card:focus-visible { outline: 2px solid var(--st-accent); }
.hub-thumb { aspect-ratio: 16 / 10; background: repeating-conic-gradient(#2a2a30 0% 25%, #222226 0% 50%) 50% / 16px 16px; display: grid; place-items: center; overflow: hidden; }
.hub-thumb.is-video { background: #050506; }
.hub-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hub-card-meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; }
.hub-card-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 28px; }
.hub-card-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--st-dim); }
.hub-card-menu { position: absolute; right: 6px; bottom: 30px; }

.hub-drop { margin-top: 40px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px; border: 1.5px dashed var(--st-line-2); border-radius: 12px; color: var(--st-dim); }
.hub-drop > div { flex: 1; min-width: 220px; }
.hub-drop b { color: var(--st-text); }

.hub-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.hub-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.hub-chip { height: 30px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--st-line-2); background: transparent; color: var(--st-dim); cursor: pointer; font-size: 12px; }
.hub-chip:hover { color: var(--st-text); }
.hub-chip[aria-selected="true"] { background: var(--st-text); color: var(--st-bg); border-color: var(--st-text); }
.hub-search { width: 200px; height: 30px; }
.hub-sort { width: 150px; height: 30px; }
.hub-storage { margin-top: 34px; padding: 14px 16px; border-radius: 12px; background: var(--st-panel); border: 1px solid var(--st-line); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.hub-storage-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--st-dim); }
.hub-storage .hub-actions { margin-top: 0; }

.hub-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.hub-settings-card { display: flex; flex-direction: column; gap: 4px; }
.hub-settings-title { display: flex; align-items: center; gap: 9px; font-family: var(--st-display); font-weight: 600; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.hub-settings-title .studio-icon { color: var(--st-accent-hi); }
.hub-setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--st-line); }
.hub-setting-text { flex: 1; min-width: 0; }
.hub-setting-label { font-weight: 500; }
.hub-setting-input { width: 170px; }
.hub-setting-num { width: 90px; }
.hub-switch { width: 38px !important; height: 22px !important; appearance: none; -webkit-appearance: none; border-radius: 12px; background: var(--st-line-2); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.hub-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--st-ease); }
.hub-switch:checked { background: var(--st-accent); }
.hub-switch:checked::after { transform: translateX(16px); }

.studio-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; }
.studio-shortcut { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--st-line); font-size: 12px; }

.hub-docs { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 30px; align-items: start; }
.hub-toc { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.hub-toc a { color: var(--st-dim); text-decoration: none; padding: 6px 10px; border-radius: 8px; border-left: 2px solid transparent; }
.hub-toc a:hover { color: var(--st-text); border-left-color: var(--st-accent); background: var(--st-panel); }
.hub-doc-body { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.hub-doc { background: var(--st-panel); border: 1px solid var(--st-line); border-radius: 12px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 80px; }
.hub-doc-title { font-family: var(--st-display); font-weight: 600; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; }
.hub-doc p, .hub-doc li { color: var(--st-dim); line-height: 1.6; }

@media (max-width: 980px) { .hub-apps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .studio-app .studio-hub-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 8px; }
  .studio-app .studio-hub-header-left { display: contents; }
  .studio-app .studio-hub-header .studio-brand { grid-column: 1; grid-row: 1; }
  .studio-app .studio-hub-header-right { grid-column: 2; grid-row: 1; }
  .studio-app .studio-hub-header .studio-switcher { grid-column: 1 / -1; grid-row: 2; }
  .hub-docs { grid-template-columns: 1fr; }
  .hub-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .hub-settings { grid-template-columns: 1fr; }
  .hub-search, .hub-sort { flex: 1; width: auto; min-width: 0; }
}
@media (max-width: 480px) {
  .hub-apps { grid-template-columns: 1fr; }
  .hub-app { min-height: 0; }
  .hub-recent, .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hub-card-meta { padding: 8px; }
  .hub-setting { flex-wrap: wrap; }
  .hub-setting-input { width: 100%; }
}
@media (max-width: 340px) { .hub-recent, .hub-grid { grid-template-columns: 1fr; } }
.hub-swatches { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hub-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); cursor: pointer; padding: 0; }
.hub-swatch.is-on { border-color: var(--st-text); }
.hub-swatches .studio-color { width: 30px; height: 24px; }

/* Phones: show every app in the switcher (wrap into rows) instead of a hidden sideways scroll; same for the Attention tabs */
@media (max-width: 700px) {
  .studio-app .studio-hub-header .studio-switcher { flex-wrap: wrap; overflow: visible; row-gap: 8px; }
  .att-tabs { flex-wrap: wrap; overflow: visible; }
  .att-tab { flex: 1 1 auto; }
}

/* Touch screens: small text links and the search box get a finger-sized hit area */
@media (pointer: coarse) {
  :root body.studio-app .studio-hub-footer a, :root body.studio-app .po-links a, :root body.studio-app .po-more, :root body.studio-app .po-logo { display: inline-flex; align-items: center; min-height: 40px; }
  :root body.studio-app :is(.po-search-input, .ps-search-input) { min-height: 40px; }
}

/* Phones (any pointer): top-bar pills, buttons and colour dots are finger-sized */
@media (max-width: 700px) {
  :root body.studio-app :is(.studio-switcher-item, .po-pill, .studio-btn) { min-height: 40px; }
  :root body.studio-app .po-mode { width: 36px; height: 36px; }
  :root body.studio-app .studio-skip:focus { min-height: 40px; }
  :root body.studio-app :is(.xp-bar-btn, .studio-back, .ps-keys summary) { min-height: 40px; min-width: 40px; display: inline-flex; align-items: center; justify-content: center; }
  :root body.studio-app .ps-keys summary { justify-content: flex-start; }
}

:root body.studio-app .studio-switcher { gap: 8px; }
