/* =========================================================
   Mathia Pagani — site.css
   ========================================================= */


/* ---------------------------------------------------------
   Design tokens
   --------------------------------------------------------- */

:root {
  --color-bg: #ffffff;
  --color-text: #111111;
  --color-muted: #626262;
  --color-border: #d9d9d9;
  --color-surface: #f7f7f7;
  --color-hover: #f2f2f2;
  --color-hover-dark: #333333;

  --content-width: 980px;
  --wide-width: 1180px;

  --gutter: 28px;

  --button-width: 230px;
  --button-height: 52px;

  --radius: 2px;

  --font-sans: Inter, Arial, Helvetica, sans-serif;
}


/* ---------------------------------------------------------
   Reset / base
   --------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;

  background: var(--color-bg);
  color: var(--color-text);

  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}

img,
video {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

::selection {
  background: var(--color-text);
  color: var(--color-bg);
}


/* ---------------------------------------------------------
   Accessibility
   --------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;

  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;

  border: 0;
}


/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.site-header {
  width: 100%;

  padding: 22px max(
    var(--gutter),
    calc((100vw - var(--wide-width)) / 2 + var(--gutter))
  );

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;

  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.logo {
  flex: 0 0 auto;

  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.logo a {
  text-decoration: none;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;

  gap: 18px;
}

.nav-about {
  min-height: 38px;
  padding: 0 4px;

  display: inline-flex;
  align-items: center;

  color: var(--color-text);

  font-size: 15px;
  font-weight: 500;

  text-decoration: none;
}

.nav-about:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.social-link {
  width: 36px;
  height: 36px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: var(--color-text);

  text-decoration: none;
}

.social-link:hover {
  opacity: 0.6;
}

.social-link iconify-icon {
  display: block;

  font-size: 25px;
  line-height: 1;
}


/* ---------------------------------------------------------
   Typography
   --------------------------------------------------------- */

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--color-text);
}

h1 {
  margin-bottom: 28px;

  font-size: clamp(54px, 7vw, 90px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.section h2 {
  margin-bottom: 28px;

  font-size: clamp(34px, 5vw, 56px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
}

.section p {
  max-width: 840px;

  color: var(--color-muted);

  font-size: 19px;
  line-height: 1.75;
}

.section em {
  color: var(--color-text);

  font-style: normal;
  font-weight: 600;
}

.subtitle {
  max-width: 780px;

  margin-bottom: 24px;

  color: var(--color-text);

  font-size: clamp(25px, 3vw, 38px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 760px;

  color: var(--color-muted);

  font-size: 19px;
  line-height: 1.72;
}


/* ---------------------------------------------------------
   Small section labels
   --------------------------------------------------------- */

.eyebrow {
  display: block;

  margin-bottom: 20px;

  color: var(--color-muted);

  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}


/* ---------------------------------------------------------
   Actions / buttons
   --------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;

  gap: 12px;

  margin-top: 28px;
}


/*
 * All CTA buttons share exactly the same geometry.
 * Individual components must not redefine width or height.
 */

.btn,
.newsletter-form-wrapper button.sib-form-block__button {
  width: var(--button-width);
  height: var(--button-height);

  padding: 0 18px;

  border: 1px solid var(--color-text);
  border-radius: var(--radius);

  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;

  text-align: center;
}

.btn {
  flex: 0 0 var(--button-width);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--color-bg);
  color: var(--color-text);

  text-decoration: none;

  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.btn:hover {
  background: var(--color-hover);
}

.btn--primary {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn--primary:hover {
  background: var(--color-hover-dark);
}


/* ---------------------------------------------------------
   Action groups
   --------------------------------------------------------- */

.action-group {
  margin-top: 36px;
}

.action-group .eyebrow {
  margin-bottom: 12px;
}

.action-group .actions {
  margin-top: 0;
}


/* ---------------------------------------------------------
   Main sections
   --------------------------------------------------------- */

.section {
  width: 100%;
  max-width: var(--content-width);

  margin: 0 auto;
  padding: 72px var(--gutter);
}

.section--wide {
  max-width: var(--wide-width);
}

.section--compact {
  padding-top: 40px;
  padding-bottom: 40px;
}


/* ---------------------------------------------------------
   Two-column sections
   --------------------------------------------------------- */

.section-with-illustration {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(220px, 320px);

  gap: 64px;

  align-items: center;
}

/* ---------------------------------------------------------
   Home
   --------------------------------------------------------- */

.home-book {
  padding-top: 96px;
  padding-bottom: 64px;
}

.home-title {
  margin-bottom: 30px;

  font-size: clamp(44px, 5.5vw, 72px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
}


/* Main book actions */

.home-main-actions {
  margin-top: 28px;

  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 28px;
}


/* Secondary textual action */

.text-link {
  display: inline-block;

  color: var(--color-text);

  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;

  text-decoration: none;

  border-bottom: 1px solid var(--color-text);

  transition: opacity 0.15s ease;
}

.text-link:hover {
  opacity: 0.55;
}


/* Purchase links */

.purchase-line {
  margin-top: 28px;

  display: flex;
  flex-wrap: wrap;
  align-items: baseline;

  gap: 8px;

  color: var(--color-muted);

  font-size: 14px;
  line-height: 1.5;
}

.purchase-label {
  margin-right: 6px;

  font-size: 12px;
  font-weight: 600;

  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.purchase-line a {
  color: var(--color-text);

  font-weight: 500;

  text-decoration: none;
}

.purchase-line a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* Resources */

.resources-section {
  padding-top: 0;
  padding-bottom: 0;
}

.resources-card {
  width: 100%;

  padding: 30px 32px;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  gap: 48px;

  align-items: end;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-surface);
  color: var(--color-text);

  text-decoration: none;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.resources-card:hover {
  background: var(--color-hover);
  border-color: var(--color-text);
}

.resources-card .eyebrow {
  margin-bottom: 12px;
}

.resources-card h2 {
  margin-bottom: 10px;

  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.resources-card p {
  max-width: 650px;

  margin-bottom: 0;

  font-size: 17px;
  line-height: 1.6;
}

.resources-card-link {
  flex-shrink: 0;

  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;

  white-space: nowrap;
}


/* Book purchase / resources */

.book-support {
  display: grid;

  gap: 32px;
}

.book-support .purchase-line {
  margin-top: 0;
}


/* Final CTA */

.primary-with-link {
  margin-top: 28px;

  display: flex;
  flex-wrap: wrap;
  align-items: center;

  gap: 28px;
}


/* Error Project */

.project-section > div {
  max-width: 820px;
}

.project-lead {
  max-width: 760px;
}


/* ---------------------------------------------------------
   Book hero
   --------------------------------------------------------- */

.hero {
  width: 100%;
  max-width: var(--wide-width);

  margin: 0 auto;
  padding: 72px var(--gutter) 88px;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(280px, 340px);

  gap: 72px;

  align-items: center;
}


/* ---------------------------------------------------------
   Covers
   --------------------------------------------------------- */

.cover-card {
  width: 100%;
  max-width: 320px;

  justify-self: center;
}

.hero .cover-card {
  max-width: 340px;
}

.cover-card a {
  display: block;
}

.cover-card img {
  display: block;

  width: 100%;
  height: auto;
}


/* ---------------------------------------------------------
   Illustrations
   --------------------------------------------------------- */

.section-illustration {
  display: block;

  width: min(100%, 280px);
  height: auto;

  justify-self: center;

  margin: 36px auto 0;
}

.section-with-illustration > .section-illustration {
  margin-top: 0;
}


/* ---------------------------------------------------------
   Full-screen book video
   --------------------------------------------------------- */

.fullscreen-video {
  width: 100%;
  height: calc(100svh - 83px);

  margin: 0;
  padding: 0;

  overflow: hidden;

  background: var(--color-bg);
}

.fullscreen-video__media {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;
}


/* ---------------------------------------------------------
   Progression
   --------------------------------------------------------- */

.progression-section {
  max-width: 1060px;
}

.progression-list {
  display: grid;

  gap: 12px;
}

.progression-item {
  padding: 22px 24px;

  display: grid;

  grid-template-columns:
    48px
    minmax(0, 1fr);

  gap: 20px;

  align-items: center;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-bg);
}

.progression-item > span {
  color: var(--color-muted);

  font-size: 18px;
  font-weight: 500;
}

.progression-item strong {
  display: block;

  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
}

.progression-item p {
  max-width: none;

  margin: 6px 0 0;

  font-size: 17px;
  line-height: 1.5;
}


/* ---------------------------------------------------------
   What the book dismantles
   --------------------------------------------------------- */

.dismantle-section {
  max-width: 1060px;
}

.dismantle-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;
}

.dismantle-card {
  padding: 26px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-bg);
}

.dismantle-card del {
  display: block;

  margin-bottom: 12px;

  color: var(--color-muted);

  font-size: 18px;
  font-weight: 500;

  text-decoration-thickness: 1px;
}

.dismantle-card strong {
  display: block;

  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}


/* ---------------------------------------------------------
   Audience
   --------------------------------------------------------- */

.audience-section {
  max-width: 1060px;
}

.audience-checkerboard {
  max-width: 980px;

  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;
}

.audience-card {
  padding: 24px;

  display: grid;

  grid-template-columns:
    32px
    minmax(0, 1fr);

  gap: 18px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-bg);
}

.audience-card iconify-icon {
  margin-top: 2px;

  color: var(--color-text);

  font-size: 25px;
}

.audience-card strong {
  display: block;

  margin-bottom: 6px;

  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.audience-card span {
  display: block;

  color: var(--color-muted);

  font-size: 16px;
  line-height: 1.5;
}

.audience-conclusion {
  max-width: 760px;

  margin: 38px auto 0;

  color: var(--color-muted);

  text-align: center;
}

.audience-illustration {
  display: block;

  width: 118px;
  height: auto;

  margin: 32px auto 0;
}


/* ---------------------------------------------------------
   Quote
   --------------------------------------------------------- */

.quote-section {
  padding-top: 48px;
  padding-bottom: 48px;
}

blockquote {
  max-width: 800px;

  margin: 0;
  padding: 8px 0 8px 28px;

  border-left: 2px solid var(--color-text);

  color: var(--color-text);

  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

blockquote p {
  margin: 0;

  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

blockquote strong {
  font-weight: 600;
}


/* ---------------------------------------------------------
   Author
   --------------------------------------------------------- */

#about {
  scroll-margin-top: 40px;
}

.author-block {
  max-width: none;

  background: var(--color-surface);
}

.author-with-photo {
  display: grid;

  grid-template-columns:
    minmax(0, 720px)
    160px;

  justify-content: center;
  align-items: center;

  gap: 56px;
}

.author-photo {
  width: 145px;
  height: 145px;

  justify-self: center;

  object-fit: cover;
  object-position: center;

  border-radius: 50%;
}


/* ---------------------------------------------------------
   Newsletter
   --------------------------------------------------------- */

.newsletter-section {
  padding-top: 40px;
  padding-bottom: 40px;
}

.newsletter-box {
  padding: 30px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  background: var(--color-bg);
}

.newsletter-section .newsletter-question {
  margin: 0 0 26px;

  max-width: none;

  color: var(--color-text);

  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.newsletter-section .newsletter-custom-success {
  display: none;

  max-width: none;

  margin: 0;

  color: var(--color-text);

  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}

.newsletter-form-wrapper {
  width: 100%;
}

.newsletter-form-wrapper .sib-form-container {
  margin: 0;
}

.newsletter-form-wrapper #sib-container {
  max-width: 100%;

  padding: 0;

  border: 0;

  background: transparent;

  text-align: left;
}

.newsletter-form-wrapper #sib-form {
  width: 100%;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  gap: 12px;

  align-items: start;
}

.newsletter-form-wrapper .sib-input,
.newsletter-form-wrapper .sib-form-block {
  margin: 0;
  padding: 0;
}

.newsletter-form-wrapper .entry__field {
  border: 0;

  background: transparent;
}

.newsletter-form-wrapper input.input {
  width: 100%;
  height: var(--button-height);

  padding: 0 16px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  outline: none;

  background: var(--color-bg);
  color: var(--color-text);

  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
}

.newsletter-form-wrapper input.input::placeholder {
  color: #8a8a8a;
}

.newsletter-form-wrapper input.input:focus {
  border-color: var(--color-text);
}

.newsletter-form-wrapper button.sib-form-block__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--color-text);
  color: var(--color-bg);

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.newsletter-form-wrapper button.sib-form-block__button:hover {
  background: var(--color-hover-dark);
}

.newsletter-form-wrapper svg {
  display: none;
}

.newsletter-form-wrapper .input--hidden {
  display: none;
}


/* Brevo messages */

.newsletter-form-wrapper .sib-form-message-panel {
  display: none;

  margin: 0 0 14px;
  padding: 12px 14px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius);

  font-size: 14px;
  line-height: 1.45;
}

.newsletter-form-wrapper .sib-form-message-panel__text {
  display: block;
}

.newsletter-form-wrapper #success-message {
  color: var(--color-text);

  background: var(--color-surface);
}

.newsletter-form-wrapper #error-message {
  color: #7a1f1f;

  border-color: #d7abab;

  background: #fff6f6;
}

.newsletter-form-wrapper .entry__error {
  display: none;

  margin-top: 8px;

  color: #7a1f1f;

  font-size: 14px;
  line-height: 1.4;
}

.newsletter-box--success .newsletter-question,
.newsletter-box--success .newsletter-form-wrapper {
  display: none;
}

.newsletter-box--success .newsletter-custom-success {
  display: block;
}


/* ---------------------------------------------------------
   SEO / article pages
   --------------------------------------------------------- */

.prose {
  max-width: 780px;
}

.prose h1 {
  font-size: clamp(42px, 6vw, 72px);
}

.prose p {
  margin-bottom: 24px;
}

.prose .actions {
  margin-top: 40px;
}

.prose .action-group .actions {
  margin-top: 0;
}


/* ---------------------------------------------------------
   Contact
   --------------------------------------------------------- */

.contact-email {
  margin-top: 16px;
}

.contact-email a {
  color: var(--color-text);

  font-size: clamp(24px, 4vw, 38px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.025em;

  text-decoration: none;
}

.contact-email a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}


/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

footer {
  width: 100%;
  max-width: var(--wide-width);

  margin: 0 auto;
  padding: 34px var(--gutter) 48px;

  border-top: 1px solid var(--color-border);

  color: var(--color-muted);

  font-size: 14px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;

  gap: 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;

  gap: 10px 18px;
}

.footer-links a {
  color: var(--color-muted);

  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-text);

  text-decoration: underline;
  text-underline-offset: 4px;
}

.publication-note {
  font-size: 0.85em;
  font-weight: 400;
  font-style: italic;
}


/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 900px) {

  .site-header {
    padding: 18px 22px;

    gap: 18px;
  }

  .top-nav {
    gap: 10px;
  }

  .nav-about {
    font-size: 14px;
  }


  .hero,
  .section-with-illustration,
  .author-with-photo {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 48px;

    padding-top: 56px;
  }

  .section-with-illustration {
    gap: 42px;
  }


  .cover-card,
  .section-illustration,
  .author-photo {
    justify-self: center;

    margin-left: auto;
    margin-right: auto;
  }

  .section-with-illustration > .section-illustration {
    margin-top: 0;
  }


  .actions {
    justify-content: center;
  }

  .action-group {
    text-align: center;
  }


  .author-text {
    text-align: left;
  }

  .audience-conclusion {
    text-align: left;
  }

}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 700px) {

  :root {
    --gutter: 22px;
  }


  .site-header {
    padding: 18px 20px;

    flex-direction: column;
    align-items: center;
  }

  .top-nav {
    justify-content: center;
  }


  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .home-book {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .hero {
    padding-top: 48px;
    padding-bottom: 64px;
  }


  h1 {
    font-size: clamp(46px, 14vw, 66px);
  }

  .home-title {
    font-size: clamp(42px, 13vw, 60px);
  }


  .actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: min(100%, 320px);
    flex-basis: auto;
  }


  .home-main-actions {
    flex-direction: column;
    align-items: flex-start;

    gap: 18px;
  }


  .purchase-line {
    gap: 7px 9px;
  }

  .purchase-label {
    flex: 0 0 100%;

    margin-right: 0;
    margin-bottom: 2px;
  }


  .resources-section {
    padding-top: 0;
    padding-bottom: 0;
  }

  .resources-card {
    grid-template-columns: 1fr;

    gap: 20px;

    padding: 24px;
  }

  .resources-card-link {
    white-space: normal;
  }


  .primary-with-link {
    flex-direction: column;
    align-items: flex-start;

    gap: 18px;
  }


  .fullscreen-video {
    height: auto;

    aspect-ratio: 16 / 9;
  }


  .cover-card,
  .hero .cover-card {
    width: min(100%, 300px);
  }


  .section-illustration {
    width: min(100%, 260px);
  }


  .progression-item {
    grid-template-columns:
      38px
      minmax(0, 1fr);

    padding: 20px;
  }


  .dismantle-grid,
  .audience-checkerboard {
    grid-template-columns: 1fr;
  }

  .dismantle-card {
    padding: 22px;
  }


  .newsletter-box {
    padding: 24px;
  }

  .newsletter-form-wrapper #sib-form {
    display: block;
  }

  .newsletter-submit-block {
    margin-top: 12px;
  }

  .newsletter-form-wrapper button.sib-form-block__button {
    width: 100%;
  }


  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    justify-content: flex-start;
  }

}


/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  .btn,
  .text-link,
  .resources-card,
  .newsletter-form-wrapper button.sib-form-block__button {
    transition: none;
  }

}