:root {
  --navy-deep: #081A2C;
  --navy-secondary: #10253B;
  --gold: #D4AF5F;
  --text-primary: #F8F8F8;
  --text-secondary: #AAB4C0;
  --up: #4CAF7D;
  --down: #C46A6A;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
}
body.light-mode {
  --navy-deep: #FAF7F0;
  --navy-secondary: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #4A4A4A;
  --gold: #B8860B;
}

body.light-mode .site-nav__link,
body.light-mode .status-bar,
body.light-mode .status-bar__label,
body.light-mode .status-bar__clock-text,
body.light-mode .status-bar__market-text {
  color: #1A1A1A !important;
}

body.light-mode .card,
body.light-mode .card--terminal,
body.light-mode .terminal-box {
  background: #FFFFFF !important;
  border-color: rgba(184, 134, 11, 0.3) !important;
}

body.light-mode .card__price,
body.light-mode .terminal-box__row--price span:last-child,
body.light-mode .terminal-box__header {
  color: #1A1A1A !important;
}

body.light-mode .terminal-box__row span {
  color: #4A4A4A !important;
}

body.light-mode .card__unit,
body.light-mode .card__meta {
  color: #6A6A6A !important;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
  background: var(--navy-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
}

/* ---------- Corner branding ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem 0;
}

.site-header__link {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  text-decoration: none;
  flex-shrink: 1;
}

.site-header__logo {
  width: 85px;
  height: auto;
  flex-shrink: 0;
}

.site-header__name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}

/* ---------- Header status bar ---------- */

.status-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: none;
  padding: 0;
}

.status-bar__clocks-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.status-bar__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.status-bar__item + .status-bar__item {
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 0.7rem;
}

.status-bar__market {
  width: 100%;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 201, 77, 0.25);
  letter-spacing: 0.1em;
  justify-content: flex-end;
}

.status-bar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.status-bar__dot.open {
  background: #3ddc84;
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-bar__dot.closed {
  background: #e5484d;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-bar__label {
  letter-spacing: 0.05em;
  color: #FFFFFF;
}

.status-bar__flag {
  font-size: 1.3rem;
  line-height: 1;
}

.flag-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
}


/* India is always the first status-bar item — targeted positionally since it
   shares the same classes as the London item. */
.status-bar > .status-bar__item:first-child .status-bar__label,
.status-bar > .status-bar__item:first-child .status-bar__clock-text {
  color: #D4AF37;
}

/* London is always the second status-bar item — same positional approach. */
.status-bar > .status-bar__item:nth-child(2) .status-bar__label,
.status-bar > .status-bar__item:nth-child(2) .status-bar__clock-text {
  color: #A9C6E8;
}

.status-bar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--text-secondary);
}

.status-bar__dot.open {
  background: var(--up);
  box-shadow: 0 0 6px var(--up);
}

.status-bar__dot.closed {
  background: var(--down);
  box-shadow: 0 0 6px var(--down);
}

.status-bar__market-text {
  font-weight: 700;
}

/* ---------- Markets section ---------- */

.markets {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 3rem;
}

.markets__heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.5rem;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.cards-grid--secondary {
  margin-top: 1.25rem;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 700px) {
  .cards-grid--secondary,
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 701px) and (max-width: 1000px) {
  .cards-grid,
  .cards-grid--secondary {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: rgba(16, 37, 59, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(212, 175, 95, 0.35);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  text-align: left;
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  transform: translateY(12px);
  animation: card-in 0.6s ease forwards;
}
.card__price--secondary {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: -0.5rem;
  opacity: 0.85;
}
.card__price.flash-up {
  animation: flash-green 0.8s ease;
}

.card__price.flash-down {
  animation: flash-red 0.8s ease;
}

@keyframes flash-green {
  0%   { color: var(--up); text-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
  100% { color: inherit; text-shadow: none; }
}

@keyframes flash-red {
  0%   { color: var(--down); text-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
  100% { color: inherit; text-shadow: none; }
}

.card:hover,
.card:focus-visible {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.card__label {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.card__price {
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 0.35rem;
  letter-spacing: 0.01em;
}

.card__price.is-loading {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

.card__unit {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0 0 0.9rem;
}

.card__trend {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card__trend.up { color: var(--up); }
.card__trend.down { color: var(--down); }
.card__trend.flat { color: var(--text-secondary); }

.card__meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card__stale-note {
  color: var(--gold);
}

/* ---------- Terminal-style index cards ---------- */

.card--terminal {
  background: #05070a;
  border: 1px solid rgba(248, 248, 248, 0.3);
  padding: 0.85rem;
}

.card--terminal:hover,
.card--terminal:focus-visible {
  border-color: rgba(248, 248, 248, 0.55);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.terminal-box {
  font-family: 'Courier New', Courier, monospace;
  color: var(--text-primary);
  border: 1px solid rgba(248, 248, 248, 0.6);
  padding: 0.7rem 0.85rem;
}

.terminal-box__header {
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(248, 248, 248, 0.6);
}

.terminal-box__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.15rem 0;
  font-size: 0.75rem;
}

.terminal-box__row--price {
  font-size: 0.9rem;
  font-weight: 700;
  padding-bottom: 0.3rem;
}

.terminal-box__change {
  margin: 0.2rem 0 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.terminal-box__change.up { color: var(--up); }
.terminal-box__change.down { color: var(--down); }

.terminal-box__meta,
.terminal-box__stale {
  margin: 0.75rem 0 0;
  font-size: 0.7rem;
  font-family: var(--font-body);
  color: var(--text-secondary);
}

.terminal-box__stale {
  color: var(--gold);
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* ---------- Detail pages ---------- */

.detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.detail__back {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.detail__back:hover {
  text-decoration: underline;
}

.detail__heading {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 1.25rem 0 0.5rem;
}

.detail__description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.detail__stat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem;
  background: rgba(16, 37, 59, 0.7);
  border: 1px solid rgba(212, 175, 95, 0.35);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
}

.detail__price {
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0;
}

.detail__chart {
  border: 1px solid rgba(212, 175, 95, 0.35);
  border-radius: 16px;
  overflow: hidden;
  background: var(--navy-secondary);
}

.detail__chart iframe {
  display: block;
  width: 100%;
  height: 500px;
  border: 0;
}

/* ---------- Motion ---------- */

.fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: fade-in 0.7s ease forwards;
}

@keyframes fade-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes card-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .status-bar {
    font-size: 0.6rem;
    gap: 0.45rem;
    padding: 0.4rem 0.6rem;
  }
}

@media (max-width: 480px) {
  .site-header { padding: 1rem 0.25rem 0 0; gap: 0.5rem; }
  .site-header__logo { width: 90px; }
  .site-header__name { font-size: clamp(1.3rem, 8vw, 2rem); }
  .status-bar { width: 100%; justify-content: center; }
}
.site-nav {
  display: flex;
  gap: 2.5rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(212, 175, 95, 0.2);
  margin-top: 1rem;
}

.site-nav__link {
  position: relative;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 6px;
  transition: color 0.2s ease;
}

.site-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: #D4AF5F;
  transition: width 0.25s ease;
}

.site-nav__link:hover {
  color: #D4AF5F;
}

.site-nav__link:hover::after {
  width: 100%;
}
.page-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.page-section__heading {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 2rem;
}

.page-section__text {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.services-grid__card {
  background: var(--navy-secondary);
  border: 1px solid rgba(212, 175, 95, 0.25);
  padding: 1.75rem;
  text-align: center;
}

.services-grid__card h3 {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.services-grid__card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.contact-info {
  text-align: center;
}

.contact-info p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.contact-info strong {
  color: var(--text-primary);
}
/* ---------- TV / large display mode (auto-detected by screen width) ---------- */
@media (min-width: 1800px) {
  .site-nav {
    display: none;
  }

  .site-header {
    padding: 2.5rem 3rem 0;
  }

  .site-header__logo {
    width: 90px;
  }

  .site-header__name {
    font-size: clamp(3.5rem, 6vw, 5.5rem);
  }

  .status-bar {
    font-size: 1.1rem;
    gap: 1rem;
  }

  .flag-icon {
    width: 32px;
    height: 32px;
  }

  .markets__heading {
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
  }

  .cards-grid {
    gap: 2rem;
  }

  .card,
  .card--terminal {
    padding: 2rem;
  }

  .terminal-box__header {
    font-size: 1.4rem;
  }

  .terminal-box__row--price span:last-child {
    font-size: 2.2rem;
  }

  .terminal-box__row span {
    font-size: 1.1rem;
  }

  .card__price {
    font-size: 2rem;
  }

  .site-footer {
    font-size: 1rem;
  }
}
.theme-toggle {
  background: none;
  border: 1px solid rgba(212, 175, 95, 0.4);
  color: var(--text-primary);
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  border-color: #D4AF5F;
  transform: scale(1.05);
}
.metal-card {
  background: #0e2138;
  border: 1px solid #1e3a5a;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.metal-card__left {
  display: flex;
  flex-direction: column;
}
.metal-card__symbol {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
}
.metal-card__expiry {
  color: #9a9aa8;
  font-size: 0.9rem;
  font-weight: 400;
  margin-left: 8px;
}
.metal-card__ltp {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 6px;
}
.metal-card__change {
  font-size: 1rem;
  margin-top: 4px;
  font-weight: 600;
}
.metal-card__change--up { color: #2ecc71; }
.metal-card__change--down { color: #e05252; }
.metal-card__change--flat { color: #9a9aa8; }
.metal-card__right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.metal-card__bidask {
  color: #D4AF5F;
  font-size: 1.3rem;
  font-weight: 700;
}
.metal-card__ohl {
  color: #9a9aa8;
  font-size: 0.9rem;
  margin-top: 6px;
}
.metal-card__ltp {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.metal-card__bidask {
  display: flex;
  gap: 8px;
  align-items: center;
}
.metal-card__sep {
  color: #9a9aa8;
}
.price-badge {
  color: #D4AF5F;
  font-weight: 700;
  font-size: 1.3rem;
  padding: 2px 10px;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.price-badge.flash-up, .metal-card__ltp.flash-up {
  background-color: #2ecc71;
  color: #06210f;
}
.price-badge.flash-down, .metal-card__ltp.flash-down {
  background-color: #e05252;
  color: #2b0808;
}
.metal-card {
  min-width: 0;
}
.metal-card__right {
  min-width: 0;
}
.metal-card__bidask {
  flex-wrap: wrap;
  min-width: 0;
}
.price-badge {
  white-space: nowrap;
}
.metals-table {
  border-collapse: collapse;
  width: 100%;
  background: #0e2138;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1.25rem;
}
.metals-table thead tr {
  background: #142942;
}
.metals-table th {
  text-align: left;
  padding: 16px 18px;
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  font-weight: 600;
}
.metals-table th:first-child {
  color: #D4AF5F;
}
.metals-table td {
  padding: 16px 18px;
  border-top: 1px solid #1e3a5a;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}
.product-cell {
  font-weight: 600;
  font-size: 1rem;
}
.product-expiry {
  color: #9a9aa8;
  font-size: 0.8rem;
  font-weight: 400;
  margin-left: 6px;
}
.product-change {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 2px;
}
.change--up { color: #2ecc71; }
.change--down { color: #e05252; }
.change--flat { color: #9a9aa8; }
.price-cell {
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  color: #D4AF5F;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.price-cell--ltp {
  color: #fff;
  font-size: 1.15rem;
}
.ohl-cell {
  color: #9a9aa8;
  font-weight: 400;
  font-size: 0.95rem;
}
.price-cell.flash-up {
  background-color: #2ecc71;
  color: #06210f;
}
.price-cell.flash-down {
  background-color: #e05252;
  color: #2b0808;
}
@media (max-width: 700px) {
  .metals-table { font-size: 0.85rem; }
  .metals-table th, .metals-table td { padding: 10px 8px; }
}
@media (max-width: 480px) {
  .metals-table th,
  .metals-table td {
    padding: 8px 5px;
    font-size: 0.7rem;
  }
  .metals-table th:nth-child(5),
  .metals-table td:nth-child(5),
  .metals-table th:nth-child(6),
  .metals-table td:nth-child(6) {
    display: none;
  }
  .product-cell {
    font-size: 0.75rem;
  }
  .product-expiry {
    display: block;
    margin-left: 0;
    font-size: 0.65rem;
  }
}
.ticker-wrap {
  background: #0e2138;
  border-bottom: 1px solid #1e3a5a;
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
}
.ticker-content {
  display: inline-block;
  white-space: nowrap;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  animation: scrollLeft 55s linear infinite;
  padding-left: 100%;
}
.ticker-content span {
  margin-right: 60px;
}
@keyframes scrollLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
@media (max-width: 600px) {
  .ticker-content {
    font-size: 0.8rem;
  }
}


@media (max-width: 480px) {
  #index-cards-grid.cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }
  #index-cards-grid .card {
    padding: 0.6rem 0.35rem;
    border-radius: 8px;
  }
  #index-cards-grid .card__price {
    font-size: 0.95rem;
  }
  #index-cards-grid .card__price--secondary {
    font-size: 0.55rem;
    margin-top: -0.2rem;
  }
  #index-cards-grid .card * {
    font-size: 0.65rem;
  }
  #index-cards-grid .card__price {
    font-size: 0.95rem !important;
  }

  .product-cell {
    font-size: 0.65rem;
    line-height: 1.2;
  }
  .metals-table td,
  .metals-table th {
    padding: 6px 4px;
    font-size: 0.62rem;
  }
}

@media (max-width: 480px) {
  #index-cards-grid.cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }
  #index-cards-grid .metal-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 0.4rem;
    border-radius: 8px;
  }
  #index-cards-grid .metal-card__right {
    display: none;
  }
  #index-cards-grid .metal-card__symbol {
    font-size: 0.62rem;
  }
  #index-cards-grid .metal-card__ltp {
    font-size: 0.8rem;
  }
  #index-cards-grid .metal-card__change {
    font-size: 0.55rem;
  }
}
