/* Base tokens */
:root {
  --bg: #0a1020;
  --bg-2: #0b1a2e;
  --surface: rgba(255, 255, 255, 0.10);
  --surface-2: rgba(255, 255, 255, 0.14);
  --text: #eaf3ff;
  --muted: #a9b6c7;
  --accent: #2b6cbf;
  --accent-2: #9fb5c8;
  --card: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --radius: 14px;
}

/* Reset & layout helpers */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(135deg, rgba(8,16,40,.95) 0%, rgba(14,28,60,.95) 60%), #06101a;
  min-height: 100vh;
  background-attachment: fixed;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* cobalt watercolor clouds + subtle glow */
  background-image:
    radial-gradient(circle at 20% 25%, rgba(60,120,210,.25) 0 20%, transparent 22%),
    radial-gradient(circle at 70% 60%, rgba(120,180,230,.20) 0 25%, transparent 26%),
    radial-gradient(circle at 40% 70%, rgba(40,90,160,.15) 0 25%, transparent 26%);
  background-size: cover;
  mix-blend-mode: overlay;
  filter: saturate(1.1);
  opacity: 0.9;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* subtle scanlines for depth */
  background-image:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: 0.25;
}

/* Glass utility (fallback for non-backdrop-filter) */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255,255,255,.18); }
}

/* Layout primitives */
.container { width: 100%; max-width: clamp(320px, 92vw, 1100px); margin-inline: auto; padding-inline: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.tag { display: inline-block; padding: .25rem .5rem; border-radius: 999px; font-size: .75rem; background: rgba(43,108,191,.25); color: #eaffff; border: 1px solid rgba(43,108,191,.55); }

/* Image frame styling (required selector) */
.image-frame { aspect-ratio: 16 / 9; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid rgba(210,225,245,.4); box-shadow: inset 0 0 8px rgba(255,255,255,.15); background: #111; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Hero + content sections */
header {
  display: block;
  margin: 1rem auto;
  padding: 1.25rem;
  width: min(100%, 1200px);
  border-radius: 14px;
  background: rgba(18,28,60,.58);
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
  text-align: center;
}
header h1 {
  font-size: clamp(1.8rem, 2vw + 1.2rem, 3.25rem);
  line-height: 1.05;
  margin: 0 0 .35rem;
  letter-spacing: .2px;
  color: transparent;
  background: linear-gradient(90deg, #d9eaff 0%, #a8c7f0 40%, #7aa9e6 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
header .meta {
  color: var(--muted);
  font-size: clamp(0.8rem, 0.4vw + .75rem, 1rem);
  margin-top: .15rem;
}
nav { margin-top: .5rem; }
nav a {
  color: var(--text);
  text-decoration: none;
  padding: .5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.04);
  display: inline-block;
  transition: transform .15s ease, background .2s ease;
}
nav a:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
nav a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Main content */
main { padding: 1rem; }
article { max-width: min(760px, 92vw); margin: 0 auto; padding: 0 0.5rem 1.5rem; }

/* Typography scale for body text with responsive line length */
p, li { color: #eaf3ff; font-size: clamp(1rem, 0.95vw + 0.25rem, 1.125rem); line-height: 1.6; }
h2 { font-size: clamp(1.25rem, 1vw + 1rem, 1.9rem); margin: 1rem 0 .5rem; color: #eaf4ff; }

/* Blockquote styling for mood */
blockquote {
  margin: .75rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

/* List visuals */
ul { padding-left: 1.25rem; margin: .5rem 0; }
li { margin: .25rem 0; }

/* Footer / "glass" sections */
footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,.15); margin-top: 1rem; }
.product-ad, .sponsored-page { flex: 1 1 240px; min-width: 240px; padding: .75rem; display: block; }
footer { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* Glass panels for footer items (and content panels) */
.glass-panel { composes: glass; padding: .75rem; border-radius: 12px; min-width: 180px; text-align: center; }

/* Links inside panels */
footer a { color: var(--text); text-decoration: none; display: block; padding: .5rem 0; }

/* Primary/secondary CTAs (buttons) */
.btn, button, .cta {
  display: inline-block;
  padding: .75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.15);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn {
  background: linear-gradient(135deg, var(--accent), #1a60b4);
  color: #fff;
  box-shadow: 0 6px 18px rgba(43,108,191,.45);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.cta {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.4);
}
.cta:hover { background: rgba(255,255,255,.08); }

/* Link emphasis with underline on focus/hover for accessibility */
a, .btn, .cta { text-decoration-skip-ink: auto; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* Image framing within article (fallback for any future .image-frame usage) */
article .image-frame { border-radius: 12px; overflow: hidden; border: 1px solid rgba(210,225,245,.35); }

/* Responsive helpers for containers/tools */
@media (max-width: 700px) {
  header { padding: 1rem; }
  .grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; align-items: stretch; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Print styles for readability */
@media print {
  body { background: white; color: #000; }
  header, main, footer { background: none; color: #000; }
  a { color: #000; text-decoration: underline; }
}
