/* ——— The top row, the same on every Project 1 page ———
   Left: the name. Right, in this order: globe, day/night, menu.
   The menu icon sits at the right end with a fuller stroke. The day/night
   drawing (.dial) and its button (.switch) always move together, so the
   button stays under the moon or sun. Written after palette.css. */
.mode .dial,.mode .switch{right:calc(var(--band) / 2 - 16px + 46px)}
.room-menu-toggle{color:var(--frame-fg)}
.room-menu-toggle svg{width:26px;height:26px}
.room-menu-toggle svg path{stroke-width:2}

/* Home and privacy: the controls hold only the menu icon. */
.project1-page > .room-controls{left:auto;right:calc(var(--side) + var(--band, 12px) / 2 - 22px);top:2px}
.project1-page .mode .lang{right:calc(var(--band) / 2 - 15px + 92px)}
.project1-page .room-controls .room-map,:root[data-project] .project1-page .room-map{left:auto;right:0}

/* Inner pages (walk, world, articles, podcast): the controls hold menu, globe and
   name. The name stays on the left; the menu and globe go to the right end. */
body:not(.project1-page) > .room-controls{top:2px}
body:not(.project1-page) > .room-controls .room-menu-toggle{position:fixed;top:2px;right:8px}
body:not(.project1-page) > .room-controls .lang{position:fixed;top:2px;right:100px}
body:not(.project1-page) > .room-controls .room-signature.name.hand{padding-left:0}
body:not(.project1-page) .room-controls .room-map,:root[data-project] body:not(.project1-page) .room-map{position:fixed;top:50px;left:auto;right:8px}
@media (max-width:700px){body:not(.project1-page) > .room-controls{top:2px}}

@media (min-width:960px){
  .project1-page > .room-controls{top:8px}
  body:not(.project1-page) > .room-controls,
  body:not(.project1-page) > .room-controls .room-menu-toggle,
  body:not(.project1-page) > .room-controls .lang{top:8px}
  body:not(.project1-page) .room-controls .room-map{top:56px}
}

/* The walk page fixes its own small .mode box lower down; lift it onto the same line. */
.walk-page .mode{top:0;right:24px}

/* Below the desktop width, home and privacy sit the icons 10px further in, so they
   stand exactly where they stand on the inner pages and do not jump between pages. */
@media (max-width:959px){
  .project1-page .mode .dial,.project1-page .mode .switch{right:calc(var(--band) / 2 - 16px + 56px)}
  .project1-page .mode .lang{right:calc(var(--band) / 2 - 15px + 102px)}
  .project1-page > .room-controls{right:calc(var(--side) + var(--band, 12px) / 2 - 12px)}
}

/* The landscape behind the page reaches past the right edge on phones, which made the
   page 420px wide on a 390px screen (sideways wobble, taps landing off target). Clip it. */
html,body{overflow-x:clip}

/* Pointing at day/night. Night: the moon leans in slowly, lifts a hair and glows very
   faintly; its star brightens. Day: the sun's rays grow out and turn a little, with a
   faint warm glow. (Overrides the plainer turn in scene-background.css.) */
html .mode .sky.moon{transform-box:view-box;transform-origin:50% 50%;
  transition:transform 1.6s cubic-bezier(.22,1,.36,1),filter 1.2s ease,opacity .55s ease-in}
html .mode .sky.moon > path:last-child{transform-box:fill-box;transform-origin:50% 50%;transition:transform 1.4s cubic-bezier(.22,1,.36,1),opacity 1s ease;opacity:.85}
html:not([data-mode="day"]) .mode:is(:has(.switch:is(:hover,:focus-visible)),.sky-near) .sky.moon{
  transform:rotate(-9deg) translateY(-.6px) scale(1.04);
  filter:drop-shadow(0 0 3px color-mix(in srgb,var(--frame-fg) 30%,transparent)) drop-shadow(0 0 9px color-mix(in srgb,var(--frame-fg) 12%,transparent))}
html:not([data-mode="day"]) .mode:is(:has(.switch:is(:hover,:focus-visible)),.sky-near) .sky.moon > path:last-child{transform:scale(1.22) rotate(45deg);opacity:1}
html .mode .sky.sun{transition:filter 1.2s ease,opacity .55s ease-in}
html[data-mode="day"] .mode .sky.sun{transition:filter 1.2s ease,opacity .8s ease-out .35s}
html .mode .sky.sun .icon-rays{transform-box:view-box;transform-origin:16px 16px;transition:transform 1.5s cubic-bezier(.22,1,.36,1)}
html[data-mode="day"] .mode:is(:has(.switch:is(:hover,:focus-visible)),.sky-near) .sky.sun .icon-rays:first-of-type{transform:scale(1.34) rotate(12deg)}
html[data-mode="day"] .mode:is(:has(.switch:is(:hover,:focus-visible)),.sky-near) .sky.sun .icon-rays:last-of-type{transform:scale(1.4) rotate(12deg);transition-delay:.08s}
html[data-mode="day"] .mode:is(:has(.switch:is(:hover,:focus-visible)),.sky-near) .sky.sun{filter:drop-shadow(0 0 4px rgba(214,168,72,.32))}
@media (prefers-reduced-motion:reduce){html .mode .sky.moon,html .mode .sky.moon > path:last-child,html .mode .sky.sun .icon-rays{transition:none}}

/* Coming back to the room ("В стаята", or the browser's Back), the page focuses the room so
   keys and screen readers start there. That focus is not a choice the visitor made, so it
   draws no box around the whole room. */
#room:focus{outline:none}

/* ——— Type for everything that is written: PT Mono, a typewriter face with a good Cyrillic
   (the free counterpart of the mono on shapeofdesignbook.com, whose own faces are licensed).
   The handwritten name and the notes inside the drawing keep their hand. ——— */
:root{--write:'PT Mono','Courier New',Courier,monospace}
body .foot,body .foot a,body .foot p{font-family:var(--write)!important;font-size:12px;letter-spacing:.02em;font-style:normal}
body .writing-main,body .writing-main p,body .writing-lead{font-family:var(--write);font-size:15px;line-height:1.75}
body .writing-back,body .writing-eyebrow,body .writing-index,body .writing-number,body .writing-section .writing-status,body .writing-footer,body .writing-footer a,body .walk-begin{font-family:var(--write)!important;font-size:13px;letter-spacing:.02em}
body .writing-main h1{font:400 clamp(30px,4.4vw,46px)/1.15 var(--write);letter-spacing:-.01em}
body .writing-section h2{font:400 clamp(19px,2.2vw,24px)/1.3 var(--write)}

/* ——— Long reading (the privacy policy first): set like a chapter of The Shape of Design ———
   one 600px column, everything in the typewriter mono (PT Mono): text at 15/27, headings and
   small labels at 14px in capitals. */
:root{--read:'Source Serif 4',Georgia,serif}
body article.doc{max-width:600px;margin-left:auto;margin-right:auto;color:var(--ink,#333)}
body article.doc p,body article.doc li{font:400 10px/18px var(--write);letter-spacing:0;text-wrap:pretty}
body article.doc .lead{font-size:10px;line-height:18px}
body article.doc li{margin:0 0 .6em}
body article.doc strong{font-weight:700}
body article.doc a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
body article.doc h1{font:400 14px/1.5 var(--write);text-transform:uppercase;letter-spacing:.02em;margin:0 0 6px}
body article.doc h2{font:400 14px/1.5 var(--write);text-transform:uppercase;letter-spacing:.02em;margin:2.4em 0 .9em}
body article.doc h3{font:400 14px/1.5 var(--write);margin:1.8em 0 .6em}
body article.doc .upd{font:400 14px/1.5 var(--write);opacity:.65;margin:0 0 2.2em}


/* The privacy pages on the home page's ground (no landscape); the sheets of paper stay. */
body:has(article.doc) .scene-background{display:none!important}
/* The logo as on the home page: small, on the line of the icons, without the welcome line. */
body:has(article.doc) .top{position:relative;z-index:30;height:46px;margin-top:-46px;padding:0;display:flex;align-items:center;pointer-events:none}
body:has(article.doc) .top .brand{pointer-events:auto}
body:has(article.doc) .name.hand{font-size:30px;line-height:1}
body:has(article.doc) .name.hand a{display:block;line-height:1}
body:has(article.doc) .welcome{display:none}
@media (min-width:960px){body:has(article.doc) .top{height:52px;margin-top:-52px}body:has(article.doc) .name.hand{font-size:38px;translate:0 4px}}
/* 20px of clear space between the icon line and the highest edge of the sheets. */
body:has(article.doc) .paper-stack{margin-top:32px!important}
@media (max-width:959px){body:has(article.doc) .paper-stack{margin-top:25px!important}}

/* No gold rings left round the icons after a click (the switch takes focus when it is pressed). */
.mode .switch:focus,.mode .switch:focus-visible,.lang:focus,.lang:focus-visible,.nm-btn:focus,.nm-btn:focus-visible{outline:none!important;box-shadow:none!important}
/* the small footer on every page (added by nav-menu.js where a page has none) and the home footer, smaller */
.site-foot{position:relative;z-index:2;clear:both;text-align:center;padding:30px 16px calc(24px + env(safe-area-inset-bottom));color:var(--dim,#8a857b);font:400 10.5px/1.7 var(--mono,'PT Mono',monospace);letter-spacing:.04em}
.site-foot .sf-rule{display:block;width:150px;height:12px;margin:0 auto 12px;opacity:.8}
.site-foot p{margin:0}
.site-foot a{color:inherit;text-decoration:none;border-bottom:1px solid currentColor;padding-bottom:1px}
.site-foot a:hover{color:var(--accent,#A9614E)}
body .foot,body .foot a,body .foot p{font-size:10.5px!important}
body .foot .rule svg{width:150px!important;height:12px!important}
body .foot .social svg{width:20px!important;height:20px!important}
body .foot{padding-top:28px!important;padding-bottom:calc(22px + env(safe-area-inset-bottom))!important}
@media (max-width:760px){.site-foot{padding-bottom:calc(84px + env(safe-area-inset-bottom))}}
footer .made{margin:8px 0 0!important;font-size:9.5px!important;letter-spacing:.06em;opacity:.7}
footer .made a{color:inherit;text-decoration:none;border-bottom:1px dotted currentColor}
footer .made a:hover{color:var(--accent,#A9614E);opacity:1}
/* "към бюрото": the hanging arrow at the foot of every page (nav-menu.js), as on Мисли */
.backto{display:flex;justify-content:center;margin:26px 0 40px;position:relative;z-index:3}
.backto .hl-pull{all:unset;display:flex;flex-direction:column;align-items:center;gap:8px;min-width:44px;min-height:44px;cursor:pointer;color:var(--ln,currentColor);-webkit-tap-highlight-color:transparent}
.backto svg{width:30px;height:48px;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;transition:translate .45s cubic-bezier(.34,1.56,.64,1)}
.backto span{font:400 11px/1 var(--mono,'PT Mono',monospace);letter-spacing:.12em;text-transform:uppercase;color:var(--dim,#8a857b);transition:color .2s}
.backto .hl-pull:hover svg,.backto .hl-pull:focus-visible svg{translate:0 -7px}
.backto .hl-pull:hover span,.backto .hl-pull:focus-visible span{color:var(--accent,#A9614E)}
.backto.pulled svg{translate:0 -16px;color:var(--accent,#A9614E)}
@media (max-width:600px){.backto{margin-bottom:96px}}
