/* Base Palette & Utilities */
:root{
  --bg: #2a1a0a;            /* deep brown core */
  --bg-2: #4a2b1b;          /* warm coppery brown */
  --text: #f7ecd8;            /* high-contrast on dark glass */
  --muted: #d7b49a;           /* subtle secondary text */
  --accent: #b66a2a;          /* copper accent */
  --accent-2: #d07a2a;        /* brighter copper highlight */
  --card: rgba(255,255,255,.08);
  --card-2: rgba(255,255,255,.12);
  --stroke: rgba(255,255,255,.28);
  --focus: #ffd07a;
  --radius: 12px;
}

/* Global reset */
*,
*::before,
*::after{ box-sizing: border-box; }
html{ font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; -webkit-font-smoothing: antialiased; }
:focus{ outline: none; } /* overridden by focus-visible rules below */

/* Layered, responsive background (gradient + pixel mosaic + scanlines) */
html, body { height: 100%; }
body{
  margin:0;
  min-height:100dvh;
  color: var(--text);
  background-color: var(--bg);
  /* Layered background: gradient + subtle pixel mosaic + scanlines */
  background-image:
    linear-gradient(135deg, rgba(184,106,60,.95) 0%, rgba(72,40,22,.95) 60%, rgba(184,106,60,.95) 100%),
    /* brown pixel mosaic (pure CSS) */
    repeating-linear-gradient(0deg, rgba(0,0,0,.05) 0px, rgba(0,0,0,.05) 1px, transparent 1px, transparent 8px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.04) 0px, rgba(0,0,0,.04) 1px, transparent 1px, transparent 8px);
  background-blend-mode: overlay;
  background-attachment: fixed;
  overscroll-behavior: none;
}
body::after{
  /* subtle scanlines overlay for atmosphere (no heavy GPUs) */
  content:"";
  position: fixed; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.05) 0 1px, transparent 1px 2px);
  background-size: 100% 2px;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity:.6;
}
@media (prefers-reduced-motion: reduce){
  body::after{ display: none; }
  *{ transition: none !important; animation: none !important; }
}

/* Layout helpers (mobile-first) */
.container{ width: 100%; max-width: clamp(320px, 88vw, 1100px); padding-inline: 1rem; margin-inline: auto; }

/* Glass panel treatment (with backdrop-filter fallback) */
.header, main, article, footer, aside, nav {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  padding: 1rem;
  margin: .75rem 0;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@supports not (backdrop-filter: blur(12px)){
  .header, main, article, footer, aside, nav {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.4);
    backdrop-filter: none;
  }
}

/* Typographic scale (fluid) */
h1{ font-size: clamp(1.75rem, 2.4vw + 0.5rem, 3.5rem); line-height: 1.05; margin: .25rem 0 .75rem; }
p{ font-size: clamp(0.95rem, 0.6vw + .9rem, 1.15rem); line-height: 1.5; color: var(--muted); }
strong{ color: var(--text); }

/* Hero & navigation layout */
header{ text-align: center; padding: 1.25rem 0; }
nav{ display: flex; justify-content: center; gap: .75rem; padding-top: .5rem; }

a{ color: var(--accent-2); text-decoration: none; }
a:hover, a:focus{ text-decoration: underline; color: var(--accent); }
a:focus-visible, button:focus-visible{ outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

/* Buttons & CTAs (solid + outline variants) */
.btn, .cta{ display:inline-block; padding: .55rem 1rem; border-radius: 8px; border: 1px solid rgba(0,0,0,.25);
  background: var(--accent-2); color: #fff; font-weight: 600; text-align: center; cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s;
  text-decoration: none;
}
.btn:hover, .cta:hover{ transform: translateY(-1px); background: var(--accent); border-color: rgba(0,0,0,.35); }
.btn:active, .cta:active{ transform: translateY(0); opacity:.95; }

/* Outlined variant helper */
.btn.outline{ background: transparent; color: var(--text); border: 1px solid rgba(183,106,45,.6); }

/* Image frame styling */
.image-frame{
  width: min(100%, 760px);
  aspect-ratio: 16/9;
  margin: 1rem auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  display: grid; place-items: center;
}
.image-frame img{
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  /* subtle inner glow */
  filter: saturate(1.05);
  mix-blend-mode: normal;
}
@media (min-width: 720px){
  .image-frame{ margin: 2rem auto; }
}

/* Content area */
.content{ padding: 0.5rem 0 1rem; }

/* Card & grid utilities (compact) */
.grid{ display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card{ background: var(--card); border: 1px solid var(--stroke); border-radius: 10px; padding: .95rem; box-shadow: 0 4px 14px rgba(0,0,0,.22); }

/* Tag utility (chip) */
.tag{ display:inline-block; padding:.25em .5em; border-radius:999px; font-size:.75rem; color: #fff;
  background: linear-gradient(135deg, rgba(183,106,45,.8), rgba(208,122,42,.8)); border:1px solid rgba(255,255,255,.4);
}

/* Product ad & sponsor sections (glass panels) */
.product-ad, .sponsored-page{ display:flex; align-items:center; justify-content:center; text-align:center;
  padding: .75rem; min-height: 72px;
}
.product-ad a, .sponsored-page a{ display:inline-flex; align-items:center; justify-content:center; width:100%; padding: .6rem 1rem; border-radius: 8px; text-decoration: none;
  background: rgba(182,106,42,.6); color: #fff; border:1px solid rgba(255,255,255,.5); font-weight:600;
}
.product-ad a:hover, .sponsored-page a:hover{ background: rgba(182,106,42,.9); }

/* Layout semantics for the required selectors */
html, body, header, nav, main, article, footer, aside { /* explicit selectors required by spec */ }
.image-frame, .image-frame img { }

/* Print styles (basic readability) */
@media print{
  body{ background: #fff; color: #000; }
  header, main, article, footer, aside{ background: #fff; border: none; box-shadow: none; }
}
