/* Section: Tokens & Foundations */
:root{
  --bg: #022028;
  --bg-2: #0a3a3a;
  --text: #efe5d0;
  --muted: #b8ad9a;
  --surface: rgba(255,255,255,0.08);
  --surface-2: rgba(255,255,255,0.14);
  --border: rgba(255,255,255,0.28);
  --accent: #2bd4c3;       /* teal */
  --accent-2: #e6d1b2;     /* beige */
  --shadow: 0 8px 24px rgba(0,0,0,.25);
  --radius: 12px;
  --focus: 2px solid #ffffff;
  --focus-color: #ffffff;
  --glass-blur: blur(8px);
}

/* Section: Layout & Background (mobile-first) */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; }
body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(135deg, rgba(2,50,44,0.95) 0%, rgba(8,70,66,0.95) 60%, rgba(2,50,44,0.95) 100%);
  /* Teal polka dots backdrop + subtle gradient */
  background-image:
    radial-gradient(circle at 10px 10px, rgba(43,212,195,0.25) 2px, transparent 2px),
    radial-gradient(circle at 30px 20px, rgba(43,212,195,0.15) 2px, transparent 2px);
  background-size: 40px 40px, 40px 40px;
  background-blend-mode: overlay;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}
body::before {
  /* subtle scanlines */
  content:"";
  position: fixed; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0 60%, rgba(0,0,0,0.05) 60% 61%, rgba(0,0,0,0) 61% 100%);
  background-size: 100% 3px;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.25;
}
body::after {
  /* faint noise texture layer (pure CSS approximation) */
  content:"";
  position: fixed; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 1px),
                    radial-gradient(circle at 8px 8px, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 9px 9px;
  mix-blend-mode: overlay;
  opacity: 0.25;
  pointer-events: none;
}
/* Section: Structural containers */
.container {
  width: 100%;
  max-width: clamp(320px, 92vw, 1100px);
  margin-inline: auto;
  padding: 0 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.product-ad {
  display: block;
  text-decoration: none;
  color: var(--text);
  text-align: center;
  padding: .75rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
}
.product-ad:hover { transform: translateY(-1px); }

/* Section: Header / Hero */
header {
  padding: 1.25rem 1rem;
  text-align: center;
}
header h1 {
  font-size: clamp(1.6rem, 1rem + 3vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 .4rem;
  color: var(--text);
  letter-spacing: .2px;
}
header .meta {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .75rem;
}
nav {
  display: inline-flex;
  gap: .5rem;
  margin-top: .25rem;
}
nav a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.3);
  padding: .5rem .75rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}
nav a:hover, nav a:focus-visible {
  text-decoration: underline;
  outline: none;
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.6);
  color: #fff;
}
@media (min-width: 700px){
  header { padding: 2rem 1rem; }
}

/* Section: Content styling (article & content blocks) */
main { padding: 1rem 0; }
article { display: block; padding: 0 0 2rem; }
.content { padding: 0 0 1rem; }

/* Section: Image frame (and swap for featured-image) */
.image-frame, .featured-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  margin: 1rem auto;
  background: rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.image-frame img, .featured-image img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.image-frame:hover img, .featured-image:hover img { transform: scale(1.03); }

/* Fallback when backdrop-filter not supported (glass fallback) */
@supports not (backdrop-filter: blur(8px)) and not (-webkit-backdrop-filter: blur(8px)) {
  .card { background: rgba(255,255,255,.22); }
  .image-frame { border-color: rgba(255,255,255,.6); }
  body { background: linear-gradient(135deg, #032326, #0b2f2f); }
}

/* Section: Typography & links accessibility */
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; outline: none; }
a:focus-visible { outline: var(--focus); outline-offset: 3px; color: #fff; }

/* Section: Buttons & CTAs (solid & outline variants) */
.btn, .cta {
  display: inline-block;
  padding: .6rem .95rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5);
  color: #041c1a;
  background: rgba(255,255,255,.9);
  font-weight: 700;
  text-transform: none;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease, color .2s ease;
  cursor: pointer;
}
.btn { color: #041c1a; background: rgba(255,255,255,.92); }
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: var(--accent);
  color: #062626;
  border-color: rgba(0,0,0,.15);
}
.btn.outline {
  background: transparent;
  color: var(--text);
  border-color: rgba(255,255,255,.6);
}
.btn:focus-visible, .cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.cta { display:inline-block; }

/* Section: Utility typography scales */
h2, h3 { color: var(--text); margin: .75rem 0 .5rem; }
h2 { font-size: clamp(1.15rem, 0.9rem + 1.5vw, 1.6rem); }
h3 { font-size: clamp(1rem, 0.9rem + 1vw, 1.15rem); }
p, li { font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem); line-height: 1.55; color: var(--text); }
ul, ol { padding-left: 1.25rem; }

/* Section: Lists and subtle accents */
li { margin: .25rem 0; }
.tag {
  display: inline-block;
  padding: .15rem .4rem;
  border-radius: 999px;
  font-size: .75rem;
  border: 1px solid rgba(43,212,195,.6);
  background: rgba(43,212,195,.15);
  color: var(--text);
}

/* Section: Print & motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  body { color: #000; background: #fff; }
  a, a:visited { text-decoration: underline; color: #000; }
  .image-frame, .featured-image, .card { page-break-inside: avoid; }
}
