/* Base tokens */
:root {
  --bg: #0b0f14;
  --bg-2: #111821;
  --text: #e8f0ff;
  --muted: #a9b4c2;
  --accent: #5ef3ff;
  --accent-2: #8a5cff;
  --glass: rgba(12, 16, 24, 0.28);
  --glass-2: rgba(12, 16, 24, 0.40);
  --border: rgba(255, 255, 255, 0.22);
  --shadow: 0 8px 28px rgba(0,0,0,0.35);
  --radius: 14px;
  --focus: 2px solid var(--accent);
  --gap: 1rem;
  --link: #aee8ff;
}

/* Helpers */
* { box-sizing: border-box; }
html { font-size: 16px; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, #0a0f14 0%, #111821 60%, #0b0f14 100%),
    /* Crosshatch: white-on-black grid for cyberpunk feel */
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 4px);
  background-blend-mode: overlay;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }

/* Layout helpers */
.container {
  width: min(92%, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  gap: var(--gap);
}
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.backdrop { background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* Sectioning elements (styling targets) */
html, body, header, nav, main, article, footer, aside {
  display: block;
}
header {
  padding: 1.75rem 0;
  text-align: center;
  margin-bottom: 0.75rem;
}
header h1 {
  font-size: clamp(1.6rem, 1.4rem + 2.5vw, 2.6rem);
  line-height: 1.15;
  margin: 0.25rem 0 0.25rem;
  letter-spacing: .2px;
}
header .meta {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: .25rem;
  font-size: .92rem;
}

/* Main content styling */
main { padding: 0 0 2rem; }
article { padding: 0; }

/* Image handling (grid-ready frame) */
.image-frame, .featured-image {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  background: #000;
  display: block;
}
.image-frame img, .image-frame > img {
  width: 100%; height: auto; display: block;
  object-fit: cover;
}
.image-frame { aspect-ratio: 16/9; }

/* Content/text blocks */
.content { color: var(--text); }
p, ul, ol, blockquote, h2, h3 { color: var(--text); margin: .75rem 0; }
h2 { font-size: clamp(1.25rem, 0.9rem + 1.8vw, 1.75rem); margin-top: 1rem; }
h3 { font-size: clamp(1.1rem, 0.8rem + 1.2vw, 1.25rem); margin-top: 1rem; }
blockquote { border-left: 3px solid var(--accent); padding-left: .75rem; color: #dbeaff; opacity: .95; }

/* Lists and typography */
ul, ol { padding-left: 1.25rem; margin: .75rem 0; }
li { margin: .25rem 0; }

/* Links and interactive elements (a, button, .btn, .cta) */
a { color: var(--link); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; outline: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Buttons and CTAs (solid and outline variants) */
button, .btn, .cta {
  border: 1px solid rgba(255,255,255,.25);
  background: linear-gradient(to bottom right, rgba(94,243,255,.25), rgba(138,92,255,.25));
  color: var(--text);
  padding: .65rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
button:hover, .btn:hover, .cta:hover { transform: translateY(-1px); }
button:active, .btn:active, .cta:active { transform: translateY(0); }
button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn.outline, .cta.outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,.6);
  color: var(--text);
}
.btn.primary, .cta.primary {
  background: linear-gradient(135deg, rgba(94,243,255,.9), rgba(138,92,255,.9));
  border: 1px solid rgba(255,255,255,.9);
  color: #041018;
}
.btn, .cta { display: inline-flex; align-items: center; gap: .5rem; }

/* Lists styling resets for consistency */
ul { padding-left: 1.25rem; }
li { line-height: 1.6; }

/* Footer / ad panels (glass panels) */
footer {
  padding: 1.25rem 0 2rem;
  margin-top: 1rem;
}
.product-ad, .sponsored-page {
  min-height: 72px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
footer .product-ad a, footer .sponsored-page a { display: block; width: 100%; height: 100%; text-decoration: none; color: inherit; text-align: center; }

/* Footer grid for panels */
footer { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
footer p { text-align: center; color: var(--muted); margin: .5rem 0 0; }

/* Glass panel styling (SF-style frosted glass with fallback) */
.backdrop, .product-ad, .sponsored-page {
  background: rgba(12, 16, 24, 0.28);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .backdrop, .product-ad, .sponsored-page { background: rgba(12,16,24,0.55); } /* fallback */
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Utilities (compact helpers) */
.image-frame, .image-frame img { will-change: transform; }
.container + .container { margin-top: 1rem; }

/* Print styles (readable) */
@media print {
  body { background: white; color: #000; }
  a { color: #000; text-decoration: underline; }
}
