/** Primal Intelligence — Presentation Stylesheet
Stile ispirato ai pattern delle presentazioni Hugowiz/Bracco
Copyright © 2026 Ugo Mendes Donelli — Hugowiz SaS
**/

/* ── Google Fonts ───────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset by Kevin Powell ──────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; font: inherit; }
html { color-scheme: dark light; hanging-punctuation: first last; }
body { min-height: 100svh; overflow: hidden; }
img, picture, svg, video { vertical-align: middle; max-width: 100%; max-height: 100svh; height: auto; font-style: italic; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
p, li { max-width: var(--p-max-width, 65ch); text-wrap: pretty; }

/* ── Custom Properties ────────────────────────── */
:root {
  --primal-navy:    #0a1628;
  --primal-gold:    #d4a843;
  --primal-deep:    #1a2a44;
  --primal-accent:  #c97d4a;
  --primal-warm:    #e8d5b7;
  --primal-text:    #2b2b2b;
  --primal-text-light: #5a5a5a;
  --primal-text-on-dark: rgba(255,255,255,0.88);
  --primal-overlay: rgba(10,22,40,0.6);
  --primal-overlay-heavy: rgba(10,22,40,0.82);

  --fs-xl:  clamp(2.5rem, 5vw + 1rem, 4.5rem);
  --fs-800: clamp(1.5rem, 2.5vw + 0.5rem, 2.8rem);
  --fs-600: clamp(1rem, 1.5vw + 0.3rem, 1.6rem);
  --fs-400: clamp(0.9rem, 0.8vw + 0.3rem, 1.1rem);
  --fs-small: clamp(0.7rem, 0.5vw + 0.3rem, 0.85rem);

  --space-3xs: clamp(0.25rem, 0.23rem + 0.11vw, 0.35rem);
  --space-2xs: clamp(0.5rem,  0.45rem + 0.22vw, 0.7rem);
  --space-xs:  clamp(0.75rem, 0.68rem + 0.33vw, 1rem);
  --space-s:   clamp(1rem,    0.91rem + 0.45vw, 1.5rem);
  --space-m:   clamp(1.5rem,  1.36rem + 0.68vw, 2rem);
  --space-l:   clamp(2rem,    1.82rem + 0.91vw, 3rem);
  --space-xl:  clamp(3rem,    2.73rem + 1.36vw, 4.5rem);
  --space-2xl: clamp(4rem,    3.64rem + 1.82vw, 5.5rem);

  --font-display: 'Noto Serif', 'Georgia', serif;
  --font-body:    'Inter', 'Helvetica Neue', sans-serif;
}

/* ── Base ─────────────────────────────────────── */
html, body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--primal-text);
  background: var(--primal-navy);
  scroll-behavior: smooth;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; }

strong { font-weight: 600; color: var(--primal-gold); }

em { font-style: italic; color: var(--primal-warm); }

/* ── Slide Simulation ─────────────────────────── */
@media screen and (min-width: 769px) and (min-height: 501px) {
  main {
    overflow: auto;
    scroll-snap-type: block mandatory;
    height: 100vh;
    height: 100dvh;
    scrollbar-width: thin;
    scrollbar-color: var(--primal-gold) transparent;
  }
  main > section {
    scroll-snap-align: center;
    height: 100vh;
    height: 100dvh;
  }
}

@page { size: a3 landscape; margin: 0; }
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { background: var(--primal-navy); }
  main > section { display: grid; height: 100vh; page-break-after: always; }
}

/* ── Layout Classes ────────────────────────────── */

/* Cover - copertina */
.cover {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  grid-template-rows: 20vh 60vh 20vh;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primal-overlay-heavy) 0%, var(--primal-overlay) 50%, var(--primal-overlay-heavy) 100%);
    z-index: 1;
  }
  & > img {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  & > :not(img) { z-index: 2; }
  & h1 {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    align-self: center;
    justify-self: center;
    text-align: center;
    color: #fff;
    font-size: var(--fs-xl);
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  }
  & .subtitle {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    align-self: start;
    justify-self: center;
    text-align: center;
    color: var(--primal-gold);
    font-size: var(--fs-600);
    font-family: var(--font-body);
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  & .logo-area {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    align-self: start;
    justify-self: start;
    padding: var(--space-m);
    color: rgba(255,255,255,0.5);
    font-size: var(--fs-small);
    font-family: var(--font-body);
    letter-spacing: 0.1em;
  }
}

/* Show Right - testo a sx, immagine a dx */
.show-right {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: 1fr;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, transparent 0%, rgba(10,22,40,0.15) 100%);
    z-index: 1;
  }
  & > img {
    grid-column: 2;
    grid-row: 1 / -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  & > .slide-text {
    z-index: 2;
    padding: var(--space-xl) var(--space-2xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--primal-navy);
    color: var(--primal-text-on-dark);

    & h2 {
      font-size: var(--fs-800);
      margin-bottom: var(--space-s);
      color: var(--primal-gold);
    }
    & h3 {
      font-family: var(--font-body);
      font-variant: small-caps;
      font-size: var(--fs-400);
      margin-bottom: var(--space-xs);
      color: var(--primal-gold);
    }
    & p {
      font-size: var(--fs-400);
      margin-bottom: var(--space-xs);
      color: var(--primal-text-on-dark);
      max-width: 42ch;
    }
  }
}

/* Show Left - immagine a sx, testo a dx */
.show-left {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr;
  position: relative;

  & > img {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  & > .slide-text {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--primal-navy);
    color: var(--primal-text-on-dark);

    & h2 {
      font-family: var(--font-display);
      font-size: var(--fs-800);
      margin-bottom: var(--space-s);
      color: var(--primal-gold);
    }
    & h3 {
      font-family: var(--font-body);
      font-variant: small-caps;
      font-size: var(--fs-400);
      margin-bottom: var(--space-xs);
      color: var(--primal-gold);
    }
    & p {
      font-size: var(--fs-400);
      margin-bottom: var(--space-xs);
      color: var(--primal-text-on-dark);
      max-width: 42ch;
    }
  }
}

/* Center - solo testo centrato */
.center {
  display: grid;
  place-content: center center;
  text-align: center;
  background: var(--primal-navy);
  color: var(--primal-text-on-dark);
  padding: var(--space-xl);

  & h2 {
    font-size: var(--fs-800);
    color: var(--primal-gold);
    margin-bottom: var(--space-m);
  }
  & p {
    font-size: var(--fs-600);
    max-width: 55ch;
    margin: 0 auto var(--space-s);
    color: var(--primal-text-on-dark);
  }
}

/* Half - due colonne pari */
.half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  background: var(--primal-navy);
  color: var(--primal-text-on-dark);

  & > div {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;

    &:first-child {
      border-right: 1px solid rgba(212,168,67,0.2);
    }
  }
  & h3 {
    font-family: var(--font-body);
    font-variant: small-caps;
    font-size: var(--fs-400);
    color: var(--primal-gold);
    margin-bottom: var(--space-s);
  }
  & p {
    font-size: var(--fs-400);
    color: var(--primal-text-on-dark);
    margin-bottom: var(--space-xs);
    max-width: 40ch;
  }
}

/* ── Blockquote inside slides ─────────────────── */
.slide-quote {
  border-left: 3px solid var(--primal-gold);
  padding: var(--space-s) var(--space-m);
  margin: var(--space-s) 0;
  background: rgba(255,255,255,0.05);
  border-radius: 0 4px 4px 0;

  & p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--fs-600);
    color: var(--primal-warm);
    max-width: 38ch;
  }
  & cite {
    display: block;
    margin-top: var(--space-2xs);
    font-family: var(--font-body);
    font-size: var(--fs-small);
    font-style: normal;
    color: var(--primal-gold);
  }
}

/* ── List styles inside slides ────────────────── */
.slide-text ul, .show-left .slide-text ul, .half ul {
  list-style: none;
  padding: 0;
}
.slide-text li, .show-left .slide-text li, .half li {
  padding-left: var(--space-m);
  position: relative;
  margin-bottom: var(--space-2xs);
  font-size: var(--fs-400);
  color: var(--primal-text-on-dark);
}
.slide-text li::before, .show-left .slide-text li::before, .half li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--primal-gold);
  font-size: 0.7rem;
}

/* ── Power colors ──────────────────────────────── */
.power-intuition    { --power-color: #7eb8da; }  /* blue */
.power-imagination  { --power-color: #d4a843; }  /* gold */
.power-emotion      { --power-color: #c97d4a; }  /* copper */
.power-commonsense  { --power-color: #6b9e7a; }  /* sage */

.power-label {
  display: inline-block;
  padding: 0.2rem var(--space-s);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
  background: var(--power-color, var(--primal-gold));
  color: var(--primal-navy);
}

/* ── Inline label (gold uppercase) ──────────── */
.slide-label {
  display: block;
  color: var(--primal-gold);
  font-size: var(--fs-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-2xs);
}

/* ── Logo / Footnotes ──────────────────────────── */
.slide-footnote {
  position: absolute;
  bottom: var(--space-s);
  right: var(--space-m);
  font-size: var(--fs-small);
  color: rgba(255,255,255,0.3);
  z-index: 3;
  font-family: var(--font-body);
}

/* ── Cover image block ─────────────────────────── */
.cover-image {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--primal-overlay-heavy) 0%, var(--primal-overlay) 60%, transparent 100%);
    z-index: 1;
  }
  & > img {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  & > :not(img) { z-index: 2; }
  & .slide-text {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    align-self: end;
    padding: var(--space-xl) var(--space-2xl) var(--space-2xl);

    & h2 {
      font-size: var(--fs-800);
      color: var(--primal-gold);
      margin-bottom: var(--space-xs);
    }
    & p {
      font-size: var(--fs-400);
      color: var(--primal-text-on-dark);
      max-width: 50ch;
      margin-bottom: var(--space-xs);
    }
  }
}

/* ── Numbered item (for 4 powers) ──────────────── */
.power-item {
  display: flex;
  gap: var(--space-s);
  align-items: flex-start;
  margin-bottom: var(--space-m);

  & .power-number {
    flex-shrink: 0;
    width: var(--space-l);
    height: var(--space-l);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid var(--power-color, var(--primal-gold));
    color: var(--power-color, var(--primal-gold));
    background: color-mix(in srgb, var(--power-color, var(--primal-gold)) 12%, transparent);
  }
  & .power-text {
    & h4 {
      font-family: var(--font-display);
      font-size: var(--fs-600);
      color: var(--power-color, #fff);
      margin-bottom: var(--space-3xs);
    }
    & p {
      color: var(--primal-text-on-dark);
      font-size: var(--fs-400);
      max-width: 40ch;
    }
    & .hint {
      font-size: var(--fs-small);
      opacity: 0.65;
      font-style: italic;
      margin-top: var(--space-3xs);
    }
  }
}

/* ── Numbered list (esercizi) ─────────────────── */
.numbered-list {
  list-style: none;
  padding: 0;

  & li {
    padding-left: var(--space-l);
    position: relative;
    color: var(--primal-text-on-dark);
    margin-bottom: var(--space-s);

    &:last-child {
      margin-bottom: 0;
    }
  }
  & .num {
    position: absolute;
    left: 0;
    color: var(--primal-gold);
    font-weight: 700;
  }
}

/* ── Zoom / Overflow degrade ─────────────────── */
html.zoomed body {
  overflow: auto;
}
html.zoomed main {
  overflow: auto;
  scroll-snap-type: none;
  height: auto;
}
html.zoomed main > section {
  scroll-snap-align: none;
  height: auto;
  min-height: auto;
}

/* ── Mobile (max 768px) ────────────────────────── */
@media screen and (max-width: 768px), screen and (max-height: 500px) {

  body {
    overflow: auto;
  }
  main > section {
    height: auto;
    min-height: 100svh;
  }

  .show-left,
  .show-right {
    grid-template-columns: 1fr;
    grid-template-rows: 35vh 1fr;
  }
  .show-left > img,
  .show-right > img {
    grid-column: 1;
    grid-row: 1;
  }
  .show-left > .slide-text {
    padding: var(--space-m);
  }
  .show-right > .slide-text {
    padding: var(--space-m);
  }

  .half {
    grid-template-columns: 1fr;
  }
  .half > div:first-child {
    border-right: none;
    border-bottom: 1px solid rgba(212,168,67,0.2);
  }
  .half > div {
    padding: var(--space-m);
  }

  .cover {
    grid-template-columns: 1fr;
    grid-template-rows: 15vh 55vh 30vh;
  }
  .cover h1 {
    grid-column: 1 / -1;
  }
  .cover .subtitle {
    grid-column: 1 / -1;
  }

  .cover-image .slide-text {
    padding: var(--space-m) var(--space-m) var(--space-l);
  }

  .center {
    padding: var(--space-m);
  }

  .power-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .power-item .power-text p {
    max-width: 100%;
  }

  .numbered-list li {
    padding-left: var(--space-m);
  }

}
