/* ——— Project 1 · the home page ———
   Only the logo, the menu by the icons, and the desk. No sheets of paper. The landscape (hills,
   church, trees) is kept for the other pages. Day keeps the site's own colours ("Утро"); the
   desk and the chair are drawn in a bolder line (diary.js). Night is a deep warm olive with soft
   warm-grey lines, easy on the eyes. */
:root:has(body.project1-home){--d-terra:#A9614E;--d-rule:rgba(23,22,20,.22);--d-ink:#141311}
:root:has(body.project1-home)[data-mode="night"]{
  /* Night, easy on the eyes: a deep warm olive, never black; lines and words in soft warm grey,
     never white; the gold of the candle the only bright thing. */
  --frame-bg:#1D1F1B; --frame-fg:#CFCBBE; --paper:#1D1F1B; --ink:#CFCBBE; --edge:#B79A6A;
  --study-ink:#8F8A7B; --d-ink:#CFCBBE; --d-terra:#C9957F;
}

/* The landscape stays on the other pages. */
body.project1-home .scene-background{display:none!important}


/* The welcome line: strong small capitals, like the question on a planner page. */
body.project1-home .welcome{font:600 11px/1.5 'Golos Text',system-ui,sans-serif;letter-spacing:.12em;opacity:1}


/* ——— The home page: the logo, the hidden menu by the icons, and the desk. No sheets. ———
   The logo stands on the same line as the menu, language and day/night icons; the room starts at
   the very top of the window, so the lamp's cord hangs from the edge of the browser. */
body.project1-home .frame.paper-stack{display:none}
body.project1-home .mode{z-index:31}
body.project1-home .top{position:relative;z-index:30;height:46px;margin-top:-46px;padding:0;display:flex;align-items:center;pointer-events:none}
body.project1-home .top .brand{pointer-events:auto}
body.project1-home .name.hand{font-size:38px;line-height:1}
body.project1-home .name.hand a{display:block;line-height:1}
body.project1-home .welcome{display:none}
body.project1-home .study-room{margin-top:-46px}
@media (max-width:959px){body.project1-home .name.hand{font-size:30px}}
@media (min-width:960px){body.project1-home .top{height:52px;margin-top:-52px}body.project1-home .name.hand{translate:0 4px}body.project1-home .study-room{margin-top:-52px}}

/* The desk and the chair, drawn over in a bolder line (see diary.js). */
.desk-bold{pointer-events:none}

/* ——— Phone: the desk fills the screen ———
   The room is enlarged around the desk, so the lamp, the desk, the chair and Rafa are big enough
   to read and touch; the lemon tree and the window step out of the frame (the menu reaches them).
   The scale is set by diary.js. */
@media (max-width:600px){body:has(.study-room){overflow-x:clip}}
/* Phone: the window is out of the frame, so neither it nor its breeze is drawn. */
/* Phone: the window, its breeze and the lemon tree are not drawn (on every page with the desk).
   Tablet and wider: the whole room. */
@media (max-width:600px){body:has(.study-room) :is(.study-window,.study-room-breeze,.study-lemon-tree){display:none}}

/* The room in the microphone's hand: full ink (cream at night), slightly wavering, its line
   broken by the grain of the paper like chalk or pencil. */
body:has(.study-room) .study-room{color:var(--frame-fg)}
:root[data-mode="night"] body.project1-home .study-room,:root:not([data-mode="day"]) body:has(.study-room) .study-room{--study-ink:#D9D3C4}
:root[data-mode="day"] body:has(.study-room) .study-room{--study-ink:#24211D}
/* Only on the still drawing, not the whole scene: a filter over the moving parts (lamp,
   candle, breeze, Rafa) would be redrawn on every frame and slows the page down. */
body:has(.study-room) .study-ink svg > rect[mask="url(#study-lines)"]{filter:url(#room-chalk)}
body:has(.study-room) .study-ink svg{will-change:auto}

/* The room appears whole, not piece by piece: hidden until its drawings are decoded (diary.js),
   then faded in. If anything fails it shows anyway after a few seconds. */
body:has(.study-room) .study-room{opacity:0;animation:room-failsafe 0s 4.5s forwards}
html.room-ready body .study-room{opacity:1;animation:none;transition:opacity .45s ease}
@keyframes room-failsafe{to{opacity:1}}
