/* Base & Tokens */
:root {
  --bg: #0b0b0f;
  --bg-2: #1a0f0f;
  --text: #f5f5f5;
  --muted: #c9c9c9;
  --accent: #ffd166;       /* gold */
  --accent-2: #ff4d4d;      /* red */
  --card: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.25);
}

html, body { height: 100%; }
*, *::before, *::after { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background: 
    linear-gradient(135deg, rgba(255,0,0,.22), rgba(0,0,0,.6) 60%, rgba(0,0,0,.75)),
    radial-gradient(circle at 20% -10%, rgba(255,140,0,.25), transparent 40%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.03) 0 1px, transparent 1px 2px),
    var(--bg);
  background-blend-mode: overlay;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100%;
}
:root { color-scheme: dark; }

/* Layout utilities */
.container { width: 100%; max-width: clamp(640px, 90vw, 1100px); margin-inline: auto; padding-inline: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

/* Sectioned structure styling */
header, nav, main, article, aside, footer { scroll-margin-top: 2rem; }
header { padding: 2rem 0 1rem; text-align: center; }
header h1 { margin: 0; font-size: clamp(1.6rem, 2vw + 1rem, 2.8rem); line-height: 1.15; letter-spacing: .2px; }

main { display: block; padding: 0 0 1rem; }
article { display: grid; place-items: center; padding: 1rem; }

footer { padding: 1.25rem 0; display: grid; gap: .75rem; justify-items: center; }

/* Media panels (glass / frosted) */
.glass, .product-ad, .sponsored-page {
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  color: var(--text);
}
@supports not (backdrop-filter: blur(8px)) {
  .glass, .product-ad, .sponsored-page { background: rgba(0,0,0,.55); border-color: rgba(255,255,255,.25); }
}
.header-ghost { /* helper for potential nav spacing */ height: 0.75rem;
}

/* Image frame styling */
.image-frame { aspect-ratio: 16/9; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 12px 28px rgba(0,0,0,.45); }
.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

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

/* Links, buttons, CTAs */
a { color: var(--accent); text-decoration: none; transition: color .2s ease, text-decoration .2s ease; }
a:hover, a:focus { text-decoration: underline; outline: none; }
button, .btn, .cta { display: inline-flex; align-items: center; justify-content: center; padding: .65rem 1rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,209,102,.25); color: var(--text); cursor: pointer; text-decoration: none; transition: transform .2s ease, background .2s ease; }
.btn { background: linear-gradient(135deg, rgba(255,209,102,.28), rgba(255,93,93,.28)); border-color: rgba(255,255,255,.4); }
.cta { padding-inline: 1.25rem; }
button:hover, .btn:hover, .cta:hover { background: rgba(255,209,102,.34); transform: translateY(-1px); }
button:focus-visible, .btn:focus-visible, .cta:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Text helpers & typography */
.tag { display: inline-block; padding: .15rem .5rem; font-size: .75rem; border-radius: 999px; background: rgba(255,209,102,.2); border: 1px solid rgba(255,209,102,.5); color: #fff; }

/* Product/ad specific tweaks */
.product-ad { display: inline-block; min-width: 0; text-align: center; padding: .75rem; }
.sponsored-page { text-align: center; }

/* Form elements (baseline) */
input, textarea, select { font: inherit; color: inherit; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: .5rem .75rem; outline: none; }
input:focus, textarea:focus, select:focus { border-color: rgba(255,255,255,.6); box-shadow: 0 0 0 3px rgba(255,255,255,.15); }

/* Print styles */
@media print {
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .glass { background: #fff; border: 1px solid #bbb; box-shadow: none; }
}

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

/* Dark mode fallback for light-scheme users */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f7;
    --bg-2: #e9e9e9;
    --text: #111;
    --muted: #444;
    --accent: #b56b00;
    --accent-2: #c62828;
  }
  body {
    background: 
      linear-gradient(135deg, #f5f5f5 0%, #e9e9e9 60%, #ddd 100%), 
      repeating-linear-gradient(to bottom, rgba(0,0,0,.03) 0 1px, transparent 1px 2px),
      var(--bg);
    color: var(--text);
  }
  .glass { background: rgba(255,255,255,.9); border-color: rgba(0,0,0,.15); }
}
