/* Base Theme & Palette (tokenized) */
:root {
  --bg: #0b0f14;
  --bg-2: #0a0f1a;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.14);
  --text: #e9f2ff;
  --muted: #a6b6cc;
  --accent: #ffd6b3;       /* peach */
  --accent-2: #cfe8ff;     /* holographic light */
  --card-border: rgba(255, 255, 255, 0.28);
  --shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --focus: 0 0 0 3px rgba(255, 214, 179, 0.9);
  --gap: 1rem;
}

/* Section: Base reset & layout fundamentals */
html, body, header, nav, main, article, footer, aside {
  box-sizing: border-box;
}
html, body {
  height: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  color: var(--text);
  font-family: ui-system, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans";
  line-height: 1.55;
  background: #0b0f14;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Layered holographic galaxy backdrop (gradient + subtle noise/scan) */
  background-color: var(--bg);
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  /* star-like speckles + gradient tint */
  background:
    radial-gradient(circle at 12% 18%, rgba(180,210,255,.40) 0 2px, transparent 2px),
    radial-gradient(circle at 78% 22%, rgba(255,255,255,.40) 0 2px, transparent 2px),
    linear-gradient(135deg, rgba(8,12,20,.95) 0%, rgba(15,19,28,.95) 60%, rgba(8,12,20,.95) 100%);
  background-blend-mode: screen, overlay, normal;
}
body::after {
  /* subtle scanlines/noise */
  background: repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,.04) 0px,
      rgba(255,255,255,.04) 1px,
      transparent 1px,
      transparent 2px
    );
  opacity: .55;
  mix-blend-mode: overlay;
}

/* Section: Structural containers */
.container {
  width: 100%;
  max-width: clamp(320px, 90vw, 1100px);
  margin-inline: auto;
  padding-inline: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
}
.card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 0.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .18s ease, background .2s ease;
}
.card:hover { transform: translateY(-2px); }

/* Section: Image frame & media handling */
.image-frame,
.featured-image {
  width: min(860px, 92%);
  margin: 0 auto;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
}
.image-frame { aspect-ratio: 16 / 9; }
.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 16 / 9;
  image-rendering: auto;
  filter: saturate(1.05);
}
.featured-image { /* fallback container if used differently */ }

/* Section: Typography & Content */
.content { padding: 0.75rem; color: var(--text); }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 4vw + 1rem, 3.25rem); letter-spacing: .2px; text-wrap: pretty; }
h2 { font-size: clamp(1.4rem, 2.8vw + .5rem, 2.25rem); }
h3 { font-size: clamp(1.05rem, 1.8vw + .6rem, 1.25rem); color: #e9efff; }
p { margin: .75rem 0; }

/* Section: Lists & chips */
ul { padding-left: 1.25rem; margin: .25rem 0 1rem; }
li { margin: .25rem 0; }

/* Section: Utility & micro UI elements */
.tag {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: var(--text);
  font-size: .75rem;
}
a, button, .btn, .cta {
  font-family: inherit;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.14);
  border-radius: 999px;
  padding: .55rem .95rem;
  display: inline-block;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .cta:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.btn { line-height: 1; }
.btn--solid {
  background: linear-gradient(135deg, rgba(255,214,179,.95), rgba(255,214,179,.75));
  border: 1px solid rgba(210,140,110,.95);
  color: #2a140b;
}
.btn--outline {
  background: rgba(0,0,0,0);
  border: 1px solid rgba(255,255,255,.75);
  color: var(--text);
}
.cta { font-weight: 700; }

/* Section: Layout helpers (container-centric) */
.header,
.main-area,
.footer-area { display: block; }
header {
  padding: clamp(1.25rem, 2.6vw, 2rem) 1rem;
  text-align: center;
  margin-bottom: 0.25rem;
  background: rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 0 0 12px 12px;
}
header h1 { color: var(--text); }
header .meta { color: var(--muted); font-size: .92rem; }

/* Main content region as glass panel for depth */
main {
  padding: 1rem 0 2rem;
}
article {
  max-width: clamp(320px, 92vw, 900px);
  margin: 0 auto;
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
footer {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,.05);
  border-top: 1px solid rgba(255,255,255,.25);
}
.product-ad {
  margin: 1rem auto 0;
  padding: 1rem;
  text-align: center;
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: var(--shadow);
  max-width: 520px;
}
.product-ad h3 { margin: 0 0 .5rem; font-size: 1.05rem; }

/* Section: Print styles (readable) */
@media print {
  body { background: white; color: #000; }
  a { color: #00f; text-decoration: underline; }
  .image-frame { page-break-inside: avoid; }
}

/* Section: Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}