/* ============================================================
   IL PERCORSO DELL'ANIMA — stylesheet
   "Quaderno di un uomo che ha appena trovato la sua strada"
   ============================================================ */

:root {
  /* color tokens — paper + ink + mediterranean light */
  --bg: oklch(0.985 0.006 85);
  --bg-warm: oklch(0.965 0.010 82);
  --bg-soft: oklch(0.945 0.012 80);

  --ink: oklch(0.22 0.060 245);
  --ink-strong: oklch(0.16 0.055 248);
  --ink-soft: oklch(0.38 0.045 245);
  --ink-fade: oklch(0.56 0.035 245);
  --ink-whisper: oklch(0.72 0.025 245);

  --sky: oklch(0.62 0.090 230);
  --sky-deep: oklch(0.46 0.105 235);
  --sky-soft: oklch(0.82 0.060 225);
  --sky-ghost: oklch(0.94 0.025 225);

  --paper-rule: oklch(0.88 0.010 85);
  --paper-rule-soft: oklch(0.93 0.008 85);

  /* type */
  --font-display: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Caveat", "Brush Script MT", cursive;

  /* layout */
  --maxw: 1100px;
  --maxw-prose: 660px;
  --gutter: clamp(20px, 5vw, 64px);
  --header-h: 64px;
  --section-pad: clamp(72px, 11vw, 144px);
  --radius: 4px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-optical-sizing: auto;
  color: var(--ink-strong);
  letter-spacing: -0.005em;
  line-height: 1.12;
}

p {
  margin: 0;
}

::selection {
  background: var(--sky-soft);
  color: var(--ink-strong);
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  font-weight: 500;
  z-index: 200;
}
.skip-link:focus {
  left: 12px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--paper-rule-soft);
}

.header-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.05;
  letter-spacing: -0.005em;
}

.wordmark-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  flex-shrink: 0;
}

.wordmark-text {
  display: inline-flex;
  flex-direction: column;
}
.wordmark-line-1 { font-size: 13px; color: var(--ink-soft); font-family: var(--font-body); letter-spacing: 0.01em; }
.wordmark-line-2 { font-size: 18px; }

.nav-desktop {
  display: none;
  gap: 32px;
  align-items: center;
}
.nav-desktop a {
  font-size: 15px;
  color: var(--ink-soft);
  position: relative;
  padding: 8px 0;
  transition: color 0.2s ease;
}
.nav-desktop a:hover,
.nav-desktop a:focus-visible {
  color: var(--ink-strong);
}
.nav-desktop a:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 4px;
  border-radius: 2px;
}

/* burger */
.burger {
  width: 44px;
  height: 44px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius);
  margin-right: -10px;
}
.burger:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}
.burger-line {
  width: 22px;
  height: 1.5px;
  background: var(--ink-strong);
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.burger[aria-expanded="true"] .burger-line:nth-child(1) {
  transform: translateY(3.75px) rotate(45deg);
}
.burger[aria-expanded="true"] .burger-line:nth-child(2) {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* ---------- drawer ---------- */
.nav-drawer {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  background: color-mix(in srgb, var(--bg) 98%, transparent);
  padding: 32px var(--gutter) 48px;
  border-bottom: 1px solid var(--paper-rule-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(calc(-100% - var(--header-h) - 4px));
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.32s;
  z-index: 40;
}
.nav-drawer.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0s;
}
.nav-drawer a {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink-strong);
  padding: 14px 0;
  border-bottom: 1px solid var(--paper-rule-soft);
  min-height: 44px;
}
.nav-drawer a:last-of-type {
  border-bottom: none;
}
.nav-drawer-note {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-fade);
  margin-top: 24px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(56px, 12vw, 120px) var(--gutter) var(--section-pad);
}

.hero-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 8vw, 80px);
  align-items: start;
}

.hero-text {
  position: relative;
  z-index: 1;
}

.hero-figure {
  margin: 0;
  position: relative;
}
.hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  box-shadow:
    0 1px 0 var(--paper-rule-soft),
    0 22px 44px -28px oklch(0.22 0.06 245 / 0.28);
  filter: saturate(0.92);
}
.hero-figure figcaption {
  margin-top: 14px;
  font-family: var(--font-hand);
  font-size: 19px;
  color: var(--ink-fade);
  line-height: 1.3;
  text-align: right;
  padding-right: 6px;
}

.hero-kicker {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--sky-deep);
  font-weight: 500;
  margin-bottom: 32px;
  display: inline-block;
}

.hero-claim {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8.5vw, 5.6rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.018em;
  color: var(--ink-strong);
  margin-bottom: 40px;
  max-width: 18ch;
}
.hero-line {
  display: block;
}
.hero-line-soft {
  color: var(--ink-soft);
}

.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 48ch;
  margin-bottom: 28px;
}

.hero-sign {
  font-family: var(--font-hand);
  font-size: clamp(1.5rem, 2.8vw, 1.9rem);
  color: var(--ink-fade);
  margin-bottom: 48px;
  display: inline-block;
  padding-left: 4px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

/* a subtle "page margin" line on the hero — only on large screens */
.hero-margin {
  display: none;
}

/* ---------- CTA ---------- */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.005em;
  min-height: 44px;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cta-primary {
  background: var(--ink-strong);
  color: var(--bg);
  border: 1px solid var(--ink-strong);
}
.cta-primary:hover,
.cta-primary:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}
.cta-primary:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}

.cta-ghost {
  background: transparent;
  color: var(--ink-strong);
  border: 1px solid var(--paper-rule);
}
.cta-ghost:hover,
.cta-ghost:focus-visible {
  border-color: var(--ink-strong);
}
.cta-ghost:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
}

.cta-block {
  margin-top: 8px;
  align-self: flex-start;
}

/* ---------- sections (shared) ---------- */
.section {
  padding: var(--section-pad) var(--gutter);
  position: relative;
}
.section + .section {
  border-top: 1px solid var(--paper-rule-soft);
}

.section-inner {
  max-width: var(--maxw);
  margin-inline: auto;
}

.section-head {
  margin-bottom: clamp(40px, 6vw, 64px);
  max-width: 28ch;
}

.section-tag {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--sky-deep);
  font-weight: 500;
  margin-bottom: 16px;
  display: inline-block;
}

.section-title {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink-strong);
}

/* ---------- chi-sono ---------- */
.chi-sono {
  background: var(--bg);
}

.prose {
  max-width: var(--maxw-prose);
  font-size: clamp(1.05rem, 1.4vw, 1.15rem);
  line-height: 1.7;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.prose p {
  margin: 0;
}

.dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 4.4em;
  float: left;
  line-height: 0.86;
  padding: 0.08em 0.12em 0 0;
  font-weight: 500;
  color: var(--ink-strong);
}

.prose-values {
  font-family: var(--font-display);
  font-size: 1.05em;
  color: var(--ink-strong);
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.prose-values span {
  position: relative;
  padding-right: 22px;
}
.prose-values span:not(:last-child)::after {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--sky);
  border-radius: 50%;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- temi ---------- */
.temi {
  background: var(--bg-warm);
}

.temi-figure {
  margin: 0 0 clamp(48px, 7vw, 72px) 0;
  max-width: 460px;
  position: relative;
}
.temi-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 35%;
  border-radius: 4px;
  box-shadow:
    0 1px 0 var(--paper-rule-soft),
    0 22px 44px -28px oklch(0.22 0.06 245 / 0.22);
  filter: saturate(0.9);
}
.temi-figure figcaption {
  margin-top: 12px;
  font-family: var(--font-hand);
  font-size: 19px;
  color: var(--ink-fade);
  line-height: 1.3;
  text-align: right;
  padding-right: 6px;
}

.temi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  max-width: 880px;
}

.tema {
  display: grid;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--paper-rule);
}
.tema:first-child {
  border-top: none;
  padding-top: 0;
}

.tema-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
}

.tema p {
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ---------- libro ---------- */
.libro {
  background: var(--bg);
}

.libro-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 8vw, 80px);
  align-items: center;
}

.libro-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  order: -1;
}

.book {
  position: relative;
  width: clamp(210px, 52vw, 240px);
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  filter: drop-shadow(0 18px 32px oklch(0.22 0.06 245 / 0.18));
  transform: rotate(-1.5deg);
  transition: transform 0.4s ease;
}
.book:hover {
  transform: rotate(-0.5deg) translateY(-4px);
}

.book-spine {
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: oklch(0.16 0.045 248);
  border-radius: 2px 0 0 2px;
}

.book-cover {
  position: absolute;
  inset: 0 0 0 8px;
  background:
    linear-gradient(135deg, oklch(0.20 0.060 248) 0%, oklch(0.26 0.075 245) 100%);
  border-radius: 0 4px 4px 0;
  padding: 28px 14px;
  color: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  overflow: hidden;
}
.book-cover::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid oklch(0.95 0.020 225 / 0.18);
  border-radius: 2px;
  pointer-events: none;
}

.book-tag {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: oklch(0.85 0.055 225);
  font-weight: 500;
}

.book-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.8vw, 1.5rem);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--bg);
  word-break: keep-all;
  hyphens: none;
}
.book-title span { display: block; }

.book-rule {
  display: block;
  width: 28px;
  height: 1px;
  background: oklch(0.85 0.055 225 / 0.5);
  margin: 8px auto;
}

.book-author {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.86 0.045 225);
}

.book-foot {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.78 0.045 225);
  line-height: 1;
  font-weight: 500;
}

.book-caption {
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--ink-fade);
  max-width: 22ch;
  text-align: center;
  line-height: 1.3;
}

.libro-text {
  max-width: 52ch;
}
.libro-text .section-tag {
  margin-bottom: 16px;
}
.libro-text .section-title {
  margin-bottom: 28px;
}
.libro-text p {
  font-size: clamp(1.02rem, 1.3vw, 1.1rem);
  line-height: 1.7;
  margin-bottom: 20px;
  color: var(--ink-soft);
}

/* ---------- scrivimi ---------- */
.scrivimi {
  background: var(--bg-soft);
}

.contatti {
  max-width: var(--maxw-prose);
}

.contatti-intro {
  font-size: clamp(1.05rem, 1.4vw, 1.15rem);
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 40px;
}

.contatti-list {
  margin: 0;
  display: grid;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--paper-rule);
}

.contatto {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--paper-rule-soft);
}
.contatto:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.contatto dt {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-fade);
  font-weight: 500;
}
.contatto dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 500;
  color: var(--ink-strong);
  letter-spacing: -0.005em;
  word-break: break-word;
}

.contatti-foot {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--ink-fade);
  margin-top: 32px;
  line-height: 1.3;
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink-strong);
  color: oklch(0.86 0.020 225);
  padding: clamp(56px, 8vw, 80px) var(--gutter) clamp(32px, 5vw, 48px);
  border-top: 1px solid var(--paper-rule-soft);
}

.footer-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer-brand {
  display: grid;
  gap: 6px;
}
.footer-mark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--bg);
  letter-spacing: -0.005em;
}
.footer-by {
  font-family: var(--font-hand);
  font-size: 20px;
  color: oklch(0.78 0.045 225);
}

.footer-meta {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: oklch(0.78 0.025 225);
}

.footer-credit a {
  color: oklch(0.92 0.030 225);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.footer-credit a:hover {
  color: var(--bg);
}

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .libro-art {
    flex-direction: row;
    gap: 32px;
  }
  .book-caption {
    text-align: left;
    max-width: 16ch;
  }
}

@media (min-width: 768px) {
  body { font-size: 18px; }

  .nav-desktop { display: flex; }
  .burger { display: none; }
  .nav-drawer { display: none; }

  .wordmark-line-1 { font-size: 12px; }
  .wordmark-line-2 { font-size: 19px; }

  .temi-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .contatti-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
  .contatto {
    border-bottom: none;
    padding-bottom: 0;
    border-left: 1px solid var(--paper-rule);
    padding-left: 24px;
  }
  .contatto:first-child {
    border-left: none;
    padding-left: 0;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
  .footer-meta {
    text-align: right;
  }

  .libro-inner {
    grid-template-columns: minmax(260px, 360px) 1fr;
  }
  .libro-art {
    order: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .book-caption {
    text-align: left;
    max-width: 22ch;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding-left: calc(var(--gutter) + 32px);
  }
  .hero-inner {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
  }
  .hero-figure img {
    aspect-ratio: 3 / 4;
  }
  .hero-margin {
    display: block;
    position: absolute;
    top: clamp(56px, 12vw, 120px);
    bottom: var(--section-pad);
    left: var(--gutter);
    width: 1px;
    background: var(--sky-ghost);
  }
  .hero-margin::before {
    content: "";
    position: absolute;
    top: 0;
    left: -3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sky);
  }

  .temi-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 64px;
    row-gap: 56px;
  }
  .tema:nth-child(2) {
    border-top: none;
    padding-top: 0;
  }
  .tema:nth-child(3) {
    grid-column: span 2;
    max-width: 56ch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
