/* ==========================================================================
   Abdullah Al-Ateeqi — site styles
   Brand: slate header (#384d57), orange headings (#e6783c), sand from the logo.
   ========================================================================== */

:root {
    --slate:        #384d57;   /* header background */
    --slate-deep:   #283a42;   /* footer, page-head gradient end */
    --slate-line:   rgba(242, 220, 196, 0.16);
    --orange:       #e6783c;   /* headings */
    --orange-hover: #f08b54;
    --orange-ink:   #b4521e;   /* orange for small text on white (passes contrast) */
    --sand:         #f2dcc4;   /* logo beige */
    --sand-soft:    #fbf5ee;   /* tinted sections */
    --sand-line:    #ecdfd0;
    --ink:          #22313a;   /* body text */
    --muted:        #5b6b73;
    --white:        #ffffff;
    --up:           #1d7a4e;
    --down:         #b8322a;
    --up-dark:      #86dfb0;   /* on slate */
    --down-dark:    #ffa093;

    --font: 'Readex Pro', 'Segoe UI', Tahoma, Arial, sans-serif;
    --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    --radius-s: 8px;
    --radius:   14px;
    --container: 1160px;
    --shadow: 0 1px 2px rgba(40, 58, 66, 0.06), 0 10px 30px rgba(40, 58, 66, 0.08);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-ink); }
a:hover { color: var(--orange); }
p { margin: 0 0 1em; }
h1, h2, h3 { color: var(--orange); line-height: 1.2; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.15rem; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--sand-soft); padding: 0.1em 0.35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Hidden above the page until focused (no off-screen offset, so no sideways scroll in Arabic). */
.skip-link {
    position: absolute; top: 10px; inset-inline-start: 12px; z-index: 2000;
    transform: translateY(-200%);
    background: var(--orange); color: var(--ink); padding: 8px 16px; border-radius: var(--radius-s); font-weight: 600;
}
.skip-link:focus { transform: none; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.break { word-break: break-all; }

/* ---------- Header ---------- */
.site-header {
    background: var(--slate);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 80px; }
.site-nav { margin-inline-start: auto; }
.lang-switch {
    flex: none; display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(242, 220, 196, 0.45);
    color: var(--sand); text-decoration: none; font-size: 0.92rem; line-height: 1.3;
    transition: background-color 0.2s, color 0.2s;
}
.lang-switch:hover { background: rgba(242, 220, 196, 0.12); color: #fff; }
.lang-switch i { font-size: 0.85em; opacity: 0.8; }
.brand { display: flex; align-items: center; flex: none; padding: 6px 0; }
.brand img { height: 62px; width: auto; }
.site-nav ul { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.site-nav a, .nav-sub-toggle {
    position: relative; display: flex; align-items: center; gap: 8px;
    font-family: inherit; background: none; border: 0; cursor: pointer;
    padding: 9px 10px; border-radius: var(--radius-s);
    color: #eef2f3; text-decoration: none; font-size: 0.93rem; font-weight: 400; white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
}
.site-nav a i, .nav-sub-toggle i { color: var(--sand); opacity: 0.75; font-size: 0.85em; }
.site-nav a:hover, .nav-sub-toggle:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.site-nav a.active, .nav-sub-toggle.active { color: #fff; font-weight: 500; }
.site-nav a.active i, .nav-sub-toggle.active i { color: var(--orange); opacity: 1; }
.site-nav a.active::after, .nav-sub-toggle.active::after {
    content: ''; position: absolute; left: 10px; right: 10px; bottom: 1px;
    height: 3px; border-radius: 3px; background: var(--orange);
}
/* Dropdown (Tools): opens on hover or keyboard focus, and on click with JavaScript. */
.has-sub { position: relative; }
.nav-caret { font-size: 0.65em !important; transition: transform 0.2s; }
.has-sub.is-open .nav-caret { transform: rotate(180deg); }
.site-nav .sub-menu {
    position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 10;
    min-width: 230px; padding: 6px; display: none; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--slate); border: 1px solid var(--slate-line); border-radius: var(--radius-s);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}
.sub-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; } /* keeps hover alive across the gap */
.has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu, .has-sub.is-open .sub-menu { display: flex; }
.js .has-sub.is-closed .sub-menu { display: none; }
.site-nav .sub-menu a { padding: 10px 12px; }
.site-nav .sub-menu a.active { background: rgba(255, 255, 255, 0.08); }
.site-nav .sub-menu a.active::after { display: none; }
.nav-toggle {
    display: none; width: 46px; height: 46px; border-radius: var(--radius-s);
    border: 1px solid var(--slate-line); background: transparent; color: var(--sand);
    font-size: 1.2rem; cursor: pointer;
}

@media (max-width: 1060px) {
    .nav-toggle { display: inline-grid; place-items: center; }
    .lang-switch { margin-inline-start: auto; }
    .site-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--slate); border-top: 1px solid var(--slate-line);
        padding: 8px 20px 18px; box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2);
        display: none;
    }
    .site-nav.is-open { display: block; }
    .site-nav ul { flex-direction: column; align-items: stretch; }
    .site-nav a, .nav-sub-toggle { padding: 12px 10px; font-size: 1rem; width: 100%; }
    .site-nav a.active::after, .nav-sub-toggle.active::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
    /* In the mobile menu the Tools pages are listed under their heading, always open. */
    .nav-sub-toggle { cursor: default; color: var(--sand); }
    .nav-sub-toggle:hover { background: none; color: var(--sand); }
    .nav-sub-toggle.active::after, .nav-caret { display: none; }
    .site-nav .sub-menu, .js .has-sub.is-closed .sub-menu {
        display: flex; position: static; min-width: 0; padding: 0 0 0 18px;
        background: none; border: 0; box-shadow: none;
    }
    .sub-menu::before { display: none; }
    /* Without JavaScript the menu simply stays open. */
    html:not(.js) .site-nav { display: block; position: static; box-shadow: none; padding: 0 0 12px; }
    html:not(.js) .nav-toggle { display: none; }
    html:not(.js) .header-inner { flex-wrap: wrap; }
}
@media (max-width: 480px) {
    .header-inner { min-height: 68px; }
    .brand img { height: 50px; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 999px; border: 2px solid transparent;
    font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
    text-decoration: none; cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-primary { background: var(--orange); color: #1d2a31; }
.btn-primary:hover { background: var(--orange-hover); color: #1d2a31; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { border-color: rgba(242, 220, 196, 0.45); color: var(--sand); }
.btn-ghost:hover { background: rgba(242, 220, 196, 0.1); color: #fff; }
.btn-small { padding: 8px 16px; font-size: 0.9rem; background: var(--slate); color: #fff; border-radius: var(--radius-s); }
.btn-small:hover { background: var(--slate-deep); color: #fff; }
.btn-small.is-done { background: var(--up); }

/* ---------- Home: hero ---------- */
.hero {
    background:
        radial-gradient(ellipse 60% 55% at 50% 38%, rgba(242, 220, 196, 0.10), transparent 70%),
        linear-gradient(180deg, var(--slate) 0%, var(--slate-deep) 100%);
    color: #eef2f3;
    text-align: center;
    padding: 40px 0 84px;
    overflow: hidden;
}
.hero-logo { width: min(460px, 82vw); margin: 0 auto 8px; }
.hero h1 { margin-bottom: 0.2em; }
.hero-tagline { font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 300; color: var(--sand); margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* A white light sweeps through the calligraphy at 75°, masked to the logo's own shape. */
.hero-logo { position: relative; display: block; }
.hero-logo img { width: 100%; }
.hero-logo::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    /* Gray shade on each side of the white makes the band stand out against the light letters. */
    background: linear-gradient(75deg, transparent 34%, rgba(70, 82, 88, 0.45) 43%, rgba(255, 255, 255, 0.4) 47%,
        rgba(255, 255, 255, 0.95) 50%, rgba(255, 255, 255, 0.4) 53%, rgba(70, 82, 88, 0.45) 57%, transparent 66%) no-repeat;
    /* Twice the logo's width, so 110% → −10% carries the band from just off the left edge to just off the right. */
    background-size: 200% 100%;
    background-position: 110% 0;
    -webkit-mask: url('../img/logo.png') center / 100% 100% no-repeat;
            mask: url('../img/logo.png') center / 100% 100% no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
    .hero-logo::after { animation: shine 5s ease-in-out 0.3s both; }
    .hero h1 { animation: rise 0.8s ease 0.3s both; }
    .hero-tagline { animation: rise 0.8s ease 0.45s both; }
    .hero-actions { animation: rise 0.8s ease 0.6s both; }
}
@keyframes shine {
    from { background-position: 110% 0; }
    to   { background-position: -10% 0; }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section--tint { background: var(--sand-soft); }
.section--compact { padding: 36px 0; }
.section-title { margin-bottom: 28px; }
.section-head { max-width: 720px; margin-bottom: 20px; }
.section-head h2 { margin-bottom: 0.25em; }
.section-head p { color: var(--muted); margin: 0; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-tools { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card { background: var(--white); border: 1px solid var(--sand-line); border-radius: var(--radius); padding: 28px; }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card h3 i { font-size: 0.9em; }

/* Diamond bullets, like the dots in the calligraphy. */
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 7px 0 7px 22px; border-bottom: 1px dashed var(--sand-line); }
.ticks li:last-child { border-bottom: 0; }
.ticks li::before {
    content: ''; position: absolute; left: 2px; top: 50%;
    width: 8px; height: 8px; margin-top: -4px;
    background: var(--orange); transform: rotate(45deg); border-radius: 1px;
}

.edu { background: var(--slate); color: #dfe7ea; border-radius: var(--radius); padding: 28px; }
.edu-icon { display: block; font-size: 1.4rem; color: var(--sand); margin-bottom: 18px; }
.edu h3 { font-size: 1.3rem; margin-bottom: 0.35em; }
.edu p { margin: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.tags li {
    padding: 9px 18px; border-radius: 999px; background: var(--sand-soft);
    border: 1px solid var(--sand-line); color: var(--slate); font-weight: 500;
}

.tool {
    display: flex; align-items: flex-start; gap: 16px; padding: 22px;
    background: var(--white); border: 1px solid var(--sand-line); border-radius: var(--radius);
    color: var(--ink); text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tool:hover { color: var(--ink); border-color: var(--orange); box-shadow: var(--shadow); }
.tool-icon {
    flex: none; width: 48px; height: 48px; border-radius: 12px;
    display: grid; place-items: center; background: var(--slate); color: var(--sand); font-size: 1.15rem;
}
.tool h3 { margin: 2px 0 4px; font-size: 1.1rem; }
.tool p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Contact + social ---------- */
.contact { background: var(--slate); color: #dfe7ea; text-align: center; }
.contact p { color: var(--sand); max-width: 560px; margin: 0 auto; }
.social-links { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 0; padding: 0; }
.social-link {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(242, 220, 196, 0.12); color: var(--sand); text-decoration: none; font-size: 1.05rem;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.social-link:hover { background: var(--orange); color: #1d2a31; transform: translateY(-2px); }
.social-links--large { justify-content: center; gap: 16px; margin-top: 28px; }
.social-links--large .social-link { width: 56px; height: 56px; font-size: 1.35rem; background: var(--sand); color: var(--slate); }
.social-links--large .social-link:hover { background: var(--orange); color: #1d2a31; }

/* ---------- Footer ---------- */
.site-footer { background: var(--slate-deep); color: #c8d3d8; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 32px 20px; }
.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-brand img { height: 54px; width: auto; }
.footer-name { margin: 0; color: #fff; font-weight: 500; }
.footer-tag { margin: 0; font-size: 0.9rem; color: var(--sand); }
.footer-bottom { border-top: 1px solid var(--slate-line); padding: 16px 0; font-size: 0.85rem; }
.footer-bottom p { margin: 0; }
.footer-bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
.disclaimer { color: #9fb0b8; }

/* ---------- Tool pages: header band ---------- */
.page-head {
    background: linear-gradient(180deg, var(--slate) 0%, var(--slate-deep) 100%);
    color: #e7edf0; padding: 44px 0 40px;
}
.page-head--short { padding-bottom: 44px; }
.lead { font-size: 1.08rem; max-width: 700px; color: #dbe4e8; font-weight: 300; }
.source-note { display: flex; gap: 8px; align-items: baseline; font-size: 0.9rem; color: var(--sand); margin: 0; max-width: 760px; }
.notice {
    display: flex; gap: 10px; align-items: baseline;
    background: rgba(184, 50, 42, 0.16); border: 1px solid rgba(255, 160, 147, 0.4);
    color: #ffe3de; padding: 12px 16px; border-radius: var(--radius-s); max-width: 760px;
}
.notice--light { background: #fdecea; color: var(--down); border-color: #f3c2bd; margin-top: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 28px; }
.stat {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 16px 18px; border-radius: var(--radius-s);
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--slate-line);
}
.stat-label { font-size: 0.88rem; color: var(--sand); }
.stat-value { font-size: 1.55rem; font-weight: 600; color: #fff; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 0.8rem; font-weight: 400; color: #b9c7cd; }

/* Change pills */
.pill {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
    font-size: 0.85rem; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pill.up   { color: var(--up);   background: #e3f3ea; }
.pill.down { color: var(--down); background: #fbe7e5; }
.pill.flat { color: var(--muted); background: #eef1f2; }
.page-head .pill.up   { color: var(--up-dark);   background: rgba(134, 223, 176, 0.12); }
.page-head .pill.down { color: var(--down-dark); background: rgba(255, 160, 147, 0.12); }
.page-head .pill.flat { color: #c8d3d8; background: rgba(255, 255, 255, 0.08); }

/* In-page links */
.jump { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 28px; }
.jump a {
    padding: 7px 16px; border-radius: 999px; border: 1px solid var(--sand-line);
    color: var(--slate); text-decoration: none; font-size: 0.92rem; background: var(--white);
}
.jump a:hover { border-color: var(--orange); color: var(--orange-ink); }

/* ---------- Price tables ---------- */
.table-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--sand-line); border-radius: var(--radius); background: var(--white);
}
.table-wrap--narrow { max-width: 560px; }
.price-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.price-table th, .price-table td { padding: 12px 16px; text-align: left; vertical-align: middle; }
.price-table thead th {
    background: var(--slate); color: #f1f4f5; font-weight: 500; font-size: 0.85rem; white-space: nowrap;
}
.price-table tbody tr + tr th, .price-table tbody tr + tr td { border-top: 1px solid var(--sand-line); }
.price-table tbody tr:nth-child(even) { background: #fdfaf6; }
.price-table tbody tr:hover { background: var(--sand-soft); }
.price-table tbody th { font-weight: 400; }
.price-table .num { text-align: right; white-space: nowrap; }
.price-table .strong { font-weight: 600; color: var(--ink); }
.price-table td.up { color: var(--up); }
.price-table td.down { color: var(--down); }
.sym { display: block; font-weight: 600; color: var(--slate); white-space: nowrap; }
.sym-name { display: block; font-size: 0.82rem; color: var(--muted); }
.unit { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.stale { color: var(--orange); font-weight: 700; cursor: help; }

.coin { display: flex; align-items: center; gap: 12px; }
.coin-badge {
    flex: none; width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; background: var(--sand); color: var(--slate);
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
}

.note {
    max-width: 820px; font-size: 0.92rem; color: var(--muted);
    border-left: 3px solid var(--sand); padding: 4px 0 4px 18px; margin-top: 8px;
}
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--ink); font-weight: 500; }

@media (max-width: 640px) {
    .hide-sm { display: none; }
    .price-table th, .price-table td { padding: 11px 12px; }
    .stat-value { font-size: 1.3rem; }
}

/* ---------- Forex chart ---------- */
.chart-panel {
    background: var(--white); border: 1px solid var(--sand-line); border-radius: var(--radius);
    padding: 22px 24px; box-shadow: var(--shadow);
}
.chart-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 14px; }
.chart-title { display: flex; flex-direction: column; min-width: 0; }
.chart-sym { font-size: 1.3rem; font-weight: 600; color: var(--slate); line-height: 1.2; }
.chart-name { font-size: 0.85rem; color: var(--muted); }
.chart-figures { display: flex; align-items: center; gap: 10px; }
.chart-price { font-size: 1.5rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-ranges { display: flex; gap: 4px; margin-inline-start: auto; background: var(--sand-soft); padding: 4px; border-radius: 999px; }
.chart-ranges button, .chip {
    font: inherit; cursor: pointer; border: 1px solid transparent; background: transparent; color: var(--slate);
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chart-ranges button { padding: 5px 13px; border-radius: 999px; font-size: 0.88rem; font-weight: 500; white-space: nowrap; }
.chart-ranges button:hover { color: var(--orange-ink); }
.chart-ranges button[aria-pressed="true"] { background: var(--slate); color: #fff; }

/* The chart always runs left to right (oldest to newest), on Arabic pages too. */
.chart-box { position: relative; direction: ltr; min-height: 240px; transition: opacity 0.2s; }
.chart-box.is-loading { opacity: 0.55; }
.chart-box svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.chart-status { display: grid; place-items: center; min-height: 240px; margin: 0; color: var(--muted); text-align: center; }
.chart-grid { stroke: var(--sand-line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-fill-top { stop-color: var(--orange); stop-opacity: 0.22; }
.chart-fill-bottom { stop-color: var(--orange); stop-opacity: 0; }
.chart-cross { stroke: var(--slate); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.chart-dot { fill: var(--orange); stroke: var(--white); stroke-width: 2; }
.chart-tip {
    position: absolute; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap;
    display: flex; flex-direction: column; align-items: center;
    background: var(--slate); color: #fff; padding: 5px 10px; border-radius: var(--radius-s);
    font-size: 0.85rem; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.35;
}
.chart-tip[hidden] { display: none; }
.chart-tip-date { font-size: 0.75rem; font-weight: 400; color: var(--sand); }

.chart-picker { display: grid; gap: 12px; border-top: 1px dashed var(--sand-line); margin-top: 14px; padding-top: 16px; }
.chart-group { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; align-items: baseline; }
.chart-group-label { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 12px; border-radius: 999px; border-color: var(--sand-line); font-size: 0.85rem; white-space: nowrap; }
.chip:hover { border-color: var(--orange); color: var(--orange-ink); }
.chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #1d2a31; font-weight: 500; }

/* Table rows open their chart. */
.price-table a.sym { text-decoration: none; }
.price-table a.sym i { font-size: 0.75em; color: var(--orange); opacity: 0; transition: opacity 0.15s; margin-inline-start: 4px; }
.price-table tr.is-chartable { cursor: pointer; }
.price-table tr.is-chartable:hover a.sym, .price-table a.sym:focus-visible { color: var(--orange-ink); }
.price-table tr.is-chartable:hover a.sym i, .price-table a.sym:focus-visible i { opacity: 1; }

/* The chart needs JavaScript; without it the section is left out. */
html:not(.js) .chart-section, html:not(.js) .jump a[href="#chart"] { display: none; }

@media (max-width: 640px) {
    .chart-panel { padding: 16px; }
    .chart-ranges { margin-inline-start: 0; width: 100%; justify-content: space-between; gap: 2px; }
    .chart-ranges button { padding: 5px 8px; font-size: 0.82rem; }
    .chart-group { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* ---------- Gold page ---------- */
.gold-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; margin-top: 28px; }
.gold-price {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 24px 26px; border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--slate-line);
}
.gold-price-label { color: var(--sand); }
.gold-price-value {
    font-size: clamp(2.6rem, 7vw, 4.2rem); line-height: 1; font-weight: 600; color: #fff;
    font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.gold-price-value small { font-size: 0.34em; font-weight: 400; color: var(--sand); margin-left: 10px; letter-spacing: 0; }
.gold-price-date { font-size: 0.85rem; color: #b9c7cd; }
.basis { margin: 0; display: grid; gap: 0; align-content: center; }
.basis div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--slate-line); }
.basis div:last-child { border-bottom: 0; }
.basis dt { color: var(--sand); }
.basis dd { margin: 0; text-align: right; color: #eef2f3; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .gold-hero { grid-template-columns: 1fr; } }

/* Two-column layouts */
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split--wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
/* minmax(0, 1fr) lets wide tables scroll inside their box instead of widening the page. */
@media (max-width: 900px) { .split, .split--even, .split--wide { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Panels & forms ---------- */
.panel {
    background: var(--white); border: 1px solid var(--sand-line); border-radius: var(--radius);
    padding: 26px; display: flex; flex-direction: column; gap: 18px;
}
.panel h2 { font-size: 1.3rem; margin: 0; }
.panel p { margin: 0; }
.panel--plain { background: var(--sand-soft); }
.panel--plain p + p { margin-top: 0; }
.calc { box-shadow: var(--shadow); }
.calc--wide { margin-bottom: 24px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 0.9rem; font-weight: 500; color: var(--slate); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; align-items: end; }
.field-row--top { align-items: start; }
.input {
    width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
    padding: 11px 14px; border: 1.5px solid #d9cab9; border-radius: var(--radius-s); background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(230, 120, 60, 0.25); }
textarea.input { resize: vertical; min-height: 160px; line-height: 1.5; }
select.input { cursor: pointer; }
.input[readonly] { background: var(--sand-soft); }
.hint { font-size: 0.82rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.95rem; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }

.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
    display: block; text-align: center; padding: 10px 0; border-radius: var(--radius-s);
    border: 1.5px solid #d9cab9; font-weight: 500; color: var(--slate);
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.segmented input:checked + span { background: var(--slate); border-color: var(--slate); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }

.result {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--sand-soft); border: 1px solid var(--sand-line); border-radius: var(--radius-s); padding: 14px 18px;
}
.result-label { font-size: 0.85rem; color: var(--muted); }
.result-value { font-size: 1.6rem; font-weight: 600; color: var(--slate); font-variant-numeric: tabular-nums; line-height: 1.25; word-break: break-word; }
.result-sub { color: var(--muted); font-variant-numeric: tabular-nums; }
.js .js-hide { display: none; }

/* ---------- Converter ---------- */
.converter h2 { font-size: 1.2rem; }
.conv { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.conv-eq { color: var(--orange); padding-bottom: 13px; }
.input-unit { position: relative; }
.input-unit .input { padding-right: 52px; }
.input-unit span {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: 0.85rem; pointer-events: none;
}
.conv-rule { font-size: 0.88rem; color: var(--muted); border-top: 1px dashed var(--sand-line); padding-top: 14px; }
@media (max-width: 420px) {
    .conv { grid-template-columns: 1fr; }
    .conv-eq { justify-self: center; padding: 0; transform: rotate(90deg); }
}

/* ---------- SHA-256 ---------- */
.hash-output { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.hash-output[hidden] { display: none; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { font-size: 0.9rem; letter-spacing: 0.01em; }
.copy-row .btn { flex: none; }
#sha-form > .btn { align-self: flex-start; }

/* ---------- Contact form ---------- */
.field.has-error .input { border-color: var(--down); }
.field.has-error .input:focus { box-shadow: 0 0 0 3px rgba(184, 50, 42, 0.2); }
.field-error { font-size: 0.85rem; color: var(--down); }
.panel h2 .fa-circle-check { color: var(--up); }
.panel > .btn { align-self: flex-start; }
.social-links--plain .social-link { background: var(--white); color: var(--slate); border: 1px solid var(--sand-line); }
.social-links--plain .social-link:hover { background: var(--orange); color: #1d2a31; border-color: var(--orange); }
.contact-cta { margin-top: 28px; }

/* ---------- Services page ---------- */
.svc-hero {
    background:
        radial-gradient(ellipse 55% 70% at 85% 20%, rgba(230, 120, 60, 0.16), transparent 70%),
        radial-gradient(ellipse 50% 60% at 10% 90%, rgba(242, 220, 196, 0.10), transparent 70%),
        linear-gradient(180deg, var(--slate) 0%, var(--slate-deep) 100%);
    color: #e7edf0; padding: 72px 0 80px;
}
.svc-hero h1 { max-width: 820px; }
.svc-hero .lead { margin-bottom: 30px; }
.svc-hero-actions { justify-content: flex-start; }
.eyebrow {
    display: inline-block; margin: 0 0 14px; padding: 5px 14px; border-radius: 999px;
    border: 1px solid rgba(242, 220, 196, 0.35); color: var(--sand); font-size: 0.85rem; letter-spacing: 0.04em;
}

.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.svc-card {
    display: flex; flex-direction: column; gap: 12px; padding: 26px;
    background: var(--white); border: 1px solid var(--sand-line); border-radius: var(--radius);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.svc-card:hover, .svc-card:focus-within { transform: translateY(-4px); border-color: var(--orange); box-shadow: var(--shadow); }
.svc-card h3 { margin: 4px 0 0; font-size: 1.12rem; }
.svc-card > p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.svc-icon {
    width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    background: var(--slate); color: var(--sand); font-size: 1.3rem;
    transition: background-color 0.25s, color 0.25s, transform 0.25s;
}
.svc-card:hover .svc-icon { background: var(--orange); color: #1d2a31; transform: rotate(-6deg); }
.svc-list { font-size: 0.92rem; }
.svc-list li { padding-top: 6px; padding-bottom: 6px; }
.svc-link {
    margin-top: auto; padding-top: 6px; font-weight: 500; font-size: 0.92rem; text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
}
.svc-link i { transition: transform 0.2s; font-size: 0.85em; }
.svc-link:hover i { transform: translateX(4px); }

.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.tech {
    display: flex; align-items: center; gap: 14px; padding: 16px 18px;
    background: var(--white); border: 1px solid var(--sand-line); border-radius: var(--radius-s);
    font-weight: 500; color: var(--slate); transition: border-color 0.2s, transform 0.2s;
}
.tech:hover { border-color: var(--orange); transform: translateY(-2px); }
.tech i { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--sand-soft); color: var(--orange-ink); font-size: 1.15rem; }

.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px 28px; }
.why { display: flex; gap: 16px; align-items: flex-start; padding: 6px 0; }
.why-icon {
    flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(230, 120, 60, 0.12); color: var(--orange-ink); font-size: 1.05rem;
}
.why h3 { margin: 2px 0 4px; font-size: 1.05rem; color: var(--slate); }
.why p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding-inline-start: 46px; min-height: 32px; }
.steps li::before {
    content: counter(step); position: absolute; inset-inline-start: 0; top: 0;
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
    background: var(--slate); color: #fff; font-weight: 600; font-size: 0.9rem;
}
.steps strong { display: block; color: var(--ink); font-weight: 500; }
.steps span { color: var(--muted); font-size: 0.93rem; }

/* Fade-in on scroll (added by main.js, so without JavaScript everything is simply visible). */
.will-reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.will-reveal.is-visible { opacity: 1; transform: none; }
.svc-card.will-reveal.is-visible:hover { transform: translateY(-4px); }

@media (max-width: 640px) {
    .svc-hero { padding: 48px 0 56px; }
    .why-grid { grid-template-columns: minmax(0, 1fr); }
    .svc-hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
