/* DESKTOP-POLISH-20261027: mobile styles intentionally untouched. */
@media(min-width:901px){
 main.social{padding-top:150px;padding-bottom:32px}
 #home a.button[href="about.html"]{display:inline-block;background:transparent;color:inherit;border-radius:0;border:0;border-bottom:1px solid currentColor;padding:14px 0 12px;min-height:44px;margin-top:2px;font-size:14px;font-weight:400}
 #home a.button[href="about.html"]:hover{background:transparent}
 #musician .musician-actions>a[href="#music"]{display:none}
 .home-page main>section{position:relative}
 .desktop-next{position:absolute;bottom:6px;left:calc(50% - 22px);width:44px;height:44px;display:flex;align-items:center;justify-content:center;color:inherit;z-index:2;border-radius:50%;text-decoration:none}
 .desktop-next svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;animation:desktop-next-breathe 2.4s ease-in-out infinite}
 .desktop-next:focus-visible{outline:2px solid currentColor;outline-offset:2px}
 .book article h2:has(.chapter-toggle){margin:0;border-bottom:1px solid #dcd9d0;scroll-margin-top:calc(var(--nav) + 16px)}
 .chapter-toggle{font:inherit;letter-spacing:inherit;line-height:1.3;color:inherit;text-align:left;width:100%;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:22px 0;background:none;border:0;cursor:pointer}
 .chapter-toggle::after{content:'+';flex:none;font:400 24px/1 Arial,sans-serif}
 .chapter-toggle[aria-expanded="true"]::after{content:'−'}
 .chapter-content{padding:24px 0 8px}
 .chapter-content[hidden]{display:none}
}
@keyframes desktop-next-breathe{0%,100%{transform:translateY(-2px)}50%{transform:translateY(2px)}}
@media(prefers-reduced-motion:reduce){.desktop-next svg{animation:none}}

@media(min-width:901px) and (max-height:800px){main.social{padding-top:110px}}
/* DESKTOP-V2: shared hero container; no root/snap overrides. */
.purpy-brand{display:none}
.contacts{padding-top:calc(var(--nav) + 64px);padding-bottom:64px;min-height:100svh}
.contacts h1{font-size:clamp(36px,4.3vw,62px);font-weight:400;letter-spacing:-2px;margin:0 0 32px}
.contact-list{border-top:1px solid #d4d2cb}
.contact-list section{padding:24px 0;border-bottom:1px solid #d4d2cb}
.contact-list h2{font-size:18px;font-weight:400;margin:0 0 10px}
.contact-list p{font-size:24px;margin:0 0 8px}
.contact-list a{display:inline-block;font-size:18px;line-height:1.5;min-height:44px;padding:8px 0;border-bottom:1px solid currentColor;overflow-wrap:anywhere}
@media(min-width:901px){
 #blogger{padding-left:max(var(--gutter),calc((100% - 1440px)/2 + var(--gutter)));padding-right:max(var(--gutter),calc((100% - 1440px)/2 + var(--gutter)))}
 #musician .scene-inner{max-width:1440px;margin:auto;padding:44px var(--gutter);width:100%}
 .book .contents{display:none}
 .book-title{padding-bottom:24px}
 #purpy{background:#fff;color:var(--ink)}
 #purpy>.scene-image{display:none}
 #purpy::after{display:none}
 #purpy .scene-inner{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:64px;align-items:center;max-width:1440px;padding:44px var(--gutter);margin:auto;background:transparent}
 #purpy .copy{width:100%;max-width:540px}
 #purpy h2{white-space:normal}
 #purpy h2>img{display:none}
 #purpy h2 span{color:#4e14ad}
 #purpy .purpy-brand{display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;isolation:isolate;margin:0}
 .purpy-brand::before{content:"";position:absolute;inset:5%;border-radius:50%;background:radial-gradient(ellipse,#6421cb1c,transparent 68%);filter:blur(24px);z-index:-1}
 #purpy .purpy-brand img{width:min(100%,360px);height:auto;clip-path:inset(3.99% 4.55% 3.67% 4.55% round 18.6%)}
 #purpy .purpy-brand figcaption{color:#4e14ad;font-size:42px;line-height:1.1;font-weight:600;letter-spacing:-1px;margin-top:12px}
 #video .media-stage{max-width:clamp(600px,calc((100svh - 430px)*1.7778),900px)}
 #video .stories{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
 #video .story{grid-template-rows:auto minmax(36px,auto) auto}
 #video .story h3{font-size:15px;line-height:18px}
 #video .video-views{font-size:12px;line-height:16px}
}
@media(max-width:900px){
 #links.open{max-height:calc(100svh - var(--nav));overflow-y:auto}
 .contacts{padding-top:calc(var(--nav) + 32px)}
}
@media(min-width:901px){
 /* Keep the next-scene target separate from the channel action. */
 #video{padding-bottom:60px}
 #video .media-stage{max-width:clamp(530px,calc((100svh - 465px)*1.7778),900px)}
}
@media(min-width:901px) and (max-height:800px){main.social{padding-top:90px;padding-bottom:8px}}

/* V2.1: existing Telegram SVG within the contact link. */
.contact-list a.contact-telegram{display:inline-flex;align-items:center;gap:8px;max-width:100%}
.contact-telegram svg{width:24px;height:24px;flex:none}
/* V2.1 desktop media alignment: measured header menu axis; no size changes. */
@media(min-width:901px){
 #home>.scene-image,#blogger .portrait,#musician>.scene-image,#purpy .purpy-brand{translate:var(--desktop-media-shift,0px) 0}
}

/* V2.1 musician edge fix: original background continues behind translated image.
   No translate/size/position changes; edge fade is outside the subject. */
@media(min-width:901px){
 #musician.guitar::before{content:"";position:absolute;inset:auto 0 0;height:min(100%,calc(100svh - var(--nav)));background:url("assets/guitar.webp") right top/cover no-repeat;z-index:-2;pointer-events:none}
 #musician.guitar>.scene-image{mask-image:linear-gradient(to right,transparent,#000 48px,#000 calc(100% - 48px),transparent)!important;-webkit-mask-image:linear-gradient(to right,transparent,#000 48px,#000 calc(100% - 48px),transparent)!important}
}
/* The hero underlay reuses the original image at its existing unshifted size.
   Only background at the lateral edges is blended; the person stays opaque. */
@media(min-width:901px){
 #home.hero::before{content:"";position:absolute;top:-33%;right:-4%;width:min(82%,calc((100svh - var(--nav))*1.42));aspect-ratio:1365/2048;background:url("assets/hero-portrait.jpg") center/100% 100% no-repeat;z-index:-2;pointer-events:none}
 #home.hero>.scene-image{mask-image:linear-gradient(to right,transparent,#000 48px,#000 calc(100% - 48px),transparent)!important;-webkit-mask-image:linear-gradient(to right,transparent,#000 48px,#000 calc(100% - 48px),transparent)!important}
}

/* APPROVED-MOBILE-20261027: desktop >=901px remains unchanged. */
@media(max-width:900px){
 .home-page #purpy{background:#fff;color:var(--ink);min-height:calc(100svh - var(--nav));height:auto;justify-content:center}
 .home-page #purpy>.scene-image,.home-page #purpy::after{display:none}
 .home-page #purpy .scene-inner{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:24px;flex:0 0 auto;width:100%;margin:auto;padding:28px max(20px,env(safe-area-inset-right)) max(28px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));background:#fff}
 .home-page #purpy .copy{width:100%;max-width:540px}
 .home-page #purpy h2{white-space:normal;flex-wrap:wrap}
 .home-page #purpy h2>img{display:none}
 .home-page #purpy h2 span{color:#4e14ad}
 .home-page #purpy .purpy-brand{display:flex;order:-1;flex-direction:column;align-items:center;justify-content:center;position:relative;isolation:isolate;margin:0;width:100%;max-width:300px;flex:none}
 .home-page #purpy .purpy-brand::before{content:"";position:absolute;inset:5%;border-radius:50%;background:radial-gradient(ellipse,#6421cb1c,transparent 68%);filter:blur(24px);z-index:-1}
 .home-page #purpy .purpy-brand img{width:clamp(136px,calc((100svh - var(--nav))* .29),240px);max-width:100%;height:auto;clip-path:inset(3.99% 4.55% 3.67% 4.55% round 18.6%)}
 .home-page #purpy .purpy-brand figcaption{color:#4e14ad;font-size:32px;line-height:1.1;font-weight:600;letter-spacing:-1px;margin-top:8px}
 .home-page #purpy .mobile-story p{font-size:16px;line-height:1.5}
 .home-page main::after,html.scenes-fit .home-page main::after{background:#fff}
 .book .contents{display:none}
 .book-title{padding-bottom:24px}
 .book article h2:has(.chapter-toggle){margin:0;border-bottom:1px solid #dcd9d0;scroll-margin-top:calc(var(--nav) + 16px)}
 .chapter-toggle{font:inherit;letter-spacing:inherit;line-height:1.3;color:inherit;text-align:left;width:100%;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 0;background:none;border:0;cursor:pointer}
 .chapter-toggle::after{content:'+';flex:none;font:400 24px/1 Arial,sans-serif}
 .chapter-toggle[aria-expanded="true"]::after{content:'−'}
 .chapter-content{padding:20px 0 8px}
 .chapter-content[hidden]{display:none}
}
@media(max-width:900px) and (max-height:670px){
 .home-page #purpy .scene-inner{gap:16px;padding-top:20px;padding-bottom:20px}
}

/* MOBILE-CTA-20261027: carry over the two approved desktop CTA decisions. */
@media(max-width:900px){
 #home a.button[href="about.html"]{background:transparent;color:inherit;border-radius:0;border:0;border-bottom:1px solid currentColor;padding-left:0;padding-right:0;font-weight:400}
 #home a.button[href="about.html"]:hover{background:transparent}
 #musician .musician-actions>a[href="#music"]{display:none}
}

/* MOBILE-SEVEN-20261027. Desktop media/layout rules remain unchanged. */
.mobile-contact-scene{display:none}
@media(max-width:900px){
 .home-page main::after,html.scenes-fit .home-page main::after{content:none;display:none;height:0}
 .home-page dialog form[method="dialog"]>button,.home-page #full-story form[method="dialog"]>button{position:relative;display:inline-block;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:0;background:transparent;color:inherit;font-size:0;box-shadow:none}
 .home-page dialog form[method="dialog"]>button::before,.home-page dialog form[method="dialog"]>button::after{content:"";position:absolute;width:24px;height:2px;left:10px;top:21px;background:currentColor;transform:rotate(45deg)}
 .home-page dialog form[method="dialog"]>button::after{transform:rotate(-45deg)}
 .home-page dialog form[method="dialog"]>button:focus:not(:focus-visible){outline:none}
 .home-page dialog form[method="dialog"]>button:focus-visible{outline:2px solid currentColor;outline-offset:3px}
 .home-page #blogger .portrait{position:relative;inset:auto;order:-1;width:100%;height:auto;aspect-ratio:1.2;max-width:440px;padding:0;margin:0 auto 16px;overflow:hidden;flex:none}
 .home-page #blogger .portrait img{width:100%;height:auto;max-width:none;object-fit:contain;object-position:center top}
 .home-page #musician>.scene-image{display:none}
 .home-page #musician::before{content:"";position:relative;inset:auto;display:block;width:100%;height:clamp(230px,calc(100svh - 355px),360px);flex:none;background:url("assets/guitar.webp") 88% 12.3%/auto 228.4% no-repeat;pointer-events:none}
 .home-page #musician .scene-inner{flex:1;margin-top:0}
 .home-page #contact-scene{display:flex;flex-direction:column;justify-content:center;align-items:stretch;min-height:calc(100vh - var(--nav));min-height:calc(100svh - var(--nav));min-height:calc(100dvh - var(--nav));height:auto;scroll-snap-align:start;scroll-snap-stop:always;scroll-margin:0;background:var(--paper);color:var(--ink);padding:24px max(20px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}
 #contact-scene .contact-scene-inner{width:100%;max-width:540px;margin:auto}
 #contact-scene h2{font-size:36px;line-height:1.15;font-weight:400;letter-spacing:-1px;margin:0 0 18px}
 #contact-scene .contact-list section{padding:10px 0}
 #contact-scene .contact-list h3{font-size:16px;line-height:1.4;font-weight:400;letter-spacing:normal;margin:0}
 #contact-scene .contact-list p{font-size:20px;line-height:1.3;margin:4px 0 0}
 #contact-scene .contact-list a{font-size:16px;line-height:1.5;min-height:44px;padding:8px 0}
}

/* MOBILE-REFINE-20261027: approved crops, non-framed focus, stable terminal. */
@media(max-width:900px){
 .home-page dialog form[method="dialog"]>button:focus-visible,.home-page #full-story form[method="dialog"]>button:focus-visible{outline:none;background-image:linear-gradient(currentColor,currentColor);background-size:24px 2px;background-position:center bottom;background-repeat:no-repeat}
 .home-page dialog h2[tabindex="-1"]:focus{outline:none}
 .home-page #blogger{padding-top:0;justify-content:flex-start}
 .home-page #blogger .portrait{width:calc(100% + 40px);max-width:none;aspect-ratio:1.28;margin:0 -20px 16px;align-self:stretch}
 .home-page #blogger .portrait img{margin-top:calc(10px - 10.1vw)}
 .home-page #home>.scene-image{display:none}
 .home-page #home::before{content:"";position:relative;inset:auto;display:block;width:100%;height:clamp(230px,calc(100svh - 350px),360px);flex:none;aspect-ratio:auto;background:url("assets/hero-portrait.jpg") 57% calc(10px - 41vw)/120% auto no-repeat;pointer-events:none;z-index:auto}
 .home-page #purpy .purpy-brand figcaption{display:none}
 .home-page #contact-scene{min-height:calc(100vh - var(--nav));min-height:calc(100svh - var(--nav));min-height:calc(100lvh - var(--nav));justify-content:flex-start}
 #contact-scene .contact-scene-inner{margin:0 auto}
}
/* Contact utilities only; existing anchors and their destinations stay intact. */
.contact-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.contact-copy{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;padding:10px;border:0;border-radius:6px;background:transparent;color:inherit;cursor:pointer}
.contact-copy svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.contact-copy:hover{background:transparent}
.contact-copy:focus{outline:none;box-shadow:none}
.contact-copy:focus-visible{background:linear-gradient(currentColor,currentColor) center bottom / 22px 2px no-repeat}
.contact-copy-status{min-height:24px;margin:8px 0 0;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.contact-manual{display:block;margin-top:8px;font-size:14px;line-height:1.5}
.contact-manual input{display:block;width:100%;min-height:44px;font:inherit;padding:8px;border:1px solid currentColor;background:transparent;color:inherit}

/* MOBILE-BALANCE: viewport-sized terminal, compact real content, balanced Purpy. */
@media(max-width:900px){
 .home-page #purpy{min-height:calc(100vh - var(--nav));min-height:calc(100dvh - var(--nav))}
 .home-page #purpy .scene-inner{margin:auto;padding-top:20px;padding-bottom:calc(20px + env(safe-area-inset-bottom));gap:20px}
 .home-page #purpy .purpy-brand{align-self:center}
 .home-page #contact-scene{min-height:calc(100vh - var(--nav));min-height:calc(100dvh - var(--nav));padding-top:12px;padding-bottom:max(12px,env(safe-area-inset-bottom));justify-content:flex-start}
 #contact-scene h2{margin-bottom:12px}
 #contact-scene .contact-list section{padding:6px 0}
 #contact-scene .contact-copy-status{min-height:21px;margin-top:4px}
}
