:root {

  --canvas:          #eef1ef;
  --glass:           rgba(255, 255, 255, .66);
  --glass-strong:    rgba(255, 255, 255, .82);
  --hairline:        rgba(18, 32, 24, .07);
  --hairline-soft:   rgba(18, 32, 24, .05);
  --highlight:       rgba(255, 255, 255, .85);

  --ink:             #1c2321;
  --ink-soft:        #4a5450;
  --ink-mute:        #78837e;
  --ink-faint:       #9aa39f;

  --brand:           #0e9d5e;
  --brand-bright:    #14ce71;
  --brand-ink:       #ffffff;
  --brand-line:      rgba(14, 157, 94, .22);
  --up:              #0e9d5e;
  --down:            #c0392b;

  --r-xl:            30px;
  --r-lg:            24px;
  --r-sm:            11px;
  --r-pill:          999px;

  --lift-1: 0 1px 2px rgba(18, 32, 24, .04),
            0 6px 16px -8px rgba(18, 32, 24, .10);
  --lift-2: 0 1px 2px rgba(18, 32, 24, .04),
            0 10px 28px -12px rgba(18, 32, 24, .14),
            0 32px 64px -32px rgba(18, 32, 24, .18);
  --inner-top: inset 0 1px 0 var(--highlight);

  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 300;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2 { margin: 0; font-weight: 300; letter-spacing: -.03em; }
p, dl, dd { margin: 0; }

:where(a, button, input):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.shell {
  display: flex; flex-direction: column;
  min-height: 100svh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 24px 48px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 56px;
}
.logo { width: 112px; height: 30px; flex: none; background: url("../brand/logo.png") left center / contain no-repeat; }

.languages { display: flex; align-items: center; gap: 4px; }
.language {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: .795rem; font-weight: 400;
  color: var(--ink-mute); text-decoration: none; white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.language:hover { color: var(--ink); background: var(--glass); }
.language[aria-current] {
  color: var(--ink); font-weight: 500;
  background: var(--glass-strong);
  border-color: var(--hairline);
  box-shadow: var(--lift-1);
}
.flag {
  width: 20px; height: 14px; flex: none;
  border-radius: 3px;
  outline: 1px solid rgba(18, 32, 24, .1);
  outline-offset: -1px;
  object-fit: cover;
}

.stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 40px; }

.intro { margin: 0 auto 40px; text-align: center; }

h1 {
  font-size: clamp(2.15rem, 5.4vw, 3.5rem);
  line-height: 1.02;
  font-weight: 200;
  letter-spacing: -.045em;
}
h1 em { font-style: normal; font-weight: 300; }

.card {
  position: relative;
  border-radius: var(--r-xl);
  background: var(--glass);
  border: 1px solid var(--hairline);
  box-shadow: var(--lift-2), var(--inner-top);
  -webkit-backdrop-filter: blur(20px) saturate(175%);
  backdrop-filter: blur(20px) saturate(175%);
  overflow: hidden;
}
.card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(155deg, rgba(255, 255, 255, .10), transparent 42%);
}

.label, .fact dt {
  font-size: 10px; font-weight: 400;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--ink-mute);
}

.quote {
  --pad: 30px;
  display: flex; flex-direction: column;
  width: 100%; max-width: 600px;
  margin: 0 auto;
  text-align: center;
  container-type: inline-size;
}
.quote-main {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 34px var(--pad) 28px;
}

.otc {
  margin: 14px 0 12px;
  font-size: clamp(2.6rem, 16cqi, 5.25rem);
  font-weight: 200; line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.change {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: .82rem;
  color: var(--ink-mute);
}
.change-arrow { font-size: .66rem; }
.change-arrow:empty { display: none; }
.change-value { font-weight: 400; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.change[data-trend="up"] .change-arrow { color: var(--up); }
.change[data-trend="down"] .change-arrow { color: var(--down); }

.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--hairline-soft);
}
.fact {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px 12px 20px;
}
.fact + .fact { border-left: 1px solid var(--hairline-soft); }
.fact dd {
  font-size: 1.1rem; font-weight: 300;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: inherit; font-size: .795rem; font-weight: 500;
  letter-spacing: -.005em; white-space: nowrap;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease),
              border-color .2s var(--ease), color .2s var(--ease);
}
.btn svg { width: 14px; height: 14px; flex: none; }

.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-bright); transform: translateY(-1.5px); }
.btn-primary:active { transform: translateY(0) scale(.985); }

.btn-ghost {
  background: var(--glass-strong);
  border-color: var(--hairline);
  color: var(--ink-soft);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--brand-line); transform: translateY(-1.5px); }
.btn-ghost:active { transform: translateY(0) scale(.985); }

.spread {
  margin: -7px 0;
  padding: 7px 14px;
  font-size: 1.1rem; font-weight: 300;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.spread svg { width: 13px; height: 13px; color: var(--ink-mute); }

.status {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 18px;
  padding: 16px var(--pad) 20px;
  border-top: 1px solid var(--hairline-soft);
  font-size: .78rem;
  color: var(--ink-mute);
}
.status-live { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; color: var(--ink-soft); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.status time { font-variant-numeric: tabular-nums; }

.status[data-state="live"] .status-dot { background: var(--brand-bright); animation: pulse 1.8s var(--ease) infinite; }
.status[data-state="stale"] .status-dot { background: var(--down); }
.status[data-state="stale"] .status-live,
.status[data-state="stale"] .status-time { color: var(--down); }

.disclaimer {
  max-width: 64ch;
  margin: 24px auto 0;
  text-align: center;
  font-size: .72rem; line-height: 1.6;
  color: var(--ink-mute);
}

.sheet {
  width: min(360px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--glass-strong);
  box-shadow: var(--lift-2), var(--inner-top);
  -webkit-backdrop-filter: blur(20px) saturate(175%);
  backdrop-filter: blur(20px) saturate(175%);
  color: var(--ink);
  font: inherit;
}
.sheet[open] { animation: sheet-in .32s var(--ease); }
.sheet::backdrop {
  background: rgba(18, 32, 24, .18);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.sheet form { padding: 24px; }
.sheet h2 { margin-bottom: 18px; font-size: 1.05rem; font-weight: 500; letter-spacing: -.02em; }
.sheet label { display: block; margin-bottom: 8px; font-size: .72rem; font-weight: 400; color: var(--ink-mute); }
.sheet input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .9);
  font: inherit; font-size: 1.1rem; font-weight: 300;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--ink);
}
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; padding: 12px 18px; }

.rise { animation: rise .62s var(--ease) both; }
.rise-1 { animation-delay: 55ms; }
.rise-2 { animation-delay: 110ms; }
.rise-3 { animation-delay: 165ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: none; }
}
@keyframes pulse {
  from { box-shadow: 0 0 0 0 rgba(20, 206, 113, .45); }
  to   { box-shadow: 0 0 0 7px rgba(20, 206, 113, 0); }
}

@media (max-width: 940px) {
  .shell { padding: 22px 20px 44px; }
  .topbar { margin-bottom: 40px; }
  .stage { padding-bottom: 24px; }
  .intro { margin-bottom: 30px; }
}

@media (max-width: 620px) {
  .shell { padding: 14px 14px calc(32px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 26px; }
  .stage { justify-content: flex-start; padding-bottom: 0; }
  .intro { margin-bottom: 22px; }
  .logo { width: 92px; height: 25px; }

  .languages { gap: 2px; }
  .language { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .language-name {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .flag { width: 22px; height: 16px; }

  .card { border-radius: var(--r-lg); }
  .quote { --pad: 18px; }
  .quote-main { padding: 26px var(--pad) 22px; }
  .otc { margin: 12px 0 10px; }
  .fact { padding: 14px 10px 16px; }
  .fact dd, .spread { font-size: 1.02rem; }
  .spread { padding: 9px 14px; }
  .status { padding: 14px var(--pad) 16px; }

  .disclaimer { margin-top: 18px; }

  .sheet {
    width: 100%; max-width: 100%;
    margin: auto 0 0;
    border-bottom: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .sheet[open] { animation: sheet-up .32s var(--ease); }
  .sheet form { padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
