/* Base tokens */
:root {
  --bg: #0b0f14;
  --bg-2: #111722;
  --rose: #e5cbd3;
  --rose-2: #d4b8c0;
  --sage: #8fb79b;
  --sage-2: #6a8f7f;
  --text: #e8f0ee;
  --muted: #b8c8c2;
  --accent: #7bd2a8;
  --accent-2: #4aa09a;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 8px 24px rgba(0,0,0,.28);
  --radius: 14px;
  --radius-sm: 10px;
  --focus: 0 0 0 3px rgba(123,210,168,.6);
}

/* Baseline resets */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }

/* Layout scaffolding */
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: #0b0f14;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  isolation: isolate;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 110, 140, .25) 0 40px, transparent 40px),
    radial-gradient(circle at 70% 60%, rgba(100, 180, 140, .25) 0 50px, transparent 50px);
  background-blend-mode: overlay, overlay;
}

/* Subtle, pure-CSS layered noise/scanline effect */
body::before,
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; }
body::before {
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.04) 0 1px, transparent 1px 2px);
  opacity: .75;
  mix-blend-mode: overlay;
}
body::after {
  background:
    radial-gradient(circle at 25% 25%, rgba(255, 100, 140,.18), transparent 60px),
    radial-gradient(circle at 75% 60%, rgba(120, 210, 160,.14), transparent 60px);
  opacity: .9;
  mix-blend-mode: overlay;
}

/* Global anchor behavior */
a { color: var(--accent-2); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* Container utilities */
.container { width: 100%; max-width: clamp(320px, 90vw, 1100px); padding-inline: 1rem; margin-inline: auto; }

/* Grid utilities */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }

/* Card utility */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Tag utility */
.tag {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  background: rgba(123,210,168,.25);
  color: #eafff2;
  border: 1px solid rgba(123,210,168,.6);
}

/* Image frame styling (also for backward compatibility with .image-frame) */
.image-frame,
.image-frame img {
  border-radius: 12px;
}
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transform: scale(1);
  transition: transform .3s ease;
}
.image-frame:hover img { transform: scale(1.03); }

/* Featured image container (fallback for non .image-frame usage) */
.featured-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}
.featured-image img { width: 100%; height: auto; display: block; }

/* Glass-panel aesthetic for major regions */
header,
main,
footer,
aside {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  position: relative;
  z-index: 1;
  overflow: clip;
}

/* Header hero styling */
header {
  text-align: center;
  padding: 1.25rem 1rem 1rem;
}
header h1 {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: clamp(1.75rem, 2.8vw + 1rem, 3rem);
  line-height: 1.15;
  margin: .25rem 0 0.25rem;
  letter-spacing: .2px;
  color: var(--text);
}
header .meta {
  color: var(--muted);
  font-size: clamp(0.75rem, 0.9vw + 0.6rem, 0.9rem);
  margin-top: .25rem;
}

/* Nav styling inside header */
nav {
  margin-top: .75rem;
}
nav a {
  padding: .5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  color: var(--text);
  text-decoration: none;
}
nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }

/* Main content flow */
main { display: block; padding: 1rem 0; }
article { display: block; padding: 0; }

/* Typography rhythm */
h2 { font-size: clamp(1.25rem, 1vw + 1.25rem, 1.75rem); margin: 0.75rem 0 0.25rem; color: var(--text); }
h3 { font-size: clamp(1.05rem, 0.8vw + 1rem, 1.25rem); margin: 0.75rem 0 .25rem; color: var(--text); }
p { font-size: clamp(0.92rem, 0.8vw + 0.9rem, 1.05rem); color: var(--text); margin: 0.6rem 0; }

/* Blockquote styling */
blockquote {
  margin: 1rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--accent-2);
  background: rgba(0,0,0,.15);
  border-radius: 6px;
  color: #f4fbf7;
}

/* Lists (ul, li) styling */
ul { padding-left: 1.25rem; margin: .25rem 0; }
li { margin: .25rem 0; }

/* Product ad section in footer */
.product-ad,
.sponsored-page {
  display: block;
  text-align: center;
  padding: .5rem;
}
.product-ad a,
.sponsored-page a {
  display: inline-block;
  padding: .6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(123,210,168,.25);
  color: var(--text);
  text-decoration: none;
}
.product-ad a:hover,
.sponsored-page a:hover { background: rgba(123,210,168,.4); text-decoration: none; }

/* Footer layout and typography */
footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
}
footer p { text-align: center; color: var(--muted); margin: .25rem 0 0; }

/* Responsive tweaks */
@media (min-width: 700px) {
  main { padding: 1rem 0; }
  footer { grid-template-columns: 1fr 1fr; }
  article { padding: 0; }
}
@media (min-width: 1024px) {
  .container { padding-inline: 0; }
}

/* Button and link variants (interactive) */
button,
.btn,
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.12);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
  user-select: none;
}
.btn:hover,
.cta:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.btn:active,
.cta:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(255,255,255,.5);
  color: #062b22;
}
.btn.ghost {
  background: transparent;
  border-color: rgba(255,255,255,.5);
}
.btn:focus-visible,
.cta:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  outline-offset: 2px;
}

/* Accessibility: higher contrast for focus states on links */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(123,210,168,.6);
  border-radius: 6px;
}

/* Print styles for readability */
@media print {
  body { background: white; color: black; }
  header, main, footer { background: transparent; border: none; box-shadow: none; }
  a { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; transform: none !important; }
}