﻿:root{--ink:#33333b;--muted:#6b6f7b;--line:#e3e5ea;--bg:#f3f0ec;--card:#fff;--red:#e5322d;--blue:#2f6df6;--green:#18a661;--orange:#f08a1c;--purple:#7a4cf0}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.55 Inter,"Noto Sans Sinhala","Noto Sans Tamil",system-ui,sans-serif}
.wrap{max-width:1100px;margin:0 auto;padding:0 16px}
.narrow{max-width:900px}
[hidden]{display:none!important}
.top{background:#fff;border-bottom:1px solid var(--line)}
.bar{display:flex;align-items:center;justify-content:space-between;height:64px}
.brand{display:flex;align-items:center;gap:8px;font-size:1.35rem;font-weight:600;color:var(--ink);text-decoration:none}
.brand b{color:var(--red)}
.logo{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:var(--red);color:#fff;font-weight:800}
nav a{color:var(--ink);text-decoration:none;font-weight:600}
.hero{text-align:center;padding:48px 0 28px}
.hero h1{font-size:clamp(1.7rem,4.5vw,2.6rem);line-height:1.2;margin:0 0 12px;font-weight:800}
.hero p{margin:0 auto;color:var(--muted);max-width:56ch;font-size:1.1rem}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px;padding-bottom:48px}
.card{display:block;background:var(--card);border-radius:12px;padding:24px 20px;text-decoration:none;color:var(--ink);border:1px solid transparent;transition:.15s;position:relative}
.card:hover{box-shadow:0 8px 24px rgba(0,0,0,.1);transform:translateY(-2px)}
.card .ic{display:grid;place-items:center;width:52px;height:52px;border-radius:12px;color:#fff;font-size:1.5rem;font-weight:700;margin-bottom:14px;background:var(--c)}
.card h3{margin:0 0 4px;font-size:1.1rem}
.card p{margin:0;color:var(--muted);font-size:.92rem}
.card.soon{opacity:.55;pointer-events:none}
.card .tag{position:absolute;top:14px;right:14px;background:#eee;color:var(--muted);font-size:.7rem;font-weight:700;padding:2px 8px;border-radius:99px}
.back{display:inline-block;margin:20px 0 0;color:var(--muted);text-decoration:none;font-weight:600}
h1{font-size:clamp(1.6rem,4vw,2.2rem);margin:10px 0 6px;text-align:center;font-weight:800}
.sub{text-align:center;color:var(--muted);margin:0 0 24px}
.io{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.pane-head{display:flex;justify-content:space-between;align-items:center;font-weight:600;font-size:.9rem;margin-bottom:6px}
.link{border:0;background:none;color:var(--blue);font:inherit;font-weight:600;cursor:pointer}
textarea{width:100%;min-height:300px;resize:vertical;font-family:inherit;font-size:1.15rem;line-height:1.6;color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px}
textarea:focus,select:focus{outline:2px solid var(--blue);outline-offset:1px}
.center{text-align:center;margin:20px 0}
.big{border:0;background:var(--red);color:#fff;font:inherit;font-size:1.1rem;font-weight:700;padding:14px 34px;border-radius:10px;cursor:pointer;margin:4px}
.big:hover{filter:brightness(.93)}
.big:disabled{opacity:.4;cursor:not-allowed}
.big.small{font-size:.95rem;padding:9px 18px}
.big.ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}
.warn{background:#fff4d6;color:#8a5a00;border-radius:8px;padding:10px 14px;margin:12px 0 0;font-size:.9rem}
.hint{color:var(--muted);font-size:.85rem;text-align:center;max-width:70ch;margin:8px auto 40px}
.drop{background:#fff;border:2px dashed #c9ccd4;border-radius:14px;padding:40px 16px;text-align:center;cursor:pointer;min-height:240px;display:grid;place-items:center}
.drop.over{border-color:var(--red);background:#fff6f5}
.drop .up{font-size:2.2rem;color:var(--red)}
.drop p{color:var(--muted);margin:8px 0 0}
.drop img{max-width:100%;max-height:340px;border-radius:8px}
kbd{border:1px solid var(--line);border-bottom-width:2px;border-radius:5px;padding:0 5px;font-size:.8rem;background:#fafafa}
.langrow{display:flex;align-items:flex-end;justify-content:center;gap:16px;flex-wrap:wrap;margin:22px 0 8px}
.langrow label{display:flex;flex-direction:column;font-size:.85rem;font-weight:600;gap:4px}
select{font:inherit;padding:12px;border:1px solid var(--line);border-radius:10px;background:#fff;min-width:240px}
progress{display:block;margin:12px auto;width:min(360px,90%);accent-color:var(--red)}
.badge{margin-left:8px;background:#e6f6ee;color:var(--green);font-size:.75rem;padding:2px 9px;border-radius:99px}
.foot{text-align:center;color:var(--muted);font-size:.85rem;padding:24px 16px 40px}
/* ad slots: fixed heights so the page never jumps when ads load */
.ad{display:grid;place-items:center;background:repeating-linear-gradient(45deg,#ece8e3,#ece8e3 8px,#f3f0ec 8px,#f3f0ec 16px);border:1px dashed #c9ccd4;border-radius:8px;color:#8b8f9a;font-size:.8rem;text-align:center;overflow:hidden}
.ad small{display:block;opacity:.7}
.ad-wide{width:100%;max-width:728px;height:90px;margin:24px auto}
.ad-side{display:none;position:fixed;top:100px;width:160px;height:600px}
.ad-side.left{left:calc(50% - 450px - 180px)}
.ad-side.right{right:calc(50% - 450px - 180px)}
@media(min-width:1260px){body[data-view="tool"] .ad-side{display:grid}}
@media(max-width:720px){.ad-wide{max-width:320px;height:100px}}
@media(max-width:720px){.io{grid-template-columns:1fr}}

/* fit tool pages in one screen: no scrolling needed to reach the buttons and both ads */
#tool .ad-wide,#ocr .ad-wide{margin:10px auto;height:70px}
#tool h1,#ocr h1{margin:4px 0 2px;font-size:1.6rem}
#tool .sub,#ocr .sub{margin:0 0 6px}
#tool .back,#ocr .back{margin-top:10px}
#tool textarea{min-height:140px;height:calc(100vh - 500px)}
.center{margin:12px 0}
.ocrgrid{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
.ocrgrid .drop{min-height:140px;height:calc(100vh - 500px);padding:12px}
.ocrgrid .drop img{max-height:calc(100vh - 530px);min-height:100px;object-fit:contain}
.ocrgrid textarea{min-height:140px;height:calc(100vh - 450px)}
#result.empty .acts{opacity:.4;pointer-events:none}
#result.empty .badge{display:none}
@media(max-width:720px){.ocrgrid{grid-template-columns:1fr}#tool textarea,.ocrgrid textarea,.ocrgrid .drop{height:220px}.ocrgrid .drop img{max-height:200px}}
.ocrgrid .drop{min-height:210px}
.ocrgrid textarea{min-height:210px}

/* branding + calmer ads (one slim slot per tool page) */
.logo{background:none;width:36px;height:36px;border-radius:9px;display:block}
.wordmark{font-weight:700;letter-spacing:-.01em}
.ad-side{display:none}
.ad{background:none;border:1px dashed #d6d9e0;color:#a3a7b1;font-size:.7rem}
.ad small{display:none}
.ad-wide{height:60px;max-width:728px;margin:14px auto}
#tool textarea{height:calc(100vh - 430px)}
.ocrgrid textarea{height:calc(100vh - 380px)}
.ocrgrid .drop{height:calc(100vh - 430px)}

.card .ic svg{display:block}

/* footer */
.site-foot{background:#1f2230;color:#c9ccd6;margin-top:40px;padding:44px 0 0}
.site-foot a{color:#c9ccd6;text-decoration:none;display:block;padding:3px 0;font-size:.92rem}
.site-foot a:hover{color:#fff}
.site-foot h4{color:#fff;margin:0 0 10px;font-size:.85rem;letter-spacing:.06em;text-transform:uppercase}
.site-foot .brand{color:#fff;padding:0}
.fgrid{display:grid;grid-template-columns:1.6fr 1fr 1fr 1fr;gap:28px}
.fbrand p{margin:10px 0 0;font-size:.9rem;max-width:34ch;color:#9ea3b3}
.fbottom{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:34px;padding:16px;border-top:1px solid #343848;font-size:.82rem;color:#9ea3b3}
@media(max-width:720px){.fgrid{grid-template-columns:1fr 1fr}.fbrand{grid-column:1/-1}}
/* blog + pages */
.posts{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px;margin:8px 0 40px}
.post-card{background:#fff;border-radius:12px;padding:20px;text-decoration:none;color:var(--ink);display:block;transition:.15s}
.post-card:hover{box-shadow:0 8px 24px rgba(0,0,0,.1);transform:translateY(-2px)}
.post-card h2{font-size:1.1rem;margin:6px 0}
.post-card p{margin:0 0 10px;color:var(--muted);font-size:.92rem}
.post-card .more{color:var(--red);font-weight:600;font-size:.9rem}
.date{color:var(--muted);font-size:.8rem}
.article{background:#fff;border-radius:12px;padding:28px;margin:16px 0 40px;line-height:1.7}
.article h1{text-align:left;font-size:1.8rem;margin:6px 0 14px}
.article h2{font-size:1.2rem;margin:22px 0 6px}
.article a{color:var(--blue)}
.article code{background:#f1f2f6;padding:1px 6px;border-radius:5px}
#page .back+h1{margin-top:6px}


/* right-side ad: only where there is spare room beside the content */
.ad-side.right{left:auto;right:calc(50% - 450px - 190px);top:96px;width:160px;height:600px}
@media(min-width:1300px){body[data-view="tool"] .ad-side.right,body[data-view="page"] .ad-side.right{display:grid}}

/* ads are invisible (no box, no space) until enabled; preview with ?ads=1 */
body:not(.ads-on) .ad{display:none!important}
/* footer only on the home page */
body:not([data-view="home"]) .site-foot{display:none}

.badge:empty{display:none}
.back::before{content:"\2190\00a0"}

