/* Section: Tokens */
:root{
  --bg: #031017;
  --bg-2: #0b1b20;
  --text: #e7fbff;
  --muted: #a9b7c6;
  --accent: #2ff3e3;
  --accent-2: #cbd6e1;
  --card: rgba(255,255,255,.08);
  --card-border: rgba(255,255,255,.25);
  --shadow: 0 6px 20px rgba(0,0,0,.25);
  --radius: 14px;
  --focus: 0 0 0 3px rgba(0,255,230,.6);
  --glass: rgba(255,255,255,.08);
  --glass-border: rgba(255,255,255,.25);
}
@media (prefers-color-scheme: light){
  :root{
    --text: #0a1e22;
    --muted: #51616f;
  }
}
/* Section: Layered Background (gradient + subtle scanlines/noise) */
html, body { height: 100%; }
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
body{
  margin:0;
  min-height:100%;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  line-height: 1.5;
  background:
    /* energy gradient */
    linear-gradient(135deg, rgba(0,255,230,.14) 0%, rgba(32,176,255,.08) 40%, rgba(0,0,0,.0) 100%),
    /* subtle chrome glow */
    linear-gradient(to bottom right, rgba(4, 18, 24, .85), rgba(4, 18, 24, .65)),
    /* base */
    #04131a;
  background-blend-mode: overlay, overlay, normal;
  position: relative;
  overflow-x: hidden;
  /* layered scanlines/noise (pure CSS) */
  isolation: isolate;
}
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(to bottom, rgba(0,255,230,.04) 0 1px, rgba(0,0,0,0) 1px 2px),
    radial-gradient(circle at 20% 0%, rgba(0,255,230,.08), transparent 40px);
  mix-blend-mode: overlay;
}
main { position: relative; z-index: 1; }

/* Section: Layout primitives */
.container{ max-width: clamp(320px, 90vw, 1100px); margin-inline: auto; padding: 1rem; }
.grid{ display: grid; gap: 1rem; }
.card{ background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.tag{ display:inline-block; padding:.25em .6em; border-radius:999px; font-size:.75rem; color:#031b1f; background: rgba(47, 243, 227, .85); border: 1px solid rgba(47,243,227,.9); }

/* Section: Components & semantics */
header, nav, main, article, aside, footer { /* glassy panels with fallback */ 
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--radius) - 2px);
  padding: 1rem;
  margin: .75rem auto;
  max-width: clamp(320px, 92vw, 1200px);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  box-shadow: var(--shadow);
}
header{ text-align:center; padding: 1.75rem 1rem 1rem; }
header h1{ margin: .25rem 0 .25rem; font-size: clamp(1.8rem, 3vw + 1rem, 3.5rem); line-height: 1.08; letter-spacing:.2px; }
header .meta{ color: var(--muted); font-size: clamp(.9rem, .4vw + .8rem, 1.05rem); }

/* Section: Hero & typography hierarchy */
h2{ font-size: clamp(1.4rem, 1vw + 1.2rem, 2.4rem); margin:.75rem 0; }
h3{ font-size: clamp(1.1rem, .8vw + 1rem, 1.6rem); margin:.5rem 0; }

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

/* Section: Content area (body copy) */
.content{ font-size: clamp(1rem, .8vw + .9rem, 1.125rem); color: var(--text); line-height: 1.6; }

/* Section: Links & interactive controls (focus accessibility) */
a, button, .btn, .cta{ text-decoration: none; color: var(--text); cursor: pointer; }
a{ color: var(--accent); }
a:hover, a:focus{ text-decoration: underline; outline: none; }
:focus-visible{ outline: none; box-shadow: var(--focus); outline-offset: 2px; }

/* Buttons (solid & outline variants) */
.btn{ display:inline-block; padding:.65rem .95rem; border-radius: 8px; border:1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.25); color:#eaffff; font-weight:600; transition: transform .15s ease, background .2s ease; }
.btn + .btn{ margin-left:.5rem; }
.btn.primary{ background: linear-gradient(135deg, #00d9d0 0%, #00a6a0 100%); border: none; color:#051518; }
.btn.outline{ background: transparent; border:1px solid rgba(0, 214, 214, .9); color: var(--text); }
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }

.cta{ font-weight:700; }

/* Section: Lists & typography defaults */
ul, li{ padding-left: 1.15rem; margin: .35rem 0; }
li{ color: var(--text); }

/* Section: Supplemental layout utilities (grid / cards / tags) */
.grid.auto{ grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card{ display: block; }

/* Section: Forms (baseline styling) */
input, textarea, select{ background: rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25); border-radius:8px; padding:.5rem .6rem; color: var(--text); width: 100%; }
input:focus-visible, textarea:focus-visible, select:focus-visible{ outline: none; box-shadow: var(--focus); }

/* Section: Page structure rules for non-content areas */
nav{ display:flex; justify-content:center; gap:.5rem; flex-wrap: wrap; padding: .25rem 0 0; }
nav a{ padding:.4rem .6rem; border-radius:6px; border:1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); }

/* Section: Specific page regions */
header > h1{ font-weight: 700; }
main{ padding: 1rem; }
article{ padding: 0; }

/* Section: Footer & ads styling */
footer{ text-align:center; padding: 1rem; }

/* Section: Print styles (basic readability) */
@media print{
  body{ background: #fff; color: #000; }
  a{ color: #000; text-decoration: underline; }
  header, nav, main, article, aside, footer{ background: transparent; border: none; box-shadow: none; }
}
  
/* Section: Motion preferences */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}