/* Theme tokens */
:root {
  --bg: #1a180f;
  --grain: #d4a017;       /* mustard */
  --teal: #19d2c2;          /* retro teal */
  --teal-2: #2be0c8;
  --text: #e9fff7;
  --muted: #a4b8b0;
  --card: rgba(255,255,255,0.08);
  --card-border: rgba(255,255,255,0.28);
  --shadow: 0 8px 28px rgba(0,0,0,.28);
  --radius: 14px;
  --focus: 3px solid rgba(255,255,255,.95);
  --focus-offset: 2px;
}

/* Global reset (mobile-first) */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif; }
body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  /* Layered background: gradient + subtle wood-grain feel + scanlines/noise effect */
  background-image:
    linear-gradient(135deg, rgba(214, 168, 0, 0.25) 0%, rgba(22, 60, 56, 0.15) 60%, rgba(0,0,0,0.0) 100%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 2px),
    linear-gradient(to bottom, rgba(214, 168, 0, 0.12), rgba(214, 168, 0, 0.04) 60%, rgba(0,0,0,0.0) 100%);
  background-blend-mode: overlay, overlay, overlay, normal;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Section wrappers and typography */
header, main, footer, aside { display: block; }
header { padding: 2rem 0 1rem; text-align: center; }
header h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); line-height: 1.15; margin: .25rem 0 0.25rem; letter-spacing: .2px; }
header .meta { font-size: calc(0.9rem + 0.2vw); color: var(--muted); margin-top: .25rem; }

/* Article content with subtle glass panels */
article { padding: 1rem; }

/* Glass panels (frosted glass with fallback) */
.glass {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  position: relative;
}
@supports not (backdrop-filter: blur(12px)) {
  .glass { background: rgba(255,255,255,0.18); }
}
@media (prefers-reduced-motion: reduce) {
  .glass { transition: none; backdrop-filter: none; }
}

/* Featured image frame with aspect ratio and glow */
.image-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: block;
  margin: 0 auto 1rem;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.05);
  transform: translateZ(0); /* GPU hint for smoother rendering */
}
.image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  border-radius: 12px;
}

/* Content area styling */
.content { font-size: clamp(1rem, 1.8vw, 1.125rem); line-height: 1.6; color: var(--text); }

/* Headings and hierarchy */
h2, h3 { color: #eaffff; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2.2rem); margin: .75rem 0 .25rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); margin: .75rem 0 .25rem; }

/* Lists and inline emphasis */
ul { margin: .25rem 0 0.75rem 1.25rem; padding: 0; }
li { margin: .25rem 0; }
strong { color: #eaffff; }

/* Blockquote styling for emphasis */
blockquote {
  margin: .75rem 0; padding: .75rem 1rem;
  border-left: 3px solid var(--teal);
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
}

/* Product ad (footer area) as a glass panel */
.product-ad {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0 0;
}
.product-ad h3 { font-size: 1.05rem; margin: 0; }
.product-ad a { text-decoration: none; color: inherit; }
.product-ad a p { margin: 0; }

/* Links, buttons, and interactive states */
a, button, .btn, .cta { transition: color .2s ease, background .2s ease, transform .2s ease; }
a { color: var(--teal); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; outline: none; }
a:focus-visible { outline: 3px solid #fff; outline-offset: var(--focus-offset); border-radius: 6px; }

/* Buttons and CTA variants */
.btn, .cta {
  padding: .65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.25);
  color: #fff;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.btn.primary, .cta.primary, .btn:hover, .cta:hover { background: var(--teal); border-color: rgba(0,0,0,0); color: #041; }
.btn.secondary, .cta.secondary { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); color: #eaffff; }
.btn:focus-visible, .cta:focus-visible { outline: 3px solid rgba(255,255,255,0.9); outline-offset: 2px; }

/* Card utility for compact blocks */
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: .75rem; }

/* Tag utility */
.tag {
  display: inline-block; padding: .15em .5em; border-radius: 999px;
  font-size: .75rem; background: rgba(27, 214, 198, 0.25); color: #eaffff;
  border: 1px solid rgba(27,214,198,0.5);
}

/* List reset for readability on narrow screens */
ul { padding-left: 1.25rem; }

/* Section wrappers for page sections */
main { padding: 1rem 0 2rem; }
footer { padding: 1rem 0; text-align: center; }

/* Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  .glass { background: #fff; border: none; box-shadow: none; backdrop-filter: none; }
  a, a:visited { color: #000; text-decoration: underline; }
  .image-frame { page-break-inside: avoid; }
}
 
/* Accessibility tweaks for reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}