:root {
  --ink: #090909;
  --paper: #f3f3f0;
  --white: #ffffff;
  --line: #d7d7d2;
  --muted: #6b6b67;
  --red: #c8102e;
  --focus: #767676;
}

* { box-sizing: border-box; }
html { background: var(--ink); color-scheme: light; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.currency-shell { min-height: 100vh; background: var(--paper); }
.currency-app { width: min(100%, 880px); min-height: 100vh; margin: 0 auto; padding: 0 24px; }
.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: var(--ink); color: var(--white); font-size: 12px; font-weight: 800; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.025em; }
.back-link { color: var(--ink); border-bottom: 1px solid var(--ink); text-decoration: none; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.brand:focus-visible, .back-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.currency-hero { padding: 58px 0 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.eyebrow { margin: 0 0 13px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(42px, 9vw, 72px); line-height: .94; letter-spacing: -.065em; }
.intro { max-width: 540px; margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.currency-badge, .source-badge { flex: none; padding: 8px 10px; border: 1px solid var(--ink); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }

.quote-card { border: 1px solid var(--ink); background: var(--ink); color: var(--white); padding: 30px; }
.quote-heading, .quote-meta, .chart-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; }
.quote-heading .eyebrow { color: #aaa9a4; }
.quote-pair { margin: 0; color: #d7d7d2; font-size: 15px; font-weight: 700; }
.live-indicator { display: inline-flex; align-items: center; gap: 8px; color: #d7d7d2; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.live-indicator > span { width: 7px; height: 7px; border-radius: 50%; background: #ff244b; }
.current-rate { margin: 45px 0 42px; color: #ff244b; font-size: clamp(50px, 11vw, 86px); font-weight: 800; line-height: .92; letter-spacing: -.065em; overflow-wrap: anywhere; }
.quote-meta { padding-top: 16px; border-top: 1px solid #343432; color: #aaa9a4; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }

.chart-card { margin-top: 32px; border: 1px solid var(--ink); background: var(--white); padding: 30px; box-shadow: 8px 8px 0 var(--ink); }
.chart-heading { align-items: center; margin-bottom: 24px; }
.chart-heading h2, .method-note h2 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.chart-wrap { position: relative; width: 100%; overflow: hidden; border-top: 1px solid var(--line); }
#rate-chart { display: block; width: 100%; height: auto; min-height: 290px; touch-action: none; }
.grid-line { stroke: #dfdfda; stroke-width: 1; }
.axis-line { stroke: var(--ink); stroke-width: 1.2; }
.axis-label, .tick-label { fill: #6b6b67; font-family: inherit; font-size: 11px; font-weight: 700; }
.axis-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.rate-area { fill: rgba(200, 16, 46, .09); }
.rate-line { fill: none; stroke: var(--red); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.last-point { fill: var(--red); stroke: var(--white); stroke-width: 4; }
.focus-guide { stroke: #989894; stroke-width: 1; stroke-dasharray: 4 4; }
.focus-point { fill: var(--white); stroke: var(--red); stroke-width: 4; }
.interaction-layer { fill: transparent; cursor: crosshair; }
.chart-tooltip { position: absolute; z-index: 2; min-width: 132px; transform: translate(-50%, -112%); border: 1px solid var(--ink); background: var(--ink); color: var(--white); padding: 10px 12px; pointer-events: none; }
.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip strong { color: #ff244b; font-size: 15px; }
.chart-tooltip span { margin-top: 4px; color: #c7c7c2; font-size: 10px; }
.chart-status { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.method-note { margin-top: 38px; border-left: 4px solid var(--red); padding: 6px 0 6px 22px; }
.method-note p:last-child { max-width: 650px; margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.footer { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

@media (max-width: 640px) {
  .currency-app { padding: 0 18px; }
  .topbar { min-height: 74px; }
  .currency-hero { padding: 42px 0 28px; display: block; }
  .currency-badge { display: inline-block; margin-top: 22px; }
  .quote-card, .chart-card { padding: 23px 20px; }
  .chart-card { box-shadow: 5px 5px 0 var(--ink); }
  .quote-heading, .quote-meta, .chart-heading { flex-direction: column; }
  .current-rate { margin: 38px 0 34px; }
  .source-badge { align-self: flex-start; }
  #rate-chart { min-height: 245px; }
  .footer { align-items: flex-start; justify-content: center; flex-direction: column; }
}

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