/* Bartolomeo — dedicated historical register */
:root {
  --paper: #f4efe4;
  --ink: #1d2428;
  --ink-soft: #4a555c;
  --rule: rgba(29, 36, 40, 0.14);
  --accent: #6b4e3d;
  --accent-soft: #8a6a55;
  --deep: #12171a;
  --font-display: "Libre Baskerville", "Times New Roman", serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-ui: "Source Sans 3", "Segoe UI", sans-serif;
  --nav-h: 4.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wash-accent: rgba(107, 78, 61, 0.08);
  --wash-ink: rgba(29, 36, 40, 0.05);
  --wash-parchment: rgba(196, 170, 130, 0.1);
  --page-atmosphere:
    radial-gradient(900px 560px at 8% -6%, var(--wash-accent), transparent 60%),
    radial-gradient(820px 520px at 96% 4%, var(--wash-ink), transparent 58%),
    radial-gradient(1000px 700px at 50% 112%, var(--wash-parchment), transparent 60%),
    var(--paper);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--page-atmosphere);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--deep); color: var(--paper); padding: .6rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(244, 239, 228, 0.98);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none;
  font-family: var(--font-ui); font-size: 0.9rem; font-weight: 500;
  color: var(--ink);
}
.brand img {
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(29, 36, 40, 0.12);
}
.brand__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: nowrap;
  font-family: var(--font-ui);
}
.nav__intro,
.nav__lede { display: none; }
.nav__links,
.nav__cta { display: contents; }
.nav__link {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}
.nav__link--home { display: none; }
.nav__link:hover,
.nav__link[aria-current="page"] { color: var(--ink); }
.nav__link--aside {
  color: var(--ink-soft);
  font-weight: 500;
}
.nav__link--aside:hover,
.nav__link--aside[aria-current="page"] { color: var(--ink); }
.nav__brand { margin: 0; }

.mobile-call { display: none; }

.nav-toggle {
  display: none;
  position: relative;
  z-index: 60;
  border: 0;
  background: transparent;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}
.nav-toggle__bars {
  display: block;
  position: relative;
  width: 1.35rem;
  height: 0.85rem;
  margin-inline: auto;
}
.nav-toggle__bars span {
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease), top 0.35s var(--ease);
}
.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: calc(100% - 2px); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  top: calc(50% - 1px);
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
  top: calc(50% - 1px);
  transform: rotate(-45deg);
}
.nav-call__short { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.1rem; padding: 0.95rem 1.75rem; border-radius: 6px;
  text-decoration: none; border: 0; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; font-size: 1rem;
  background: var(--accent); color: #f8f2ea;
  white-space: nowrap;
}
.btn--nav-call {
  background: var(--accent);
  color: #f8f2ea;
  border: 1px solid var(--accent);
  border-radius: 6px;
  min-height: 2.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.btn:hover,
.btn--nav-call:hover { background: var(--accent-soft); border-color: var(--accent-soft); }

.hero {
  position: relative; min-height: 78svh; display: grid; align-items: end; color: #f4efe4; overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,23,26,.35), rgba(18,23,26,.78));
}
.hero__content {
  position: relative; z-index: 1;
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: calc(var(--nav-h) + 3rem) 0 3.5rem;
  animation: rise .8s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.hero__content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.12; margin: 0 0 .75rem; max-width: 16ch;
}
.hero__content p { margin: 0; max-width: 42ch; color: rgba(244,239,228,.86); font-size: 1.05rem; }

.toc {
  position: sticky; top: var(--nav-h);
  background: rgba(244,239,228,.96);
  border-bottom: 1px solid var(--rule);
  z-index: 20;
}
.toc__inner {
  width: min(980px, calc(100% - 2rem));
  margin-inline: auto;
  display: flex; gap: 1.25rem; overflow-x: auto;
  padding: .85rem 0; font-family: var(--font-ui); font-size: .88rem;
}
.toc a { text-decoration: none; color: var(--ink-soft); white-space: nowrap; }
.toc a:hover { color: var(--ink); }

.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section__inner { width: min(980px, calc(100% - 2rem)); margin-inline: auto; }
.section--deep { background: #ebe4d6; }
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0 0 1rem; line-height: 1.2;
}
.section p { margin: 0 0 1rem; color: var(--ink-soft); max-width: 68ch; }

.split {
  display: grid; grid-template-columns: 1fr 0.9fr; gap: 2rem; align-items: center;
}
.split img { width: 100%; object-fit: cover; min-height: 22rem; }
.img-invert { filter: invert(100%); }

.footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 5.5rem;
  font-family: var(--font-ui); font-size: .92rem; color: var(--ink-soft);
}
.footer__inner {
  width: min(980px, calc(100% - 2rem));
  margin-inline: auto;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.footer a { color: var(--ink); text-decoration: none; }

.cookie-notice {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 60;
  max-width: 40rem; margin-inline: auto;
  background: #fffdf8; border: 1px solid var(--rule);
  padding: 1rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  transform: translateY(120%); opacity: 0; transition: .4s var(--ease);
}
.cookie-notice.is-visible { transform: none; opacity: 1; }
.cookie-notice[hidden] { display: none !important; }
body:has(.nav.is-open) .cookie-notice,
body:has(.nav.is-open) .cookie-notice.is-visible {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(120%);
}
.cookie-notice p { margin: 0; font-family: var(--font-ui); font-size: .9rem; color: var(--ink-soft); }
.cookie-notice .btn { background: transparent; color: var(--ink); border: 1px solid var(--rule); }

.synthetic { font-family: var(--font-ui); font-size: .8rem; color: rgba(244,239,228,.7); margin-top: .75rem; }

@keyframes navRise {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

@media (max-width: 860px) {
  .site-header {
    background: transparent;
    border-bottom-color: transparent;
  }

  .brand {
    position: relative;
    z-index: 60;
  }

  .brand img {
    background: rgba(255, 253, 249, 0.72);
  }

  .nav-toggle {
    display: grid;
    place-items: center;
    position: fixed;
    top: calc((var(--nav-h) - 2.75rem) / 2);
    right: max(0.75rem, env(safe-area-inset-right));
    z-index: 70;
    background: rgba(255, 253, 249, 0.72);
    border-radius: 50%;
  }

  .mobile-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 50;
    min-height: 3rem;
    min-width: 6.5rem;
    padding: 0.7rem 1.25rem;
    border-radius: 6px;
    background: var(--accent);
    color: #f8f2ea;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 18px 48px rgba(29, 36, 40, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease), visibility 0.25s, bottom 0.25s var(--ease);
  }

  body.is-past-hero .mobile-call {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  body:has(.cookie-notice.is-visible) .mobile-call {
    bottom: calc(4.25rem + env(safe-area-inset-bottom));
  }

  body:has(.nav.is-open) .mobile-call {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .nav {
    position: fixed;
    inset: 0;
    z-index: 55;
    width: 100%;
    height: 100svh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: calc(var(--nav-h) + 1.5rem) 1.5rem max(1.25rem, env(safe-area-inset-bottom));
    background:
      radial-gradient(720px 420px at 12% 0%, rgba(107, 78, 61, 0.08), transparent 58%),
      radial-gradient(640px 380px at 100% 18%, rgba(29, 36, 40, 0.05), transparent 55%),
      var(--paper);
    border-bottom: 0;
    transform: translateY(-8%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: transform 0.45s var(--ease), opacity 0.4s var(--ease), visibility 0.4s;
  }
  .nav.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }
  .nav__intro { display: block; margin-bottom: 1.75rem; }
  .nav__brand {
    font-family: "Cormorant Garamond", "Times New Roman", serif;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -0.025em;
    color: var(--ink);
  }
  .nav__lede {
    display: block;
    margin: 0.55rem 0 0;
    max-width: 18ch;
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 3.2vw, 2.55rem);
    font-weight: 500;
    font-style: italic;
    line-height: 1.25;
    color: var(--ink-soft);
  }
  .nav__links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-height: 0;
  }
  .nav__cta {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    margin-top: auto;
    padding-top: 1rem;
    background: linear-gradient(180deg, transparent, var(--paper) 28%);
  }
  .nav__link {
    display: block;
    width: 100%;
    border: 0;
    white-space: normal;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
    padding: 0.4rem 0.1rem;
  }
  .nav__link--aside {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--rule);
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 1.4;
    color: var(--ink-soft);
  }
  .nav__link:hover,
  .nav__link[aria-current="page"] {
    color: var(--accent);
  }
  .nav__link--aside:hover,
  .nav__link--aside[aria-current="page"] {
    color: var(--ink);
  }
  .nav .btn--nav-call {
    width: 100%;
    justify-content: center;
    min-height: 3.25rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    padding: 0.95rem 1.5rem;
  }
  .nav-call__full { display: none; }
  .nav-call__short { display: inline; }
  .nav.is-open .nav__brand { animation: navRise 0.55s var(--ease) both; }
  .nav.is-open .nav__lede { animation: navRise 0.55s var(--ease) 0.06s both; }
  .nav.is-open .nav__link:nth-child(1) { animation: navRise 0.55s var(--ease) 0.12s both; }
  .nav.is-open .nav__link:nth-child(2) { animation: navRise 0.55s var(--ease) 0.18s both; }
  .nav.is-open .nav__link:nth-child(3) { animation: navRise 0.55s var(--ease) 0.24s both; }
  .nav.is-open .nav__link:nth-child(4) { animation: navRise 0.55s var(--ease) 0.3s both; }
  .nav.is-open .nav__link:nth-child(5) { animation: navRise 0.55s var(--ease) 0.36s both; }
  .nav.is-open .nav__cta { animation: navRise 0.55s var(--ease) 0.42s both; }
  .brand__name { display: none; }
  .split { grid-template-columns: 1fr; }
  .split img { min-height: 16rem; }

  .cookie-notice {
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
  }
  .cookie-notice p { font-size: 0.78rem; line-height: 1.35; }
}

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