/* Self Publishing Legacy — stylesheet
   Palette: carta calda + inchiostro + oro/bronzo. Display serif (Fraunces) + sans (Inter). */

:root {
  --paper: #FAF7F1;
  --paper-2: #F2ECE1;
  --ink: #15120D;
  --ink-soft: #4A443B;
  --muted: #7C7468;
  --gold: #B0822E;
  --gold-soft: #C99A45;
  --gold-deep: #8C6420;
  --espresso: #1A1611;
  --espresso-2: #221D16;
  --cream: #F0E7D8;
  --line: rgba(21, 18, 13, 0.12);
  --line-light: rgba(240, 231, 216, 0.16);
  --shadow: 0 18px 50px -24px rgba(21, 18, 13, 0.45);
  --radius: 18px;
  --maxw: 1120px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}

p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-2px); background: #2a241c; box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); box-shadow: none; }
.btn-light { background: var(--gold-soft); color: var(--espresso); border-color: var(--gold-soft); }
.btn-light:hover { background: #d8ab59; }
.btn-small { padding: 10px 18px; font-size: 0.9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 241, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px -22px rgba(21, 18, 13, 0.5);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-size: 1.14rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-mark { flex: none; }
.brand-text em { font-style: italic; color: var(--gold-deep); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}
.site-nav > a {
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.16s ease;
}
.site-nav > a:hover { color: var(--ink); }
.site-nav .nav-cta { color: var(--paper); }
.site-nav .nav-cta:hover { color: var(--paper); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 12vw, 150px) 0 clamp(64px, 10vw, 128px);
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(201, 154, 69, 0.16), transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
}
.hero-bg {
  position: absolute;
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  width: min(620px, 70%);
  opacity: 0.7;
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 760px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-deep);
  margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(2.35rem, 6vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 16ch;
}
.hero-sub {
  margin-top: 26px;
  font-size: clamp(1.08rem, 2.2vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 56ch;
}
.hero-cta {
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head { max-width: 640px; margin-bottom: clamp(40px, 5vw, 64px); }
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gold-deep);
  margin-bottom: 16px;
}
.kicker-light { color: var(--gold-soft); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
.section-lead {
  margin-top: 18px;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(176, 130, 46, 0.4); }
.card-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(176, 130, 46, 0.12);
  color: var(--gold-deep);
  margin-bottom: 22px;
}
.card h3 { font-size: 1.34rem; margin-bottom: 12px; }
.card p { color: var(--ink-soft); font-size: 1rem; }

/* Dark section */
.section-dark { background: var(--espresso); color: var(--cream); }
.section-dark h2, .section-dark h3 { color: var(--paper); }
.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 36px;
}
.principle { border-top: 1px solid var(--line-light); padding-top: 24px; }
.principle-num {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--gold-soft);
  letter-spacing: 0.05em;
}
.principle h3 { font-size: 1.45rem; margin: 14px 0 12px; }
.principle p { color: rgba(240, 231, 216, 0.74); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  align-items: start;
}
.about-text h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 22px; }
.about-text p { color: var(--ink-soft); font-size: 1.08rem; margin-bottom: 18px; max-width: 54ch; }
.about-aside {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 28px;
}
.facts { list-style: none; margin: 0; padding: 0; }
.facts li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.facts li:last-child { border-bottom: none; }
.fact-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.fact-value { font-family: var(--serif); font-size: 1.18rem; color: var(--ink); }

/* Contact */
.section-contact {
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(176, 130, 46, 0.22), transparent 60%),
    var(--espresso-2);
  color: var(--cream);
  text-align: center;
}
.contact-inner { max-width: 640px; margin: 0 auto; }
.section-contact h2 { color: var(--paper); font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 18px; }
.contact-lead { color: rgba(240, 231, 216, 0.78); font-size: 1.12rem; margin-bottom: 34px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(240, 231, 216, 0.7); padding: 64px 0 32px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line-light);
}
.brand-footer { color: var(--paper); font-size: 1.1rem; }
.footer-tagline { margin-top: 16px; font-size: 0.96rem; max-width: 32ch; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h4 {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--gold-soft);
  margin-bottom: 4px;
}
.footer-col a, .footer-static { font-size: 0.96rem; color: rgba(240, 231, 216, 0.72); transition: color 0.16s ease; }
.footer-col a:hover { color: var(--paper); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 28px;
  font-size: 0.86rem;
  color: rgba(240, 231, 216, 0.55);
}

/* ---------- Legal pages ---------- */
.site-nav-simple a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.16s ease;
}
.site-nav-simple a:hover { color: var(--ink); }

.legal {
  padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 8vw, 96px);
  background:
    radial-gradient(120% 70% at 90% -10%, rgba(201, 154, 69, 0.1), transparent 55%),
    var(--paper);
}
.legal-inner { max-width: 760px; }
.legal-inner h1 { font-size: clamp(2.2rem, 5vw, 3.1rem); margin: 10px 0 6px; }
.legal-updated { color: var(--muted); font-size: 0.92rem; margin-bottom: 34px; }
.legal-inner h2 { font-size: 1.4rem; margin: 38px 0 12px; }
.legal-inner p { color: var(--ink-soft); font-size: 1.04rem; margin-bottom: 14px; }
.legal-inner a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 2px; }
.legal-inner a:hover { color: var(--ink); }

/* ---------- Reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 24px 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .site-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .site-nav > a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { margin-top: 10px; border-bottom: none; text-align: center; }

  .cards { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; gap: 28px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 520px) {
  .container { padding: 0 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-bg { opacity: 0.35; }
  .btn { width: 100%; }
  .hero-cta { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover { transform: none; }
}
