:root {
  --paper: #f3ecdf;
  --paper-deep: #e7decd;
  --card: #fbf7f0;
  --ink: #241c16;
  --muted: #4e453c;
  --line: rgba(36, 28, 22, 0.16);
  --line-strong: rgba(36, 28, 22, 0.4);
  --terra: #b8431f;
  --terra-deep: #8e3414;
  --olive: #314536;
  --shadow: 0 18px 40px rgba(55, 34, 18, 0.06);
  --wash-a: rgba(184, 67, 31, 0.08);
  --wash-b: rgba(49, 69, 54, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --text: "Source Serif 4", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --measure: 42rem;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 55% at 0% -12%, var(--wash-a), transparent 56%),
    radial-gradient(ellipse 70% 48% at 100% 0%, var(--wash-b), transparent 52%),
    var(--paper);
  font-family: var(--text);
  font-size: 1.05rem;
  line-height: 1.55;
}

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

button, input { font: inherit; color: inherit; }

a { color: inherit; }

.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;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: .5rem .8rem;
  z-index: 40;
}

.skip:focus { top: .6rem; }

.frame {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--terra-deep);
  color: #faf6ee;
  flex: none;
}

.search { margin-left: auto; flex: 1; max-width: 24rem; }

.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border-radius: 999px;
  padding: .62rem 1rem;
  font-family: var(--sans);
  font-size: .95rem;
  outline: none;
}

.search input:focus {
  border-color: var(--terra-deep);
  box-shadow: 0 0 0 3px rgba(142, 52, 20, 0.15);
}

.masthead {
  padding: 1.6rem 0 1.35rem;
  margin-top: 1.2rem;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  position: relative;
}

.masthead::before,
.masthead::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink);
}

.masthead::before { top: 4px; }
.masthead::after { bottom: 4px; }

.eyebrow {
  margin: 0;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--terra-deep);
}

.masthead h1 {
  margin: .35rem 0 .2rem;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(3rem, 8vw, 5.7rem);
  line-height: .92;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  text-wrap: balance;
}

.motto {
  margin: .85rem 0 .35rem;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 520;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  color: var(--terra-deep);
}

.dek {
  max-width: 40rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.4rem;
  list-style: none;
  padding: 1rem 0 0;
  margin: .9rem 0 0;
  border-top: 1px solid var(--line);
}

.stats li { display: flex; align-items: baseline; gap: .45rem; }

.stats strong {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 560;
}

.stats span {
  font-family: var(--sans);
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2rem;
  align-items: stretch;
  padding: 2rem 0 1rem;
}

.hero h2 {
  margin: .4rem 0 .7rem;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.3rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero h2 a { text-decoration: none; }
.hero h2 a:hover { color: var(--terra-deep); }

.lede {
  margin: 0;
  font-size: 1.18rem;
  color: var(--muted);
  max-width: 38rem;
}

.meta {
  margin: .85rem 0 0;
  font-family: var(--sans);
  font-size: .86rem;
  color: var(--muted);
}

.more {
  display: inline-block;
  margin-top: 1.15rem;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  border-bottom: 1px solid var(--terra);
  padding-bottom: .12rem;
}

.more:hover { color: var(--terra-deep); }

.hero-media {
  display: block;
  position: relative;
  min-height: 18rem;
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper-deep);
  text-decoration: none;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 5;
}

.hero-index {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 1.15rem 1.2rem 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 250, 243, .65), rgba(243, 236, 223, .2));
}

.hero-index ol {
  list-style: none;
  margin: .8rem 0 0;
  padding: 0;
}

.hero-index li + li { border-top: 1px solid var(--line); }

.hero-index a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .8rem;
  align-items: baseline;
  text-decoration: none;
  padding: .75rem .1rem;
}

.hero-index a:hover .index-title { color: var(--terra-deep); }

.index-num {
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .12em;
  color: var(--terra-deep);
}

.index-title {
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.themes {
  display: flex;
  gap: .35rem 1rem;
  flex-wrap: wrap;
  align-items: baseline;
  padding: .35rem 0 1rem;
  margin-top: .4rem;
  border-bottom: 1px solid var(--line);
}

.themes a {
  font-family: var(--sans);
  font-size: .95rem;
  text-decoration: none;
  color: var(--muted);
  padding: .25rem 0;
  border-bottom: 1px solid transparent;
}

.themes a[aria-current="page"],
.themes a:hover {
  color: var(--ink);
  border-bottom-color: var(--terra);
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding-top: 1.3rem;
}

.results-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.results-head p {
  margin: 0;
  font-family: var(--sans);
  color: var(--muted);
}

.cards {
  list-style: none;
  padding: 1rem 0 3rem;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem 1.2rem;
}

.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}

.card-media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 16px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.card a:hover img { transform: scale(1.04); }

.card-media-type {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 1.05rem;
}

.card-media-type .initial {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 4.4rem;
  line-height: .8;
  letter-spacing: -0.04em;
}

.card-media-type .type-label {
  font-family: var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 600;
}

.tone-cucina { background: #f4d8c8; color: #7a2c12; }
.tone-alimentazione { background: #f3e3c2; color: #6d4a12; }
.tone-casa { background: #e1eadf; color: #24362a; }
.tone-capelli { background: #f6d9df; color: #6e2438; }
.tone-cosmetici { background: #f7e0ea; color: #6a3050; }
.tone-benessere { background: #dceadf; color: #1f4634; }
.tone-viaggi { background: #d9e4ee; color: #1d3a55; }
.tone-piante { background: #e5edd4; color: #314218; }
.tone-appunti { background: #ece4d8; color: #3d342c; }

.num, .play {
  position: absolute;
  z-index: 1;
}

.num {
  left: .7rem;
  bottom: .65rem;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: rgba(251, 247, 240, 0.92);
  color: var(--ink);
  padding: .22rem .45rem;
  border-radius: 999px;
}

.play {
  right: .7rem;
  top: .7rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(36, 28, 22, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 243, 0.3);
}

.play::before {
  content: "";
  position: absolute;
  left: .95rem;
  top: .72rem;
  border-style: solid;
  border-width: .48rem 0 .48rem .78rem;
  border-color: transparent transparent transparent #faf6ee;
}

.card-body { padding: .85rem .15rem .2rem; }

.card h3 {
  margin: .25rem 0 .4rem;
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.55rem;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.card a:hover h3 { color: var(--terra-deep); }

.excerpt {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sheet {
  width: min(44rem, 100%);
  margin: 1.6rem auto 3.5rem;
}

html[data-scene] body {
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(247, 241, 230, 0.12) 0%, rgba(247, 241, 230, 0.28) 18%, rgba(247, 241, 230, 0.86) 52%, rgba(247, 241, 230, 0.94) 100%),
    var(--scene);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.scene-hero {
  width: 100vw;
  height: clamp(16rem, 54vh, 36rem);
  margin: 0 0 1.25rem;
  margin-left: calc(50% - 50vw);
  background: var(--scene) center 42% / cover no-repeat;
}

.reading {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.35rem 1.3rem 1.7rem;
  box-shadow: var(--shadow);
}

html[data-topic="cucina"] {
  --paper: #f6dccb;
  --paper-deep: #efd0bc;
  --card: #fff8f3;
  --wash-a: rgba(184, 67, 31, 0.28);
  --wash-b: rgba(196, 120, 54, 0.22);
}

html[data-topic="alimentazione"] {
  --paper: #f6e7c4;
  --paper-deep: #edd7a4;
  --card: #fffaf0;
  --wash-a: rgba(184, 132, 32, 0.26);
  --wash-b: rgba(214, 168, 72, 0.2);
}

html[data-topic="casa"] {
  --paper: #e4eee3;
  --paper-deep: #d2e2d0;
  --card: #f7fbf6;
  --wash-a: rgba(61, 107, 72, 0.2);
  --wash-b: rgba(168, 148, 92, 0.16);
}

html[data-topic="capelli"] {
  --paper: #f8e0e4;
  --paper-deep: #f0cdd4;
  --card: #fff7f8;
  --wash-a: rgba(168, 64, 92, 0.2);
  --wash-b: rgba(214, 150, 140, 0.2);
}

html[data-topic="cosmetici"] {
  --paper: #f8e4ee;
  --paper-deep: #f0d0e0;
  --card: #fff7fb;
  --wash-a: rgba(176, 72, 120, 0.18);
  --wash-b: rgba(214, 160, 176, 0.2);
}

html[data-topic="benessere"] {
  --paper: #e3f0e4;
  --paper-deep: #cfe3d4;
  --card: #f6fbf6;
  --wash-a: rgba(46, 120, 84, 0.2);
  --wash-b: rgba(120, 164, 112, 0.16);
}

html[data-topic="viaggi"] {
  --paper: #e2eef6;
  --paper-deep: #cfe0ee;
  --card: #f6fbfe;
  --wash-a: rgba(46, 96, 150, 0.2);
  --wash-b: rgba(120, 156, 176, 0.18);
}

html[data-topic="piante"] {
  --paper: #e7f0d6;
  --paper-deep: #d5e4bc;
  --card: #f8fbf3;
  --wash-a: rgba(78, 120, 42, 0.2);
  --wash-b: rgba(164, 176, 72, 0.16);
}

html[data-topic="appunti"] {
  --paper: #efe4d2;
  --paper-deep: #e4d5bc;
  --card: #fbf6ee;
  --wash-a: rgba(120, 84, 42, 0.14);
  --wash-b: rgba(90, 70, 48, 0.1);
}

.back {
  display: inline-block;
  margin-bottom: 1.4rem;
  font-family: var(--sans);
  text-decoration: none;
  color: var(--muted);
}

.back:hover { color: var(--ink); }

.sheet header h1 {
  margin: .35rem 0 .7rem;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.sheet .lede {
  font-style: italic;
  font-size: 1.22rem;
  color: var(--ink);
}

.prose {
  margin-top: 1.6rem;
  font-size: 1.16rem;
  line-height: 1.68;
}

.prose p { margin: 0 0 1.05em; text-wrap: pretty; }

.prose.with-drop > p:first-of-type::first-letter {
  font-family: var(--serif);
  float: left;
  font-size: 3.35em;
  line-height: .78;
  padding: .08em .08em 0 0;
  color: var(--terra-deep);
  font-weight: 560;
}

.prose a {
  color: var(--terra-deep);
  text-underline-offset: .16em;
}

.prose a:hover { color: var(--terra); }

.prose strong, .prose b { font-weight: 600; }

.prose mark {
  background: linear-gradient(transparent 64%, rgba(184, 67, 31, 0.28) 64%);
  color: inherit;
}

.prose figure { margin: 1.45rem 0 1.7rem; }

.prose img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  cursor: zoom-in;
  background: var(--paper-deep);
}

.prose figcaption {
  margin-top: .55rem;
  text-align: center;
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--muted);
}

.prose .embed-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #1a140f;
}

.prose .embed-frame.portrait {
  aspect-ratio: 9 / 16;
  width: min(100%, 380px);
  margin-inline: auto;
}

.prose .embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.prose video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #16120f;
}

.prose video.portrait {
  width: min(100%, 380px);
  margin-inline: auto;
}

.prose figure:has(> video.portrait) figcaption { text-align: center; }

.prose p:has(> a.source-link:only-child) { margin: 1.15rem 0 1.3rem; }

.prose a.source-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 500;
}

.prose a.source-link::after { content: "→"; color: var(--terra-deep); }

.prose a.source-link:hover { border-color: var(--terra-deep); }

.colophon-note {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .98rem;
}

.colophon-note a { color: var(--terra-deep); }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.6rem;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  text-decoration: none;
  padding: .85rem .1rem;
  border-top: 1px solid var(--line-strong);
  min-height: 5rem;
}

.pager a.older { text-align: right; align-items: flex-end; }
.pager a:hover strong { color: var(--terra-deep); }

.pager strong {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.empty, .status {
  padding: 3rem 0 4rem;
  font-size: 1.2rem;
}

.status button, .empty button {
  margin-top: .8rem;
  font-family: var(--sans);
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: .55rem 1rem;
  cursor: pointer;
}

.site-foot {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.2rem;
  color: var(--muted);
}

.foot-grid {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 1.5rem;
}

.foot-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
}

.foot-motto {
  margin: .2rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--terra-deep);
}

#colophon p { margin: 0 0 .7rem; font-size: .95rem; }
#colophon a { color: var(--terra-deep); }

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(1100px, calc(100vw - 2rem));
  width: auto;
}

dialog::backdrop { background: rgba(28, 20, 16, 0.82); }

dialog figure { margin: 0; }

dialog img {
  display: block;
  max-height: calc(100vh - 6rem);
  width: auto;
  max-width: min(1100px, calc(100vw - 2rem));
  border-radius: 12px;
  margin: 0 auto;
}

dialog figcaption {
  color: #f6efe4;
  text-align: center;
  font-family: var(--sans);
  margin-top: .6rem;
  min-height: 1.2rem;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  font-family: var(--sans);
  background: #faf6ee;
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  padding: .45rem .8rem;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--terra-deep);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  html[data-scene] body { background-attachment: scroll; }
  .hero, .cards, .foot-grid, .pager { grid-template-columns: 1fr; }
  .hero-media img { aspect-ratio: 3 / 2; }
  .pager a.older { text-align: left; align-items: flex-start; }
  .top-bar { flex-wrap: wrap; padding: .7rem 0; }
  .search { max-width: none; margin-left: 0; flex-basis: 100%; }
}

@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .brand span:last-child { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-media img { transition: none; }
  .card a:hover img { transform: none; }
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.gate h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 520;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.gate-card {
  width: min(22rem, 100%);
  display: grid;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.6rem 1.4rem 1.4rem;
  box-shadow: var(--shadow);
}

.gate-card label,
.gate-error {
  font-family: var(--sans);
  font-size: 0.92rem;
}

.gate-error {
  margin: 0;
  color: var(--terra-deep);
}

.gate-card input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
}

.gate-card button {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  cursor: pointer;
}

@media print {
  .top, .site-foot, .themes, .pager, .back, .search, .lightbox-close { display: none !important; }
  html[data-topic],
  html[data-scene],
  body { background: white !important; background-image: none !important; }
  .scene-hero { display: none !important; }
  .reading {
    background: white;
    border: 0;
    box-shadow: none;
  }
  .sheet, .frame { width: auto; }
  .prose img, .prose video { break-inside: avoid; }
}
