/* Base tokens */
:root {
  --bg: #1b0b12;          /* deep maroon core */
  --bg-2: #2a0f14;        /* accent maroon edge */
  --text: #f5ecd6;          /* beige text (high contrast on dark) */
  --muted: #d9c9ad;         /* muted/beige secondary text */
  --accent: #e6d0a6;        /* warm beige accent */
  --accent-2: #c6a886;      /* secondary accent for UI contrast */
  --glass: rgba(246, 238, 217, 0.14);      /* frosted glass tint */
  --glass-strong: rgba(246, 238, 217, 0.22);
  --shadow: 0 8px 28px rgba(0,0,0,0.38);
  --radius: 14px;
  --focus: 3px solid #fff;
}

/* Section headers (compact) */
html, body, header, nav, main, article, footer, aside {}

/* Base reset & helpers */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-size: clamp(14px, 0.9rem + 0.5vw, 18px);
  line-height: 1.5;
  background:
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%),
    radial-gradient(circle at 10% 0%, rgba(255,255,255,0.04), transparent 40%);
  /* subtle scanlines for texture */
  background-image:
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%),
    radial-gradient(circle at 15% 6%, rgba(255,255,255,0.05), transparent 40%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0px, rgba(0,0,0,0.04) 1px, transparent 1px, transparent 2px);
  background-blend-mode: multiply;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout containers */
.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(--glass);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
}
@supports not ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .card { background: rgba(255,255,255,0.22); }
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: .25em .6em;
  font-size: .75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: var(--text);
}

/* Glass panels (with accessible fallbacks) */
.glass {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
@supports not (backdrop-filter: blur(10px)) {
  .glass { background: rgba(255,255,255,0.18); }
}

/* Header / hero styling */
header {
  padding: 1.75rem 1rem;
  display: grid;
  place-items: center;
}
header h1 {
  font-size: clamp(1.6rem, 2.6vw + 1rem, 2.9rem);
  line-height: 1.15;
  text-align: center;
  margin: 0;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--text);
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
}
@media (prefers-color-scheme: light) {
  header h1 { color: #1a1a1a; }
}

/* Image frame spec */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 8px 26px rgba(0,0,0,0.45);
  background: #000;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transform: translateZ(0);
}
@media (prefers-color-scheme: light) {
  .image-frame { border-color: rgba(0,0,0,0.15); }
}

/* Typography & content helpers */
.content { padding: 0.5rem 0; color: var(--text); }

/* Links & buttons */
a, button, .btn, .cta {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
a:hover, a:focus { text-decoration: underline; text-decoration-color: var(--accent-2); }
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .75rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.48);
  background: rgba(255,255,255,0.12);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.18); }
.btn:active { transform: translateY(0); }
.btn--solid {
  background: linear-gradient(135deg, rgba(230,210,170,0.95), rgba(230,210,170,0.75));
  border: 1px solid rgba(255,255,255,0.75);
}
.btn--outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.75);
}
.cta { display:inline-block; }

/* Lists */
ul { padding-left: 0; margin: 0; list-style: none; }

/* Layout details for main sections */
header, main, footer {
  width: 100%;
}
main { padding: 1rem 0; }

/* Product ad / sponsored sections in footer */
.product-ad, .sponsored-page {
  margin: .5rem 0;
}
.product-ad a, .sponsored-page a {
  display: block;
  text-align: center;
  padding: .75rem;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
.product-ad a { background: rgba(230,210,170,0.14); border: 1px solid rgba(255,255,255,0.28); }
.sponsored-page a { background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.28); }

/* Footer text */
footer p { text-align: center; color: var(--muted); font-size: .92rem; margin: .75rem 0 0; }

/* Layout helpers for adaptive sections in footer */
@media (min-width: 860px) {
  footer { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
  .product-ad, .sponsored-page { align-self: stretch; }
  footer p { grid-column: 1 / -1; margin-top: .75rem; }
}

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

/* Light-mode tweaks for legibility */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f0e7;
    --bg-2: #efe7da;
    --text: #1a1a1a;
    --muted: #5a4f38;
    --accent: #7a5f3c;
    --accent-2: #c49a60;
    --glass: rgba(250, 247, 235, 0.75);
  }
  body {
    background:
      linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%),
      radial-gradient(circle at 15% 6%, rgba(0,0,0,0.04), transparent 40%);
  }
  .image-frame { border-color: rgba(0,0,0,0.15); }
  .product-ad a, .sponsored-page a { color: var(--text); }
}

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; }
  .glass, .card { background: transparent; border: none; box-shadow: none; }
}
