/* La Vie de Nathalie: one stylesheet for the whole site.
   Colours and fonts are set once here, at the top. */
:root {
  --paper: #f6f1e7;      /* page background, like unprimed canvas */
  --ink: #2b2620;
  --muted: #7a7064;
  --line: #e0d6c4;
  --accent: #a3472b;     /* terracotta: pins, links on hover */
  --serif: "EB Garamond", Georgia, serif;
  --script: "Parisienne", cursive;   /* her name and the title, until her own handwriting */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font: 400 1.15rem/1.65 var(--serif); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.meta { font-style: italic; color: var(--muted); font-size: 1rem; }

/* header and footer */
.site-head { position: sticky; top: 0; z-index: 40; display: flex; justify-content: space-between; align-items: baseline; padding: 10px 18px; background: rgba(246,241,231,.94); }
.site-head .name { font: 400 1.6rem var(--script); text-decoration: none; }
.site-head nav { display: flex; gap: 16px; font-style: italic; }
.site-head nav a { text-decoration: none; }
.site-head nav a:hover { color: var(--accent); }
.home .site-head { position: fixed; left: 0; right: 0; background: linear-gradient(rgba(20,15,10,.45), transparent); color: #f6efe3; }
.home.past-film .site-head { background: linear-gradient(rgba(20,15,10,.5), transparent); }
.site-foot { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; padding: 28px 18px 40px; }
.site-foot > span { font: 400 1.5rem var(--script); }
.site-foot nav { display: flex; gap: 16px; font-style: italic; }
.site-foot a { text-decoration: none; }

/* ---------- home: the film ---------- */
.opening { height: 420svh; position: relative; }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; background: #1c1712; }
.film, .film-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.title-card { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fbf3e4; opacity: 0; pointer-events: none; padding: 0 20px; background: radial-gradient(ellipse at center, rgba(20,14,8,.35), transparent 70%); }
.cover-title { font: 400 clamp(3.2rem, 11vw, 6.8rem)/1.05 var(--script); text-shadow: 0 2px 24px rgba(0,0,0,.5); }
.skip { position: absolute; bottom: 20px; right: 20px; font-style: italic; color: #f3ead9; text-decoration: none; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.scroll-cue { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font-style: italic; color: #f3ead9; text-shadow: 0 1px 8px rgba(0,0,0,.6); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: opacity .4s; }
.scroll-cue::after { content: ""; width: 1px; height: 30px; background: currentColor; animation: cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0%, 100% { transform: scaleY(.3); opacity: .5; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- home: the painted map, hung like a canvas on a warm gallery wall ---------- */
.mapview { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 45%, #4a3f33 0%, #2e2720 60%, #211c17 100%); clip-path: circle(0% at 36% 62%); pointer-events: none; will-change: clip-path, transform; }
.live .mapview { pointer-events: auto; }
.canvas { position: absolute; inset: 64px 48px 40px; display: grid; place-items: center; }
.art { position: relative; width: min(100%, (100svh - 104px) * 1774 / 887); aspect-ratio: 1774 / 887; transform-origin: 0 0; transition: transform .9s cubic-bezier(.2,.7,.2,1);
  /* the canvas: a hint of its stretched edge, and the shadow it throws on the wall */
  box-shadow: 0 0 0 1px rgba(255,240,215,.18), 0 2px 4px rgba(0,0,0,.35), 0 28px 60px rgba(0,0,0,.55); }
.zoomed .art { cursor: zoom-out; }
.painting { width: 100%; height: 100%; display: block; }
.art picture { display: contents; } /* the phone/desktop image switch shouldn't affect layout */
/* phones and narrow windows: the painting fills the height and you swipe across it */
@media (max-width: 899px) {
  .canvas { inset: 0; display: block; place-items: normal; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .canvas::-webkit-scrollbar { display: none; }
  .art { width: auto; height: 100%; box-shadow: none; }
  .art .painting { width: auto; max-width: none; }
}

.swipe-hint { display: none; }
@media (max-width: 899px) {
  .swipe-hint { display: block; position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); margin: 0; padding: 6px 14px; border-radius: 99px; background: rgba(30,22,15,.55); color: #fff8ec; font-style: italic; font-size: .95rem; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .6s; }
  .live .swipe-hint { opacity: 1; animation: nudge 2.4s ease-in-out 3; }
  .live .swipe-hint.gone, .zoomed .swipe-hint { opacity: 0; }
  @keyframes nudge { 0%, 100% { transform: translateX(-50%); } 50% { transform: translateX(calc(-50% + 8px)); } }
}

/* places on the painting: a glowing dot and her script, painted straight onto the canvas */
.pin { position: absolute; transform: translate(-50%, -14px); background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; color: #fff8ec; opacity: 0; transition: opacity .5s ease; }
.live .pin { opacity: 1; }
.live.zoomed .pin { opacity: 0; pointer-events: none; }
.pin i { width: 12px; height: 12px; border-radius: 50%; background: #fff8ec; box-shadow: 0 0 0 3px rgba(163,71,43,.85), 0 0 14px 4px rgba(255,240,210,.7); animation: glow 2.8s ease-in-out infinite; }
.pin span { font: 400 clamp(1.5rem, 2.4vw, 2.3rem)/1.1 var(--script); white-space: nowrap; text-shadow: 0 1px 2px rgba(30,20,10,1), 0 0 6px rgba(30,20,10,.9), 0 0 14px rgba(30,20,10,.75), 0 0 28px rgba(30,20,10,.5); transition: transform .25s ease; }
.pin:hover span, .pin[aria-pressed="true"] span { transform: scale(1.08); }
/* on hover (desktop), a quiet hint of what's there */
.pin small { font: italic 400 .9rem/1.2 var(--serif); white-space: nowrap; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; text-shadow: 0 1px 2px rgba(30,20,10,.95), 0 0 8px rgba(30,20,10,.8); }
.pin:hover small, .pin:focus-visible small { opacity: 1; transform: none; }
.pin[aria-pressed="true"] i { background: var(--accent); box-shadow: 0 0 0 3px #fff8ec, 0 0 16px 5px rgba(255,240,210,.8); animation: none; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 3px rgba(163,71,43,.85), 0 0 10px 2px rgba(255,240,210,.5); } 50% { box-shadow: 0 0 0 3px rgba(163,71,43,.85), 0 0 20px 8px rgba(255,240,210,.85); } }

/* the writing slides over the painting: from the right on a computer, up from the bottom on a phone */
.sheet { position: absolute; z-index: 5; top: 50px; right: 0; bottom: 0; width: min(420px, 100%); background: var(--paper); box-shadow: -10px 0 40px rgba(0,0,0,.3); overflow-y: auto; padding: 44px 30px 40px; transform: translateX(100%); transition: transform .35s ease; }
.sheet.open { transform: none; }
@media (max-width: 899px) {
  .sheet { top: auto; left: 0; width: 100%; max-height: 72svh; border-radius: 14px 14px 0 0; padding: 40px 22px 32px; transform: translateY(100%); box-shadow: 0 -10px 40px rgba(0,0,0,.3); }
}
.close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 0; background: none; font: 400 1.8rem/1 var(--serif); color: var(--muted); cursor: pointer; }
.close:hover { color: var(--ink); }
.panel .emblem { margin-bottom: 10px; }
.panel .place { font: 400 1.6rem/1 var(--script); color: var(--accent); }
.panel h2 { font: 500 1.9rem/1.1 var(--serif); margin-top: 6px; outline: none; }
.pin:focus-visible span { text-decoration: underline; text-underline-offset: 6px; }
.panel blockquote { margin: 16px 0 6px; font-style: italic; font-size: 1.1rem; line-height: 1.5; color: #4b433a; }
.panel cite { display: block; margin-top: 6px; font-size: .9rem; color: var(--muted); }

/* lists of pieces (map panels, writing page) */
.toc { list-style: none; margin-top: 14px; border-top: 1px solid var(--line); }
.toc a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 1.12rem; line-height: 1.3; }
.toc a span:last-child { font-style: italic; font-size: .9rem; color: var(--muted); }
.toc a:hover span:first-child { color: var(--accent); }
.pdf { display: inline-block; margin-top: 14px; font-style: italic; color: var(--accent); }

/* ---------- reading pages ---------- */
.reading { max-width: 680px; margin: 0 auto; padding: 28px 20px 80px; }
.reading .back { font-style: italic; color: var(--muted); text-decoration: none; }
.reading .back:hover { color: var(--accent); }
.reading article { margin-top: 36px; }
.emblem { display: block; width: 150px; height: 150px; border-radius: 50%; background-repeat: no-repeat; box-shadow: 0 0 0 4px #fbf6ec, 0 0 0 5px var(--line), 0 10px 24px rgba(60,40,20,.18); transition: transform .3s ease; }
.emblem:hover { transform: scale(1.04); }
.panel .emblem { width: 96px; height: 96px; }
.piece-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: 8px; }
.piece-head .place { margin-top: 18px; font: 400 1.7rem/1 var(--script); color: var(--accent); text-decoration: none; }
.piece-head h1 { margin-top: 10px; }
.piece-head .meta { margin-top: 6px; }
.piece-figure { margin: 0 0 28px; }
.contents { margin: 0 0 32px; padding: 18px 22px; background: #efe8da; border-radius: 4px; }
.contents ol { margin: 6px 0 0 20px; }
.contents a { text-decoration: none; }
.contents a:hover { color: var(--accent); }
.prose h2 { font: 500 1.7rem/1.2 var(--serif); margin: 2.2em 0 .6em; scroll-margin-top: 70px; }
.prose h3 { font: italic 500 1.3rem/1.3 var(--serif); margin: 1.8em 0 .5em; }
.prose blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 2px solid var(--line); font-style: italic; color: #4b433a; }
.prose img { margin: 1.6em auto .4em; max-height: 560px; width: auto; }
.prose ul { margin: 1em 0 1em 20px; font-size: 1rem; line-height: 1.6; }
.piece-figure img { width: 100%; max-height: 520px; object-fit: contain; background: #efe8da; }
.piece-figure figcaption { margin-top: 8px; text-align: center; font-style: italic; font-size: .95rem; color: var(--muted); }
.index-head { display: flex; align-items: center; gap: 16px; }
.index-head .emblem { width: 64px; height: 64px; flex: none; box-shadow: 0 0 0 3px #fbf6ec, 0 0 0 4px var(--line); }
.index-head .place, .index .place { font: 400 1.35rem/1 var(--script); color: var(--accent); }
.about-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 32px; font-style: italic; }
.about-links a { color: var(--accent); }
.about h1 { text-align: center; }
.reading h1 { font: 500 clamp(2.1rem, 7vw, 3rem)/1.08 var(--serif); margin-top: 4px; }
.prose { margin-top: 28px; font-size: 1.2rem; line-height: 1.75; }
.prose p + p { margin-top: 1em; }
.prose.poem p { line-height: 1.6; }
.prose.poem p + p { margin-top: 1.2em; }
.source { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); font-style: italic; font-size: .95rem; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
.pager a { text-decoration: none; max-width: 48%; }
.pager a.next { text-align: right; }
.pager small { display: block; font-style: italic; color: var(--muted); font-size: .85rem; }
.index section { margin-top: 44px; scroll-margin-top: 70px; }
.index h2 { font: 500 1.6rem var(--serif); }
.frontis { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.frontis figcaption { font-style: italic; font-size: .95rem; color: var(--muted); }
.about .frontis { max-width: 260px; margin: 12px auto 28px; }
.about .frontis img { filter: sepia(.2); }
.noscript { padding: 24px; text-align: center; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
