/* Background treatment only: the compact profile and résumé remain first. */
@media screen {
  .homepage{--paper:#f6f4ed;--ink:#24382f;--body:#505951;--muted:#687567;--line:#d6dcd0;--accent:#90642f;background:var(--paper);isolation:isolate}
  .reading-background{position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none;background:#e0e4ce}
  .reading-landscape,.reading-canopy{position:absolute;inset:0;background-image:url('/assets/tree-space-v8.webp');background-size:cover;background-position:15% center}
  .reading-canopy{mask-image:linear-gradient(#000 0%,#000 16%,transparent 34%);transform-origin:12% 10%;animation:canopy-breeze 11s ease-in-out infinite alternate;will-change:transform}
  .reading-veil{position:absolute;inset:0;background:linear-gradient(90deg,#f6f4ed12 0%,#f6f4ed26 22%,#f6f4ed3d 55%,#f6f4ed00 100%)}
  .reading-right-bough{position:absolute;right:-4vw;top:39vh;width:clamp(300px,37vw,680px);aspect-ratio:1;background:url('/assets/tree-right-bough-v1.webp') center/contain no-repeat;transform-origin:96% 6%;animation:right-bough-sway 6.5s ease-in-out infinite;will-change:transform}
  .reading-sunlight{position:absolute;inset:-5%;background:radial-gradient(ellipse at 26% 20%,#fff4b733,transparent 27%),radial-gradient(ellipse at 12% 70%,#fdf8d72b,transparent 25%);mix-blend-mode:screen;animation:light-through-leaves 18s ease-in-out infinite alternate}
  .reading-leaves{position:absolute;inset:0;overflow:hidden}
  .ambient-leaf{position:absolute;top:-7%;left:var(--x);width:var(--size);height:calc(var(--size)*1.65);border-radius:3% 80% 3% 80%;background:linear-gradient(45deg,#677741,#bec17b);box-shadow:inset 1px 0 #d4d6a54d;opacity:0;will-change:transform;animation:leaf-drift var(--duration) linear var(--delay) infinite}
  .ambient-leaf:nth-child(3n){background:linear-gradient(45deg,#8d713b,#c8ad67)}
  .ambient-leaf:nth-child(even){filter:blur(.6px)}
  .ambient-leaf-right{animation-name:right-leaf-drift;box-shadow:inset 1px 0 #e4e7ac80,1px 3px 5px #344b2620}
  .homepage .header{background:#f6f4edee;backdrop-filter:blur(12px)}
  .homepage .profile{position:relative;margin-top:20px;padding:30px 34px;gap:28px;border:1px solid #d4ddca;border-radius:12px;background:linear-gradient(90deg,#fbfaf3f5 0%,#fbfaf3eb 45%,#fbfaf333 75%,#fbfaf300 100%);box-shadow:0 6px 30px #29452c08}
  .homepage .profile-copy{max-width:600px;flex:1;min-width:0}
  .constellation-sky{position:absolute;right:-11vw;top:-80px;width:clamp(720px,68vw,1200px);aspect-ratio:800/650;background:url('/assets/constellation-neighbourhood-v3.svg') center/contain no-repeat;pointer-events:none;opacity:.95;mask-image:linear-gradient(#000 0%,#000 58%,transparent 92%)}
  .homepage .profile .portrait{width:125px;height:163px;object-fit:cover;object-position:center 42%;border-radius:3px}
  .homepage .profile h1{font-size:46px;letter-spacing:-1.7px;font-weight:500;line-height:1.15}
  .homepage .profile .role{font-size:20px}
  .homepage .profile .summary{font-size:18px;line-height:1.75;max-width:540px}
  .homepage .profile .email{font-size:15px;color:#58644e}
  .homepage .page-grid{margin-top:22px;padding:30px 30px 0;background:#fcfbf6f5;border:1px solid #d7decf;border-radius:12px;box-shadow:0 8px 35px #29452c08}
  .homepage .resume{scroll-margin-top:115px;min-width:0}
  .homepage .work-column{grid-row:auto;scroll-margin-top:115px}
  .homepage .section-heading h2,.homepage .link-section>h2{color:#2d4736}
  .homepage .work-link,.homepage .link-list a{transition:color .2s}
  .homepage .work-link:hover,.homepage .link-list a:hover{color:#90642f}
  .homepage .home-updates{padding:30px;margin:28px 0 0;background:#fcfbf6f2;border:1px solid #d7decf;border-radius:12px}
  .homepage .home-briefing{background:linear-gradient(115deg,#f2f4f6e8,#f2f4f6b8),url('/assets/research-glass-v1.webp') 75% center/cover;padding:24px;border:1px solid #d6dfe5;border-radius:8px}
  .homepage .home-learning{margin-top:28px;padding:28px 30px;background:#f8f6eaf0;border:1px solid #dadcc9;border-radius:12px}
  .homepage .footer{margin-top:28px;background:#f6f4eddd;border-radius:8px 8px 0 0;padding-inline:20px}
  .homepage .chat-launcher{background:#243e2e;border-color:#50664b}
  .homepage .chat-panel{box-shadow:0 18px 60px #24382f33}
  @keyframes leaf-drift{
    0%{transform:translate3d(0,-4vh,0) rotate(-30deg);opacity:0}
    8%{opacity:.6}
    30%{transform:translate3d(35px,28vh,0) rotate(60deg)}
    55%{transform:translate3d(-15px,55vh,0) rotate(160deg);opacity:.45}
    80%{transform:translate3d(45px,83vh,0) rotate(235deg);opacity:.5}
    100%{transform:translate3d(var(--drift),112vh,0) rotate(320deg);opacity:0}
  }
  @keyframes light-through-leaves{from{transform:translate3d(-10px,-5px,0);opacity:.35}to{transform:translate3d(15px,8px,0);opacity:.7}}
  @keyframes canopy-breeze{from{transform:translate3d(0,0,0) rotate(-.12deg)}to{transform:translate3d(2px,1px,0) rotate(.2deg)}}
  @keyframes right-bough-sway{
    0%,100%{transform:rotate(-2deg) translate3d(0,0,0)}
    38%{transform:rotate(1.7deg) translate3d(-6px,8px,0)}
    70%{transform:rotate(-.6deg) translate3d(2px,3px,0)}
  }
  @keyframes right-leaf-drift{
    0%{transform:translate3d(65px,-5vh,0) rotate(-35deg) rotateY(0);opacity:0}
    7%{opacity:.85}
    30%{transform:translate3d(-40px,31vh,0) rotate(125deg) rotateY(95deg);opacity:.75}
    60%{transform:translate3d(25px,67vh,0) rotate(270deg) rotateY(200deg);opacity:.8}
    85%{opacity:.65}
    100%{transform:translate3d(-130px,114vh,0) rotate(430deg) rotateY(340deg);opacity:0}
  }
}
@media screen and (max-width:1000px){
  .homepage .profile{padding:28px;gap:24px}
  .homepage .profile h1{font-size:40px}
  .homepage .page-grid{padding:28px 24px 0}
}
@media screen and (max-width:960px){
  /* Override the earlier mobile work-first placement: experience comes first. */
  .homepage .resume{grid-column:1;grid-row:1}
  .homepage .work-column{grid-column:1;grid-row:2;margin-top:10px;margin-bottom:20px;padding-top:24px;border-top:1px solid var(--line)}
}
@media screen and (max-width:600px){
  .homepage .reading-landscape,.homepage .reading-canopy{background-position:75% center}
  .constellation-sky{width:720px;right:-175px;top:65px;opacity:.85}
  .homepage .reading-veil{background:linear-gradient(90deg,#f6f4ed55,#f6f4ed26)}
  .homepage .reading-right-bough{width:300px;right:-100px;top:43vh;opacity:.8}
  .homepage .profile{padding:23px 20px;gap:8px 20px;margin-top:14px;background:linear-gradient(90deg,#fbfaf3f2,#fbfaf3e8 55%,#fbfaf3b8)}
  .homepage .profile .portrait{width:100px;height:135px}
  .homepage .profile h1{font-size:34px;letter-spacing:-1.2px}
  .homepage .profile .role{font-size:17px}
  .homepage .profile .summary{font-size:17px;margin-top:13px}
  .homepage .profile .email{font-size:14px;margin-top:5px}
  .homepage .page-grid{padding:24px 19px 0;margin-top:16px}
  .homepage .home-updates{padding:23px 20px;margin-top:20px}
  .homepage .home-briefing{padding:22px 18px;margin-top:20px}
  .homepage .home-learning{padding:23px 20px;margin-top:20px}
  .homepage .footer{padding-inline:12px;font-size:12px}
}
@media screen and (max-width:380px){
  .homepage .profile{grid-template-columns:80px minmax(0,1fr);gap:8px 14px;padding:20px 16px}
  .homepage .profile .portrait{width:80px;height:108px}
  .homepage .profile h1{font-size:29px}
  .homepage .profile .role{font-size:15px}
}
@media(prefers-reduced-motion:reduce){
  .reading-sunlight,.reading-canopy,.reading-right-bough,.ambient-leaf{animation:none!important;will-change:auto}
  .reading-leaves,.reading-canopy{display:none}
}
@media print{
  .reading-background{display:none!important}
  .homepage .profile,.homepage .page-grid{background:none;border:0;box-shadow:none}
}
