/* Section: Base reset & tokens */
:root {
  --bg: #d7f6e2;
  --bg-2: #e8fbe9;
  --text: #0b1a12;
  --muted: #5a6a59;
  --accent: #7bd389;       /* pastel green */
  --accent-2: #e8aabf;     /* powder rose */
  --glass: rgba(255, 255, 255, 0.18);
  --glass-strong: rgba(255, 255, 255, 0.22);
  --border: rgba(255, 255, 255, 0.28);
  --shadow: 0 6px 18px rgba(0,0,0,.08);
  --radius: 12px;
  --radius-lg: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg);
  /* Layered background: polka dots + subtle gradient + scanline */
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.75) 1px, transparent 1px),
    radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(135deg, rgba(214,246,230,.25), rgba(246,223,235,.12)),
    repeating-linear-gradient(to bottom, rgba(0,0,0,.02) 0 1px, transparent 1px 2px);
  background-size: 16px 16px, 16px 16px, 100% 100%, 100% 100%;
  background-blend-mode: overlay, overlay, normal, normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  position: relative;
}
/* Subtle waste-free motion preference */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Section: Layout helpers */
.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, .content, .product-ad {
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
@supports not (backdrop-filter: blur(8px)) {
  .card, .content, .product-ad { background: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.5); }
}
/* Section: Core typography */
h1, h2, h3 { margin: 0 0 .5rem; color: var(--text); font-weight: 700; }
p { margin: 0 0 0.75rem; color: var(--muted); }
a { color: var(--accent-2); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; outline: none; color: var(--accent-2); }

/* Section: Structural selectors required by HTML */
html, body, header, nav, main, article, footer, aside {
  display: block;
}
header, nav, main, article, aside, footer { width: 100%; }

/* Section: Header styling */
header {
  padding: 1rem 0;
  position: relative;
  z-index: 2;
}
header h1 {
  font-size: clamp(1.25rem, 1.2rem + 1vw, 2rem);
  text-align: center;
  line-height: 1.15;
  letter-spacing: .2px;
}
nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: .5rem;
}
nav a {
  padding: .25rem .6rem;
  border-radius: 6px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.4);
}
nav a:hover, nav a:focus-visible { text-decoration: underline; outline: none; }

/* Section: Main content & image frame */
main { padding: 1rem 0 2rem; }
.image-frame {
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
  background: #000;
}
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
article { display: block; }

/* Section: Content panels (glass) */
.content { padding: 1rem; }

/* Section: Product ad / footer ad blocks */
.product-ad, .sponsored-page {
  display: block;
  text-align: center;
  padding: .75rem;
  margin: .5rem 0;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.4);
}
.product-ad a, .sponsored-page a { display: block; color: var(--text); text-decoration: none; }
.product-ad:hover { transform: translateY(-1px); transition: transform .2s ease; }

/* Section: Buttons & links (interactive states) */
.btn, .cta {
  font-family: inherit;
  display: inline-block;
  padding: .6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  background: linear-gradient(to bottom, rgba(139,215,164,.25), rgba(139,215,164,.15));
  color: var(--text);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); background: linear-gradient(to bottom, rgba(139,215,164,.32), rgba(139,215,164,.18)); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cta {
  background: linear-gradient(to bottom right, rgba(183, 210, 255, .25), rgba(232, 170, 189, .15));
}
.cta:hover { filter: brightness(1.02); }

ul, li { margin: 0; padding: 0; list-style: none; }
li { padding: .25rem 0; }

/* Section: Accessibility helpers for focus states on interactive items */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Section: Print styles (basic readability) */
@media print {
  body { background: #fff; color: #000; }
  a { text-decoration: underline; }
}

/* Section: Print-safe layout adjustments for narrow devices */
@media (max-width: 640px) {
  header h1 { font-size: 1.25rem; }
  .image-frame { border-radius: 10px; }
}

/* Section: High-level layout adjustments for responsiveness */
.main-layout { padding: 1rem 0; }
.main-layout .grid { gap: 1rem; }

/* Section: Utility tokens (for future composition) */
.tag {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  background: rgba(139,215,164,.25);
  color: var(--text);
  border: 1px solid rgba(139,215,164,.5);
}
aside { padding: 1rem 0; }