:root { --bg:#f4f3ef; --ink:#0f0f0f; --muted:#8b8b8b; --pad:clamp(14px,1.6vw,24px); }
* { box-sizing:border-box; margin:0; padding:0; }
html, body { background:var(--bg); color:var(--ink); font-family:"PT Sans Narrow",system-ui,sans-serif; }
a { color:inherit; text-decoration:none; }
.mono { font-family:"PT Sans Narrow",system-ui,sans-serif; font-size:11px; letter-spacing:.01em; text-transform:uppercase; line-height:1.35; }
.word { font-weight:400; line-height:.78; letter-spacing:-.02em; }

/* x-ray layer inside any cover */
.ph { position:relative; overflow:hidden; }
.xray { position:absolute; inset:0; clip-path:circle(0 at 50% 50%); background:#111 center/cover no-repeat; pointer-events:none; }

/* cursor: «✶ напиши мне» on empty space, lens over covers */
html.c-on, html.c-on * { cursor:none !important; }
.cur { position:fixed; left:0; top:0; width:0; height:0; z-index:100; pointer-events:none; will-change:transform; }
.cur .in { position:absolute; left:0; top:0; display:flex; align-items:center; justify-content:center; gap:8px; width:10em; height:2.4em; font-size:14px; border:1px solid var(--ink); border-radius:999px; background:var(--ink); color:#fff; white-space:nowrap; overflow:hidden; transform:translate(-50%,-50%) scale(0); transition:transform .4s cubic-bezier(.2,.9,.25,1.15), width .45s cubic-bezier(.2,.7,.2,1), height .45s cubic-bezier(.2,.7,.2,1), background-color .3s, border-color .3s; }
.cur .star { display:inline-block; font-size:16px; line-height:1; animation:spin 6s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
html.c-write .cur .in, html.c-lens .cur .in { transform:translate(-50%,-50%) scale(1); }
html.c-press .cur .in { transform:translate(-50%,-50%) scale(.9); }
html.c-lens .cur .in { width:150px; height:150px; background:transparent; border-color:rgba(255,255,255,.9); box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.cur .lbl { display:flex; align-items:center; gap:8px; transition:opacity .2s; }
html.c-lens .cur .lbl { opacity:0; }

/* contacts card: grows out of the «напиши мне» pill at the click point */
.sheet { position:fixed; left:0; top:0; z-index:90; width:200px; height:38px; border-radius:19px; overflow:hidden; background:#0f0f0f; color:#fff; font-family:"PT Sans Narrow", system-ui, sans-serif; opacity:0; pointer-events:none;
  transition:width .45s cubic-bezier(.2,.8,.2,1), height .45s cubic-bezier(.2,.8,.2,1), border-radius .45s, opacity .15s; box-shadow:0 18px 50px rgba(0,0,0,.25); }
.sheet.on { width:var(--w,420px); height:var(--h,330px); border-radius:24px; opacity:1; pointer-events:auto; }
.sheet .in { width:var(--w,420px); padding:18px 22px 10px; opacity:0; transition:opacity .15s; }
.sheet.on .in { opacity:1; transition:opacity .25s .22s; }
.sh-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; font-size:15px; letter-spacing:.05em; text-transform:uppercase; }
.sh-top .star { display:inline-block; margin-right:8px; animation:spin 6s linear infinite; }
.sh-top button { background:none; border:0; color:#8b8b8b; font:inherit; font-size:16px; cursor:pointer; padding:4px; } .sh-top button:hover { color:#fff; }
.sheet ul { list-style:none; }
.sheet li { display:grid; grid-template-columns:5.6em minmax(0,1fr) 28px; align-items:center; column-gap:10px; padding:11px 0 13px; border-top:1px solid #333; }
.sheet .k { font-size:13.5px; letter-spacing:.05em; text-transform:uppercase; color:#8b8b8b; }
.sheet li a:not(.act) { font-size:24px; letter-spacing:-.01em; line-height:1.1; overflow-wrap:anywhere; text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:.14em; text-decoration-color:transparent; transition:text-decoration-color .2s; }
.sheet li a:not(.act):hover { text-decoration-color:#fff; }
.sheet .act { justify-self:end; display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:none; border:0; color:#8b8b8b; font:inherit; font-size:18px; cursor:pointer; transition:color .2s, background .2s; }
.sheet .act:hover { color:#0f0f0f; background:#fff; }
.toast { position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); background:#0f0f0f; color:#fff; padding:12px 16px; z-index:120; opacity:0; transition:opacity .3s; pointer-events:none; }
.switch { position:fixed; left:50%; top:var(--pad); transform:translateX(-50%); z-index:95; display:flex; gap:4px; background:#0f0f0f; padding:4px; border-radius:99px; }
.switch a { color:#bbb; padding:5px 10px; border-radius:99px; font-size:11px; }
.switch a.on { background:#fff; color:#111; }
@media (hover:none),(pointer:coarse){ .cur{display:none} }
/* negative lens over plain photos (no interface layer underneath) */
html.c-neg .cur .in { background:transparent; border-color:transparent; box-shadow:none; -webkit-backdrop-filter:invert(1); backdrop-filter:invert(1); }

/* caps inside pills and the cursor: center by cap height, not by font box (PT Sans Narrow sits off-center) */
.cur .lbl { text-transform:uppercase; letter-spacing:.05em; }
@supports (text-box: trim-both cap alphabetic) {
  html .pill { padding:7px 11px; text-box:trim-both cap alphabetic; }
  html .cur .in { padding-bottom:0; }
  html .cur .lbl { text-box:trim-both cap alphabetic; }
}

/* inline links in case text: underline, inverted on hover (as in «Напоказ») */
.inl { text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:.18em; white-space:nowrap; }
.inl:hover { text-decoration:none; background:var(--ink); color:#fff; }

/* end of a case: «напиши мне» block */
section.case-end.g { padding-top:96px; padding-bottom:120px; border-top:1px solid var(--ink); align-items:start; }
.case-end .side { padding-top:10px; }
.case-end p { font-size:clamp(28px,2.2vw,36px); line-height:1.1; letter-spacing:-.02em; max-width:18em; }
.write-btn { display:inline-flex; align-items:center; gap:10px; margin-top:28px; height:52px; padding:0 28px; border:1px solid var(--ink); border-radius:999px; background:var(--ink); color:#fff; font:inherit; font-size:16px; text-transform:uppercase; letter-spacing:.05em; cursor:pointer; transition:background .2s, color .2s; }
.write-btn:hover { background:transparent; color:var(--ink); }
.write-btn .star { display:inline-block; font-size:16px; line-height:1; animation:spin 6s linear infinite; }
/* the label is centred by its capital letters, not by the font box (PT Sans Narrow sits low) */
.write-btn .t { display:block; line-height:1; text-box:trim-both cap alphabetic; }
.write-btn .star { display:block; line-height:1; }
@media (max-width:900px){ .case-end .side { display:none } .case-end .main { grid-column:1/13 } }

/* case chapter headings: the number sits in the heading line, grey, same size (as on «Обо мне») */
.ch-h h2 { display:flex; gap:.35em; }
.ch-h h2 .n { margin:0; font:inherit; letter-spacing:inherit; text-transform:none; color:#c3c1ba; flex:none; }

/* phone: the card always sits inside the screen, 16px from the sides, above the bottom edge */
@media (max-width:480px){ .sheet { max-height:calc(100svh - 32px); } .sheet.on { width:calc(100vw - 32px); } .sheet .in { width:calc(100vw - 32px); } }
@media (max-width:480px){ .sheet li { grid-template-columns:4.6em minmax(0,1fr) 28px; } .sheet li a:not(.act) { font-size:20px; } }

/* on a dark page (identity on the home page) the contacts card turns light, like the «напиши мне» pill there */
html.dark .sheet { background:#f4f3ef; color:#0f0f0f; box-shadow:0 18px 50px rgba(0,0,0,.5); }
html.dark .sheet li { border-top-color:#d9d6cf; }
html.dark .sheet .k, html.dark .sh-top button, html.dark .sheet .act { color:#85837d; }
html.dark .sh-top button:hover { color:#0f0f0f; }
html.dark .sheet li a:not(.act):hover { text-decoration-color:#0f0f0f; }
html.dark .sheet .act:hover { color:#f4f3ef; background:#0f0f0f; }
