/* Section: Base & Palette */
:root {
  --bg: #0a1020;
  --bg-2: #0b1b2b;
  --text: #eaf4ff;
  --muted: #a9b8d7;
  --accent: #4dd3ff;
  --accent-2: #8aa0ff;
  --surface: rgba(8, 14, 28, 0.72);
  --glass: rgba(10, 18, 38, 0.22);
  --border: rgba(255, 255, 255, 0.28);
  --shadow: 0 6px 18px rgba(0,0,0,.35);
}

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

html, body { height: 100%; }
html { font-size: 16px; }
body {
  margin: 0;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: linear-gradient(180deg, var(--bg), var(--bg-2) 60%, #050814);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  isolation: isolate;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  overflow-y: auto;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* subtle radial glows for depth */
  background:
    radial-gradient( circle at 20% 0%, rgba(64,160,255,0.15), transparent 40% ),
    radial-gradient( circle at 80% 20%, rgba(18,40,110,0.15), transparent 40% );
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* pure CSS scanlines (layered) */
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 100% 2px, 2px 100%;
  mix-blend-mode: overlay;
  opacity: 0.5;
  z-index: 0;
}
@media (prefers-reduced-motion: reduce) {
  body::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Section: Layout helpers */
.container { max-width: clamp(320px, 88vw, 1100px); margin-inline: auto; padding-inline: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card { background: var(--glass); border: 1px solid var(--border); border-radius: 12px; padding: .9rem; box-shadow: var(--shadow); }

/* Section: Structural elements styling */
html, body, header, nav, main, article, footer, aside {
  display: block;
}
header {
  padding: 2rem 0;
  text-align: center;
  position: relative;
  z-index: 1;
}
header > h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.4rem, 4vw + 1rem, 2.6rem);
  line-height: 1.05;
  letter-spacing: .2px;
}
header .meta {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}
nav { margin-top: .75rem; }
nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: .35rem .6rem;
  border-radius: 6px;
  border: 1px solid transparent;
}
nav a:hover { text-decoration: underline; }
main { padding: 1rem 0 2rem; }
article {
  margin: 0 auto;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.22);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 900px;
  box-shadow: var(--shadow);
}
footer {
  padding: 1.5rem 0 2rem;
  text-align: center;
}
.image-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  margin: 1rem auto;
}
.image-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  image-rendering: -webkit-optimize-contrast;
}
a, button, .btn, .cta {
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  padding: .55em 1em;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.btn {
  background: linear-gradient(135deg, rgba(77,211,255,0.95), rgba(40,90,170,0.95));
  border: 1px solid rgba(255,255,255,.6);
  color: #03101a;
}
.btn:hover { transform: translateY(-1px); }
.btn.secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,.28);
  color: var(--text);
}
.cta {
  background: var(--accent);
  color: #02101a;
  border: 1px solid rgba(255,255,255,.6);
}
.tag {
  display: inline-block;
  padding: .25em .5em;
  border-radius: 999px;
  font-size: .75rem;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--text);
}
ul, li { margin: 0 0 .6rem 1rem; padding: 0; }
ol { margin: 0 0 1rem 1rem; padding: 0; }
li > p { margin: .25rem 0; }

/* Section: Typography & helpers */
.content { line-height: 1.6; color: var(--text); font-size: clamp(0.95rem, 0.25vw + 0.95rem, 1.05rem); }
.content p { margin: .5rem 0 1rem; }
.content h2, .content h3 { margin: .75rem 0 .5rem; font-weight: 700; }
.content h2 { font-size: clamp(1.1rem, 2vw + 1rem, 1.8rem); }
.content h3 { font-size: clamp(1rem, 1.5vw + .8rem, 1.25rem); }

/* Section: Glass fallback for non-backdrop contexts */
@supports not (backdrop-filter: blur(8px)) {
  header, article { background: rgba(8, 12, 28, 0.9); }
  .card { background: rgba(8, 12, 28, 0.95); }
  .image-frame { border-color: rgba(255,255,255,0.5); }
}

/* Section: Print (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  header, main, footer { background: transparent; box-shadow: none; border: none; }
  a { text-decoration: underline; color: #00f; }
}
 
/* Section: Accessibility & motion preferences (focus, contrast) */
:focus { outline: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Section: Utility shortcuts (optional but ready) */
.container + main { margin-top: 0; }
@media (min-width: 700px) {
  main { padding: 1.5rem 0 2.5rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: fadeIn 420ms ease both; }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}