/* ===== ApoiCalypse 365 — high-impact professional theme (visual only) ===== */

:root {

  --bg: #0b0c10;

  --bg-soft: #0f1117;

  --card: #12131a;

  --glass: rgba(255, 255, 255, 0.04);

  --fg: #e6edf3;

  --muted: #9aa4b2;

  --accent: #ff3d6b; /* apocalypse magenta-red */

  --accent-2: #7c3aed; /* deep violet */

  --rule: #202434;

  --ring: rgba(255, 61, 107, 0.25);

  scroll-padding-top: 90px;

}

html,

body {

  background: radial-gradient(

      1200px 600px at 10% -10%,

      rgba(255, 61, 107, 0.08),

      transparent 60%

    ),

    radial-gradient(

      800px 400px at 90% 10%,

      rgba(124, 58, 237, 0.1),

      transparent 60%

    ),

    var(--bg);

  color: var(--fg);

  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;

  line-height: 1.65;

  -webkit-font-smoothing: antialiased;

  text-rendering: optimizeLegibility;

  margin: 0;

  padding: 0;

}

/* Progress bar */

.progress {

  position: fixed;

  top: 0;

  left: 0;

  height: 3px;

  width: 0;

  background: linear-gradient(90deg, var(--accent), var(--accent-2));

  z-index: 9999;

  box-shadow: 0 0 12px var(--accent);

}

/* Container */

main {

  max-width: 1000px;

  margin: 56px auto 96px;

  padding: 0 24px 80px;

}

/* Card wrapper for content */

main > *:not(.progress):not(header):not(footer) {

}

.card {

  background: linear-gradient(

    180deg,

    rgba(255, 255, 255, 0.03),

    rgba(255, 255, 255, 0.01)

  );

  border: 1px solid var(--rule);

  border-radius: 16px;

  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);

  backdrop-filter: blur(6px);

  padding: 28px 24px;

  margin-top: 20px;

}

/* Headings */

h1,

h2,

h3 {

  line-height: 1.22;

  margin: 1.2em 0 0.6em;

}

h1 {

  font-size: 2.4rem;

  font-weight: 800;

  text-align: center;

  letter-spacing: 0.3px;

  background: linear-gradient(

    90deg,

    var(--fg),

    #c7d2fe 20%,

    var(--accent) 60%,

    var(--accent-2)

  );

  -webkit-background-clip: text;

  background-clip: text;

  color: transparent;

  margin-top: 28px;

  margin-bottom: 18px;

}

h2 {

  font-size: 1.5rem;

  font-weight: 750;

  color: var(--fg);

  position: relative;

  padding-left: 14px;

}

h2::before {

  content: "";

  position: absolute;

  left: 0;

  top: 0.2em;

  bottom: 0.2em;

  width: 4px;

  background: linear-gradient(var(--accent), var(--accent-2));

  border-radius: 4px;

  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.06);

}

h3 {

  font-size: 1.2rem;

  color: #dbeafe;

  font-weight: 650;

}

p {

  margin: 0.7em 0;

  color: var(--fg);

}

ul,

ol {

  margin: 0.6em 0 0.6em 1.4em;

}

li {

  margin: 0.28em 0;

}

hr {

  border: none;

  border-top: 1px solid var(--rule);

  margin: 2rem 0;

}

/* Tables */

table {

  border-collapse: collapse;

  margin: 1.2rem 0;

  width: 100%;

  background: var(--card);

  border: 1px solid var(--rule);

  border-radius: 12px;

  overflow: hidden;

}

th,

td {

  border: 1px solid var(--rule);

  padding: 0.65rem 0.7rem;

  vertical-align: top;

}

th {

  background: rgba(124, 58, 237, 0.12);

  text-align: left;

}

/* TOC */

.toc {

  border: 1px solid var(--rule);

  background: var(--card);

  border-radius: 14px;

  padding: 16px 18px;

  margin: 1rem 0 2rem;

  position: relative;

}

.toc h2 {

  margin: 0.2rem 0 0.4rem;

  padding-left: 0;

}

.toc h2::before {

  display: none;

}

.toc a {

  color: #e5e7eb;

  text-decoration: none;

}

.toc a:hover {

  color: #fff;

  text-decoration: underline;

}

.toc ul {

  margin: 0.3rem 0 0.3rem 1.1rem;

}

/* Figures */

.figure {

  display: block;

  margin: 1.1rem auto;

  text-align: center;

}

.figure img {

  display: block;

  margin: 0 auto;

  width: min(100%, 880px);

  max-height: 560px;

  height: auto;

  object-fit: contain;

  border: 1px solid var(--rule);

  border-radius: 14px;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);

}

.caption {

  font-size: 0.92rem;

  color: var(--muted);

  margin-top: 0.45rem;

}

/* Meta table card */

table:first-of-type {

  border-radius: 14px;

  overflow: hidden;

}

/* Back to top button */

#toTop {

  position: fixed;

  right: 22px;

  bottom: 24px;

  z-index: 9998;

  border: none;

  padding: 10px 14px;

  border-radius: 999px;

  background: linear-gradient(90deg, var(--accent), var(--accent-2));

  color: #fff;

  cursor: pointer;

  font-weight: 700;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

  opacity: 0;

  transform: translateY(8px);

  transition: all 0.25s ease;

}

#toTop.show {

  opacity: 1;

  transform: translateY(0);

}

/* Wrap content into a card without changing text */

.wrap-card > *:not(.toc):not(h1) {

  /* everything except h1/toc becomes carded blocks for rhythm */

  margin-left: 0;

  margin-right: 0;

}

/* Apply card feel by grouping siblings */

section.apo-block {

  margin-top: 22px;

}

section.apo-block > .inner {

  padding: 0;

}

/* Links */

a {

  color: #c7d2fe;

}

a:hover {

  color: #fff;

}

/* Selection */

::selection {

  background: rgba(255, 61, 107, 0.35);

}



/* --- ApoiCalypse v2 layout: grouped sections, no paragraph fragmentation --- */

.apo-section {

  margin: 22px 0 26px;

  padding: 18px 20px;

  background: linear-gradient(

    180deg,

    rgba(255, 255, 255, 0.03),

    rgba(255, 255, 255, 0.01)

  );

  border: 1px solid var(--rule);

  border-radius: 14px;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

}

.apo-section h2 {

  margin-top: 0.2rem;

}

.apo-section > :not(h2) {

  /* inner rhythm */

  margin-left: 0;

  margin-right: 0;

}

.content .apo-section h2,

.content .apo-section h3 {

  scroll-margin-top: 90px !important;

}

.figure {

  margin: 1rem auto 1.1rem;

}

.figure img {

  width: min(100%, 880px);

  max-height: 560px;

}

p {

  margin: 0.7em 0;

}

ul,

ol {

  margin: 0.6em 0 0.6em 1.3em;

}



/* ===== ApoiCalypse 365 — Alternative Impact Theme (v3) ===== */

:root {

  --bg: #05060a;

  --bg2: #0b0f1a;

  --glass: rgba(255, 255, 255, 0.05);

  --fg: #e8eef6;

  --muted: #a3afbf;

  --accent: #ff2d6b;

  --accent2: #7c3aed;

  --rule: #1b2233;

}

html,

body {

  background: radial-gradient(

      1200px 600px at 0% -10%,

      rgba(255, 45, 107, 0.07),

      transparent 60%

    ),

    radial-gradient(

      900px 500px at 100% 0%,

      rgba(124, 58, 237, 0.1),

      transparent 60%

    ),

    linear-gradient(180deg, #070911, #0a0d17 40%, #0b0f1a);

  color: var(--fg);

  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;

  letter-spacing: 0.1px;

}

main {

  max-width: 1350px;

  margin: 56px auto 96px;

  padding: 0 28px 80px;

  margin-top: 20px;

}

/* Hero */

.hero {

  position: relative;

  text-align: center;

  padding: 40px 12px 24px;

  border-radius: 18px;

  background: linear-gradient(

    180deg,

    rgba(255, 255, 255, 0.02),

    rgba(255, 255, 255, 0.01)

  );

  border: 1px solid var(--rule);

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45),

    inset 0 0 60px rgba(124, 58, 237, 0.08);

}

.hero h1 {

  margin: 0 0 0.6rem 0;

  font-size: 2.4rem;

  font-weight: 900;

  line-height: 1.15;

  background: linear-gradient(

    90deg,

    #e9effa 0%,

    #c7d2fe 25%,

    var(--accent) 65%,

    var(--accent2) 100%

  );

  -webkit-background-clip: text;

  background-clip: text;

  color: transparent;

  text-shadow: 0 2px 24px rgba(124, 58, 237, 0.25);

}

.hero-deco {

  height: 3px;

  /*width: 1320px;*/

  margin: 0 auto;

  background: linear-gradient(90deg, var(--accent), var(--accent2));

  border-radius: 999px;

  box-shadow: 0 0 14px rgba(255, 45, 107, 0.35);

}



/* Grid layout */

.layout {

  display: grid;

  grid-template-columns: 310px 1fr;

  gap: 24px;

  margin-top: 26px;

}

@media (max-width: 980px) {

  .layout {

    grid-template-columns: 1fr;

  }

  .sidebar {

    position: static;

    top: auto;

  }

}



/* Sidebar TOC */

.sidebar {

  position: sticky;

  top: 130px;

  align-self: start;

}

.sidebar .toc {

  background: linear-gradient(

    180deg,

    rgba(255, 255, 255, 0.03),

    rgba(255, 255, 255, 0.01)

  );

  border: 1px solid var(--rule);

  border-radius: 14px;

  padding: 16px 18px;

  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);

}

.sidebar .toc h2 {

  margin: 0.2rem 0 0.5rem;

  font-size: 1.1rem;

  border: none;

  padding: 0;

}

.sidebar .toc a {

  color: #e5e7eb;

  text-decoration: none;

}

.sidebar .toc a:hover {

  color: #fff;

  text-decoration: underline;

}

.sidebar .toc ul {

  margin: 0.3rem 0 0.3rem -16px;

}

.sidebar .toc li {

  margin: 0.2rem 0;

}



/* Content sections */

.content .apo-section {

  background: linear-gradient(

    180deg,

    rgba(255, 255, 255, 0.02),

    rgba(255, 255, 255, 0.01)

  );

  border: 1px solid var(--rule);

  border-radius: 16px;

  padding: 22px 24px;

  margin: 18px 0 22px;

  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45);

}

.content p {

  color: var(--fg);

}

.content ul,

.content ol {

  margin-left: 1.3rem;

}



/* Numbered sections */

.content {

  counter-reset: section;

}

.content .apo-section > h2 {

  position: relative;

  padding-left: 48px;

  margin-top: 0.1rem;

}

.content .apo-section > h2::before {

  counter-increment: section;

  content: counter(section, decimal-leading-zero);

  position: absolute;

  left: 0;

  top: 0.1rem;

  font-size: 0.95rem;

  font-weight: 800;

  letter-spacing: 0.08em;

  color: #fff;

  background: linear-gradient(180deg, var(--accent), var(--accent2));

  padding: 6px 10px;

  border-radius: 10px;

  box-shadow: 0 6px 18px rgba(255, 45, 107, 0.35);

}



/* Dividers between blocks inside sections */

.content .apo-section > * + * {

  border-top: 1px dashed var(--rule);

  margin-top: 14px;

  padding-top: 14px;

}

.content .apo-section > h2 + * {

  border-top: none;

  margin-top: 0.4rem;

  padding-top: 0;

}



/* Figures — lightbox-ready */

.figure {

  text-align: center;

  margin: 1.1rem auto;

}

.figure img {

  width: min(100%, 920px);

  max-height: 600px;

  height: auto;

  object-fit: contain;

  border: 1px solid var(--rule);

  border-radius: 14px;

  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);

  cursor: zoom-in;

}

.caption {

  color: var(--muted);

}



/* Smooth anchor scrolling */

html {

  scroll-behavior: smooth;

}



/* Back to top button refinement */

#toTop {

  background: linear-gradient(90deg, var(--accent), var(--accent2));

  border: none;

}

#toTop:hover {

  filter: brightness(1.1);

}



/* Typography polish */

p {

  margin: 0.7em 0;

}

h3 {

  color: #dbeafe;

}

table {

  background: transparent;

}

th {

  background: rgba(124, 58, 237, 0.14);

}



/* Fix: Make H3 visually match section H2 (identified-issues look) */

.content .apo-section > h3 {

  position: relative;

  padding-left: 48px;

  margin-top: 0.1rem;

  font-size: 1.5rem;

  font-weight: 750;

  color: var(--fg);

}

.content .apo-section > h3::before {

  content: "—";

  position: absolute;

  left: 0;

  top: 0.1rem;

  font-size: 0.95rem;

  font-weight: 800;

  letter-spacing: 0.08em;

  color: #fff;

  background: linear-gradient(180deg, var(--accent), var(--accent2));

  padding: 6px 10px;

  border-radius: 10px;

  box-shadow: 0 6px 18px rgba(255, 45, 107, 0.35);

}

/* Remove dashed divider immediately after H3 heading */

.content .apo-section > h3 + * {

  border-top: none;

  margin-top: 0.4rem;

  padding-top: 0;

}



/* H3 now matches the bar style of H2 */

.content .apo-section > h3 {

  font-size: 1.5rem;

  font-weight: 750;

  color: var(--fg);

  position: relative;

  padding-left: 14px;

  margin-top: 0.1rem;

}

.content .apo-section > h3::before {

  content: "";

  position: absolute;

  left: 0;

  top: 0.2em;

  bottom: 0.2em;

  width: 4px;

  background: linear-gradient(var(--accent), var(--accent2));

  border-radius: 4px;

  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.06);

}

.content .apo-section > h3 + * {

  border-top: none;

  margin-top: 0.4rem;

  padding-top: 0;

}



/* Refine H3 bar spacing to avoid overlap */

.content .apo-section > h3 {

  font-size: 1.5rem;

  font-weight: 750;

  color: var(--fg);

  position: relative;

  padding-left: 12px;

  margin-top: 0.1rem;

}

.content .apo-section > h3::before {

  content: "";

  position: absolute;

  left: 0;

  top: 0.25em;

  bottom: 0.25em;

  width: 3px;

  background: linear-gradient(var(--accent), var(--accent2));

  border-radius: 2px;

  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.05);

}



/* Adjust H3: flex-centering and thinner bar with padding */

.content .apo-section > h3 {

  display: flex;

  align-items: center;

  font-size: 1.5rem;

  font-weight: 750;

  color: var(--fg);

  position: relative;

  padding-left: 16px;

  margin-top: 0.1rem;

  color: #d2a028;

  padding-top: 0;

}

.content .apo-section > h3::before {

  content: "";

  position: absolute;

  left: 0;

  top: 0;

  bottom: 0;

  width: 0px;

  padding: 3px;

  background: linear-gradient(var(--accent), var(--accent2));

  border-radius: 3px;

  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.05);

}



/* === Fixed logo bar (left/right), shrinks on scroll; keeps main width === */

.apoi-logo-bar-wrap {

  position: fixed;

  top: 0;

  left: 0;

  right: 0;

  z-index: 9998;

  backdrop-filter: blur(6px);

  background: rgba(10, 12, 18, 0.55);

  border-bottom: 1px solid var(--rule);

}

.apoi-logo-bar {

  max-width: 1300px;

  margin: 0 auto;

  padding: 14px 28px;

  display: flex;

  align-items: center;

  justify-content: space-between;

}

.apoi-logo-bar img {

  height: 36px;

  width: auto;

  object-fit: contain;

  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));

}

.apoi-logo-bar-wrap.shrink .apoi-logo-bar {

  padding: 6px 28px;

}

.apoi-logo-bar-wrap.shrink img {

  height: 26px;

}

body.has-apoi-logo-bar {

  padding-top: 64px;

}

@media (max-width: 980px) {

  .apoi-logo-bar {

    padding: 10px 18px;

  }

  body.has-apoi-logo-bar {

    padding-top: 56px;

  }

}



/* Demo video grid (responsive) */

.apoi-video-grid {

  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 16px;

  margin-top: 10px;

}

@media (max-width: 980px) {

  .apoi-video-grid {

    grid-template-columns: 1fr;

  }

}

.apoi-video {

  position: relative;

  width: 100%;

  padding-bottom: 56.25%;

  border: 1px solid var(--rule);

  border-radius: 12px;

  overflow: hidden;

  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);

  background: rgba(255, 255, 255, 0.02);

}

.apoi-video iframe {

  position: absolute;

  inset: 0;

  width: 100%;

  height: 100%;

  border: 0;

}



/* Code block styling */

.apoi-code {

  background: #0f131d;

  border: 1px solid var(--rule);

  border-radius: 12px;

  padding: 14px 16px;

  font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;

  font-size: 0.95rem;

  line-height: 1.5;

  overflow: auto;

  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);

}



/* Single-column full-width video embeds */

.apoi-video-grid {

  display: grid;

  grid-template-columns: 1fr;

  gap: 16px;

  margin-top: 10px;

}

.apoi-video {

  position: relative;

  width: 100%;

  padding-bottom: 56.25%;

  border: 1px solid var(--rule);

  border-radius: 12px;

  overflow: hidden;

  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);

  background: rgba(255, 255, 255, 0.02);

}

.apoi-video iframe {

  position: absolute;

  inset: 0;

  width: 100%;

  height: 100%;

  border: 0;

}



/* Custom logo sizing with shrink overrides */

#logo1 {

  height: 150px;

  width: auto;

}

#logo2 {

  height: 80px;

  width: auto;

}



/* When shrinking, override explicit heights */

.apoi-logo-bar-wrap.shrink #logo1 {

  height: 110px !important;

} /* adjust as desired */

.apoi-logo-bar-wrap.shrink #logo2 {

  height: 56px !important;

} /* adjust as desired */



/* Keep intrinsic image ratio */

#logo1,

#logo2 {

  object-fit: contain;

}



.video-wrap {

  position: relative;

  width: 100%;

  padding-bottom: 56.25%; /* 16:9 ratio */

  background: #000;

  border-radius: 12px;

  overflow: hidden;

  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);

}

.video-wrap video {

  position: absolute;

  inset: 0;

  width: 100%;

  height: 100%;

}





.meta {

  display: grid;

  gap: 16px;

  margin: 16px 0;

}



/* Card look coerente con il resto della pagina */

.meta-box {

  border-radius: 12px;

  padding: 16px;

  background: rgba(255,255,255,0.04);            /* fallback chiaro/scuro */

  box-shadow: 0 8px 24px rgba(0,0,0,.15);

  border: 1px solid rgba(255,255,255,0.06);

  backdrop-filter: saturate(140%) blur(8px);

  -webkit-backdrop-filter: saturate(140%) blur(8px);

}



.meta-title {

  margin: 0 0 10px 0;

  font-size: 1.05rem;

  font-weight: 700;

}



/* Lista label/valore */

.meta-list { margin: 0; }

.meta-row { display: grid; grid-template-columns: 140px 1fr; gap: 12px 16px; align-items: start; padding: 6px 0; }

.meta-row + .meta-row { border-top: 1px dashed rgba(255,255,255,0.12); }



/* Label e valore */

.meta-list dt { font-weight: 600; opacity: .9; }

.meta-list dd { margin: 0; opacity: .95; }

.meta-list a { text-decoration: none; border-bottom: 1px dotted currentColor; }



.meta-box { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)); }

.meta-title { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }



@media (min-width: 981px) {

  .meta { grid-template-columns: 1fr 1fr; }

}