/* Onion Explains — scratch build (rails always on)
   - Rails hug screen edges on mobile
   - Rails frame the centered content on desktop
   - Dark near-black purple bg
   - Lighter purple cards with rounded edges + neon pink dashed outline
   - Techy-glow blue text with harmonious h/p sizing
*/

/* ===== Tokens ===== */
:root{
  --bg0:#060010;
  --bg1:#0b0018;

  --card0: rgba(55, 12, 92, .62);
  --card1: rgba(18, 0, 30, .62);

  --pink:#ff2bb3;
  --teal:#26ffe6;

  --techBlue:#8fefff;
  --techBlue2:#b6f6ff;
  --text:#f7eaff;

  --radius: 22px;
  --max: 920px;

  /* rails */
  --railW: 8px;      /* line thickness */
  --railGlow: 22px;  /* glow radius */
  --railPad: 10px;   /* how far outside the content frame */
}

/* ===== Base ===== */
html,body{height:100%;}
body{
  margin:0;
  font-family: "Chakra Petch", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);

  background:
    radial-gradient(1100px 720px at 50% 18%, rgba(169,94,255,.16), transparent 60%),
    radial-gradient(900px 640px at 50% 92%, rgba(255,43,179,.10), transparent 62%),
    linear-gradient(180deg, var(--bg1), var(--bg0));

  padding: 28px 16px 56px;
  overflow-x:hidden;
}

/* Optional wrapper to center content */
.page{
  width: min(var(--max), 92vw);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ===== Rails (always on) =====
   Implementation uses two fixed pseudo-elements that draw the neon rails.
   - Mobile: rails sit at viewport edges
   - Desktop: rails shift inward to "frame" the .page width
*/

/* We compute the content frame edges using viewport width + --max.
   contentLeft = (100vw - min(--max,92vw)) / 2
   We can’t do min() with vw cleanly across all cases, so we use the same 92vw behavior:
   On wide screens, 92vw becomes huge, so min(...) becomes --max.
   So on desktop, frame = --max. On smaller screens, frame ~= 92vw anyway (close enough).
*/

:root{
  /* A "desktop-ish" content frame based on --max */
  --frameLeft: calc((100vw - var(--max)) / 2);
  --frameRight: calc(100vw - ((100vw - var(--max)) / 2));
}

/* Rails layer */
body::before,
body::after{
  content:"";
  position: fixed;
  top: 0; bottom: 0;
  width: var(--railW);
  pointer-events:none;
  z-index: 0;

  /* subtle vertical gradient so it feels alive, not a flat stripe */
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.95), transparent);
  opacity: .95;
}

/* left rail */
body::before{
  left: 0; /* default mobile */
  background: linear-gradient(180deg, transparent, rgba(255,43,179,.95), transparent);
  box-shadow: 0 0 var(--railGlow) rgba(255,43,179,.32);
}

/* right rail */
body::after{
  right: 0; /* default mobile */
  background: linear-gradient(180deg, transparent, rgba(38,255,230,.95), transparent);
  box-shadow: 0 0 var(--railGlow) rgba(38,255,230,.26);
}

/* Desktop framing:
   Move rails inward to sit just outside the centered content frame.
   If the viewport is narrower than --max, this would create negative offsets,
   so we guard it by only doing this at a breakpoint where it's safe. */
@media (min-width: 980px){
  body::before{
    left: calc(var(--frameLeft) - var(--railPad));
  }
  body::after{
    right: calc(var(--frameLeft) - var(--railPad));
  }
}

/* ===== Typography (techy blue glow) ===== */
h1, h2, h3{
  color: var(--techBlue2);
  text-shadow: 0 0 14px rgba(143,239,255,.22);
  letter-spacing: .35px;
  margin: 0 0 10px;
}

h1{
  font-size: clamp(2rem, 5.2vw, 3rem);
  font-weight: 800;
  margin-top: 10px;
}
h2{
  font-size: clamp(1.25rem, 3.4vw, 1.75rem);
  font-weight: 700;
  opacity: .95;
}
p{
  margin: 0 0 14px;
  line-height: 1.55;
  color: rgba(247,234,255,.94);
}

/* links generally */
a{
  color: var(--techBlue);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 6px;
  text-shadow: 0 0 12px rgba(143,239,255,.18);
}

/* ===== Post cards ===== */
.post{
  width: 100%;
  margin: 18px 0;
  padding: 18px 18px 20px;
  border-radius: var(--radius);

  background:
    radial-gradient(900px 280px at 50% 0%, rgba(169,94,255,.14), transparent 60%),
    linear-gradient(180deg, var(--card0), var(--card1));

  border: 3px dashed rgba(255,43,179,.92);

  box-shadow:
    0 18px 60px rgba(0,0,0,.62),
    0 0 0 1px rgba(255,255,255,.05) inset,
    0 0 28px rgba(255,43,179,.10);
}

/* date line */
.post .date{
  font-size: .95rem;
  letter-spacing: .5px;
  color: rgba(143,239,255,.85);
  text-shadow: 0 0 10px rgba(143,239,255,.14);
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* optional "Full Post" button vibe */
.read-more-button{
  display:inline-block;
  margin-top: 4px;
  padding: 12px 16px;
  border-radius: 18px;
  text-decoration: none;

  color: rgba(143,239,255,.95);
  background: rgba(0,0,0,.22);
  border: 2px solid rgba(143,239,255,.40);

  box-shadow:
    0 0 0 1px rgba(255,255,255,.05) inset,
    0 0 22px rgba(38,255,230,.10);
}

@media (hover:hover){
  .read-more-button:hover{
    border-color: rgba(38,255,230,.72);
    box-shadow:
      0 0 0 1px rgba(255,255,255,.06) inset,
      0 0 30px rgba(38,255,230,.18);
    transform: translateY(-1px);
  }
}
.read-more-button:active{ transform: translateY(1px); }
