:root {
  color-scheme: dark;
  --navy-950: #020b18;
  --navy-900: #020f20;
  --navy-850: #07172b;
  --navy-800: #0c1d33;
  --ink: #faf8f3;
  --muted: #aeb9c9;
  --gold: #f3c67a;
  --gold-deep: #c99236;
  --blue: #2f6fe9;
  --line: rgba(243, 198, 122, 0.32);
  --rail-width: 242px;
  --content-width: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--navy-950);
}

* { box-sizing: border-box; }
html { overflow-x: hidden; background: var(--navy-950); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--navy-950); color: var(--ink); letter-spacing: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: var(--gold); color: var(--navy-950); transform: translateY(-140%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; }
.app-rail { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--rail-width); display: flex; flex-direction: column; padding: 24px 18px; background: #031225; border-right: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { flex: 0 0 auto; }
.brand span { display: grid; line-height: 1.05; text-transform: uppercase; color: var(--gold); }
.brand strong { font-family: Georgia, serif; font-size: 19px; font-weight: 600; }
.brand small { margin-top: 3px; color: var(--ink); font-size: 10px; letter-spacing: 0.18em; }
.rail-nav { display: grid; gap: 4px; margin-top: 42px; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 12px; color: var(--muted); border-left: 2px solid transparent; font-size: 14px; font-weight: 650; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,0.035); border-color: var(--gold); }
.nav-glyph { width: 20px; text-align: center; color: var(--gold); font-size: 15px; }
.rail-footer { display: grid; gap: 14px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.install-button { min-height: 42px; border: 1px solid var(--gold); background: transparent; color: var(--gold); font-weight: 750; cursor: pointer; }
.app-frame { min-width: 0; min-height: 100vh; margin-left: var(--rail-width); }
.mobile-header, .bottom-nav { display: none; }
#app-main { width: 100%; max-width: calc(var(--content-width) + 64px); min-width: 0; margin: 0 auto; padding: 32px; overflow-x: clip; outline: none; }

.page-header { display: flex; min-width: 0; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-header > div, .section-heading > div, .hero-content { min-width: 0; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { overflow-wrap: break-word; }
h1 { max-width: 780px; margin-bottom: 8px; font-family: Georgia, serif; font-size: 44px; font-weight: 500; line-height: 1.04; }
.page-header p { max-width: 690px; margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--gold); border-radius: 4px; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.primary-button { background: var(--gold); color: var(--navy-950); }
.secondary-button { background: transparent; color: var(--gold); }
.primary-button:hover { background: #ffd992; }
.secondary-button:hover { background: rgba(243,198,122,0.08); }

.hero { position: relative; min-width: 0; min-height: 420px; display: flex; align-items: end; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--navy-800); }
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; opacity: 0.76; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2,11,24,0.96) 0%, rgba(2,11,24,0.62) 45%, rgba(2,11,24,0.12) 82%), linear-gradient(0deg, rgba(2,11,24,0.95), transparent 55%); }
.hero-content { position: relative; z-index: 1; width: min(620px, 72%); padding: 42px; }
.hero h1 { margin-bottom: 14px; color: var(--gold); }
.hero p { color: #e6e9ee; font-size: 16px; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.section { min-width: 0; padding: 38px 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.section-link { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.story-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.story-card { position: relative; min-height: 270px; display: flex; align-items: end; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--navy-800); }
.story-card img, .story-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(2,11,24,0.98) 0%, rgba(2,11,24,0.12) 72%); }
.story-card-body { position: relative; z-index: 1; width: 100%; padding: 18px; }
.story-card h3 { margin: 5px 0 0; color: var(--gold); font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.story-meta { color: #d8deea; font-size: 12px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }

.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.feature-link { min-height: 154px; padding: 22px; border: 1px solid var(--line); border-radius: 5px; background: var(--navy-850); }
.feature-link:hover { border-color: var(--gold); }
.feature-link h3 { margin: 8px 0; color: var(--gold); font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.feature-link p { margin: 0; color: var(--muted); line-height: 1.5; }

.search-form { display: flex; gap: 10px; margin: 18px 0 28px; }
.search-form input { min-width: 0; flex: 1; min-height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--navy-850); color: var(--ink); outline: none; }
.search-form input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(243,198,122,0.1); }
.topic-row { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; }
.topic-chip:hover { color: var(--gold); border-color: var(--gold); }

.status-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; border: 1px solid rgba(47,111,233,0.42); border-radius: 5px; background: rgba(47,111,233,0.08); }
.status-band strong { display: block; margin-bottom: 5px; color: var(--gold); }
.status-band p { margin: 0; color: var(--muted); }
.empty-state { padding: 42px 24px; border: 1px solid var(--line); border-radius: 5px; text-align: center; background: var(--navy-850); }
.empty-state h2 { font-family: Georgia, serif; font-weight: 500; }
.empty-state p { max-width: 560px; margin: 0 auto 20px; color: var(--muted); line-height: 1.6; }
.account-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--line); }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 62px; padding: 12px 18px; background: var(--navy-850); }
.account-row:is(button) { width: 100%; border: 0; color: inherit; text-align: left; cursor: pointer; }
.account-row:hover { background: var(--navy-800); }
.account-row span { color: var(--muted); font-size: 13px; }

.loading-view { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); }
.loading-mark { width: 38px; height: 38px; border: 2px solid rgba(243,198,122,0.2); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 60; max-width: 360px; padding: 13px 16px; border: 1px solid var(--gold); border-radius: 4px; background: var(--navy-800); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .app-rail { display: none; }
  .app-frame { margin-left: 0; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .mobile-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 8px 16px; background: rgba(3,18,37,0.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
  .icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--gold); }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: rgba(3,18,37,0.98); border-top: 1px solid var(--line); backdrop-filter: blur(16px); }
  .bottom-nav .nav-link { min-height: 50px; display: grid; place-items: center; align-content: center; gap: 2px; padding: 2px; border: 0; font-size: 10px; text-align: center; }
  .bottom-nav .nav-link[aria-current="page"] { background: transparent; color: var(--gold); }
  .bottom-nav .nav-glyph { font-size: 17px; }
  #app-main { padding: 22px 16px; }
  .page-header { align-items: start; }
  h1 { font-size: 37px; }
  .hero { min-height: 520px; }
  .hero-content { width: 82%; padding: 30px; }
  .story-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  #app-main { width: 100vw; max-width: 100vw; padding-inline: 16px; }
  .page-header { display: block; }
  .page-header > .primary-button, .page-header > .secondary-button { margin-top: 16px; }
  h1 { font-size: 34px; }
  .hero { width: 100%; max-width: 100%; min-height: 470px; }
  .hero-media { object-position: 58% center; }
  .hero::after { background: linear-gradient(0deg, rgba(2,11,24,0.98) 0%, rgba(2,11,24,0.3) 80%); }
  .hero-content { width: 100%; max-width: 100%; padding: 24px 20px; }
  .hero h1 { max-width: 100%; font-size: 34px; white-space: normal; overflow-wrap: anywhere; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .section-heading { align-items: start; }
  .section-heading .section-link { flex: 0 0 104px; text-align: right; }
  .story-strip { width: 100%; min-width: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .story-card { flex: 0 0 min(78vw, 320px); min-width: 0; scroll-snap-align: start; }
  .feature-grid { grid-template-columns: 1fr; }
  .search-form { display: grid; }
  .status-band { display: block; }
  .status-band .primary-button { width: 100%; margin-top: 16px; }
  .account-row { align-items: start; flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
