/* Pieghe di luce — Petrolio e rame. */
:root {
  --fold-ink:#083f49; --fold-mid:#a55e44; --fold-light:#ffdfb6; --fold-action:#ffaf76;
  --fold-paper:#faf5eb; --fold-dark:#823d26;
  --bg:var(--fold-paper); --bg-soft:color-mix(in srgb,var(--fold-light) 29%,white);
  --surface-soft:color-mix(in srgb,var(--fold-paper) 75%,white);
  --navy:var(--fold-ink); --accent:var(--fold-dark); --accent-dark:var(--fold-dark);
  --accent-soft:color-mix(in srgb,var(--fold-action) 25%,white);
  --border:color-mix(in srgb,var(--fold-ink) 17%,var(--fold-paper));
}
.site-header,.app-header,.footer {background:var(--fold-paper)}
.brand.serif,.footer .brand.serif {
  display:inline-flex;align-items:center;gap:.3em;color:#081636;
  font-family:"Playfair Display",Georgia,serif;font-weight:800;letter-spacing:-.035em;
}
.footer .brand.serif {font-size:24px}
.brand img {object-fit:contain;flex-shrink:0}
.btn.primary {background:var(--fold-ink);color:white;box-shadow:none}
.btn.primary:hover {background:var(--fold-dark)}
.btn:focus-visible,a:focus-visible,button:focus-visible {outline:3px solid var(--fold-dark);outline-offset:3px}
.nav-links a:hover,.footer a:hover {text-decoration:underline;text-underline-offset:.25em}
.simple-page > h1,.projects-heading h1,.stats-hero h1,.section-heading h2 {color:var(--fold-ink);letter-spacing:-.035em;text-wrap:balance}
.simple-page {position:relative;isolation:isolate}
.simple-page::before {content:"";position:absolute;z-index:-1;top:0;right:0;width:min(27%,330px);height:104px;background:var(--fold-ink) url("/assets/fold-light.jpg") right 52% / 180% auto;background-blend-mode:luminosity;clip-path:polygon(36% 0,100% 0,100% 100%,0 34%);pointer-events:none}
.simple-page > h1 {max-width:76%;font-size:clamp(38px,5.3vw,76px);line-height:1.07}
.content-card,.price-card,.faq-item,.feature-grid,.auth-card,.app-panel,.project-card {border-radius:4px}
.content-card,.price-card,.faq-item,.feature-grid,.auth-card {box-shadow:none}
.app-panel-header,.stats-table-card h2 {color:var(--fold-ink)}
.app-panel-header {background:var(--bg-soft);border-top:2px solid var(--fold-ink)}
.dropzone {border-color:var(--fold-mid)}
.book-details,.chapter-item,.ai-settings,.image-item,.ai-review-shell,.ai-history-shell,.cover-prompt-shell,.viewer-bar,.login-required-card {background:var(--surface-soft)}
.cover-prompt-body,#chapterBody {background:var(--fold-paper)}
input[type=checkbox],input[type=radio] {accent-color:var(--fold-dark)}
.chapter-item.active {background:var(--accent-soft);border-color:var(--accent)}
.projects-heading,.stats-hero {border-bottom:1px solid var(--border);padding-bottom:20px}
.auth-card {border-top:4px solid var(--fold-ink)}
.footer {border-top:2px solid var(--fold-ink)}
@media(max-width:720px){.simple-page::before{width:76px;height:47px}.simple-page>h1{max-width:100%}}

@media(min-width:900px){
  .simple-page::before {
    top:25px;width:31%;height:clamp(158px,15vw,218px);
    background-size:150% auto;background-position:85% 54%;
    clip-path:polygon(20% 0,100% 0,100% 100%,0 82%);
  }
  .simple-page > h1,.simple-page > .hero-copy {max-width:64%}
  .simple-page > .content-grid,.simple-page > .timeline,.simple-page > .faq-list,
  .simple-page > .pricing-grid {margin-top:clamp(34px,4vw,64px)}
  .auth-page {grid-template-columns:1fr minmax(440px,520px);column-gap:5vw}
  .auth-page::before {
    content:"";width:100%;height:min(68vh,650px);background:var(--fold-ink) url("/assets/fold-light.jpg") 76% center/cover;
    background-blend-mode:luminosity;clip-path:polygon(0 0,100% 4%,90% 100%,0 95%);
  }
}

/* The arriving sheet is the editor's original editable chapter field. */
html[data-fold-entry] [data-panel="chapters"] .app-panel-body {display:flex;flex-direction:column;gap:12px}
html[data-fold-entry] .chapter-editor {order:-1;margin:0}
html[data-fold-entry] #chapterBody {
  background:var(--fold-paper);color:var(--text);border:1px solid var(--border);
  border-radius:2px;min-height:clamp(240px,43svh,500px);padding:clamp(18px,3vw,44px);
  font:18px/1.65 var(--font-display);
}
@media(prefers-reduced-motion:no-preference){
  @view-transition {navigation:auto}
  html[data-fold-entry] .fold-dock .page-preview,html[data-fold-entry] #chapterBody {view-transition-name:fold-manuscript}
  ::view-transition-group(fold-manuscript) {animation-duration:420ms;animation-timing-function:cubic-bezier(.22,.7,.2,1)}
}
