/* 1. Tokens & Theme */
:root{
  --bg: #efe3cc;           /* base beige */
  --bg-2: #cdc6ba;         /* pewter mid */
  --bg-3: #e8e0d0;         /* light beige */
  --text: #0b0b0b;          /* high-contrast text */
  --muted: #5a5a5a;
  --accent: #d6c5a0;        /* pewter-beige accent */
  --accent-2: #8b8a84;      /* cooler pewter for contrasts */
  --glass: rgba(255,255,255,.14);
  --glass-2: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.34);
  --shadow: 0 8px 20px rgba(0,0,0,.15);
  --radius: 14px;
  --focus-ring: 0 0 0 3px rgba(255,255,255,.95);
  --focus-offset: 2px;
}

/* 2. Layered Background (gradient + subtle noise/scanlines) */
/* Global layout sizing */
html, body { height: 100%; }
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.5;
  background:
    /* oil-spill-like rainbow blobs */
    radial-gradient(circle at 20% 10%, rgba(255, 243, 206, .55) 0 25%, transparent 26%),
    radial-gradient(circle at 70% 25%, rgba(199, 190, 170, .55) 0 28%, transparent 29%),
    conic-gradient(from 180deg at 40% -10%, #f5e0c9 0 20%, #d7c7a9 20% 40%, #b9ae96 40% 60%, #f0e3d0 60% 80%, #dccfb7 80% 100%),
    linear-gradient(135deg, var(--bg-2) 0%, var(--bg) 60%, var(--bg-3) 100%);
  background-blend-mode: normal, normal, multiply, normal;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* prevent text rendering glitches on some browsers with oil pattern */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Subtle scanlines/noise overlay (pure CSS) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(to right, rgba(0,0,0,.03) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
  opacity: .35;
  /* slight tint to keep readability over colored bg */
  filter: saturate(110%);
}

/* 3. Global typography helpers */
h1, h2, h3 { margin: .75em 0 .5em; line-height: 1.15; font-weight: 700; color: var(--text); }
p { margin: 0 0 1em; }
ul, li { margin: 0 0 0.75em 1.25rem; padding: 0; list-style: disc; }
a { color: var(--accent-2); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* Focus visibility for accessibility */
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

/* 4. Glass panels (backdrop-filter with fallbacks) */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  /* Fallback for environments without backdrop-filter */
  /* CSS fallback: a slightly more opaque background if blur isn't supported */
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255,255,255,.86); }
}
.content { color: var(--text); }

/* 5. Layout helpers & utilities */
.container {
  width: 100%;
  max-width: clamp(640px, 90vw, 1200px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid { display: grid; gap: 1rem; }

/* Responsive grid utilities */
@media (min-width: 700px) {
  .grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 699px) {
  ul { padding-left: 1.25rem; }
  .grid { grid-template-columns: 1fr; }
}

/* Card utility */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.tag {
  display:inline-block;
  padding:.25em .5em;
  border-radius:999px;
  font-size:.75rem;
  color:#111;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,0,0,.08);
}

/* Image frame styling (used by .image-frame if present) */
.image-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform .4s ease;
}
.image-frame:hover img { transform: scale(1.04); }

/* 6. Buttons & CTAs */
.btn {
  display: inline-block;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.9);
  color: #111;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, #f0e4d1, #d7c9ad);
  color: #111;
}
.btn.secondary {
  background: rgba(255,255,255,.75);
}
.cta { text-transform: none; }

/* 7. Specific page element styling */
header, nav, main, article, aside, footer { /* semantic blocks */ }

/* Header hero defaults */
header {
  padding: 1.25rem 0 0.75rem;
}
header h1 { font-size: clamp(1.8rem, 4vw + 1rem, 3.5rem); line-height: 1.12; margin: .25rem 0 .25rem; }
header .meta { color: var(--muted); font-size: clamp(0.9rem, 1.4vw, 1.05rem); }

/* Nav links styling for accessibility and cohesion */
nav a {
  display: inline-block;
  padding: .4rem .75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.08);
}
nav a:hover, nav a:focus { text-decoration: underline; }

/* Main article visuals */
main { padding: 1rem 0 2rem; }
.featured-image { margin: .75rem 0 1rem; }

/* Footer / Ad panels */
.product-ad, .sponsored-page {
  display: block;
  text-align: center;
  padding: .75rem;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin: .5rem 0;
}
.product-ad a, .sponsored-page a { color: #111; text-decoration: none; font-weight: 700; display: block; padding: .25rem; }
.product-ad a:hover, .sponsored-page a:hover { text-decoration: underline; }

/* 8. Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; color: #000; }
  .glass { background: #fff; border: 1px solid #ccc; box-shadow: none; }
  .no-print { display: none; }
}

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