:root {
    --bg: #06100d;
    --surface: #0d1a16;
    --surface-2: #111f1b;
    --surface-3: rgba(255, 255, 255, 0.035);
    --line: rgba(255, 255, 255, 0.09);

    --text: #f5f8f6;
    --muted: #8fa29a;
    --muted-strong: #b8c5c0;

    --gold: #d8b66f;
    --gold-soft: rgba(216, 182, 111, 0.12);

    --green: #4fdaa0;
    --green-soft: rgba(79, 218, 160, 0.09);

    --red: #ff7483;
    --red-soft: rgba(255, 116, 131, 0.09);

    --shadow: 0 32px 100px rgba(0, 0, 0, 0.38);

    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;

    color: var(--text);

    background:
        radial-gradient(
            circle at 12% 8%,
            rgba(216, 182, 111, 0.085),
            transparent 28%
        ),
        radial-gradient(
            circle at 92% 90%,
            rgba(79, 218, 160, 0.055),
            transparent 28%
        ),
        linear-gradient(
            145deg,
            #06100d 0%,
            #091411 48%,
            #06100d 100%
        );

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    opacity: 0.25;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        );

    background-size: 42px 42px;

    mask-image:
        linear-gradient(
            to bottom,
            black,
            transparent 92%
        );
}

a {
    color: inherit;
    text-decoration: none;
}

.site-shell {
    width: 100%;
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 34px 20px;
}

.gold-dashboard {
    position: relative;

    width: min(1160px, 100%);
    min-height: 720px;

    overflow: hidden;

    border: 1px solid var(--line);
    border-radius: var(--radius-xl);

    background:
        linear-gradient(
            145deg,
            rgba(17, 34, 28, 0.96),
            rgba(7, 17, 14, 0.98)
        );

    box-shadow: var(--shadow);

    isolation: isolate;
}

.gold-dashboard::after {
    content: "";

    position: absolute;

    width: 460px;
    height: 460px;

    top: -260px;
    right: -190px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(216, 182, 111, 0.12),
            transparent 68%
        );

    pointer-events: none;

    z-index: -1;
}

/* =========================
   TOPBAR
========================= */

.topbar {
    min-height: 82px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 21px 30px;

    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;

    gap: 12px;
}

.brand-mark {
    width: 39px;
    height: 39px;

    display: grid;
    place-items: center;

    border:
        1px solid
        rgba(216, 182, 111, 0.38);

    border-radius: 12px;

    color: var(--gold);

    background:
        rgba(216, 182, 111, 0.08);

    font-size: 14px;
    font-weight: 800;

    letter-spacing: 0.08em;
}

.brand-copy {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.brand-copy strong {
    font-size: 15px;
    line-height: 1;

    letter-spacing: 0.18em;
}

.brand-copy small {
    color: var(--muted);

    font-size: 8px;
    font-weight: 700;

    letter-spacing: 0.2em;
}

.market-status,
.live-badge {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    white-space: nowrap;

    color: var(--muted-strong);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.14em;
}

.live-badge {
    padding: 9px 12px;

    border:
        1px solid
        rgba(79, 218, 160, 0.2);

    border-radius: 999px;

    color: var(--green);

    background:
        rgba(79, 218, 160, 0.06);
}

.status-dot {
    width: 7px;
    height: 7px;

    display: inline-block;

    flex: 0 0 7px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 0 4px
        rgba(79, 218, 160, 0.08);

    animation:
        livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.48;
    }
}

/* =========================
   HERO
========================= */

.hero {
    display: grid;

    grid-template-columns:
        minmax(260px, 0.72fr)
        minmax(0, 1.28fr);

    align-items: center;

    gap: clamp(38px, 6vw, 84px);

    padding:
        clamp(56px, 7vw, 88px)
        clamp(28px, 6vw, 78px);
}

.hero-copy {
    max-width: 420px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    margin-bottom: 18px;

    color: var(--gold);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 0.18em;
}

.eyebrow::before {
    content: "";

    width: 22px;
    height: 1px;

    background: var(--gold);
}

.hero h1 {
    margin: 0;

    font-size:
        clamp(42px, 5.2vw, 70px);

    line-height: 0.97;

    letter-spacing: -0.06em;

    font-weight: 720;
}

.hero-copy p {
    max-width: 400px;

    margin: 25px 0 0;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.75;
}

.hero-note {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    margin-top: 26px;

    color: var(--muted-strong);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.04em;
}

.hero-note-icon {
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    border:
        1px solid
        rgba(79, 218, 160, 0.18);

    border-radius: 8px;

    color: var(--green);

    background:
        var(--green-soft);
}

/* =========================
   PRICE PANEL
========================= */

.price-panel {
    position: relative;

    padding: clamp(22px, 3.2vw, 34px);

    border:
        1px solid
        rgba(255, 255, 255, 0.105);

    border-radius: var(--radius-lg);

    background:
        linear-gradient(
            145deg,
            rgba(20, 36, 30, 0.94),
            rgba(10, 21, 17, 0.97)
        );

    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, 0.035),
        0 24px 65px
        rgba(0, 0, 0, 0.25);
}

.price-panel::before {
    content: "";

    position: absolute;
    inset: 0;

    border-radius: inherit;

    pointer-events: none;

    background:
        linear-gradient(
            115deg,
            transparent 18%,
            rgba(216, 182, 111, 0.04),
            transparent 72%
        );
}

.price-panel-head {
    position: relative;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}

.price-label,
.metric-label,
.performance-label,
.chart-title {
    display: block;

    color: var(--gold);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.18em;
}

.price-context {
    display: block;

    margin-top: 7px;

    color: var(--muted);

    font-size: 11px;
}

/* =========================
   24K / 22K CARDS
========================= */

.primary-price-grid {
    position: relative;

    display: grid;

    grid-template-columns:
        minmax(0, 1.16fr)
        minmax(0, 0.84fr);

    gap: 12px;

    margin-top: 25px;
}

.gold-price-card {
    min-width: 0;

    padding: 22px;

    border:
        1px solid
        rgba(255, 255, 255, 0.075);

    border-radius: 18px;

    background:
        rgba(255, 255, 255, 0.025);

    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, 0.025);
}

.gold-price-card-primary {
    background:
        linear-gradient(
            145deg,
            rgba(216, 182, 111, 0.085),
            rgba(255, 255, 255, 0.025)
        );

    border-color:
        rgba(216, 182, 111, 0.16);
}

.gold-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;
}

.gold-purity {
    color: var(--gold);

    font-size: 10px;
    font-weight: 850;

    letter-spacing: 0.16em;
}

.gold-tag {
    padding: 5px 7px;

    border:
        1px solid
        rgba(216, 182, 111, 0.16);

    border-radius: 7px;

    color: var(--muted-strong);

    background:
        rgba(216, 182, 111, 0.045);

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.08em;
}

.main-price {
    position: relative;

    margin-top: 25px;

    color: var(--text);

    font-size:
        clamp(43px, 5.1vw, 66px);

    line-height: 0.98;

    font-weight: 730;

    letter-spacing: -0.055em;

    overflow-wrap: anywhere;
}

.secondary-price {
    position: relative;

    margin-top: 29px;

    color: var(--text);

    font-size:
        clamp(31px, 3.2vw, 43px);

    line-height: 1;

    font-weight: 700;

    letter-spacing: -0.045em;

    overflow-wrap: anywhere;
}

.price-unit {
    position: relative;

    margin-top: 10px;

    color: var(--muted);

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.18em;
}

.movement {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    margin-top: 17px;

    padding: 7px 9px;

    border-radius: 9px;

    font-size: 9px;
    font-weight: 750;

    line-height: 1.35;
}

.movement-arrow {
    font-size: 8px;
}

.movement-text {
    overflow-wrap: anywhere;
}

.movement-up {
    color: var(--green);
    background: var(--green-soft);
}

.movement-down {
    color: var(--red);
    background: var(--red-soft);
}

.movement-flat {
    color: var(--muted-strong);
    background: rgba(255, 255, 255, 0.045);
}

.market-divider {
    height: 1px;

    margin: 20px 0;

    background: var(--line);
}

/* =========================
   MARKET METRICS
========================= */

.market-grid {
    position: relative;

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 1px;

    overflow: hidden;

    border:
        1px solid var(--line);

    border-radius: var(--radius-md);

    background: var(--line);
}

.metric {
    min-width: 0;

    padding: 15px 17px;

    background:
        rgba(255, 255, 255, 0.025);
}

.metric-value {
    display: block;

    margin-top: 7px;

    color: var(--muted-strong);

    font-size: 14px;
    font-weight: 650;

    overflow-wrap: anywhere;
}

/* =========================
   PERFORMANCE
========================= */

.performance-strip {
    position: relative;

    display: grid;

    grid-template-columns:
        1fr
        1fr
        1.25fr;

    gap: 1px;

    margin-top: 12px;

    overflow: hidden;

    border:
        1px solid var(--line);

    border-radius: var(--radius-md);

    background: var(--line);
}

.performance-strip > div {
    min-width: 0;

    padding: 14px 15px;

    background:
        rgba(255, 255, 255, 0.025);
}

.performance-value {
    display: block;

    margin-top: 7px;

    font-size: 14px;
    font-weight: 750;
}

.performance-up {
    color: var(--green);
}

.performance-down {
    color: var(--red);
}

.performance-flat {
    color: var(--muted-strong);
}

.performance-source {
    display: block;

    margin-top: 7px;

    color: var(--text);

    font-size: 11px;
    font-weight: 650;

    overflow-wrap: anywhere;
}

/* =========================
   CHART
========================= */

.chart-section {
    position: relative;

    margin-top: 15px;

    padding: 17px;

    border:
        1px solid
        rgba(255, 255, 255, 0.07);

    border-radius: var(--radius-md);

    background:
        rgba(0, 0, 0, 0.10);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;
}

.chart-caption {
    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: 9px;
}

.chart-live-indicator {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    color: var(--green);

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.12em;
}

.chart-pulse {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 0 4px
        rgba(79, 218, 160, 0.08);
}

.sparkline-wrap {
    height: 130px;

    margin-top: 10px;

    overflow: hidden;

    border-radius: 10px;
}

.sparkline {
    width: 100%;
    height: 100%;

    display: block;

    overflow: visible;
}

.sparkline-path {
    fill: none;

    stroke: var(--gold);

    stroke-width: 2.6;

    stroke-linecap: round;
    stroke-linejoin: round;

    vector-effect: non-scaling-stroke;

    filter:
        drop-shadow(
            0 0 5px
            rgba(216, 182, 111, 0.18)
        );
}

.sparkline-area {
    fill:
        url(#chartFill);

    stroke: none;
}

.sparkline-dot {
    fill: var(--gold);

    stroke: #0c1915;

    stroke-width: 3;

    vector-effect: non-scaling-stroke;

    filter:
        drop-shadow(
            0 0 6px
            rgba(216, 182, 111, 0.5)
        );
}

/* =========================
   UPDATED
========================= */

.updated {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    margin-top: 15px;

    color: var(--muted);

    font-size: 9px;
}

.updated strong {
    color: var(--muted-strong);

    font-weight: 600;

    text-align: right;
}

/* =========================
   ERROR
========================= */

.error-panel {
    display: flex;
    align-items: flex-start;

    gap: 16px;

    padding: 24px;

    border:
        1px solid
        rgba(255, 116, 131, 0.18);

    border-radius: var(--radius-lg);

    background:
        var(--red-soft);
}

.error-icon {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    flex: 0 0 34px;

    border-radius: 50%;

    color: var(--red);

    background:
        rgba(255, 116, 131, 0.1);

    font-weight: 800;
}

.error-panel strong {
    display: block;

    color: var(--text);

    font-size: 14px;
}

.error-panel p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 12px;

    line-height: 1.6;
}

/* =========================
   FOOTER
========================= */

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 18px 30px;

    border-top: 1px solid var(--line);
}

.footer-line {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    color: var(--muted-strong);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.16em;
}

.footer-dot {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--gold);
}

.footer-note {
    color: var(--muted);

    font-size: 9px;

    text-align: right;
}

/* =========================
   TABLET
========================= */

@media (max-width: 980px) {

    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-copy {
        max-width: 680px;
    }

    .hero h1 {
        max-width: 650px;
    }

    .hero-copy p {
        max-width: 610px;
    }

    .price-panel {
        width: 100%;
    }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 680px) {

    .site-shell {
        display: block;
        padding: 0;
    }

    .gold-dashboard {
        min-height: 100vh;

        border-radius: 0;

        border-left: 0;
        border-right: 0;
    }

    .topbar {
        min-height: 72px;

        padding: 18px 18px;
    }

    .market-status {
        font-size: 8px;
        letter-spacing: 0.09em;
    }

    .hero {
        gap: 30px;

        padding:
            44px 18px 50px;
    }

    .hero h1 {
        font-size:
            clamp(42px, 14vw, 58px);
    }

    .hero-copy p {
        margin-top: 20px;

        font-size: 13px;
    }

    .hero-note {
        margin-top: 20px;
    }

    .price-panel {
        padding: 18px;

        border-radius: 19px;
    }

    .primary-price-grid {
        grid-template-columns: 1fr;

        gap: 10px;
    }

    .gold-price-card {
        padding: 19px;
    }

    .main-price {
        font-size:
            clamp(43px, 14vw, 58px);
    }

    .secondary-price {
        margin-top: 22px;

        font-size:
            clamp(34px, 10vw, 44px);
    }

    .performance-strip {
        grid-template-columns: 1fr 1fr;
    }

    .source-block {
        grid-column: 1 / -1;
    }

    .market-grid {
        grid-template-columns: 1fr;
    }

    .chart-section {
        padding: 14px;
    }

    .sparkline-wrap {
        height: 105px;
    }

    .updated {
        align-items: flex-start;

        flex-direction: column;

        gap: 5px;
    }

    .updated strong {
        text-align: left;
    }

    .footer {
        align-items: flex-start;

        flex-direction: column;

        padding:
            18px 18px 24px;
    }

    .footer-note {
        text-align: left;

        line-height: 1.5;
    }
}

/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 390px) {

    .brand-copy small {
        display: none;
    }

    .market-status {
        font-size: 8px;
    }

    .live-badge {
        padding: 8px 9px;
    }

    .price-panel-head {
        align-items: center;
    }

    .performance-strip {
        grid-template-columns: 1fr;
    }

    .source-block {
        grid-column: auto;
    }

}

/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}
