*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}}
html,body{background:#fbfbfd;color:#1d1d1f;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased}
html.dark-pre body{background:#000;color:#f5f5f7}
body.dark{background:#000;color:#f5f5f7}
[id]{scroll-margin-top:80px}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
.wrap{max-width:1140px;margin:0 auto;padding:0 20px}

/* -------- Top bar -------- */
.topbar{position:sticky;top:0;z-index:50;background:rgba(251,251,253,.82);backdrop-filter:saturate(180%) blur(20px);border-bottom:1px solid rgba(0,0,0,.06)}
body.dark .topbar{background:rgba(0,0,0,.7);border-bottom-color:rgba(255,255,255,.08)}
.topbar-inner{display:flex;align-items:center;justify-content:space-between;padding-top:14px;padding-bottom:14px;gap:14px}
.topbar .brand{font-weight:700;letter-spacing:-.02em;font-size:18px;display:inline-flex;align-items:center;gap:8px;text-decoration:none;color:inherit}.topbar .brand img{display:block;flex-shrink:0;width:22px;height:22px}
.topbar .nav{display:flex;gap:6px;margin-left:24px}
.topbar .nav a{padding:8px 12px;border-radius:8px;font-size:14px;color:#515154;font-weight:500;transition:all .2s}
.topbar .nav a:hover,.topbar .nav a.active{background:rgba(0,0,0,.05);color:#1d1d1f}
.topbar .nav a.active{color:#0071e3;font-weight:600}
body.dark .topbar .nav a{color:#a1a1a6}
body.dark .topbar .nav a:hover,body.dark .topbar .nav a.active{background:rgba(255,255,255,.08);color:#f5f5f7}
body.dark .topbar .nav a.active{color:#64d2ff}
.topbar .right{display:flex;gap:10px;align-items:center;margin-left:auto}
.btn{display:inline-flex;align-items:center;gap:6px;padding:9px 16px;border-radius:999px;font-size:14px;font-weight:500;border:0;cursor:pointer;transition:all .2s;text-decoration:none;font-family:inherit}
.btn-primary{background:#1d1d1f;color:#fff}
.btn-primary:hover{background:#0071e3}
body.dark .btn-primary{background:#fff;color:#000}
body.dark .btn-primary:hover{background:#0071e3;color:#fff}
@media(max-width:900px){.topbar .nav{display:none}}
@media(max-width:560px){.wrap{padding:0 16px}}

/* Theme toggle */
.theme-toggle{width:40px;height:40px;border-radius:50%;border:1px solid rgba(0,0,0,.08);background:rgba(0,0,0,.04);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;color:inherit;transition:all .25s cubic-bezier(.22,.61,.36,1);position:relative;flex-shrink:0}
.theme-toggle:hover{background:rgba(0,0,0,.08);transform:rotate(15deg)}
body.dark .theme-toggle{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.1)}
body.dark .theme-toggle:hover{background:rgba(255,255,255,.14)}
.theme-toggle svg{width:18px;height:18px;transition:transform .4s cubic-bezier(.22,.61,.36,1), opacity .2s}
.theme-toggle .icon-moon{position:absolute}
.theme-toggle .icon-sun{opacity:0;transform:rotate(-90deg) scale(.5)}
body.dark .theme-toggle .icon-moon{opacity:0;transform:rotate(90deg) scale(.5)}
body.dark .theme-toggle .icon-sun{opacity:1;transform:none}

/* -------- Hero -------- */
.hero{padding:72px 0 40px;text-align:center;position:relative;overflow:hidden}
.hero::before{content:"";position:absolute;top:-150px;left:50%;transform:translateX(-50%);width:800px;height:500px;background:radial-gradient(ellipse at center,rgba(191,90,242,.08) 0%,transparent 70%);pointer-events:none;z-index:-1}
body.dark .hero::before{background:radial-gradient(ellipse at center,rgba(191,90,242,.18) 0%,transparent 70%)}
.hero .eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:#bf5af2;font-weight:600;margin-bottom:18px;padding:6px 14px;border-radius:999px;background:rgba(191,90,242,.08);border:1px solid rgba(191,90,242,.15)}
.hero h1{font-size:clamp(36px,6vw,68px);font-weight:700;letter-spacing:-.035em;line-height:1.05;margin-bottom:14px;background:linear-gradient(180deg,#1d1d1f 0%,#515154 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
body.dark .hero h1{background:linear-gradient(180deg,#f5f5f7 0%,#a1a1a6 100%);-webkit-background-clip:text;background-clip:text}
.hero .lead{font-size:clamp(15px,1.8vw,18px);color:#6e6e73;max-width:580px;margin:0 auto 32px;line-height:1.5}
body.dark .hero .lead{color:#a1a1a6}

/* Search */
.blog-search{max-width:520px;margin:0 auto;position:relative}
.blog-search input{width:100%;padding:16px 20px 16px 54px;border-radius:999px;border:1.5px solid rgba(0,0,0,.06);background:#fff;font-size:15px;font-family:inherit;color:inherit;outline:0;transition:all .25s;box-shadow:0 12px 32px -16px rgba(0,0,0,.12)}
.blog-search input:focus{border-color:#bf5af2;box-shadow:0 0 0 5px rgba(191,90,242,.15)}
body.dark .blog-search input{background:#1c1c1e;border-color:rgba(255,255,255,.1)}
.blog-search::before{content:"";position:absolute;left:20px;top:50%;transform:translateY(-50%);width:18px;height:18px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23515154' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='8'/><path d='M21 21l-4.35-4.35'/></svg>") no-repeat center/contain;pointer-events:none;opacity:.6}
body.dark .blog-search::before{background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a6' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='8'/><path d='M21 21l-4.35-4.35'/></svg>") no-repeat center/contain}

/* Search result info */
.search-info{max-width:780px;margin:24px auto 0;padding:14px 20px;background:rgba(0,113,227,.06);border:1px solid rgba(0,113,227,.15);border-radius:14px;font-size:14px;color:#0071e3;display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
body.dark .search-info{background:rgba(0,113,227,.15);color:#64d2ff}
.search-info a{font-weight:600;text-decoration:underline;text-underline-offset:2px}

/* -------- Section spacing -------- */
.section{padding:32px 0}
.section h2{font-size:clamp(24px,2.8vw,34px);font-weight:700;letter-spacing:-.02em;margin-bottom:8px}
.section .kicker{font-size:13px;letter-spacing:.12em;text-transform:uppercase;color:#bf5af2;font-weight:600;margin-bottom:10px}
.section .desc{color:#6e6e73;margin-bottom:28px;font-size:16px;max-width:640px}
body.dark .section .desc{color:#a1a1a6}
.section .head-row{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:28px;gap:18px}
.section .head-row .desc{margin-bottom:0}

/* -------- Featured post -------- */
.featured{display:grid;grid-template-columns:1.15fr 1fr;gap:44px;align-items:center;background:#fff;border:1px solid rgba(0,0,0,.05);border-radius:28px;overflow:hidden;transition:all .3s cubic-bezier(.22,.61,.36,1);text-decoration:none;color:inherit}
body.dark .featured{background:#1c1c1e;border-color:rgba(255,255,255,.06)}
.featured:hover{transform:translateY(-4px);box-shadow:0 24px 60px -24px rgba(0,0,0,.2);border-color:rgba(191,90,242,.25)}
.featured .f-img{aspect-ratio:4/3;background:#eceef1 center/cover no-repeat;position:relative;overflow:hidden}
.featured .f-img::before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,transparent 0%,rgba(0,0,0,.05) 100%)}
.featured .f-tag{position:absolute;top:18px;left:18px;background:#fff;color:#bf5af2;padding:7px 14px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;box-shadow:0 4px 12px -4px rgba(0,0,0,.15);z-index:1}
.featured .f-body{padding:36px 44px 36px 0;display:flex;flex-direction:column;gap:14px}
.featured .f-meta{font-size:13px;color:#86868b;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.featured .f-meta .dot{width:3px;height:3px;border-radius:50%;background:#86868b}
.featured h2.f-title{font-size:clamp(24px,3vw,36px);font-weight:700;line-height:1.2;letter-spacing:-.02em;margin:0}
.featured .f-ex{font-size:15px;line-height:1.6;color:#515154;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
body.dark .featured .f-ex{color:#a1a1a6}
.featured .f-cta{margin-top:8px;color:#bf5af2;font-weight:600;font-size:14px;display:inline-flex;align-items:center;gap:6px}
.featured .f-cta::after{content:"\2192";transition:transform .25s}
.featured:hover .f-cta::after{transform:translateX(4px)}

@media(max-width:900px){
    .featured{grid-template-columns:1fr}
    .featured .f-body{padding:28px 28px 32px}
}

/* -------- Post grid -------- */
.post-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:24px;margin-top:32px}
.post-card{display:flex;flex-direction:column;background:#fff;border:1px solid rgba(0,0,0,.05);border-radius:22px;overflow:hidden;transition:all .3s cubic-bezier(.22,.61,.36,1);text-decoration:none;color:inherit;position:relative}
body.dark .post-card{background:#1c1c1e;border-color:rgba(255,255,255,.06)}
.post-card:hover{transform:translateY(-4px);box-shadow:0 18px 42px -18px rgba(0,0,0,.18);border-color:rgba(191,90,242,.2)}
.post-card .p-img{aspect-ratio:16/10;background:#eceef1 center/cover no-repeat;position:relative;overflow:hidden}
.post-card .p-img::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 60%,rgba(0,0,0,.4));opacity:0;transition:opacity .3s}
.post-card:hover .p-img::after{opacity:1}
.post-card .p-body{padding:22px 24px 26px;display:flex;flex-direction:column;gap:10px;flex:1}
.post-card .p-meta{font-size:12px;color:#86868b;display:flex;align-items:center;gap:8px}
.post-card .p-meta .dot{width:3px;height:3px;border-radius:50%;background:#86868b}
.post-card .p-title{font-size:18px;font-weight:600;line-height:1.3;letter-spacing:-.01em;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.post-card .p-ex{font-size:14px;line-height:1.55;color:#6e6e73;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;flex:1}
body.dark .post-card .p-ex{color:#a1a1a6}
.post-card .p-foot{margin-top:auto;font-size:13px;color:#bf5af2;font-weight:500;display:inline-flex;align-items:center;gap:4px}
.post-card .p-foot::after{content:"\203A";font-size:16px;transition:transform .25s}
.post-card:hover .p-foot::after{transform:translateX(3px)}

/* Skeleton card */
@keyframes shimmer{0%{background-position:-800px 0}100%{background-position:800px 0}}
@keyframes fadeUp{0%{opacity:0;transform:translateY(12px)}100%{opacity:1;transform:none}}
.sk{position:relative;overflow:hidden;background:#ececee;background-image:linear-gradient(90deg,#ececee 0,#f5f5f7 50%,#ececee 100%);background-size:800px 100%;animation:shimmer 1.4s infinite linear;border-radius:8px}
body.dark .sk{background:#2a2a2c;background-image:linear-gradient(90deg,#2a2a2c 0,#3a3a3c 50%,#2a2a2c 100%)}
.sk-card{background:#fff;border:1px solid rgba(0,0,0,.05);border-radius:22px;overflow:hidden}
body.dark .sk-card{background:#1c1c1e;border-color:rgba(255,255,255,.06)}
.sk-img{aspect-ratio:16/10;border-radius:0}
.sk-card .sk-pad{padding:22px 24px 26px;display:flex;flex-direction:column;gap:10px}
.sk-l{height:13px;border-radius:6px}
.sk-l.w1{width:30%}
.sk-l.w2{width:80%;height:18px}
.sk-l.w3{width:95%;height:11px}
.sk-l.w4{width:70%;height:11px}
.fade-in{animation:fadeUp .5s cubic-bezier(.22,.61,.36,1) both}

/* -------- Lataa lisää -------- */
.load-more-wrap{text-align:center;margin:48px 0 12px}
.load-more{padding:14px 28px;border-radius:999px;background:transparent;color:#1d1d1f;border:1.5px solid rgba(0,0,0,.12);cursor:pointer;font-size:14px;font-weight:600;font-family:inherit;transition:all .2s;display:inline-flex;align-items:center;gap:8px}
.load-more:hover{border-color:#bf5af2;color:#bf5af2;transform:translateY(-1px)}
.load-more:disabled{opacity:.5;cursor:not-allowed}
.load-more.loading::before{content:"";width:14px;height:14px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
body.dark .load-more{color:#f5f5f7;border-color:rgba(255,255,255,.15)}
body.dark .load-more:hover{border-color:#bf5af2;color:#bf5af2}

/* -------- Empty state -------- */
.empty{text-align:center;padding:80px 20px;max-width:480px;margin:0 auto}
.empty .ico{font-size:56px;margin-bottom:16px;opacity:.5}
.empty h3{font-size:22px;font-weight:600;margin-bottom:8px}
.empty p{color:#86868b;margin-bottom:24px;line-height:1.5}

/* -------- Sidebar / Popular posts strip -------- */
.popular-strip{padding:36px 32px;background:linear-gradient(135deg,rgba(191,90,242,.04),rgba(0,113,227,.04));border:1px solid rgba(191,90,242,.12);border-radius:24px;margin:48px 0}
body.dark .popular-strip{background:linear-gradient(135deg,rgba(191,90,242,.1),rgba(0,113,227,.1));border-color:rgba(191,90,242,.2)}
.popular-strip h3{font-size:18px;font-weight:700;margin-bottom:18px;letter-spacing:-.01em;display:flex;align-items:center;gap:10px}
.popular-list{display:flex;flex-direction:column;gap:2px;counter-reset:plist}
.popular-item{display:flex;gap:18px;padding:16px 0;border-bottom:1px solid rgba(0,0,0,.05);text-decoration:none;color:inherit;align-items:center;transition:all .2s}
body.dark .popular-item{border-bottom-color:rgba(255,255,255,.06)}
.popular-item:last-child{border-bottom:0}
.popular-item:hover{padding-left:8px}
.popular-item::before{counter-increment:plist;content:counter(plist,decimal-leading-zero);font-family:"SF Mono",Menlo,monospace;font-size:24px;font-weight:700;color:transparent;-webkit-text-stroke:1.5px #bf5af2;flex-shrink:0;width:42px}
.popular-item:hover::before{-webkit-text-stroke-color:#0071e3}
.popular-item .pp-title{font-size:15px;font-weight:500;line-height:1.4;flex:1}
.popular-item:hover .pp-title{color:#bf5af2}

/* -------- Scroll-top -------- */
.scroll-top{position:fixed;right:24px;bottom:24px;width:48px;height:48px;border-radius:50%;background:#fff;color:#1d1d1f;border:1px solid rgba(0,0,0,.08);cursor:pointer;display:none;align-items:center;justify-content:center;box-shadow:0 10px 24px -8px rgba(0,0,0,.18);z-index:89;transition:all .25s cubic-bezier(.22,.61,.36,1);opacity:0;transform:translateY(8px)}
.scroll-top.visible{display:flex;opacity:1;transform:none}
.scroll-top:hover{background:#bf5af2;color:#fff;border-color:#bf5af2;transform:translateY(-2px);box-shadow:0 14px 28px -8px rgba(191,90,242,.4)}
.scroll-top svg{width:18px;height:18px}
body.dark .scroll-top{background:#1c1c1e;color:#f5f5f7;border-color:rgba(255,255,255,.1)}
body.dark .scroll-top:hover{background:#bf5af2;border-color:#bf5af2}
@media(max-width:640px){.scroll-top{right:16px;bottom:16px}}

/* -------- Footer -------- */
footer.foot{padding:60px 0 40px;border-top:1px solid rgba(0,0,0,.06);margin-top:60px}
body.dark footer.foot{border-top-color:rgba(255,255,255,.08)}
.foot-grid{display:grid;grid-template-columns:1.5fr 1fr 1fr 1fr;gap:36px;margin-bottom:40px}
.foot-col h5{font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#86868b;margin-bottom:14px}
.foot-col a{display:block;padding:5px 0;font-size:14px;color:#515154;transition:color .2s}
body.dark .foot-col a{color:#a1a1a6}
.foot-col a:hover{color:#bf5af2}
.foot-col .desc{font-size:14px;color:#6e6e73;line-height:1.5}
body.dark .foot-col .desc{color:#a1a1a6}
.foot-bottom{padding-top:24px;border-top:1px solid rgba(0,0,0,.06);font-size:13px;color:#86868b;display:flex;justify-content:space-between;flex-wrap:wrap;gap:14px}
body.dark .foot-bottom{border-top-color:rgba(255,255,255,.08)}
@media(max-width:760px){.foot-grid{grid-template-columns:1fr 1fr;gap:24px}}
@media(max-width:480px){.foot-grid{grid-template-columns:1fr}}
