/* La Suite — presentation stylesheet
   Editorial monograph: paper, ink, one serif, one sans, fine rules. */

:root {
    --paper: #f3f0ea;
    --paper-2: #ebe7df;
    --ink: #1c1b19;
    --ink-2: #55524c;
    --ink-3: #8d8980;
    --rule: rgba(28, 27, 25, 0.14);
    --accent: #9a6b3f;          /* burnt ochre, used sparingly */
    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans: 'Inter', system-ui, sans-serif;
    --folio-w: 440px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%; height: 100%; overflow: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

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

.layout { display: flex; width: 100%; height: 100%; }

/* ---------- Folio (narrative column) ---------- */
.folio {
    width: var(--folio-w);
    flex: 0 0 var(--folio-w);
    height: 100%;
    display: flex; flex-direction: column;
    padding: 40px 44px 28px;
    border-right: 1px solid var(--rule);
    background: var(--paper);
    position: relative; z-index: 3;
}

.folio-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.mark { font-size: 11px; letter-spacing: 0.32em; font-weight: 600; }
.folio-meta { font-size: 11px; color: var(--ink-3); letter-spacing: 0.02em; }

.chapter { flex: 1; overflow-y: auto; padding: 44px 0 24px; scrollbar-width: thin; }
.chapter.swap { animation: swap 0.6s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ch-num { font-family: var(--serif); font-size: 64px; line-height: 1; font-weight: 400; color: var(--ink-3); }
.ch-kicker { margin-top: 18px; font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); font-weight: 500; }
.ch-title { margin-top: 10px; font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.04; letter-spacing: -0.005em; }
.ch-body { margin-top: 22px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); font-weight: 400; }
.ch-body p + p { margin-top: 12px; }
.ch-body strong { color: var(--ink); font-weight: 500; }
.ch-body .lead { font-family: var(--serif); font-size: 21px; line-height: 1.35; color: var(--ink); }

/* data rows */
.facts { margin-top: 22px; border-top: 1px solid var(--rule); }
.facts .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.facts .row span:first-child { color: var(--ink-3); }
.facts .row span:last-child { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.src { margin-top: 10px; font-size: 10.5px; color: var(--ink-3); line-height: 1.5; }
.tag { display: inline-block; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; padding: 2px 6px; border: 1px solid var(--rule); color: var(--ink-3); margin-left: 6px; vertical-align: 1px; }
.tag.warn { color: var(--accent); border-color: rgba(154, 107, 63, 0.4); }

/* big figure */
.figure { margin-top: 24px; display: flex; gap: 28px; }
.figure .n { font-family: var(--serif); font-size: 46px; line-height: 1; }
.figure .l { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }

/* lists */
.list { margin-top: 18px; list-style: none; }
.list li { padding: 9px 0 9px 22px; border-bottom: 1px solid var(--rule); position: relative; font-size: 13px; }
.list li::before { content: ''; position: absolute; left: 2px; top: 17px; width: 10px; height: 1px; background: var(--ink); }
.list.check li::before { content: '○'; background: none; width: auto; height: auto; top: 8px; font-size: 11px; color: var(--accent); }

/* swatches */
.swatches { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 12px; }
.sw { font-size: 10.5px; line-height: 1.35; color: var(--ink-2); }
.sw i { display: block; height: 54px; margin-bottom: 7px; border: 1px solid rgba(0,0,0,0.06); background-size: cover; }

/* photos */
.thumbs { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: zoom-in; filter: saturate(0.9); transition: filter 0.3s; }
.thumbs img:hover { filter: none; }
.thumbs + .src { margin-top: 6px; }

/* comparison table */
.compare { margin-top: 20px; width: 100%; border-collapse: collapse; font-size: 12px; }
.compare th, .compare td { text-align: left; padding: 8px 6px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare th { font-weight: 500; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.compare td:first-child { color: var(--ink-3); width: 30%; }
.compare .big { font-family: var(--serif); font-size: 22px; color: var(--ink); }

/* nav */
.folio-nav { display: flex; align-items: center; gap: 10px; padding-top: 18px; border-top: 1px solid var(--rule); }
.nav-arrow { width: 34px; height: 34px; border: 1px solid var(--rule); font-size: 14px; transition: background 0.2s; }
.nav-arrow:hover { background: var(--ink); color: var(--paper); }
.toc { flex: 1; display: flex; justify-content: space-between; list-style: none; }
.toc li button { font-size: 10.5px; color: var(--ink-3); padding: 6px 2px; font-variant-numeric: tabular-nums; position: relative; }
.toc li button.on { color: var(--ink); }
.toc li button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); }

/* ---------- Stage ---------- */
.stage { flex: 1; position: relative; overflow: hidden; background: #e9e6e0; }
#canvas-container { position: absolute; inset: 0; }
#canvas-container canvas { display: block; }

.fade { position: absolute; inset: 0; background: #e9e6e0; opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease); z-index: 2; }
.fade.on { opacity: 1; }

.stage-controls { position: absolute; top: 28px; right: 28px; display: flex; gap: 10px; z-index: 4; }
.seg { display: flex; background: rgba(243, 240, 234, 0.92); border: 1px solid var(--rule); backdrop-filter: blur(8px); }
.seg button { padding: 9px 14px; font-size: 11.5px; letter-spacing: 0.02em; color: var(--ink-2); transition: background 0.2s, color 0.2s; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg.disabled { opacity: 0.35; pointer-events: none; }

.caption { position: absolute; left: 32px; bottom: 28px; z-index: 4; font-family: var(--serif); font-size: 19px; font-style: italic; color: var(--ink); max-width: 60%; text-shadow: 0 0 18px rgba(243,240,234,0.8); transition: opacity 0.4s; }
.caption small { display: block; font-family: var(--sans); font-style: normal; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
body.night .caption { color: #f1ece2; text-shadow: none; }
body.night .caption small { color: rgba(241,236,226,0.6); }

.hint { position: absolute; right: 30px; bottom: 30px; font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; z-index: 4; }
body.night .hint { color: rgba(241,236,226,0.5); }

/* ---------- Plan sheet ---------- */
.plan-sheet { position: absolute; inset: 0; background: #fbfaf7; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 90px 40px 40px; transition: opacity 0.4s; }
.plan-sheet.hidden { opacity: 0; pointer-events: none; }
.plan-sheet svg { width: 100%; height: 100%; }
.plan-sheet text { font-family: var(--sans); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(20, 19, 17, 0.92); z-index: 20; display: flex; align-items: center; justify-content: center; cursor: zoom-out; transition: opacity 0.3s; }
.lightbox.hidden { opacity: 0; pointer-events: none; }
.lightbox img { max-width: 88vw; max-height: 88vh; }

.hidden { }
