/* Artem Poliakoff — personal site. Sea palette: deep blue + white; accent = deep ocean blue. */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --bg:#ffffff; --ink:#12283d; --muted:#5b7488;
  --navy:#0c2c52; --navy-deep:#08213c;
  --aqua:#1e5a8c; --aqua-deep:#14406a; --aqua-soft:#e7eef5;
  --line:#e3eaf0; --line-soft:#eef3f7;
  --sidebar-w:248px; --radius:16px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;background:#0a2150;color-scheme:light}
body{margin:0;background:transparent;color:var(--ink);font-family:'Inter',system-ui,-apple-system,sans-serif;font-size:16.5px;line-height:1.65;-webkit-font-smoothing:antialiased;position:relative;min-height:100vh;overflow-x:clip}
a{color:var(--aqua-deep);text-decoration:none}
a:hover{color:var(--navy)}
img{max-width:100%;height:auto}
h1,h2,h3{font-family:'Lora',Georgia,serif;line-height:1.18;color:var(--navy);letter-spacing:-.005em;text-wrap:balance}

/* ===== scene (fixed, behind everything) ===== */
.scene{position:absolute;inset:0;z-index:-3;overflow:hidden;background:#06223a}
.sky{position:absolute;top:0;left:0;right:0;height:100vh;background:linear-gradient(180deg,#4a93d6 0,#6fb2e6 35vh,#9bd0ee 60vh,#c6e4f1 78vh,#d4edf4 84vh,#a6dce1 89vh,#5fbed0 94vh,#2fb4c8 100vh);transition:background 1.6s}
.deep{position:absolute;top:100vh;left:0;right:0;bottom:0;background:linear-gradient(180deg,#2fb4c8 0,#1ba6c0 9%,#1391b0 20%,#0e80a2 38%,#0b6486 60%,#08475f 82%,#052a39 100%);transition:background 1.6s}
.stars{position:absolute;left:0;right:0;top:0;height:46vh;opacity:0;transition:opacity 1.6s}
.star{position:absolute;border-radius:50%;background:#fff;opacity:.85;box-shadow:0 0 2px rgba(210,230,255,.55);will-change:opacity,transform}
@media(prefers-reduced-motion:no-preference){.star{animation:twinkle var(--d,3s) ease-in-out var(--dl,0s) infinite alternate}}
@keyframes twinkle{from{opacity:var(--lo,.3);transform:scale(.7)}to{opacity:var(--hi,1);transform:scale(1.15)}}
/* meteors are spawned by JS (random size/angle/speed); head leads, tail trails along its axis */
.shoot{position:absolute;height:2px;border-radius:2px;opacity:0;pointer-events:none;background:linear-gradient(90deg,rgba(255,255,255,0),rgba(190,220,255,.38) 62%,rgba(255,255,255,.92));filter:drop-shadow(0 0 2px rgba(200,225,255,.5))}
.shoot::after{content:"";position:absolute;right:-1px;top:50%;width:var(--h,4px);height:var(--h,4px);margin-top:calc(var(--h,4px) / -2);border-radius:50%;background:#fff;box-shadow:0 0 calc(var(--h,4px) * 1.6) calc(var(--h,4px) * 0.4) rgba(210,232,255,.8)}
.lum{position:absolute;display:none;will-change:left,top;transition:left 60s linear,top 60s linear}
.sun{width:46px;height:46px;border-radius:50%;margin:-23px 0 0 -23px;background:radial-gradient(circle at 50% 50%,#fff7d6,#ffd24d);box-shadow:0 0 55px 16px rgba(255,214,90,.5)}
.moon{width:34px;height:34px;margin:-17px 0 0 -17px;filter:drop-shadow(0 0 5px rgba(216,228,244,.5)) drop-shadow(0 0 13px rgba(216,228,244,.26))}
.moonface{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
/* gulls: soaring in the sky band (top viewport height), scroll away with the sky */
.gulls-wrap{position:absolute;top:0;left:0;right:0;height:100vh;overflow:hidden;pointer-events:none}
.gulls{position:absolute;inset:0;width:100%;height:100%;display:block}
.gulls .wing,.gulls .body,.gulls .tail{fill:rgba(255,255,255,.95);filter:url(#gull-ds)}
.scene.night .gulls .wing,.scene.night .gulls .body,.scene.night .gulls .tail{fill:rgba(228,238,250,.82)}
/* sea + horizon haze are baked into the single .sky gradient (no seam) */
@media(prefers-reduced-motion:reduce){.lum{transition:none}.shoot{display:none}.sky{transition:none}.gulls-wrap{display:none}}

/* ===== layout ===== */
.layout{display:flex;align-items:flex-start}
.main{flex:1;min-width:0;display:flex;flex-direction:column;min-height:100vh}
.content{flex:1;width:100%;max-width:820px;margin:22px auto 28px;padding:34px 30px 56px}

/* glass sidebar, flush on the side */
.sidebar{width:var(--sidebar-w);flex:none;position:sticky;top:0;align-self:flex-start;height:100vh;overflow-y:auto;
  padding:26px 18px;display:flex;flex-direction:column;gap:20px;color:#eaf6ff;
  background:rgba(9,26,46,.34);-webkit-backdrop-filter:blur(16px) saturate(140%);backdrop-filter:blur(16px) saturate(140%);
  border-right:1px solid rgba(255,255,255,.14)}
.brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:#eaf6ff}
.brand img{width:42px;height:42px;border-radius:50%;object-fit:cover;border:2px solid var(--aqua)}
.brand .bn{display:block;font-family:'Lora',serif;font-weight:600;font-size:16px;line-height:1.15}
.nav-tree{list-style:none;margin:0;padding:0;font-size:14.5px}
.nav-tree>li{margin:2px 0}
.nav-tree a{display:block;padding:8px 12px;border-radius:9px;color:#e7f2fa;font-weight:500}
.nav-tree a:hover{background:rgba(255,255,255,.1)}
.nav-tree a.active{background:var(--aqua);color:#fff}
.nav-sub{list-style:none;margin:2px 0 6px;padding:0 0 0 12px;border-left:2px solid rgba(255,255,255,.16)}
.nav-sub a{font-size:13px;color:#bcd6e4;padding:6px 12px}
.nav-sub a:hover{color:#fff}
.nav-sub a.active{color:#9fd0ec;font-weight:600}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:13px}
.social{display:flex;gap:9px;flex-wrap:wrap}
.social a{width:33px;height:33px;display:flex;align-items:center;justify-content:center;border-radius:9px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.18);color:#eaf6ff}
.social a:hover{background:#fff;color:var(--navy)}
.social svg{width:16px;height:16px}
.lang{display:inline-flex;border:1px solid rgba(255,255,255,.22);border-radius:8px;overflow:hidden;width:max-content}
.lang a{padding:5px 11px;font-size:12.5px;color:#cfe2ee;background:rgba(255,255,255,.06)}
.lang a.on{background:var(--aqua);color:#fff}
.lang a+a{border-left:1px solid rgba(255,255,255,.18)}

/* topbar (mobile) */
.topbar{display:none;position:sticky;top:0;z-index:40;padding:10px 16px;align-items:center;gap:12px;color:#eaf6ff;
  background:rgba(9,26,46,.5);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-bottom:1px solid rgba(255,255,255,.12)}
.burger{width:40px;height:40px;border:1px solid rgba(255,255,255,.25);border-radius:9px;background:rgba(255,255,255,.08);color:#eaf6ff;display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;appearance:none}
.burger:hover,.burger:focus,.burger:active{background:rgba(255,255,255,.16);color:#eaf6ff}
.burger svg{width:20px;height:20px;stroke:#eaf6ff;pointer-events:none}
.burger svg path{stroke:#eaf6ff}
.topbar .tb-name{font-family:'Lora',serif;font-weight:600;color:#eaf6ff}
.backdrop{display:none;position:fixed;inset:0;background:rgba(4,16,28,.5);z-index:45}

/* hero / profile (home) */
.profile{padding:10px 0 4px;display:flex;flex-direction:column;align-items:center;text-align:center}
.profile-avatar{width:132px;height:132px;border-radius:50%;object-fit:cover;border:4px solid var(--aqua);box-shadow:0 12px 34px rgba(4,18,40,.4)}
.profile h1{font-size:clamp(30px,5vw,44px);margin:16px 0 4px}
.profile .tagline{font-size:17px;color:var(--muted);max-width:74ch;margin:6px auto 14px;line-height:1.5}
.profile .social{justify-content:center;gap:12px}
.profile .social a{width:42px;height:42px}
.profile .social svg{width:20px;height:20px}
.hr{height:1px;background:var(--line);border:0;margin:26px 0}

/* post list */
.list-head h1{font-size:clamp(26px,4vw,36px);margin:0 0 6px;color:#eafaff;text-shadow:0 2px 4px rgba(2,12,30,.55),0 0 14px rgba(2,12,30,.4)}
.list-head p{color:#dbeaf4;margin:0 0 26px;text-shadow:0 1px 3px rgba(2,12,30,.5)}
/* ── ONE glass tile — every panel inherits this; day/night variants below ── */
.glass,.post-card,.reading .content,.tldr{
  border:1px solid rgba(255,255,255,.18);border-radius:var(--radius);
  -webkit-backdrop-filter:blur(20px) saturate(140%);backdrop-filter:blur(20px) saturate(140%);
  background:linear-gradient(155deg,rgba(10,24,46,.66),rgba(5,15,32,.58));
  box-shadow:0 18px 46px rgba(2,12,30,.34),inset 0 1px 0 rgba(255,255,255,.18)}
html:not(.night) .glass,html:not(.night) .post-card,html:not(.night) .reading .content,html:not(.night) .tldr{
  background:linear-gradient(155deg,rgba(9,21,40,.72),rgba(5,14,30,.64))}
html.night .glass,html.night .post-card,html.night .reading .content,html.night .tldr{
  background:linear-gradient(155deg,rgba(14,32,58,.40),rgba(7,18,38,.34))}
.post-card{display:block;padding:22px 24px;margin:0 0 16px;transition:border-color .15s,transform .15s,box-shadow .15s}
.post-card:hover{border-color:rgba(255,255,255,.45);transform:translateY(-2px);box-shadow:0 16px 38px rgba(2,14,32,.42),inset 0 1px 0 rgba(255,255,255,.3)}
.post-card .date{font-family:'Inter',monospace;font-size:12px;color:#9fd0ec;letter-spacing:.03em;font-weight:600}
.post-card h2{font-size:21px;margin:6px 0 8px;color:#eef8ff}
.post-card p{color:#d6e6f0;margin:0;font-size:15px}

/* single post */
.post-meta{font-size:12.5px;color:var(--muted);margin:0 0 10px;letter-spacing:.02em}
.post-content h1{font-size:clamp(28px,4.6vw,40px);margin:0 0 14px}
.post-content h2{font-size:25px;margin:32px 0 12px}
.post-content h3{font-size:19px;margin:26px 0 8px}
.post-content p{margin:0 0 16px}
.post-content ul,.post-content ol{margin:0 0 16px;padding-left:22px}
.post-content li{margin:6px 0}
.post-content blockquote{border-left:3px solid var(--aqua);background:var(--aqua-soft);margin:18px 0;padding:12px 18px;border-radius:0 10px 10px 0;color:var(--navy)}
.lead{font-size:19px}
.callout{border:1px solid var(--aqua);background:var(--aqua-soft);border-radius:var(--radius);padding:18px 20px;margin:22px 0;font-size:15.5px}
.tldr{color:#eaf3fb;padding:22px 24px;margin:22px 0}
.tldr h3{color:#fff;margin:0 0 8px}
.tldr .big{font-family:'Lora',serif;font-size:clamp(22px,3.4vw,30px);color:#7fc8f0;font-weight:600}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:18px 0;border-radius:10px}
.post-content table{border-collapse:collapse;width:100%;min-width:520px;font-size:14px}
.post-content th,.post-content td{border-bottom:1px solid var(--line);padding:10px 12px;text-align:left;vertical-align:top}
.post-content th{background:var(--bg-soft,#f1f5f9);font-weight:600;color:var(--navy);font-size:12.5px;text-transform:uppercase;letter-spacing:.04em}
.report-embed{margin:20px 0 0;border:0;border-radius:0;background:transparent}
.report-embed iframe{width:100%;border:0;display:block;min-height:600px;background:transparent}
.report-note{font-size:13px;color:var(--muted);margin:8px 2px 0}

.footer{padding:16px 30px;font-size:13px;text-align:center}
/* text floating on the sky: JS picks the higher-contrast colour vs the backdrop (day/dawn/dusk/night) */
.js-onsky{color:var(--ink)}
.js-onsky.on-light{color:#0e2235!important;text-shadow:0 1px 2px rgba(255,255,255,.5)}
.js-onsky.on-dark{color:#eef7ff!important;text-shadow:0 1px 12px rgba(2,10,24,.6),0 1px 3px rgba(2,10,24,.55)}

/* reading (the embedded report): dark matte glass, light text — like home/blog */
.reading .content{color:#e3edf6;padding:34px 30px 8px}
.reading .post-content h1,.reading .post-content h2,.reading .post-content h3{color:#f1f7fd}
.reading .post-meta{color:#9fb3c6}
.reading .post-content strong{color:#fff}
.reading .post-content a{color:#9fd0ec}
.reading .post-content blockquote{border-left-color:#7cc3e8;background:rgba(255,255,255,.06);color:#e6eef7}
.reading .callout{border-color:rgba(124,195,232,.5);background:rgba(255,255,255,.06)}
.reading .post-content table th{background:rgba(255,255,255,.07);color:#cfe0ee}
.reading .post-content th,.reading .post-content td{border-bottom-color:rgba(255,255,255,.13)}
.reading .report-note{color:#9fb3c6;margin:4px 2px 2px}
/* currency switcher at the very top of the report post (flat, not a nested tile) */
.curbar-top{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:-34px -30px 22px;padding:14px 30px;border-radius:16px 16px 0 0;border-bottom:1px solid rgba(255,255,255,.14);background:rgba(8,19,38,.86);-webkit-backdrop-filter:blur(14px) saturate(140%);backdrop-filter:blur(14px) saturate(140%)}
.curbar-top.stuck{border-radius:0}
.curbar-top .burger{display:none;width:38px;height:38px;flex:none;margin-right:2px}
.curbar-top .lab{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#9fb3c6;font-weight:600}
.curbar-top .curbtns{display:inline-flex;border:1px solid #7cc3e8;border-radius:8px;overflow:hidden}
.curbar-top .curbtns button{font:600 13px Inter,system-ui,sans-serif;border:none;background:transparent;color:#9fd0ec;padding:6px 14px;cursor:pointer;border-right:1px solid rgba(124,195,232,.45)}
.curbar-top .curbtns button:last-child{border-right:none}
.curbar-top .curbtns button.on{background:#7cc3e8;color:#0a2238}
.curbar-top .rate{font-size:11.5px;color:#9fb3c6;margin-left:auto}

/* home: immersive, light text over the scene */
.home .content{background:transparent;padding:4px 30px 12px;margin:auto;flex:none}
.home .post-card{padding:13px 18px;margin:0 0 12px}
.home .post-card h2{font-size:18px;margin:4px 0 0;line-height:1.25}
.home .post-card:last-child{margin-bottom:0}
.home .profile{padding:4px 0 0}
.home .profile h1{margin:12px 0 2px}
.home .profile h1{color:#f1f9ff;text-shadow:0 2px 4px rgba(2,11,26,.6),0 0 16px rgba(2,11,26,.45),0 1px 1px rgba(2,11,26,.7)}
.home .profile .tagline{color:#eaf4fb;text-shadow:0 1px 1px rgba(1,8,20,.95),0 0 3px rgba(1,8,20,.85)}
.home .profile .social a{background:rgba(8,24,46,.32);border:1px solid rgba(255,255,255,.34);color:#eef7ff;box-shadow:0 2px 12px rgba(2,12,30,.22)}
.home .profile .social a:hover{background:#fff;color:var(--navy)}
.home .content>h2{color:#eafaff;text-shadow:0 2px 4px rgba(2,12,30,.55),0 0 14px rgba(2,12,30,.4)}
.home .hr{background:linear-gradient(90deg,transparent,rgba(2,14,32,.22),transparent)}

/* mobile */
@media (max-width:900px){
  .layout{display:block}
  .topbar{display:flex}
  .main{min-height:calc(100vh - 61px);min-height:calc(100dvh - 61px)}
  .sidebar{position:fixed;top:0;left:0;z-index:50;height:100vh;width:84%;max-width:300px;transform:translateX(-104%);transition:transform .22s ease}
  .sidebar.open{transform:translateX(0)}
  .backdrop.show{display:block}
  .content{width:auto;margin:14px 12px 24px;padding:22px 18px 44px}
  .reading .content{padding:22px 18px 24px}
  .curbar-top{margin:-22px -18px 18px;padding-left:18px;padding-right:18px;top:0}
  .curbar-top .burger{display:flex}
  .curbar-top .lab{display:none}
  body:has(.curbar-top) .topbar{display:none}
  .post-content table{min-width:480px}
  /* home must fit one screen on phones too */
  .home .profile-avatar{width:72px;height:72px;border-width:3px}
  .home .profile{padding:0}
  .home .profile h1{font-size:23px;margin:5px 0 2px}
  .home .profile .tagline{font-size:12.5px;line-height:1.34;margin:3px auto 6px;max-width:42ch}
  .home .profile .social{gap:10px}
  .home .profile .social a{width:34px;height:34px}
  .home .profile .social svg{width:17px;height:17px}
  .home .content{margin:auto;padding:0 12px 4px}
  .home .hr{margin:5px 0}
  .home .content>h2{margin:0 0 6px;font-size:16px}
  .home .post-card{padding:8px 13px;margin:0 0 7px}
  .home .post-card h2{font-size:13.5px;line-height:1.2;margin:3px 0 0}
  .home .post-card .date{font-size:10.5px}
}

.home .content>h2{margin-top:6px}

/* a11y: focus, touch, skip link (web interface guidelines) */
a,button{touch-action:manipulation}
a:focus-visible,button:focus-visible{outline:2px solid var(--aqua);outline-offset:2px;border-radius:6px}
.sidebar a:focus-visible,.social a:focus-visible,.lang a:focus-visible,.burger:focus-visible{outline:2px solid #9fd0ec;outline-offset:2px}
.skip{position:absolute;left:8px;top:0;z-index:100;background:var(--navy);color:#fff;padding:9px 16px;border-radius:0 0 10px 10px;transform:translateY(-150%);transition:transform .15s}
.skip:focus{transform:translateY(0)}
/* keep sidebar/topbar text links light on hover (global a:hover would darken them) */
.brand:hover,.nav-tree a:hover,.lang a:hover,.tb-name:hover{color:#fff}
