/* MoneyRadar 3.1 — compact home and truthful market-state UI. */
:root {
  --mr-ink: #102a27;
  --mr-forest: #0b332d;
  --mr-deep: #06231f;
  --mr-mint: #b8f56d;
  --mr-mist: #e9f1ed;
  --mr-line: #d9e7df;
  --mr-muted: #60736d;
}

body { background: #f6f9f7; color: var(--mr-ink); }

/* A restrained glass finish keeps the existing palette and text legible. */
body {
  background: radial-gradient(ellipse at 90% 25%, #e6f3ea 0, transparent 35%), #f6f9f7;
}

/* Keep copy crisp: motion may move surfaces but never blur words. */
.scroll-reveal,
.scroll-reveal.is-visible,
.editorial-feature.scroll-reveal,
.editorial-feature.scroll-reveal.is-visible {
  animation: none !important;
  filter: none !important;
  opacity: 1 !important;
}

.header {
  background: rgba(250, 255, 252, .92);
  border-bottom: 1px solid rgba(175, 207, 190, .55);
  box-shadow: 0 8px 30px rgba(6, 45, 35, .07);
}
@supports (backdrop-filter: blur(12px)) {
  .header { background: rgba(250, 255, 252, .82); backdrop-filter: blur(12px) saturate(130%); }
}
.nav a { padding: 18px 0; }
.nav a:after { bottom: 12px; }

.hero {
  min-height: 462px;
  border-radius: 0 0 30px 30px;
  background:
    radial-gradient(circle at 79% 35%, rgba(83, 163, 127, .26), transparent 32%),
    linear-gradient(120deg, #06221f 0%, #0b312c 56%, #143b34 100%);
}

.hero:before { opacity: .65; }
.hero-inner {
  display: block;
  min-height: 462px;
  padding: 76px 0 70px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 665px;
  padding: 0;
  background: none;
}

.hero h1 {
  max-width: 625px;
  margin: 18px 0;
  font-size: clamp(39px, 4.2vw, 62px);
  letter-spacing: -2.5px;
  text-shadow: none;
}

.hero p {
  max-width: 570px;
  margin-bottom: 24px;
  color: #d7e8e1;
  text-shadow: none;
}

.hero-points { margin-top: 32px; }
.hero-visual {
  position: absolute;
  z-index: 1;
  right: max(2vw, calc((100vw - 1160px) / 2 - 25px));
  top: 8px;
  width: 540px;
  height: 435px;
  max-width: none;
  margin: 0;
  transform: none;
  transform-style: flat;
  opacity: .5;
  pointer-events: none;
  transition: opacity .3s ease;
}

.hero-visual:hover { opacity: .62; }
.hero-visual .floating-tag,
.hero-visual .orbital-caption,
.hero-visual .signal-pulse { display: none; }
/* All three objects share one centre; only the texture and orbital planes rotate. */
.hero-visual .globe-disk {
  width: 300px;
  height: 300px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: none;
}
.hero-visual .orbit { left: 50%; top: 50%; max-width: none; margin: 0; }
.hero-visual .orbit-outer { width: 440px; height: 440px; }
.hero-visual .orbit-inner { width: 348px; height: 348px; animation: fieldOrbitInner 58s linear infinite; }
@keyframes fieldOrbitInner {
  from { transform: translate(-50%, -50%) rotate(45deg) rotateY(65deg); }
  to { transform: translate(-50%, -50%) rotate(405deg) rotateY(65deg); }
}

.hero .btn,
.markets-converter,
.converter-submit {
  border-radius: 12px;
  transition: transform .22s ease, box-shadow .22s ease, background-color .22s ease, border-color .22s ease;
}

/* Glass sits behind the label so the text remains sharp and high contrast. */
.hero .btn.secondary {
  background: rgba(234, 255, 244, .12);
  border: 1px solid rgba(221, 255, 231, .34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 10px 24px rgba(0, 22, 18, .14);
}
@supports (backdrop-filter: blur(10px)) {
  .hero .btn.secondary { backdrop-filter: blur(10px) saturate(125%); }
}

.hero .btn:hover,
.markets-converter:hover,
.converter-submit:hover {
  transform: translateY(-2px);
  filter: none;
}

.main { padding-top: 60px; }
.topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.topic-grid .story { min-height: 210px; }
.markets-section { scroll-margin-top: 100px; }
.markets-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.markets-heading h2 { margin: 0; color: var(--mr-ink); font-size: clamp(30px, 3.3vw, 46px); line-height: 1.08; letter-spacing: -1.7px; }
.markets-heading p { max-width: 590px; margin: 9px 0 0; color: var(--mr-muted); }
.market-integrity { display: flex; align-items: center; gap: 9px; color: #356858; font-size: 12px; font-weight: 760; white-space: nowrap; }
.market-integrity::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #78b78f; box-shadow: 0 0 0 5px #dff0e5; }

.markets-shell {
  overflow: hidden;
  border: 1px solid var(--mr-line);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(235,246,239,.9));
  box-shadow: 0 18px 42px rgba(12, 57, 46, .075), inset 0 1px 0 rgba(255,255,255,.95);
}

.market-tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--mr-line); background: rgba(255, 255, 255, .68); }
.market-tab {
  position: relative;
  flex: 1 0 max-content;
  min-height: 57px;
  padding: 0 22px;
  border: 0;
  border-right: 1px solid var(--mr-line);
  background: transparent;
  color: #49645c;
  font-size: 13px;
  font-weight: 780;
  text-align: left;
  transition: color .2s ease, background-color .2s ease;
}
.market-tab:last-child { border-right: 0; }
.market-tab::after { content: ""; position: absolute; right: 18px; bottom: 0; left: 18px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; transition: background-color .2s ease; }
.market-tab:hover { background: #edf6ef; color: #0d493d; }
.market-tab[aria-selected="true"] { color: #0c4137; background: #f5fbf6; }
.market-tab[aria-selected="true"]::after { background: #75b991; }

.market-panel { padding: 29px; }
.market-status {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 18px;
  border: 1px solid #dbe9e0;
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
}
.market-status-main { display: flex; gap: 12px; }
.market-status-icon { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: #e4f3e8; color: #2b7659; font-weight: 900; }
.market-status strong { display: block; font-size: 13px; color: #214b40; }
.market-status p { margin: 3px 0 0; color: var(--mr-muted); font-size: 12px; }
.market-timestamp { margin: 0; color: #6b8279; font-size: 11px; line-height: 1.45; text-align: right; white-space: nowrap; }

.market-instruments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px 0 0; margin: 0; list-style: none; }
.market-instrument { min-height: 92px; padding: 15px 16px; border: 1px solid #e0ebe4; border-radius: 14px; background: rgba(255, 255, 255, .72); transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.market-instrument:hover { transform: translateY(-2px); border-color: #b8d9c5; box-shadow: 0 12px 24px rgba(15, 73, 57, .08); }
.market-instrument-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.market-instrument b { color: #183f36; font-size: 13px; }
.market-instrument code { padding: 3px 6px; border-radius: 6px; background: #edf5ef; color: #55766a; font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.market-empty-value { display: block; margin-top: 13px; color: #98aaa2; font-size: 20px; font-weight: 760; letter-spacing: .04em; }
.market-pending { display: block; margin-top: 2px; color: #70867c; font-size: 11px; }

.currency-market-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.markets-converter { display: inline-flex; align-items: center; gap: 9px; border: 1px solid #227156; padding: 11px 15px; background: #0f4c3e; color: #fff; font-size: 13px; font-weight: 780; }
.markets-converter:hover { background: #0a3e33; box-shadow: 0 11px 22px rgba(10, 62, 51, .18); text-decoration: none; }

.converter-card { margin-top: 18px; padding: 22px; border: 1px solid #b9d9c7; border-radius: 16px; background: #f0f8f2; }
.converter-card[hidden] { display: none; }
.converter-top { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.converter-top h3 { margin: 0; color: #173e35; font-size: 18px; letter-spacing: -.45px; }
.converter-top p { max-width: 640px; margin: 5px 0 0; color: #587168; font-size: 12px; }
.converter-close { width: 32px; height: 32px; border: 1px solid #c4dacb; border-radius: 9px; background: #fff; color: #49645c; font-size: 21px; line-height: 1; transition: transform .2s ease, background-color .2s ease; }
.converter-close:hover { transform: rotate(5deg); background: #e3f1e7; }
.converter-fields { display: grid; grid-template-columns: 1.2fr .8fr .8fr 1.2fr auto; gap: 12px; align-items: end; margin-top: 18px; }
.converter-field { display: grid; gap: 6px; }
.converter-field label { color: #49685e; font-size: 11px; font-weight: 780; }
.converter-field input,
.converter-field select { width: 100%; min-height: 43px; border: 1px solid #c7dbce; border-radius: 10px; background: #fff; color: #193e35; padding: 9px 11px; }
.converter-submit { min-height: 43px; border: 1px solid #167252; border-radius: 10px; padding: 0 15px; background: #167252; color: #fff; font-size: 12px; font-weight: 780; }
.converter-submit:hover { background: #0d5b42; box-shadow: 0 8px 18px rgba(9, 78, 54, .16); }
.converter-result { min-height: 24px; margin: 15px 0 0; color: #355f50; font-size: 13px; font-weight: 710; }
.converter-result strong { color: #104837; }
.converter-result.is-error { color: #a14841; }

.editorial-feature:hover,
.story:hover,
.market-instrument:hover { filter: none; }

@media (max-width: 980px) {
  .hero { min-height: 515px; }
  .hero-inner { min-height: 515px; }
  .hero-visual { right: -130px; top: 58px; opacity: .36; }
  .markets-heading { align-items: start; flex-direction: column; }
  .market-instruments { grid-template-columns: repeat(2, 1fr); }
  .converter-fields { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
  .hero { min-height: 496px; }
  .hero-inner { min-height: 496px; padding: 50px 0 40px; }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: clamp(36px, 11vw, 50px); letter-spacing: -1.8px; }
  .hero-visual { top: 130px; right: -60px; width: 410px; height: 290px; opacity: .23; transform: scale(.82); }
  .hero-points { margin-top: 25px; }
  .main { padding-top: 42px; }
  .topic-grid { grid-template-columns: 1fr; }
  .markets-shell { border-radius: 17px; }
  .market-tabs { margin: 0; }
  .market-tab { min-height: 50px; padding: 0 17px; font-size: 12px; }
  .market-panel { padding: 18px; }
  .market-status { flex-direction: column; gap: 11px; }
  .market-timestamp { text-align: left; }
  .market-instruments { grid-template-columns: 1fr; padding-top: 12px; }
  .market-instrument { min-height: 80px; }
  .currency-market-actions { justify-content: stretch; }
  .markets-converter { justify-content: center; width: 100%; }
  .converter-card { padding: 17px; }
  .converter-fields { grid-template-columns: 1fr; }
  .converter-submit { min-height: 44px; }
}

/* Keep all four navigation links visible without a hidden horizontal scroller. */
@media (max-width: 540px) {
  .nav { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; white-space: normal; }
  .nav a { display: flex; align-items: center; justify-content: center; min-height: 44px; line-height: 1.25; }
  html { scroll-padding-top: 180px; }
  section[id] { scroll-margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual,
  .hero-visual *,
  .market-instrument,
  .market-tab,
  .hero .btn,
  .markets-converter,
  .converter-submit { animation: none !important; transition: none !important; }
}
