/* Crystal Bracelet — design system
   Dark, luxe, mineral. Each product carries its own --accent (the real colour of the
   stone, from the DB) which drives its aura, glow and hover state. That is the whole
   trick: one layout, thirteen different moods, all driven by data. */

:root {
    --bg:        #0a0810;
    --bg-2:      #120e1c;
    --bg-3:      #1a1428;
    --surface:   rgba(255,255,255,.035);
    --surface-2: rgba(255,255,255,.06);
    --line:      rgba(255,255,255,.09);
    --line-2:    rgba(255,255,255,.16);
    --text:      #f2eef8;
    --text-2:    #b8b0cc;
    --text-3:    #7d7593;
    --gold:      #d9b56c;
    --gold-2:    #f0d9a3;
    --accent:    #8b5fc7;
    --accent2:   #3b2559;
    --radius:    18px;
    --radius-sm: 11px;
    --ease:      cubic-bezier(.22,.61,.36,1);
    --font-d:    'Cormorant Garamond', Georgia, serif;
    --font-b:    'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-b);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Ambient aurora — fixed, very slow drift. Sits behind everything. */
body::before {
    content: '';
    position: fixed;
    inset: -25%;
    z-index: -2;
    background:
        radial-gradient(48% 42% at 18% 12%, rgba(139,95,199,.20), transparent 62%),
        radial-gradient(42% 38% at 84% 22%, rgba(58,99,184,.16), transparent 62%),
        radial-gradient(46% 40% at 70% 86%, rgba(224,121,143,.13), transparent 62%),
        radial-gradient(38% 34% at 24% 78%, rgba(46,158,115,.10), transparent 62%);
    filter: blur(28px);
    animation: drift 34s ease-in-out infinite alternate;
}
@keyframes drift {
    0%   { transform: translate3d(0,0,0) scale(1); }
    50%  { transform: translate3d(2.5%,-2%,0) scale(1.07); }
    100% { transform: translate3d(-2%,2.5%,0) scale(1.03); }
}

/* Fine grain — kills the plastic look of big gradients */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .28;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: min(1200px, 92vw); margin-inline: auto; }
.wrap-narrow { width: min(760px, 92vw); margin-inline: auto; }

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--font-d); font-weight: 300; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
h3 { font-size: 1.35rem; }

.eyebrow {
    font-size: .72rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 500;
}
.lede { font-size: 1.1rem; color: var(--text-2); }
.muted { color: var(--text-3); }

/* Gold gradient text, used sparingly */
.shine {
    background: linear-gradient(100deg, var(--gold) 0%, var(--gold-2) 42%, var(--gold) 78%);
    background-size: 220% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 7s linear infinite;
}
@keyframes shine { to { background-position: 220% center; } }

/* ---------- header ---------- */

.hdr {
    position: sticky; top: 0; z-index: 60;
    backdrop-filter: blur(16px);
    background: rgba(10,8,16,.62);
    border-bottom: 1px solid transparent;
    transition: background .3s var(--ease), border-color .3s var(--ease);
}
.hdr.stuck { background: rgba(10,8,16,.9); border-bottom-color: var(--line); }
.hdr-in { display: flex; align-items: center; gap: 2rem; height: 74px; }

.logo { display: flex; align-items: center; gap: .6rem; font-family: var(--font-d); font-size: 1.4rem; letter-spacing: .02em; white-space: nowrap; flex: none; }
/* flex-basis must be explicit: `flex:none` alone still let the gem get squeezed to a
   sliver once the header ran out of room on 375px. */
.logo-gem { width: 24px; height: 24px; flex: 0 0 24px; animation: spin 14s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotateY(360deg); } }

.nav { display: flex; gap: 1.6rem; margin-left: auto; align-items: center; }
.nav a { font-size: .89rem; color: var(--text-2); position: relative; padding: .3rem 0; transition: color .2s; }
.nav a::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
    background: var(--gold); transition: width .3s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after, .nav a[aria-current]::after { width: 100%; }

.cart-btn {
    display: inline-flex; align-items: center; gap: .5rem;
    border: 1px solid var(--line-2); border-radius: 100px;
    padding: .5rem 1rem; font-size: .85rem;
    transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.cart-btn:hover { border-color: var(--gold); background: rgba(217,181,108,.09); transform: translateY(-1px); }
.cart-pill {
    background: var(--gold); color: #1a1206; font-weight: 700; font-size: .68rem;
    min-width: 18px; height: 18px; border-radius: 100px;
    display: grid; place-items: center; padding: 0 5px;
}
.burger { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; padding: .2rem .4rem; }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    padding: .92rem 1.9rem; border-radius: 100px;
    font-size: .9rem; font-weight: 500; letter-spacing: .02em;
    border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
    cursor: pointer; transition: all .28s var(--ease); font-family: var(--font-b);
}
.btn:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-2px); }
.btn-gold {
    background: linear-gradient(135deg, var(--gold), #c49a4e);
    color: #1a1206; border-color: transparent; font-weight: 600;
}
.btn-gold:hover { box-shadow: 0 12px 32px -8px rgba(217,181,108,.5); transform: translateY(-2px); }
.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-color: transparent; color: #fff; font-weight: 600;
}
.btn-accent:hover { box-shadow: 0 12px 32px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sm { padding: .6rem 1.15rem; font-size: .82rem; }

/* ---------- hero ---------- */

.hero { position: relative; padding: clamp(4rem, 9vw, 8rem) 0 clamp(3rem, 6vw, 6rem); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { margin-bottom: 1.4rem; }
.hero h1 em { font-style: italic; }
.hero .lede { max-width: 46ch; margin-bottom: 2.2rem; }
.hero-cta { display: flex; gap: .9rem; flex-wrap: wrap; }

.hero-media { position: relative; aspect-ratio: 4/5; border-radius: 200px 200px var(--radius) var(--radius); overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.2s var(--ease); }
.hero-media:hover img { transform: scale(1.12); }
.hero-media::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(10,8,16,.82), transparent 55%);
}
.hero-media::before {
    content: ''; position: absolute; inset: -2px; z-index: 2; border-radius: inherit;
    padding: 1px; pointer-events: none;
    background: linear-gradient(160deg, rgba(217,181,108,.6), transparent 40%, rgba(139,95,199,.45));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
}
.hero-badge {
    position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
    z-index: 3; backdrop-filter: blur(10px); background: rgba(10,8,16,.6);
    border: 1px solid var(--line-2); border-radius: 100px; padding: .5rem 1.1rem;
    font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
    white-space: nowrap;
}

.trust { display: flex; gap: 2.2rem; margin-top: 2.6rem; flex-wrap: wrap; }
.trust div { font-size: .8rem; color: var(--text-3); display: flex; align-items: center; gap: .45rem; }
.trust svg { color: var(--gold); flex: none; }

/* ---------- sections ---------- */

.sec { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.sec-head { margin-bottom: 2.8rem; }
.sec-head .eyebrow { display: block; margin-bottom: .8rem; }
.sec-head p { color: var(--text-2); max-width: 56ch; margin: .9rem 0 0; }

/* ---------- intention chips ---------- */

.chips { display: flex; gap: .6rem; flex-wrap: wrap; }
.chip {
    padding: .5rem 1.1rem; border-radius: 100px; border: 1px solid var(--line);
    font-size: .83rem; color: var(--text-2); background: var(--surface);
    transition: all .25s var(--ease); white-space: nowrap;
}
.chip:hover { border-color: var(--gold); color: var(--text); transform: translateY(-2px); }
.chip[aria-current] { background: var(--gold); color: #1a1206; border-color: transparent; font-weight: 600; }
.chip span { opacity: .55; font-size: .76em; margin-left: .2rem; }

/* ---------- product grid ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 1.5rem; }

.card {
    position: relative; border-radius: var(--radius); overflow: hidden;
    background: linear-gradient(165deg, var(--surface), rgba(255,255,255,.012));
    border: 1px solid var(--line);
    transition: transform .45s var(--ease), border-color .45s, box-shadow .45s;
    display: flex; flex-direction: column;
}
/* The aura: each card glows in its own stone's colour on hover */
.card::before {
    content: ''; position: absolute; inset: 0; z-index: 0; opacity: 0;
    background: radial-gradient(70% 55% at 50% 0%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%);
    transition: opacity .5s var(--ease);
}
.card:hover { transform: translateY(-7px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.card:hover::before { opacity: 1; }
.card:hover { box-shadow: 0 26px 60px -22px color-mix(in srgb, var(--accent) 55%, transparent); }

.card-media { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--accent2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .card-media img { transform: scale(1.09) rotate(-1.2deg); }
.card-media::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(10,8,16,.6), transparent 58%);
}
/* Sheen sweep on hover */
.card-media::before {
    content: ''; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; z-index: 2;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.13), transparent);
    transform: skewX(-18deg); transition: left .75s var(--ease);
}
.card:hover .card-media::before { left: 130%; }

.card-tag {
    position: absolute; top: .8rem; left: .8rem; z-index: 3;
    font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
    padding: .3rem .7rem; border-radius: 100px;
    background: color-mix(in srgb, var(--accent) 88%, black); color: #fff;
    box-shadow: 0 4px 14px -4px rgba(0,0,0,.6);
}
.card-save {
    position: absolute; top: .8rem; right: .8rem; z-index: 3;
    font-size: .64rem; font-weight: 700; letter-spacing: .06em;
    padding: .3rem .6rem; border-radius: 100px; background: var(--gold); color: #1a1206;
}
.card-body { padding: 1.15rem 1.15rem 1.3rem; position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.18rem; margin-bottom: .25rem; }
.card-tagline { font-size: .82rem; color: var(--text-3); font-style: italic; margin-bottom: .9rem; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.price { font-family: var(--font-d); font-size: 1.5rem; }
.price s { font-size: .7em; color: var(--text-3); margin-right: .35rem; font-family: var(--font-b); }
.stretch::after { content: ''; position: absolute; inset: 0; z-index: 4; }

/* ---------- product page ---------- */

.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); padding: 3rem 0; align-items: start; }
.pdp-media { position: sticky; top: 100px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; border: 1px solid var(--line); }
.pdp-media img { width: 100%; height: 100%; object-fit: cover; }
.pdp-media::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(60% 60% at 50% 40%, transparent, color-mix(in srgb, var(--accent) 22%, transparent));
}
.pdp h1 { font-size: clamp(2rem, 3.6vw, 3rem); margin-bottom: .4rem; }
.pdp-tagline { font-style: italic; color: var(--text-2); font-size: 1.05rem; margin-bottom: 1.6rem; }
.pdp-price { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 1.6rem; }
.pdp-price .price { font-size: 2.2rem; }

.spec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin: 1.8rem 0; }
.spec div { background: var(--bg-2); padding: .85rem 1rem; }
.spec dt { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: .2rem; }
.spec dd { margin: 0; font-size: .92rem; }

.prose { color: var(--text-2); }
.prose p { margin: 0 0 1rem; }
.prose em { color: var(--text); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 100px; overflow: hidden; }
.qty button { background: none; border: 0; color: var(--text); width: 38px; height: 44px; cursor: pointer; font-size: 1.1rem; transition: background .2s; }
.qty button:hover { background: var(--surface-2); }
.qty input { width: 40px; height: 44px; background: none; border: 0; color: var(--text); text-align: center; font-size: .95rem; font-family: var(--font-b); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.stock-line { font-size: .82rem; display: flex; align-items: center; gap: .5rem; margin-bottom: 1.2rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.18); flex: none; }
.dot.low { background: var(--gold); box-shadow: 0 0 0 3px rgba(217,181,108,.18); }
.dot.out { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.18); }

.care-note {
    border-left: 2px solid var(--accent); padding: .3rem 0 .3rem 1rem;
    font-size: .88rem; color: var(--text-2); margin: 1.6rem 0;
}

/* ---------- cart ---------- */

.cart-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 1.1rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-row img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); }
.totals { border-top: 1px solid var(--line-2); margin-top: 1.6rem; padding-top: 1.4rem; }
.totals-row { display: flex; justify-content: space-between; padding: .42rem 0; color: var(--text-2); font-size: .93rem; }
.totals-row.grand { color: var(--text); font-size: 1.35rem; font-family: var(--font-d); padding-top: .9rem; margin-top: .5rem; border-top: 1px solid var(--line); }

.ship-bar { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: .55rem 0 .3rem; }
.ship-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .6s var(--ease); }

/* ---------- notices ---------- */

.notice {
    border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    padding: .9rem 1.1rem; font-size: .89rem; margin-bottom: 1.4rem;
    background: var(--surface); color: var(--text-2);
}
.notice-warn { border-color: rgba(217,181,108,.45); background: rgba(217,181,108,.08); color: var(--gold-2); }

/* ---------- footer ---------- */

.ftr { border-top: 1px solid var(--line); margin-top: 4rem; padding: 3.5rem 0 2rem; background: rgba(0,0,0,.25); }
.ftr-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2.5rem; margin-bottom: 3rem; }
.ftr h4 { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); margin: 0 0 1.1rem; font-weight: 600; }
.ftr ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.ftr a { font-size: .89rem; color: var(--text-2); transition: color .2s; }
.ftr a:hover { color: var(--gold); }
.ftr-btm { border-top: 1px solid var(--line); padding-top: 1.6rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--text-3); }
.disclaimer { font-size: .76rem; color: var(--text-3); max-width: 68ch; margin-top: .8rem; line-height: 1.6; }

/* ---------- scroll reveal ----------
   Gated on .js (set by an inline script in <head>). Without JS the content is simply
   visible — never hide content behind a script that might not run. */

.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-media { aspect-ratio: 3/2; border-radius: var(--radius); order: -1; }
    .pdp { grid-template-columns: 1fr; }
    .pdp-media { position: static; }
    .ftr-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 640px) {
    /* 375px has to fit logo + cart + burger. Tighten everything rather than let the
       logo wrap onto two lines. */
    .hdr-in { gap: .6rem; }
    .logo { font-size: 1.12rem; }
    .cart-btn { padding: .45rem .75rem; }
    .cart-btn span:not(.cart-pill) { display: none; }   /* icon + count only */
    .nav { display: none; }
    .nav.open {
        display: flex; position: absolute; top: 74px; left: 0; right: 0;
        flex-direction: column; align-items: flex-start; gap: 0;
        background: rgba(10,8,16,.97); backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--line); padding: .5rem 4vw 1.2rem;
    }
    .nav.open a { padding: .85rem 0; width: 100%; border-bottom: 1px solid var(--line); }
    .burger { display: block; margin-left: auto; }
    .cart-btn { margin-left: .5rem; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
    /* Two cards to a 375px row leaves the intention tag and the discount badge fighting
       for the same strip — shrink both and let a long word ellipsis rather than collide. */
    .card-tag { font-size: .55rem; padding: .24rem .5rem; max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .card-save { font-size: .55rem; padding: .24rem .45rem; }
    .card-body { padding: .85rem .85rem 1rem; }
    .card-body h3 { font-size: 1rem; }
    .price { font-size: 1.2rem; }
    .spec { grid-template-columns: 1fr; }
    .ftr-grid { grid-template-columns: 1fr; }
    .cart-row { grid-template-columns: 64px 1fr; row-gap: .7rem; }
    .cart-row img { width: 64px; height: 64px; }
    .trust { gap: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    /* Must out-specify `.js .reveal` (0,2,0) or reduced-motion visitors keep the hidden
       state and depend on the observer to ever see the page. Show it, unconditionally. */
    .js .reveal, .reveal { opacity: 1 !important; transform: none !important; }
}
