/* ==========================================================================
   Home page (marketplace/host-pages/home.js), "Obsidian". Host classes: .ms-*. Tokens, .ms-box, .ms-chip,
   .ms-badge and the iso block faces (.ms-bt/.ms-bl/.ms-br/.ms-rim) come from theme.css;
   docs/mockups/variant-e-obsidian.html is the reference. Light theme = html without data-theme="dark".
   ========================================================================== */

.ms-home { background: var(--mp-bg); }
.ms-wrap { width: min(1280px, 100% - clamp(2.25rem, 5vw, 3rem)); margin-inline: auto; }
.ms-sec { padding-block: clamp(3.75rem, 7vw, 5.5rem); scroll-margin-top: 64px; }
.ms-sec--alt { background: var(--mp-bg-alt); border-block: 1px solid var(--ms-hairline); }
.ms-empty { padding: 32px 0; text-align: center; color: var(--mp-fg-muted); }
.ms-home h1, .ms-home h2, .ms-home h3 { font-family: var(--mp-font-text); }

/* ── Section heads ───────────────────────────────────────────────────────── */
.ms-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 36px; }
.ms-head h2 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.625rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; max-width: 20ch; }
.ms-head p { color: var(--mp-fg-muted); max-width: 46ch; margin-top: 12px; }
.ms-more { margin-top: 28px; }
.ms-link {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 600; color: var(--mp-primary-text);
    text-decoration: none; transition: color var(--mp-dur, 0.15s);
}
.ms-link .mp-i { width: 16px; height: 16px; transition: translate 0.2s var(--mp-ease); }
.ms-link:hover { text-decoration: none; color: var(--mp-fg); }
.ms-link:hover .mp-i { translate: 3px 0; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.ms-hero { position: relative; overflow: clip; isolation: isolate; }
.ms-hero::before {
    content: ""; position: absolute; inset: -10% -10% auto auto; width: 78%; height: 120%; z-index: -2;
    background: radial-gradient(closest-side at 62% 42%, rgb(139 0 255 / 0.34), rgb(139 0 255 / 0.1) 55%, transparent 80%);
}
html:not([data-theme="dark"]) .ms-hero::before {
    background: radial-gradient(closest-side at 62% 42%, rgb(139 0 255 / 0.2), rgb(139 0 255 / 0.06) 55%, transparent 80%);
}
.ms-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.55; pointer-events: none;
    background-image: linear-gradient(30deg, var(--ms-hairline) 1px, transparent 1px), linear-gradient(150deg, var(--ms-hairline) 1px, transparent 1px);
    background-size: 64px 37px;
    -webkit-mask-image: radial-gradient(60% 70% at 70% 40%, #000, transparent 75%); mask-image: radial-gradient(60% 70% at 70% 40%, #000, transparent 75%);
}
.ms-hero__in {
    display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); align-items: center; gap: 32px;
    padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(2.25rem, 4vw, 4rem);
}
.ms-hero h1 { font-size: clamp(2.375rem, 1.4rem + 3.2vw, 4.125rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1.02; max-width: 14ch; }
.ms-lead { margin-top: 24px; max-width: 50ch; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); color: var(--mp-fg-muted); }
.ms-cta { margin-top: 36px; gap: 12px; }
.ms-compat {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 44px; padding-top: 24px; max-width: 560px;
    border-top: 1px solid var(--ms-hairline); font-size: 0.875rem; color: var(--mp-fg-muted);
}
.ms-compat .ms-chip, .ms-feat .ms-chip { min-height: 28px; font-variant-numeric: tabular-nums; }
.ms-sep { width: 1px; height: 18px; background: var(--mp-border-strong); margin-inline: 6px; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ms-hero__art { position: relative; aspect-ratio: 1 / 0.92; }
.ms-hero__art > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ms-feat {
    position: absolute; left: -2%; bottom: 3%; width: min(300px, 64%); display: grid; gap: 12px; padding: 16px; border-radius: 16px;
    background: color-mix(in srgb, var(--mp-surface) 82%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: 0 0 0 1px var(--ms-hairline), 0 1px 0 var(--ms-hi) inset, var(--ms-shadow-lg);
    transition: translate 0.25s var(--mp-ease);
}
.ms-feat:hover { translate: 0 -3px; }
.ms-feat__link { position: absolute; inset: 0; border-radius: 16px; }
.ms-feat__link:focus-visible { outline: 2px solid var(--mp-ring); outline-offset: 2px; }
.ms-feat__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.ms-feat__thumb { position: relative; width: 56px; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--cover-bg); }
.ms-feat__thumb img, .ms-feat__thumb svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.ms-feat__thumb img { position: absolute; inset: 0; }
.ms-feat__txt b { display: block; font-size: 0.9375rem; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.ms-feat__txt small { color: var(--mp-fg-subtle); font-size: 0.8125rem; }
.ms-feat__price { font-weight: 650; font-size: 0.9375rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Category bento ──────────────────────────────────────────────────────── */
.ms-bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.ms-tile {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 216px; padding: 24px;
    border-radius: var(--mp-radius-lg); overflow: hidden; background: linear-gradient(180deg, var(--ms-surface-3), var(--mp-surface));
    box-shadow: var(--ms-shadow-sm); transition: box-shadow 0.25s;
}
html:not([data-theme="dark"]) .ms-tile { background: var(--mp-surface); }
.ms-tile:hover { box-shadow: 0 1px 0 var(--ms-hi) inset, 0 0 0 1px var(--ms-primary-line), 0 22px 44px -26px rgb(139 0 255 / 0.6); }
.ms-tile:has(h3 a:focus-visible) { outline: 2px solid var(--mp-ring); outline-offset: 2px; }
.ms-tile--1, .ms-tile--2 { grid-column: span 3; min-height: 260px; }
.ms-tile--3, .ms-tile--4, .ms-tile--5 { grid-column: span 2; }
.ms-tile__art { position: absolute; right: -3%; top: 6%; width: 56%; max-width: 300px; transition: translate 0.35s var(--mp-ease); pointer-events: none; }
.ms-tile--3 .ms-tile__art, .ms-tile--4 .ms-tile__art, .ms-tile--5 .ms-tile__art { width: 62%; right: -8%; top: -2%; }
.ms-tile__art svg { display: block; width: 100%; height: auto; overflow: visible; }
.ms-tile:hover .ms-tile__art { translate: 0 -6px; }
.ms-tile h3 { position: relative; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.03em; }
.ms-tile h3 a { color: var(--mp-fg); text-decoration: none; }
.ms-tile h3 a:focus-visible { outline: none; }
.ms-tile h3 a::after { content: ""; position: absolute; inset: -300px; }
.ms-tile p { position: relative; margin-top: 6px; max-width: 28ch; font-size: 0.875rem; color: var(--mp-fg-muted); }
.ms-tile--3 p, .ms-tile--4 p, .ms-tile--5 p { max-width: 20ch; }

/* ── Picks: tabs + library cards ─────────────────────────────────────────── */
.ms-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--ms-surface-3); box-shadow: 0 0 0 1px var(--ms-hairline) inset; }
.ms-tabs::-webkit-scrollbar { display: none; }
.ms-tabs button {
    display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 15px; border: 0; border-radius: 8px; background: transparent;
    font: 550 0.875rem/1 var(--mp-font-text); color: var(--mp-fg-muted); white-space: nowrap; cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.ms-tabs button:hover { color: var(--mp-fg); }
.ms-tabs button[aria-selected="true"] { background: var(--mp-surface); color: var(--mp-fg); box-shadow: 0 0 0 1px var(--mp-border-strong), 0 1px 0 var(--ms-hi) inset; }
.ms-tabs button:focus-visible { outline: 2px solid var(--mp-ring); outline-offset: 1px; }
.ms-tabs .mp-i { width: 15px; height: 15px; }
.ms-home .mp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* ── Free products: horizontal cards ─────────────────────────────────────── */
.ms-free-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ms-free-list .mp-product { display: grid; grid-template-columns: 116px minmax(0, 1fr); }
.ms-free-list .mp-product:hover { box-shadow: 0 1px 0 var(--ms-hi) inset, 0 0 0 1px var(--ms-primary-line); }
.ms-free-list .mp-well { aspect-ratio: auto; height: 100%; min-height: 150px; }
.ms-free-list .mp-product__body { padding: 12px 14px; }
/* The narrow cover has no room for badges (the whole block says "free") or the heart. */
.ms-free-list .mp-tags, .ms-free-list .mp-fav { display: none; }

/* ── Studio services ─────────────────────────────────────────────────────── */
.ms-svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.ms-svc-grid:empty { display: none; }
.ms-scard {
    position: relative; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--mp-surface);
    box-shadow: var(--ms-shadow-sm); transition: box-shadow 0.25s;
}
.ms-scard:hover { box-shadow: 0 1px 0 var(--ms-hi) inset, 0 0 0 1px var(--ms-primary-line), 0 22px 44px -26px rgb(139 0 255 / 0.55); }
.ms-scard:has(h3 a:focus-visible) { outline: 2px solid var(--mp-ring); outline-offset: 2px; }
.ms-scard__img {
    position: relative; aspect-ratio: 16 / 10; display: grid; place-items: end center; overflow: hidden;
    background: radial-gradient(70% 90% at 50% 100%, rgb(139 0 255 / 0.32), transparent 70%), var(--ms-surface-3);
}
.ms-scard__img::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px var(--mp-img-outline); pointer-events: none; }
.ms-scard__img img { height: 92%; width: auto; max-width: 92%; object-fit: contain; object-position: bottom; transition: scale 0.6s var(--mp-ease); }
.ms-scard:hover .ms-scard__img img { scale: 1.04; }
.ms-scard__body { display: grid; gap: 8px; align-content: start; flex: 1; padding: 16px 18px 18px; }
.ms-scard h3 { font-size: 1.0938rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.ms-scard h3 a { color: var(--mp-fg); text-decoration: none; }
.ms-scard h3 a:focus-visible { outline: none; }
.ms-scard h3 a::after { content: ""; position: absolute; inset: 0; }
.ms-scard p { font-size: 0.875rem; color: var(--mp-fg-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ms-price { margin-top: auto; padding-top: 6px; font-size: 0.84rem; color: var(--mp-fg-subtle); font-variant-numeric: tabular-nums; }
.ms-price b { color: var(--mp-fg); font-weight: 600; }

.ms-why { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.ms-why li { display: flex; align-items: flex-start; gap: 12px; padding: 18px; border-radius: 16px; }
.ms-why .mp-i { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--mp-success); }
.ms-why li > span { display: block; font-size: 0.875rem; line-height: 1.5; color: var(--mp-fg-muted); }
.ms-why b { display: block; margin-bottom: 4px; font-size: 0.9375rem; font-weight: 650; color: var(--mp-fg); }

/* ── Portfolio mosaic ────────────────────────────────────────────────────── */
.ms-pf-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 220px; gap: 16px; }
.ms-pf { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: var(--ms-surface-3); box-shadow: var(--ms-shadow-sm); grid-column: span 4; }
.ms-pf--p1 { grid-column: span 7; grid-row: span 2; }
.ms-pf--p2, .ms-pf--p3 { grid-column: span 5; }
.ms-pf img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: scale 0.7s var(--mp-ease); }
.ms-pf:hover img { scale: 1.04; }
.ms-pf::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--mp-img-outline); pointer-events: none; }
.ms-pf figcaption {
    position: absolute; inset: auto 0 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 44px 20px 18px;
    background: linear-gradient(0deg, rgb(6 6 10 / 0.9), rgb(6 6 10 / 0)); color: #f1f1f6;
}
.ms-pf figcaption b { font-size: 1.0625rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
.ms-pf--p1 figcaption b { font-size: 1.3125rem; }
.ms-pf .ms-badge {
    min-height: 0; padding: 4px 9px; border: 0; border-radius: 6px; background: rgb(255 255 255 / 0.14); color: #fff;
    font: 600 0.75rem/1 var(--mp-font-text); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* ── Reviews ─────────────────────────────────────────────────────────────── */
.ms-rv-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ms-rv { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 24px; border-radius: 16px; }
.ms-stars { display: inline-flex; gap: 2px; color: var(--mp-primary-text); }
.ms-stars .mp-i { width: 15px; height: 15px; fill: currentColor; stroke-width: 1.5; }
.ms-rv blockquote { margin: 0; }
.ms-rv p { font-size: 0.97rem; line-height: 1.6; }
.ms-rv figcaption { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.ms-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; background: var(--ms-surface-3); outline: 1px solid var(--mp-img-outline); outline-offset: -1px; }
.ms-rv figcaption b { display: block; font-size: 0.9rem; line-height: 1.2; }
.ms-rv figcaption small { color: var(--mp-fg-subtle); font-size: 0.8125rem; }

/* ── Closing CTA ─────────────────────────────────────────────────────────── */
.ms-cta-box {
    position: relative; overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px;
    padding: 56px; border-radius: 24px; background: var(--mp-surface); box-shadow: 0 0 0 1px var(--ms-hairline), 0 1px 0 var(--ms-hi) inset, var(--ms-shadow-lg);
}
.ms-cta-box::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image: linear-gradient(30deg, var(--ms-hairline) 1px, transparent 1px), linear-gradient(150deg, var(--ms-hairline) 1px, transparent 1px);
    background-size: 56px 32px; -webkit-mask-image: linear-gradient(90deg, transparent 10%, #000); mask-image: linear-gradient(90deg, transparent 10%, #000);
}
.ms-cta-box h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; max-width: 18ch; }
.ms-cta-box p { margin-top: 14px; max-width: 48ch; color: var(--mp-fg-muted); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .ms-home .mp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ms-free-list { grid-template-columns: 1fr 1fr; }
    .ms-free-list .mp-product:nth-child(3) { grid-column: 1 / -1; }
    .ms-why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .ms-hero__in { grid-template-columns: minmax(0, 1fr); }
    .ms-hero__art { max-width: 560px; margin-inline: auto; width: 100%; }
    .ms-hero h1 { max-width: 16ch; }
    .ms-home .mp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ms-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ms-tile--1, .ms-tile--2, .ms-tile--3, .ms-tile--4, .ms-tile--5 { grid-column: span 1; min-height: 230px; }
    .ms-tile--5 { grid-column: span 2; }
    .ms-pf-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 190px; }
    .ms-pf--p1 { grid-column: span 6; grid-row: span 2; }
    .ms-pf--p2, .ms-pf--p3, .ms-pf--p4, .ms-pf--p5 { grid-column: span 3; }
    .ms-pf--p6 { grid-column: span 6; }
    .ms-rv-list { grid-template-columns: 1fr 1fr; }
    .ms-cta-box { grid-template-columns: minmax(0, 1fr); padding: 36px; }
}
@media (max-width: 760px) {
    .ms-head { margin-bottom: 26px; }
    .ms-hero__in { padding-block: 40px 36px; }
    /* Stacked hero: the glow sits behind the art (lower half), spanning the full width so no edge shows. */
    .ms-hero::before { inset: 35% -30% auto -30%; width: auto; height: 70%; background-position: center; }
    .ms-hero__art { aspect-ratio: auto; }
    .ms-hero__art > svg { position: relative; display: block; height: auto; }
    .ms-feat { position: relative; left: auto; bottom: auto; width: 100%; margin-top: -24px; }
    .ms-free-list { grid-template-columns: minmax(0, 1fr); }
    .ms-free-list .mp-product { grid-template-columns: 104px minmax(0, 1fr); }
    .ms-rv-list { grid-template-columns: minmax(0, 1fr); }
    .ms-rv:nth-child(n+4) { display: none; }
    .ms-tabs button, .ms-link { min-height: 44px; }
    .ms-tabs button { padding-inline: 14px; }
}
@media (max-width: 520px) {
    .ms-home .mp-grid { gap: 12px; }
    .ms-tile { padding: 18px; min-height: 210px; }
    .ms-tile h3 { font-size: 1.25rem; }
    .ms-tile__art { width: 66%; }
    .ms-cta .mp-btn, .ms-cta-box .mp-btn { flex: 1; }
    .ms-compat .ms-sep { display: none; }
    .ms-why { grid-template-columns: minmax(0, 1fr); }
    .ms-scard { flex-direction: row; }
    .ms-scard__img { aspect-ratio: auto; width: 120px; flex: none; }
    .ms-pf-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 170px; }
    .ms-pf--p1, .ms-pf--p2, .ms-pf--p3, .ms-pf--p4, .ms-pf--p5, .ms-pf--p6 { grid-column: auto; grid-row: auto; }
    .ms-pf--p1 figcaption b { font-size: 1.0625rem; }
    .ms-cta-box { padding: 26px; border-radius: 20px; }
}
@media (max-width: 420px) {
    .ms-home .mp-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .ms-feat, .ms-tile, .ms-tile__art, .ms-scard, .ms-pf img, .ms-scard__img img, .ms-link .mp-i { transition: none; }
    .ms-feat:hover, .ms-tile:hover .ms-tile__art, .ms-link:hover .mp-i { translate: none; }
    .ms-pf:hover img, .ms-scard:hover .ms-scard__img img { scale: none; }
}
