/* =============================================================================
   Stellium — Digital Products Studio
   main.css : one design system for the whole storefront.
   Palette: deep indigo ink, soft "stellium" violet, warm gold accent, paper.
   ========================================================================== */

:root {
    --ink:        #16161f;
    --ink-soft:   #3a3a4d;
    --muted:      #6b6b80;
    --line:       #e7e4ef;
    --paper:      #ffffff;
    --paper-2:    #faf9fd;
    --paper-3:    #f2f0f9;

    --violet:     #6c5ce7;
    --violet-600: #5a49d6;
    --violet-050: #efecfd;
    --gold:       #d9a441;
    --gold-050:   #fbf3e2;
    --green:      #2f9e6f;
    --red:        #d9534f;

    --radius:     14px;
    --radius-sm:  9px;
    --radius-lg:  22px;
    --shadow-sm:  0 1px 2px rgba(22,22,31,.06), 0 1px 8px rgba(22,22,31,.05);
    --shadow-md:  0 6px 24px rgba(22,22,31,.09);
    --shadow-lg:  0 18px 50px rgba(22,22,31,.16);

    --container:  1160px;
    --font:       "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --font-head:  "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
}

/* ---- reset / base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--paper-2);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--violet-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.15; font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.15rem); letter-spacing: -.5px; }
h2 { font-size: clamp(1.55rem, 3vw, 2.25rem); letter-spacing: -.3px; }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1rem; }
small { color: var(--muted); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 22px; }
.section { padding: 72px 0; }
.section--tight { padding: 44px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .74rem; font-weight: 700; color: var(--violet-600); margin: 0 0 .6rem; }
.stack > * + * { margin-top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- buttons ------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font: inherit; font-weight: 600; cursor: pointer;
    padding: .72rem 1.4rem; border-radius: 999px; border: 1.5px solid transparent;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--violet); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--violet-600); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--violet); color: var(--violet-600); }
.btn--gold { background: var(--gold); color: #2a1f05; }
.btn--gold:hover { filter: brightness(1.04); }
.btn--block { width: 100%; }
.btn--sm { padding: .5rem 1rem; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---- badges / pills ----------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700;
    padding: .28rem .6rem; border-radius: 999px; letter-spacing: .02em; }
.badge--sub { background: var(--gold-050); color: #8a6410; }
.badge--new { background: var(--violet-050); color: var(--violet-600); }
.badge--cat { background: var(--paper-3); color: var(--ink-soft); }

/* ---- header / nav ------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.86); backdrop-filter: saturate(1.2) blur(10px);
    border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-head);
    font-weight: 600; font-size: 1.3rem; color: var(--ink); letter-spacing: -.3px; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--violet), var(--gold)); border-radius: 9px; color: #fff; font-size: 1rem; }
.nav__links { display: flex; gap: 1.15rem; margin-left: .5rem; }
.nav__links a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--violet-600); text-decoration: none; }
.nav__spacer { flex: 1; }
.nav__actions { display: flex; align-items: center; gap: .85rem; }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-soft); font-weight: 500; }
.cart-count { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--violet);
    color: #fff; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.cart-count[data-empty="true"] { background: var(--muted); }
.nav__toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--ink); }

@media (max-width: 860px) {
    .nav__links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column;
        background: var(--paper); border-bottom: 1px solid var(--line); padding: 1rem 22px; gap: 1rem; }
    .nav__links.is-open { display: flex; }
    .nav__toggle { display: block; }
}

/* ---- hero --------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background:
    radial-gradient(1200px 500px at 82% -10%, var(--violet-050), transparent 60%),
    radial-gradient(900px 400px at 5% 110%, var(--gold-050), transparent 55%), var(--paper-2); }
.hero__inner { padding: 90px 0 76px; max-width: 760px; }
.hero h1 { margin-bottom: .35em; }
.hero .lead { margin-bottom: 1.8rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero__trust { margin-top: 1.8rem; color: var(--muted); font-size: .9rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ---- grids -------------------------------------------------------------- */
.grid { display: grid; gap: 24px; }
.grid--products { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid--cats { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---- cards -------------------------------------------------------------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.card--pad { padding: 26px; }

.product-card { transition: transform .15s ease, box-shadow .2s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.product-card__media { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--paper-3), var(--violet-050));
    display: grid; place-items: center; position: relative; }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.product-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.product-card__cat { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.product-card__name { font-family: var(--font-head); font-size: 1.08rem; color: var(--ink); margin: 0; }
.product-card__summary { font-size: .9rem; color: var(--ink-soft); margin: 0; flex: 1; }
.product-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; }
.price { font-weight: 700; color: var(--ink); font-size: 1.08rem; }
.price small { color: var(--muted); font-weight: 500; }

.cat-card { padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper);
    display: flex; flex-direction: column; gap: .4rem; transition: border-color .15s ease, transform .15s ease; }
.cat-card:hover { border-color: var(--violet); transform: translateY(-2px); text-decoration: none; }
.cat-card__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--violet-050); color: var(--violet-600);
    display: grid; place-items: center; font-size: 1.15rem; margin-bottom: .3rem; }
.cat-card h3 { font-size: 1.02rem; margin: 0; }
.cat-card p { font-size: .85rem; color: var(--muted); margin: 0; }

/* ---- panels / callouts -------------------------------------------------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-sm); }
.callout-sub { background: linear-gradient(120deg, #1d1b3a, #3a2f6e); color: #fff; border-radius: var(--radius-lg);
    padding: 48px; position: relative; overflow: hidden; }
.callout-sub h2, .callout-sub h3 { color: #fff; }
.callout-sub .lead { color: rgba(255,255,255,.82); }
.callout-sub::after { content: ""; position: absolute; inset: auto -60px -80px auto; width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(217,164,65,.4), transparent 70%); }

.feature { display: flex; gap: .9rem; align-items: flex-start; }
.feature__icon { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--gold-050); color: #8a6410;
    display: grid; place-items: center; font-size: 1.15rem; }
.feature h3 { font-size: 1.05rem; margin: .1rem 0 .25rem; }
.feature p { font-size: .92rem; color: var(--ink-soft); margin: 0; }

/* ---- forms -------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.field input, .field textarea, .field select {
    font: inherit; padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: var(--paper); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-050); }
.field textarea { min-height: 130px; resize: vertical; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form__note { font-size: .85rem; color: var(--muted); }
.form__note a { text-decoration: underline; }

/* ---- messages / toast --------------------------------------------------- */
.form-message { border-radius: var(--radius-sm); padding: .7rem .9rem; font-size: .9rem; display: none; }
.form-message.is-shown { display: block; }
.form-message--error { background: #fdecec; color: #96302d; border: 1px solid #f4c9c7; }
.form-message--ok { background: #e8f6ef; color: #1f6b4b; border: 1px solid #c3e6d5; }

.banner { border-radius: var(--radius-sm); padding: .7rem 1rem; font-size: .9rem; margin-bottom: 1rem; }
.banner--warn { background: var(--gold-050); color: #7a5710; border: 1px solid #ecd6a2; }

.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: .6rem; }
.toast { background: var(--ink); color: #fff; padding: .8rem 1.1rem; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); font-size: .92rem; opacity: 0; transform: translateY(10px); transition: all .25s ease; max-width: 320px; }
.toast.is-shown { opacity: 1; transform: translateY(0); }
.toast--ok { background: #1f6b4b; }
.toast--error { background: #a2312d; }

/* ---- tables (orders / library) ----------------------------------------- */
.data-list { display: flex; flex-direction: column; gap: 14px; }
.order-row, .library-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--paper); }
.order-row__head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.order-row__ref { font-weight: 700; }
.status-pill { font-size: .74rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; }
.status-pill--paid { background: #e8f6ef; color: #1f6b4b; }
.status-pill--pending { background: var(--gold-050); color: #8a6410; }

/* ---- cart --------------------------------------------------------------- */
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center;
    padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item__thumb { width: 72px; height: 56px; border-radius: 8px; background: var(--paper-3); object-fit: cover; }
.cart-item__name { font-weight: 600; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { border: 0; background: var(--paper-2); width: 30px; height: 30px; cursor: pointer; font-size: 1rem; color: var(--ink); }
.qty span { min-width: 30px; text-align: center; font-weight: 600; }
.link-danger { color: var(--red); background: none; border: 0; cursor: pointer; font-size: .85rem; padding: 0; }
.summary-row { display: flex; justify-content: space-between; padding: .4rem 0; }
.summary-row--total { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .8rem; font-weight: 700; font-size: 1.15rem; }

@media (max-width: 780px) {
    .cart-layout { grid-template-columns: 1fr; }
    .form__row { grid-template-columns: 1fr; }
}

/* ---- product detail ----------------------------------------------------- */
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: start; }
.pdp__media { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background:
    linear-gradient(135deg, var(--paper-3), var(--violet-050)); aspect-ratio: 4/3; display: grid; place-items: center; }
.pdp__meta { display: flex; gap: .6rem; flex-wrap: wrap; margin: .4rem 0 1rem; }
.pdp__price { font-size: 2rem; font-weight: 700; font-family: var(--font-head); }
.spec-list { list-style: none; padding: 0; margin: 1.2rem 0; border-top: 1px solid var(--line); }
.spec-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.spec-list dt, .spec-list .k { color: var(--muted); }
@media (max-width: 820px) { .pdp { grid-template-columns: 1fr; gap: 26px; } }

/* ---- pricing tiers (membership) ---------------------------------------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.tier { border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 30px; background: var(--paper); display: flex; flex-direction: column; }
.tier--featured { border-color: var(--violet); box-shadow: var(--shadow-md); position: relative; }
.tier--featured::before { content: "Most popular"; position: absolute; top: -12px; left: 30px; background: var(--violet); color: #fff;
    font-size: .72rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; }
.tier__price { font-family: var(--font-head); font-size: 2.3rem; font-weight: 600; margin: .3rem 0; }
.tier__price small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.tier ul { list-style: none; padding: 0; margin: 1rem 0 1.6rem; display: flex; flex-direction: column; gap: .55rem; }
.tier li { padding-left: 1.6rem; position: relative; font-size: .93rem; color: var(--ink-soft); }
.tier li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

/* ---- toolbar / filters -------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 26px; }
.chip { border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-soft); border-radius: 999px;
    padding: .4rem .9rem; font-size: .88rem; cursor: pointer; font: inherit; transition: all .15s ease; }
.chip:hover { border-color: var(--violet); color: var(--violet-600); }
.chip[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.toolbar__spacer { flex: 1; }

/* ---- prose (legal / resources) ----------------------------------------- */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.4rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

.article-card { display: flex; flex-direction: column; gap: .5rem; }
.article-card time { font-size: .82rem; color: var(--muted); }

/* ---- footer ------------------------------------------------------------- */
.site-footer { background: #14131f; color: #c9c7d6; margin-top: 40px; }
.site-footer a { color: #c9c7d6; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding: 56px 0 30px; }
.footer-brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-size: 1.25rem; color: #fff; }
.footer-col h4 { color: #fff; font-family: var(--font); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .9rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; font-size: .92rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; display: flex; justify-content: space-between;
    flex-wrap: wrap; gap: .6rem; font-size: .85rem; color: #86849a; }
.footer-url { color: #fff; font-weight: 600; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---- misc --------------------------------------------------------------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, var(--paper-3) 25%, #ece9f5 37%, var(--paper-3) 63%);
    background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: var(--radius); }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
