/* The creator's public page (ADR-0017). One layout grammar; the look comes
   from theme tokens set as custom properties on .cp (CreatorPage::Theme).
   Plain CSS, served alone on the page so a visitor loads nothing else. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.cp-body { margin: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.cp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cp {
  --r: 14px; --r-media: 12px;
  --sys: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  position: relative; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}
.cp[data-background="gradient"] { background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%); }
.cp[data-corners="square"] { --r: 6px; --r-media: 4px; }
.cp[data-corners="rounded"] { --r: 14px; --r-media: 10px; }
.cp[data-corners="pill"] { --r: 999px; --r-media: 18px; }
.cp ::selection { background: var(--text); color: var(--bg); }
.cp a { color: inherit; }
.cp :focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.cp button { font: inherit; color: inherit; cursor: pointer; }

/* Own photo as wallpaper: fixed behind the column with a scrim toward the ground. */
.cp-wallpaper { position: fixed; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.cp-wallpaper::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent), color-mix(in srgb, var(--bg) 82%, transparent)); }

.cp-stage { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
@media (min-width: 720px) { .cp-stage { padding-top: 32px; } }

.cp-inapp { position: relative; z-index: 2; margin: 0; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); display: flex; gap: 10px; align-items: center; font-size: 13px; line-height: 1.35; background: var(--text); color: var(--bg); }
.cp-inapp svg { width: 18px; height: 18px; flex: none; }
.cp-inapp a { margin-left: auto; text-decoration: none; background: var(--bg); color: var(--text); font-weight: 600; font-size: 12px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }

.cp-top { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 3; }
.cp-iconbtn { width: 40px; height: 40px; border-radius: 999px; border: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 72%, transparent); color: var(--text); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cp-iconbtn svg { width: 18px; height: 18px; }

/* Header */
.cp-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(64px + env(safe-area-inset-top, 0px)) 20px 0; }
.cp-avatar { width: 96px; height: 96px; border-radius: 999px; object-fit: cover; }
.cp-avatar-empty { display: grid; place-items: center; background: color-mix(in srgb, var(--text) 12%, var(--bg)); font-family: var(--font-head); font-weight: var(--head-weight); font-size: 38px; }
.cp-id { display: flex; flex-direction: column; align-items: center; }
.cp-name { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); font-size: 27px; line-height: 1.1; margin: 14px 0 0; text-wrap: balance; overflow-wrap: anywhere; }
.cp-bio { margin: 6px 0 0; color: var(--muted); max-width: 30ch; text-wrap: pretty; }
.cp-socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 12px; }
.cp-social { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; color: var(--text); }
.cp-social:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
.cp-social svg { width: 23px; height: 23px; }

.cp[data-header="hero"] .cp-head { padding: 0; }
.cp-hero { position: relative; width: 100%; height: min(112vw, 440px); overflow: hidden; }
.cp-hero img, .cp-hero-empty { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: linear-gradient(180deg, #000 52%, transparent 100%); mask-image: linear-gradient(180deg, #000 52%, transparent 100%); }
.cp-hero-empty { background: color-mix(in srgb, var(--text) 16%, var(--bg)); }
@media (min-width: 720px) { .cp-hero { border-radius: 28px 28px 0 0; } }
.cp[data-header="hero"] .cp-id { margin-top: -118px; padding: 0 20px; position: relative; }
.cp[data-header="hero"] .cp-name { font-size: 33px; margin-top: 0; }

/* Links | Shop */
.cp-switch { display: flex; justify-content: center; margin: 18px 0 2px; }
.cp-switch-track { display: inline-flex; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.cp-switch a { text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 24px; border-radius: 999px; }
.cp-switch a[aria-current="page"] { background: var(--text); color: var(--bg); }

/* Blocks */
.cp-blocks { display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 0; }
.cp-heading { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); font-size: 17px; line-height: 1.25; margin: 16px 2px -2px; }
.cp-empty { text-align: center; color: var(--muted); padding: 24px 8px; margin: 0; }

.cp-surface { position: relative; display: block; text-decoration: none; background: var(--btn-bg); color: var(--btn-text); border-radius: var(--r); transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s cubic-bezier(.2,.8,.2,1); }
.cp[data-button="soft_shadow"] .cp-surface { box-shadow: 0 1px 2px rgba(20,20,20,.06), 0 6px 18px -6px rgba(20,20,20,.16); }
.cp[data-button="hard_shadow"] .cp-surface { border: 2px solid var(--edge); box-shadow: 4px 4px 0 var(--edge); }
.cp[data-button="outline"] .cp-surface { background: transparent; color: var(--text); border: 1px solid color-mix(in srgb, var(--text) 36%, transparent); }
.cp[data-button="glass"] .cp-surface { background: color-mix(in srgb, #fff 13%, transparent); border: 1px solid color-mix(in srgb, #fff 22%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
a.cp-surface:active { transform: scale(.985); }
.cp[data-button="hard_shadow"] a.cp-surface:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--edge); }
@media (hover: hover) {
  .cp[data-button="soft_shadow"] a.cp-surface:hover { box-shadow: 0 1px 2px rgba(20,20,20,.06), 0 10px 24px -8px rgba(20,20,20,.22); }
  .cp[data-button="outline"] a.cp-surface:hover, .cp[data-button="glass"] a.cp-surface:hover { border-color: color-mix(in srgb, var(--text) 60%, transparent); }
}

.cp-ad { font-size: 11px; font-weight: 600; letter-spacing: .01em; opacity: .75; white-space: nowrap; }

.cp-link { display: flex; align-items: center; justify-content: center; min-height: 58px; padding: 10px 58px; text-align: center; font-weight: 600; overflow-wrap: anywhere; }
.cp-link-thumb { position: absolute; left: 8px; top: 50%; translate: 0 -50%; width: 42px; height: 42px; border-radius: min(var(--r), 10px); overflow: hidden; }
.cp-link-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cp-feature { overflow: hidden; }
.cp[data-corners="pill"] .cp-feature, .cp[data-corners="pill"] .cp-product, .cp[data-corners="pill"] .cp-video-card { border-radius: 28px; }
.cp-feature-media, .cp-product-media { display: block; aspect-ratio: 16 / 10; margin: 8px 8px 0; border-radius: var(--r-media); overflow: hidden; }
.cp-feature-media img, .cp-product-media img { width: 100%; height: 100%; object-fit: cover; }
.cp-feature-title { display: block; padding: 12px 16px 14px; text-align: center; font-weight: 600; }

.cp-code { padding: 12px 12px 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand brand" "save chip" "note note"; gap: 2px 10px; align-items: center; }
.cp[data-corners="pill"] .cp-code { border-radius: 26px; padding-left: 22px; }
.cp-code-brand { grid-area: brand; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 13px; }
.cp-code-brand > span:first-child { opacity: .8; }
.cp-code-save { grid-area: save; min-width: 0; text-decoration: none; font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); font-size: 17px; line-height: 1.2; text-wrap: balance; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
.cp .cp-code-chip { grid-area: chip; display: flex; align-items: center; gap: 8px; min-height: 44px; border: 1.5px dashed currentColor; border-radius: min(var(--r), 12px); padding: 5px 5px 5px 11px; background: transparent; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.cp-code-chip .cp-copy { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: currentColor; }
.cp-code-chip .cp-copy svg { width: 15px; height: 15px; color: var(--btn-bg); }
.cp[data-button="outline"] .cp-code-chip .cp-copy svg, .cp[data-button="glass"] .cp-code-chip .cp-copy svg { color: var(--bg); }
.cp-code-chip.is-copied { border-style: solid; }
.cp-code-note { grid-area: note; margin: 6px 0 0; font-size: 13px; opacity: .8; }

.cp-product { overflow: hidden; }
.cp-product-body { display: grid; gap: 2px; padding: 12px 16px 16px; }
.cp-product-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; opacity: .85; }
.cp-product-title { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); font-size: 18px; line-height: 1.2; }
.cp-product-code { font-size: 13px; opacity: .85; }
.cp-price { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; margin-top: 4px; font-weight: 600; }
.cp-price s { font-weight: 400; opacity: .65; }
.cp-cta { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px; font-weight: 600; font-size: 14px; border-radius: min(var(--r), 12px); background: var(--btn-text); color: var(--btn-bg); }
.cp[data-button="outline"] .cp-cta, .cp[data-button="glass"] .cp-cta { background: var(--text); color: var(--bg); }
.cp[data-corners="pill"] .cp-cta { border-radius: 999px; }
.cp-cta svg { width: 15px; height: 15px; }

/* Collections and cards */
.cp-coll-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 10px 2px 10px; }
.cp-coll-head h2 { margin: 0; font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); font-size: 17px; line-height: 1.25; }
.cp-coll-head span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cp-coll-items { display: grid; gap: 10px; }
.cp-coll[data-layout="grid"] .cp-coll-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-coll[data-layout="carousel"] .cp-coll-items, .cp-video-items { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 2px 18px 10px; scroll-padding: 0 18px; scrollbar-width: none; }
.cp-coll[data-layout="carousel"] .cp-coll-items::-webkit-scrollbar, .cp-video-items::-webkit-scrollbar { display: none; }
.cp-coll[data-layout="carousel"] .cp-card, .cp-video-items .cp-card { flex: 0 0 136px; scroll-snap-align: start; }
.cp[data-button="hard_shadow"] .cp-coll[data-layout="carousel"] .cp-coll-items, .cp[data-button="hard_shadow"] .cp-video-items { padding-right: 22px; }
.cp-coll[data-layout="stack"] .cp-card { display: grid; grid-template-columns: 72px 1fr; align-items: center; }
.cp-coll[data-layout="stack"] .cp-card-media { margin: 6px; aspect-ratio: 1; }
.cp-card { overflow: hidden; }
.cp[data-corners="pill"] .cp-card { border-radius: 22px; }
.cp-card-media { position: relative; display: block; aspect-ratio: 1; margin: 6px 6px 0; border-radius: max(calc(var(--r-media) - 4px), 4px); overflow: hidden; background: color-mix(in srgb, currentColor 8%, transparent); }
.cp-card-media img { width: 100%; height: 100%; object-fit: cover; }
.cp-card-media .cp-ad { position: absolute; left: 6px; top: 6px; background: rgba(255,255,255,.92); color: #1b1b1b; opacity: 1; padding: 1px 6px; border-radius: 999px; font-size: 10px; }
.cp-card-body { display: grid; padding: 8px 10px 10px; }
.cp-card-title { font-size: 13px; line-height: 1.25; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.cp-card .cp-price { font-size: 13px; gap: 0 6px; }
.cp-card-vendor { font-size: 12px; opacity: .75; }

.cp-video { display: grid; gap: 10px; }
.cp-video-card { overflow: hidden; }
.cp-video-media { position: relative; display: block; aspect-ratio: 4 / 5; margin: 8px 8px 0; border-radius: var(--r-media); overflow: hidden; background: color-mix(in srgb, currentColor 10%, transparent); }
.cp-video-media img { width: 100%; height: 100%; object-fit: cover; }
.cp-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 56px; height: 56px; border-radius: 999px; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cp-play svg { width: 24px; height: 24px; margin-left: 3px; }
.cp-video-title { display: block; padding: 12px 16px 14px; font-weight: 600; text-align: center; }

/* Footer and feedback */
.cp-foot { margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; color: var(--muted); }
.cp-foot nav { display: flex; gap: 18px; }
.cp-foot a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.cp-foot .cp-made { text-decoration: none; }
.cp-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); translate: -50% 12px; opacity: 0; z-index: 10; pointer-events: none; white-space: nowrap; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 999px; transition: opacity .2s, translate .25s cubic-bezier(.2,.8,.2,1); }
.cp-toast.is-on { opacity: 1; translate: -50% 0; }

@media (prefers-reduced-motion: reduce) { .cp-surface, .cp-toast { transition: none; } }
