/* Crypto Price PKR — PHP version. Same look as the preview:
   light warm theme, green accent, Libre Franklin + IBM Plex Mono. */

:root {
  --bg: #fafaf7; --surface: #ffffff; --surface-alt: #eef2ee;
  --text: #101613; --dim: #5c665f; --border: #dde3dd;
  --accent: #0b6e4f; --accent-ink: #ffffff;
  --gain: #0b6e4f; --loss: #c0392b; --ad: #d97706;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e120f; --surface: #161b17; --surface-alt: #1d241e;
    --text: #eef2ee; --dim: #9aa79d; --border: #2a332b;
    --accent: #2fbf8f; --accent-ink: #06231a;
    --gain: #2fbf8f; --loss: #e0654f; --ad: #e8a33d;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.num { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.muted { color: var(--dim); }
.small { font-size: 12px; }
.warn { color: var(--loss); font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1152px; margin: 0 auto; padding: 0 16px; }
main .wrap { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font-size: 20px; letter-spacing: -0.02em; margin: 28px 0 12px; }
section { margin-bottom: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { margin-bottom: 12px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px; background: var(--accent);
  color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.brand-text { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.brand-text strong { color: var(--accent); }
.brand-tag { display: block; font-size: 11px; font-weight: 400; color: var(--dim); letter-spacing: 0; }
nav.main { display: flex; gap: 4px; margin-left: auto; }
nav.main a {
  color: var(--text); font-weight: 600; padding: 6px 14px; border-radius: 999px;
  transition: transform .15s; white-space: nowrap;
}
nav.main a:hover { text-decoration: none; transform: translateY(-1px); }
nav.main a.active { background: var(--accent); color: var(--accent-ink); }
.cur-form { margin-left: 4px; }
.cur-form select {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 10px; max-width: 190px; cursor: pointer;
}
@media (max-width: 860px) {
  nav.main { order: 3; width: 100%; }
  nav.main a { flex: 1; text-align: center; padding: 6px 4px; font-size: 14px; }
  .cur-form { margin-left: auto; }
}

/* ---------- ticker ---------- */
.ticker { overflow: hidden; border-bottom: 1px solid var(--border); background: var(--surface-alt); padding: 8px 0; }
.ticker-track { display: flex; width: max-content; animation: marquee 55s linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
.ticker-item { display: flex; align-items: center; gap: 6px; padding: 0 24px; font-size: 14px; white-space: nowrap; }
.ticker-item strong { font-weight: 700; }
.t-up { color: var(--gain); font-weight: 600; }
.t-down { color: var(--loss); font-weight: 600; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- cards & buttons ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-title { font-size: 18px; margin: 0 0 4px; }
.btn {
  display: inline-block; border: 0; border-radius: 999px; padding: 10px 22px;
  font: inherit; font-weight: 700; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { text-decoration: none; opacity: .92; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- spotlight ---------- */
.spotlight { padding: 20px; display: flex; flex-wrap: wrap; gap: 16px; }
@media (min-width: 640px) { .spotlight { padding: 28px; } }
.spot-left { flex: 1 1 420px; min-width: 0; }
.spot-head { display: flex; align-items: center; gap: 12px; }
.coin-lg { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.spot-head h1 { font-size: 20px; margin: 0; }
@media (min-width: 640px) { .spot-head h1 { font-size: 24px; } }
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gain); margin-right: 4px; animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.spot-price { font-size: clamp(1.65rem, 6vw, 3rem); font-weight: 700; letter-spacing: -0.02em; margin: 14px 0 2px; line-height: 1.1; }
.spot-sub { font-size: 16px; color: var(--dim); margin: 0; }
.spot-badges { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.spot-right { display: none; flex-shrink: 0; text-align: right; }
@media (min-width: 640px) { .spot-right { display: block; } }
.spot-right .small { margin-top: 4px; }
.spot-foot {
  flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px;
  font-size: 13px; color: var(--dim);
}

/* ---------- ad slots ---------- */
.ad-slot { margin: 20px 0; }
.ad-label { text-align: center; font-size: 11px; letter-spacing: .12em; color: var(--ad); font-weight: 600; margin-bottom: 4px; }
.ad-slot .box { border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-alt); }
.ad-slot.leaderboard .box { min-height: 96px; }
@media (min-width: 640px) { .ad-slot.leaderboard .box { min-height: 112px; } }
.ad-slot.banner .box { min-height: 80px; }

/* ---------- price board ---------- */
.table-card { overflow-x: auto; }
.price-table { display: none; width: 100%; border-collapse: collapse; font-size: 15px; }
.price-table th, .price-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.price-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); }
.price-table tr:last-child td { border-bottom: 0; }
.price-table .r { text-align: right; }
.coin-cell { display: flex; align-items: center; gap: 8px; }
.coin-sm { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.badge { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge.up { color: var(--gain); background: rgba(11, 110, 79, .1); }
.badge.down { color: var(--loss); background: rgba(192, 57, 43, .1); }
@media (prefers-color-scheme: dark) {
  .badge.up { background: rgba(47, 191, 143, .14); }
  .badge.down { background: rgba(224, 101, 79, .14); }
}
.mobile-list { display: block; }
.m-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.m-row:last-child { border-bottom: 0; }
.m-row:hover { text-decoration: none; background: var(--surface-alt); }
.m-coin { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.m-spark { display: none; }
@media (min-width: 480px) { .m-spark { display: block; } }
.m-price { text-align: right; }
@media (min-width: 768px) {
  .price-table { display: table; }
  .mobile-list { display: none; }
}

/* ---------- converter & chart ---------- */
.grid-2 { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-2 .card { padding: 20px; }
.seg { display: inline-flex; background: var(--surface-alt); border-radius: 999px; padding: 3px; gap: 2px; }
.seg-btn {
  border: 0; background: transparent; color: var(--dim); font: inherit; font-size: 14px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.seg-btn.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.conv-grid { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 640px) { .conv-grid { grid-template-columns: 1fr 1fr; } }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.conv-result { background: var(--surface-alt); border-radius: var(--radius); padding: 18px; text-align: center; margin-top: 4px; }
.conv-big { font-size: 26px; font-weight: 700; }
.conv-result .muted { margin-top: 6px; font-size: 14px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.chip img { width: 16px; height: 16px; border-radius: 50%; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.range-row { display: flex; gap: 4px; margin-top: 12px; }
.range-btn {
  border: 0; border-radius: 8px; padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 700;
  background: var(--surface-alt); color: var(--dim); cursor: pointer;
}
.range-btn.active { background: var(--accent); color: var(--accent-ink); }
#chart-box { margin-top: 14px; }
.chart-svg { display: block; }
.chart-caption { font-size: 13px; color: var(--dim); margin-top: 6px; }
.chart-empty { padding: 40px 16px; text-align: center; color: var(--dim); }

/* ---------- popular / quick answers ---------- */
.pop-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .pop-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .pop-grid { grid-template-columns: repeat(3, 1fr); } }
.pop-card { padding: 18px 20px; }
.pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pop-head img { width: 22px; height: 22px; border-radius: 50%; }
.pop-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; border-bottom: 1px solid var(--border); }
.pop-row:last-child { border-bottom: 0; }
.qa-list { display: grid; gap: 12px; }
.qa-list .card { padding: 16px 20px; }
.qa-list .card p { margin: 6px 0 0; }

/* ---------- blog ---------- */
.blog-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
.blog-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; color: var(--text);
}
.blog-card:hover { text-decoration: none; border-color: var(--accent); }
.blog-meta { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--accent); text-transform: uppercase; }
.blog-card h3 { margin: 10px 0 6px; font-size: 18px; line-height: 1.3; }
.blog-card p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.6; }
.read-link { display: inline-block; margin-top: 12px; font-weight: 700; color: var(--accent); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.pill {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; padding: 7px 16px; border-radius: 999px; cursor: pointer;
}
.pill.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- article / faq / legal ---------- */
.article { max-width: 720px; margin: 0 auto; }
.article h1 { font-size: 30px; }
.article h2 { font-size: 21px; margin-top: 28px; }
.article p { line-height: 1.75; }
.lede { font-size: 18px; color: var(--dim); line-height: 1.6; }
.byline { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 10px 0; color: var(--dim); font-size: 14px; margin: 16px 0 8px; }
.keep-reading { background: var(--surface-alt); border-radius: var(--radius); padding: 18px 20px; margin-top: 28px; }
.keep-reading p { margin: 8px 0 0; }
.faq-list { margin-top: 24px; }
.faq-item { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.faq-q {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: 0; padding: 16px 20px; text-align: left;
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
}
.faq-plus { flex-shrink: 0; color: var(--accent); font-size: 20px; line-height: 1; transition: transform .3s; }
.faq-item.open .faq-plus { transform: rotate(45deg); }
.faq-a { display: grid; grid-template-rows: 1fr; opacity: 1; }
.faq-a > div { overflow: hidden; }
.faq-a p { margin: 0; padding: 0 20px 20px; line-height: 1.625; color: var(--dim); }
html.js .faq-a { grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s, opacity .3s; }
html.js .faq-item.open .faq-a { grid-template-rows: 1fr; opacity: 1; }
.legal { max-width: 720px; }
.legal h2 { font-size: 19px; margin-top: 28px; }
.legal p { line-height: 1.75; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; }
.foot-grid { display: grid; gap: 32px; }
@media (min-width: 640px) { .foot-grid { grid-template-columns: 1fr 1fr 1fr; } }
.foot-brand { font-size: 17px; font-weight: 800; }
.foot-brand strong { color: var(--accent); }
.foot-grid p { color: var(--dim); font-size: 14px; line-height: 1.625; max-width: 22rem; }
.foot-h { font-size: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 8px; }
.foot-grid a { display: block; color: var(--dim); padding: 4px 0; font-size: 15px; }
.foot-grid a:hover { color: var(--accent); }
.foot-note { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 16px; font-size: 12px; line-height: 1.625; color: var(--dim); }
.foot-note + .foot-note { margin-top: 8px; border-top: 0; padding-top: 0; }
.foot-note strong { color: var(--text); }

/* ---------- animation ---------- */
/* Content is visible by default. The old rise-in effect hid content until
   JavaScript ran — that is exactly the "empty boxes" failure, so it is off.
   Flash animations for live price changes are kept. */
.reveal { opacity: 1; }
.flash-up { animation: flashUp .9s ease; }
.flash-down { animation: flashDown .9s ease; }
@keyframes flashUp { 0% { background: rgba(11, 110, 79, .22); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: rgba(192, 57, 43, .22); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track, .live-dot, .flash-up, .flash-down { animation: none; }
}
