:root {
    --primary: #c9a24b;
    --primary-light: #e0c274;
    --primary-dark: #a3812f;
    --bg: #f8f6f2;
    --bg-alt: #ffffff;
    --bg-soft: #f1ede4;
    --text: #201d18;
    --text-muted: #6b6459;
    --border: #e8e2d4;
    --card-shadow: 0 6px 24px rgba(30,25,10,.06);
    --card-shadow-hover: 0 14px 34px rgba(30,25,10,.10);
    --up: #1a8a4a;
    --down: #c93a3a;
    --radius: 16px;
    --radius-sm: 10px;
    --font-heading: 'Manrope', 'Segoe UI', Arial, sans-serif;
    --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

[data-theme="dark"] {
    --bg: #0d0f13;
    --bg-alt: #15181e;
    --bg-soft: #191c23;
    --text: #f0ece1;
    --text-muted: #a19a8c;
    --border: #262a33;
    --card-shadow: 0 6px 24px rgba(0,0,0,.35);
    --card-shadow-hover: 0 14px 34px rgba(0,0,0,.5);
    --up: #34c77a;
    --down: #ea5a5a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    transition: background .25s, color .25s;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-heading); letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 22px; }

/* ---------- Header ---------- */
header.site-header {
    background: color-mix(in srgb, var(--bg-alt) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; font-family: var(--font-heading); }
.logo img { height: 42px; width: auto; }
.logo .logo-emoji { font-size: 26px; }
nav.main-menu { display: flex; gap: 28px; align-items: center; }
nav.main-menu a { font-weight: 600; font-size: 14.5px; color: var(--text-muted); position: relative; padding: 4px 0; margin-right: 4px; }
nav.main-menu a::after {
    content: ''; position: absolute; left: 0; bottom: -3px; width: 0; height: 2px;
    background: var(--primary); transition: width .2s;
}
nav.main-menu a:hover { color: var(--text); }
nav.main-menu a:hover::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px;
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 17px; transition: transform .2s, background .2s;
}
.theme-toggle:hover { transform: rotate(15deg); background: var(--bg); }
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 11px 24px; border-radius: 999px;
    font-weight: 700; background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #1a1508; border: none; cursor: pointer; font-size: 14px; transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 14px rgba(201,162,75,.35);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(201,162,75,.45); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); box-shadow: none; }
.btn-outline:hover { background: var(--primary); color: #1a1508; }
.menu-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--text); cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
    padding: 88px 0 60px; text-align: center; position: relative; overflow: hidden;
}
.hero.hero-gradient {
    background:
      radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 55%),
      radial-gradient(circle at 85% 30%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 50%),
      var(--bg);
}
.hero.hero-image { background-size: cover; background-position: center; }
.hero.hero-image::before { content: ''; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 78%, transparent); }
.hero-content { position: relative; z-index: 1; }
.hero .eyebrow {
    display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--primary-dark); background: color-mix(in srgb, var(--primary) 16%, transparent);
    padding: 6px 16px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(30px, 5vw, 48px); margin: 0 0 14px; font-weight: 800; }
.hero p { max-width: 640px; margin: 0 auto 30px; color: var(--text-muted); font-size: 17px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(24px, 3.4vw, 30px); font-weight: 800; margin-bottom: 8px; text-align: center; }
.section-desc { text-align: center; color: var(--text-muted); margin-bottom: 36px; font-size: 15.5px; }

/* ---------- Rates table ---------- */
.rates-wrap { background: var(--bg-alt); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; border: 1px solid var(--border); }
table.rates { width: 100%; border-collapse: collapse; }
table.rates th, table.rates td { padding: 15px 20px; text-align: left; font-size: 14.5px; }
table.rates th { color: var(--text-muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
table.rates td { border-bottom: 1px solid var(--border); font-weight: 600; }
table.rates tbody tr { transition: background .15s; }
table.rates tbody tr:hover { background: var(--bg-soft); }
table.rates tr:last-child td { border-bottom: none; }
.rate-name { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.rate-name .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.rate-buy, .rate-sell { font-variant-numeric: tabular-nums; font-weight: 700; }
.chg-up { color: var(--up); font-weight: 700; }
.chg-down { color: var(--down); font-weight: 700; }
.rates-updated { text-align: right; font-size: 12px; color: var(--text-muted); padding: 10px 20px; border-top: 1px solid var(--border); }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--up); margin-right: 6px; animation: pulse 1.5s infinite; }

.rates-status { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 10px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.rates-status.status-live { background: color-mix(in srgb, var(--up) 12%, transparent); color: var(--up); }
.rates-status.status-error { background: color-mix(in srgb, var(--down) 12%, transparent); color: var(--down); }
.rates-status.status-error .pulse { background: var(--down); animation: none; }

@keyframes flashUp { 0% { background: color-mix(in srgb, var(--up) 35%, transparent); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: color-mix(in srgb, var(--down) 35%, transparent); } 100% { background: transparent; } }
table.rates td.flash-up { animation: flashUp 1.1s ease-out; }
table.rates td.flash-down { animation: flashDown 1.1s ease-out; }
@keyframes pulse { 0%{opacity:1} 50%{opacity:.25} 100%{opacity:1} }

/* ---------- Converter ---------- */
.converter-card {
    background: var(--bg-alt); border-radius: var(--radius); box-shadow: var(--card-shadow);
    border: 1px solid var(--border); padding: 34px; max-width: 580px; margin: 0 auto;
}
.conv-row { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.conv-row > div { flex: 1; min-width: 180px; }
.conv-row label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 7px; font-weight: 600; }
.conv-row select, .conv-row input {
    width: 100%; padding: 13px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 15px; font-family: inherit;
}
.conv-row select:focus, .conv-row input:focus { outline: none; border-color: var(--primary); }
.conv-result { text-align: center; margin-top: 22px; padding: 20px; border-radius: var(--radius-sm); background: var(--bg-soft); }
.conv-result .val { font-size: 27px; font-weight: 800; color: var(--primary-dark); }
[data-theme="dark"] .conv-result .val { color: var(--primary); }
.conv-note { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 12px; }
.radio-inline { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; cursor: pointer; }
.radio-inline input { width: auto; }

/* ---------- Feature cards ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px,1fr)); gap: 24px; }
.feature-card {
    background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px; box-shadow: var(--card-shadow); transition: transform .2s, box-shadow .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.feature-card .icon {
    width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 25%, transparent), color-mix(in srgb, var(--primary) 8%, transparent));
    font-size: 24px; margin-bottom: 16px;
}
.feature-card h3 { margin: 0 0 10px; font-size: 18px; }
.feature-card p { color: var(--text-muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 16px; }

/* ---------- About ---------- */
.about-wrap { display: flex; gap: 48px; align-items: center; flex-wrap: wrap; }
.about-wrap > div { flex: 1; min-width: 280px; }
.about-wrap img { width: 100%; border-radius: var(--radius); box-shadow: var(--card-shadow); }
.about-wrap .eyebrow { color: var(--primary-dark); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; display: block; }
.about-wrap h2 { font-size: clamp(24px,3vw,32px); margin: 0 0 16px; }
.about-wrap p { color: var(--text-muted); line-height: 1.75; font-size: 15.5px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.contact-info { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--card-shadow); }
.contact-info .row { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-start; }
.contact-info .row .ic {
    width: 38px; height: 38px; border-radius: 10px; background: var(--bg-soft); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.contact-info .row a:hover { color: var(--primary-dark); }
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 300px; box-shadow: var(--card-shadow); }
.map-frame iframe { width: 100%; height: 100%; min-height: 300px; border: 0; display: block; }

/* ---------- Sell page ---------- */
.sell-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; max-width: 660px; margin: 0 auto; box-shadow: var(--card-shadow); }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 13px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 15px; font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.whatsapp-btn { background: #25D366; color: #fff; box-shadow: 0 4px 14px rgba(37,211,102,.35); }
.whatsapp-btn:hover { background: #1eb857; box-shadow: 0 8px 22px rgba(37,211,102,.45); }
.divider { border: none; border-top: 1px solid var(--border); margin: 30px 0; }

/* ---------- Footer ---------- */
footer.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 50px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; margin-bottom: 30px; }
.footer-grid h4 { margin: 0 0 14px; font-size: 15px; font-family: var(--font-heading); }
.footer-grid a, .footer-grid p { color: var(--text-muted); font-size: 14px; line-height: 2; }
.footer-grid a:hover { color: var(--primary-dark); }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
    font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border); padding: 18px 0 22px;
}
.dp-credit a { color: var(--primary-dark); font-weight: 700; }
.dp-credit a:hover { text-decoration: underline; }

/* ---------- Utility ---------- */
.hint { font-size: 12px; color: var(--text-muted); }

@media (max-width: 860px) {
    nav.main-menu {
        position: fixed; top: 68px; left: 0; right: 0; background: var(--bg-alt);
        flex-direction: column; align-items: flex-start; padding: 18px 22px; gap: 16px;
        border-bottom: 1px solid var(--border); display: none; box-shadow: 0 12px 24px rgba(0,0,0,.08);
    }
    nav.main-menu.open { display: flex; }
    .menu-toggle { display: block; }
    .contact-grid, .form-grid, .footer-grid { grid-template-columns: 1fr; }
    table.rates th:nth-child(4), table.rates td:nth-child(4) { display: none; }
    .hero { padding: 60px 0 44px; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
