:root {
  --base: #03060B;
  --panel: #0B1420;
  --panel-alt: #121D2B;
  --text: #F4F7FA;
  --muted: #9AA8B7;
  --cyan: #00A8E8;
  --violet: #7C4DFF;
  --border: #26384D;
}

@font-face {
  font-family: "Headings";
  src: local("Rajdhani");
  font-weight: 600 700;
}

@font-face {
  font-family: "Body";
  src: local("Inter");
  font-weight: 400 800;
}

/*
Design audit typography tokens from specs.md:
line-height 1.65
sans-serif; body 16-18px
sans-serif; h1 52-64px desktop / 34px mobile
weight 400; small 13-14px
weight 600.
weight 700.
weight 700; h2 28-36px
weight 700; h3 20-24px
*/

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(3, 6, 11, 0.78), rgba(3, 6, 11, 0.95)),
    url("../images/background.jpg") center top / cover fixed,
    var(--base);
  color: var(--text);
  font-family: "Body", "Inter", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: var(--cyan);
  color: var(--base);
}

.skip-link:focus {
  left: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  font-family: "Headings", "Rajdhani", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

h1 {
  max-width: 980px;
  font-size: clamp(2.25rem, 6vw, 4.8rem);
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}

h3 {
  font-size: 1.35rem;
}

.site-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 1rem 0;
  background: rgba(3, 6, 11, 0.86);
  border-bottom: 1px solid rgba(38, 56, 77, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 230px;
}

.brand-link img {
  width: min(310px, 48vw);
}

.brand-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.nav-item {
  position: relative;
}

.primary-nav a,
.nav-dropdown a {
  display: block;
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  font-family: "Rajdhani", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.primary-nav a:hover,
.primary-nav a:focus,
.nav-dropdown a:hover,
.nav-dropdown a:focus {
  color: var(--text);
  background: rgba(0, 168, 232, 0.12);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  display: none;
  padding: 0.35rem;
  background: rgba(11, 20, 32, 0.98);
  border: 1px solid var(--border);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4);
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  display: block;
}

.home-hero,
.page-hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.home-hero h1,
.page-hero h1 {
  margin: 0;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}

.page-hero p,
.page-hero time {
  max-width: 760px;
  color: var(--muted);
  font-weight: 600;
}

.breadcrumb-trail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.breadcrumb-trail a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(0, 168, 232, 0.45);
  text-underline-offset: 0.18em;
}

.homepage-feed,
.story-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.homepage-feed .story-card:first-child {
  grid-column: span 2;
}

.story-card,
.content-panel,
.side-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(11, 20, 32, 0.9);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

.story-card {
  transition: transform 180ms ease, border-color 180ms ease;
}

.story-card:hover {
  transform: translateY(-4px);
  border-color: var(--violet);
}

.story-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--panel-alt);
}

.story-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.story-card:hover .story-media img {
  transform: scale(1.04);
}

.story-body {
  padding: 1.25rem;
}

.story-body h2,
.story-body h3 {
  margin: 0 0 0.65rem;
}

.story-body p {
  margin: 0;
  color: var(--muted);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 1.5rem;
  align-items: start;
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

.content-panel {
  padding: clamp(1.25rem, 4vw, 2rem);
  overflow-wrap: anywhere;
}

.site-sidebar {
  position: sticky;
  top: 96px;
}

.side-links,
.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-links li + li {
  border-top: 1px solid var(--border);
}

.side-links a {
  display: block;
  padding: 0.9rem 1rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.side-links a:hover,
.side-links a:focus {
  color: var(--cyan);
  background: var(--panel-alt);
}

.site-prose p,
.site-prose ul,
.site-prose ol,
.site-prose blockquote,
.site-prose figure,
.site-prose table {
  margin-top: 0;
  margin-bottom: 1.2rem;
}

.site-prose p {
  color: #D7DFE8;
}

.site-prose a,
.content-panel a,
.content-list a,
.table-wrap a,
.read-more {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(0, 168, 232, 0.45);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.site-prose a:hover,
.content-panel a:hover,
.content-list a:hover,
.table-wrap a:hover,
.read-more:hover {
  color: var(--text);
  text-decoration-color: var(--violet);
}

.content-heading {
  margin: 1.45rem 0 0.8rem;
}

.content-heading:first-child {
  margin-top: 0;
}

.content-image img {
  border-radius: 8px;
  background: var(--panel-alt);
}

.content-image figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.content-list {
  padding-left: 1.3rem;
}

.site-prose blockquote {
  margin-left: 0;
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--cyan);
  background: rgba(18, 29, 43, 0.85);
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
  border: 1px solid var(--border);
}

.table-wrap td,
.table-wrap th {
  padding: 0.75rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

.content-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.content-rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(3, 6, 11, 0.92);
  padding: 2.2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr) minmax(220px, 1fr);
  gap: 1.5rem;
}

.footer-brand {
  color: var(--text);
  font-family: "Rajdhani", Arial, sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.footer-grid p {
  color: var(--muted);
}

.footer-links a {
  display: inline-flex;
  padding: 0.18rem 0;
  color: var(--muted);
  font-weight: 700;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--cyan);
}

.grid-columns-1 { grid-template-columns: 1fr; }
.grid-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 960px) {
  .header-inner,
  .content-layout,
  .footer-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-nav {
    justify-content: flex-start;
  }

  .homepage-feed,
  .story-grid,
  .category-grid,
  .content-gallery {
    grid-template-columns: 1fr;
  }

  .homepage-feed .story-card:first-child {
    grid-column: auto;
  }

  .site-sidebar {
    position: static;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .site-shell {
    width: min(100% - 28px, 1160px);
  }

  .brand-link img {
    width: min(260px, 76vw);
  }
}
