/* Mohamad G. Berry — one stylesheet for every page */
:root{
  --board:#17352E;--board-deep:#0E241E;--board-line:#2C4F46;
  --paper:#F1F3F2;--surface:#FFFFFF;--ink:#132330;--muted:#5B6B68;
  --rule:#D3DAD8;--rule-strong:#BCC8C5;--accent:#1F6F63;--accent-soft:#EDF3F1;
  --brass:#A8801A;--chalk:#E6EDE8;--chalk-dim:#A9BDB6;
  --wrap:74rem;--text:46rem;--radius:10px;
  --serif:"Newsreader",Georgia,serif;
  --sans:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:5rem}
body{margin:0;background:var(--paper);color:var(--ink);font:400 17px/1.6 var(--sans);-webkit-font-smoothing:antialiased}
img{max-width:100%;height:auto}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline;text-underline-offset:3px}
:focus-visible{outline:2px solid var(--brass);outline-offset:3px;border-radius:3px}
.wrap{max-width:var(--wrap);margin:0 auto;padding:0 clamp(1rem,4vw,3rem)}
.skip{position:absolute;left:-999px;top:0;background:var(--surface);padding:.6rem 1rem;z-index:200}
.skip:focus{left:1rem;top:1rem}

/* ---------- top bar ---------- */
.topbar{background:var(--board-deep);color:var(--chalk);position:sticky;top:0;z-index:60;border-bottom:1px solid var(--board-line)}
.home .topbar{position:relative}
.topbar .inner{display:flex;align-items:center;gap:1rem;min-height:3.6rem}
.mark{display:flex;align-items:center;gap:.6rem;color:var(--chalk);font-family:var(--serif);font-size:1.08rem;white-space:nowrap;flex:0 0 auto}
.mark:hover{text-decoration:none}
.mark b{display:grid;place-items:center;width:30px;height:30px;border-radius:6px;background:var(--chalk);color:var(--board);font:600 .78rem/1 var(--sans);letter-spacing:.02em}
.menu-btn{margin-left:auto;display:flex;align-items:center;gap:.45rem;background:none;border:1px solid var(--board-line);color:var(--chalk);border-radius:8px;padding:.45rem .8rem;font:inherit;font-size:.92rem;cursor:pointer}
.menu-btn svg{width:16px;height:16px;stroke:currentColor;stroke-width:2;fill:none}
.sitenav{display:none;position:absolute;left:0;right:0;top:100%;background:var(--board-deep);border-bottom:1px solid var(--board-line);padding:.5rem clamp(1rem,4vw,3rem) 1rem}
.sitenav.open{display:block}
.sitenav a{display:block;color:var(--chalk-dim);padding:.6rem .2rem;font-size:1rem;border-bottom:1px solid var(--board-line)}
.sitenav a:last-child{border-bottom:0}
.sitenav a:hover,.sitenav a[aria-current]{color:#fff;text-decoration:none}
@media(min-width:900px){
  .menu-btn{display:none}
  .sitenav{display:flex;position:static;margin-left:auto;padding:0;border:0;background:none;gap:.15rem}
  .sitenav a{border:0;padding:.45rem .7rem;border-radius:7px;font-size:.93rem}
  .sitenav a:hover{background:rgba(255,255,255,.07)}
  .sitenav a[aria-current]{background:rgba(255,255,255,.1)}
}

/* ---------- page header ---------- */
.pagehead{background:var(--board);color:var(--chalk);padding:clamp(2.2rem,5vw,3.4rem) 0 clamp(2rem,4.5vw,3rem);
  background-image:radial-gradient(120% 90% at 85% 0%,#1E463C 0%,var(--board) 55%,var(--board-deep) 100%)}
.crumbs{display:flex;flex-wrap:wrap;gap:.3rem .5rem;font-size:.88rem;color:var(--chalk-dim);margin:0 0 .9rem;padding:0;list-style:none}
.crumbs a{color:var(--chalk-dim)}
.crumbs a:hover{color:#fff}
.crumbs li+li::before{content:"›";margin-right:.5rem;opacity:.6}
.pagehead h1{font-family:var(--serif);font-weight:500;font-size:clamp(2.1rem,6vw,3.4rem);line-height:1.06;letter-spacing:-.015em;margin:0}
.pagehead .sub{margin:.8rem 0 0;color:#C3D3CC;font-size:1.05rem;max-width:40rem}
.stats{display:flex;flex-wrap:wrap;gap:.45rem;margin-top:1.1rem}
.stats span{border:1px solid #3E635A;border-radius:999px;padding:.22rem .75rem;font-size:.84rem;color:var(--chalk)}

/* ---------- page body ---------- */
main.page{padding:clamp(2.2rem,5vw,3.5rem) 0 clamp(3rem,6vw,4.5rem)}
.block{margin:0 0 2.6rem}
.block:last-child{margin-bottom:0}
.prose{max-width:var(--text)}
.prose p{margin:0 0 1rem}
.prose ul{margin:0 0 1rem;padding-left:1.2rem}
.prose li{margin:.25rem 0}
h2.sec{font-family:var(--serif);font-weight:500;font-size:clamp(1.45rem,3.2vw,1.85rem);line-height:1.2;margin:0 0 1rem;max-width:var(--text)}
.label{font-size:.78rem;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);margin:0 0 .8rem;font-weight:500}

/* section cards (child pages) */
.cards{display:grid;gap:.7rem;grid-template-columns:repeat(auto-fill,minmax(15.5rem,1fr))}
.card{display:flex;align-items:center;justify-content:space-between;gap:.8rem;background:var(--surface);border:1px solid var(--rule);border-radius:var(--radius);padding:.95rem 1.05rem;color:var(--ink);font-weight:500;line-height:1.35}
.card:hover{border-color:var(--accent);color:var(--accent);text-decoration:none}
.card small{display:block;font-weight:400;color:var(--muted);font-size:.84rem;margin-top:.15rem}
.card svg{flex:0 0 auto;width:16px;height:16px;stroke:currentColor;stroke-width:2;fill:none;opacity:.6}

/* link lists */
.links{display:grid;gap:.5rem;grid-template-columns:repeat(auto-fill,minmax(17rem,1fr))}
.links a{display:flex;align-items:center;justify-content:space-between;gap:.7rem;background:var(--surface);border:1px solid var(--rule);border-radius:9px;padding:.7rem .95rem;color:var(--ink);font-size:.97rem;line-height:1.35}
.links a:hover{border-color:var(--accent);color:var(--accent);text-decoration:none}
.links a .host{font-size:.78rem;color:var(--muted);white-space:nowrap}
.links a svg{flex:0 0 auto;width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;opacity:.55}

/* files */
.files{display:grid;gap:.55rem;grid-template-columns:repeat(auto-fill,minmax(19rem,1fr))}
.file{display:flex;align-items:center;gap:.85rem;background:var(--surface);border:1px solid var(--rule);border-radius:9px;padding:.7rem .9rem;color:var(--ink);min-width:0}
.file:hover{border-color:var(--accent);text-decoration:none}
.file:hover .fname{color:var(--accent)}
.badge{flex:0 0 auto;width:2.6rem;height:2.6rem;border-radius:7px;display:grid;place-items:center;font:600 .7rem/1 var(--sans);letter-spacing:.04em;color:#fff;background:#8A9997}
.badge.pdf{background:#B5442F}.badge.ppt{background:#C2662A}.badge.doc{background:#2F5FA8}.badge.xls{background:#2D7D4A}.badge.zip{background:#6B5A8E}.badge.img{background:#1F6F63}
.fmeta{min-width:0}
.fname{display:block;font-size:.95rem;line-height:1.3;overflow-wrap:anywhere}
.fsize{display:block;font-size:.8rem;color:var(--muted)}

/* videos */
.videos{display:grid;gap:1.1rem;grid-template-columns:repeat(auto-fill,minmax(19rem,1fr))}
figure.video{margin:0;min-width:0}
.yt{position:relative;display:block;width:100%;aspect-ratio:16/9;border:0;padding:0;border-radius:9px;overflow:hidden;background:#0E241E;cursor:pointer}
.yt img{width:100%;height:100%;object-fit:cover;display:block;opacity:.92;transition:opacity .15s}
.yt:hover img{opacity:1}
.yt .play{position:absolute;inset:0;margin:auto;width:62px;height:44px;border-radius:12px;background:rgba(14,36,30,.82);display:grid;place-items:center}
.yt:hover .play{background:#B5442F}
.yt .play::after{content:"";border-left:16px solid #fff;border-top:10px solid transparent;border-bottom:10px solid transparent;margin-left:4px}
.yt iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.video figcaption{font-size:.92rem;color:var(--ink);margin-top:.5rem;line-height:1.4}
.video figcaption a{color:var(--muted);font-size:.82rem;margin-left:.3rem}

/* figures */
.figure{margin:0 0 2.6rem;max-width:var(--text)}
.figure img{max-height:75vh;width:auto;border-radius:9px;border:1px solid var(--rule);background:var(--surface)}
.figure figcaption{font-size:.88rem;color:var(--muted);margin-top:.4rem}

/* more in this section */
.siblings{border-top:1px solid var(--rule);margin-top:3.2rem;padding-top:2rem}
.pills{display:flex;flex-wrap:wrap;gap:.45rem}
.pills a{font-size:.9rem;padding:.42rem .85rem;border:1px solid var(--rule);border-radius:999px;color:var(--ink);background:var(--surface)}
.pills a:hover{border-color:var(--accent);color:var(--accent);text-decoration:none}
.pills a[aria-current]{background:var(--board);border-color:var(--board);color:var(--chalk)}

/* ---------- homepage ---------- */
.hero{background:var(--board);color:var(--chalk);padding:clamp(3.2rem,8vw,6rem) 0 clamp(3rem,7vw,4.5rem);
  background-image:radial-gradient(120% 80% at 80% 0%,#1E463C 0%,var(--board) 55%,var(--board-deep) 100%)}
.hero h1{font-family:var(--serif);font-weight:500;font-size:clamp(2.9rem,8.5vw,5.1rem);line-height:1.02;letter-spacing:-.018em;margin:0 0 1.1rem}
.hero .lede{font-size:clamp(1.05rem,2.3vw,1.28rem);line-height:1.5;color:#C3D3CC;max-width:38rem;margin:0 0 2.2rem}
.epigraph{font-family:var(--serif);font-size:1.05rem;font-style:italic;color:#9DB3AB;border-left:2px solid #3C6157;padding-left:1rem;margin:0 0 2.4rem;max-width:32rem}
.contact-row{display:flex;flex-wrap:wrap;gap:.55rem}
.chip{display:inline-flex;align-items:center;gap:.45rem;border:1px solid #3E635A;border-radius:999px;padding:.46rem 1rem;font-size:.94rem;color:var(--chalk);background:rgba(255,255,255,.035)}
.chip:hover{background:rgba(255,255,255,.1);text-decoration:none;border-color:#6E938A}
.chip svg{width:15px;height:15px;fill:currentColor;opacity:.85}
.searchbar{position:sticky;top:0;z-index:50;background:rgba(241,243,242,.94);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--rule)}
.searchbar .inner{display:flex;align-items:center;gap:1rem;padding-top:.7rem;padding-bottom:.7rem}
.field{position:relative;flex:1 1 auto;min-width:0}
.field svg{position:absolute;left:.8rem;top:50%;transform:translateY(-50%);width:16px;height:16px;fill:none;stroke:var(--muted);stroke-width:2}
#q{width:100%;font:inherit;font-size:1rem;color:var(--ink);background:var(--surface);border:1px solid var(--rule);border-radius:9px;padding:.62rem .9rem .62rem 2.35rem}
#q::placeholder{color:#8A9997}
#q:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 3px rgba(31,111,99,.15)}
.tally{flex:0 0 auto;font-size:.86rem;color:var(--muted);white-space:nowrap;display:none}
@media(min-width:760px){.tally{display:block}}
section.band{padding:clamp(3rem,6vw,4.75rem) 0}
section.band+section.band{border-top:1px solid var(--rule)}
.head{max-width:var(--text);margin-bottom:2.2rem}
.head h2{font-family:var(--serif);font-weight:500;font-size:clamp(1.85rem,4vw,2.5rem);line-height:1.15;letter-spacing:-.01em;margin:0 0 .55rem}
.head p{margin:0;color:var(--muted);font-size:1.02rem;line-height:1.55}

/* ventures */
.ventures{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(21rem,1fr))}
.venture{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--rule);border-radius:12px;overflow:hidden}
.venture .shot{display:block;aspect-ratio:16/10;background:#DFE5E3;overflow:hidden;border-bottom:1px solid var(--rule)}
.venture .shot img{width:100%;height:100%;object-fit:cover;object-position:top;display:block;transition:transform .3s ease}
.venture .shot:hover img{transform:scale(1.02)}
.venture .body{padding:1.05rem 1.15rem 1.15rem;display:flex;flex-direction:column;gap:.45rem;flex:1}
.venture .kind{font-size:.76rem;letter-spacing:.07em;text-transform:uppercase;color:var(--brass);font-weight:600}
.venture h3{font-family:var(--serif);font-weight:500;font-size:1.42rem;margin:0;line-height:1.2}
.venture h3 a{color:var(--ink)}
.venture h3 a:hover{color:var(--accent);text-decoration:none}
.venture p{margin:0;color:var(--muted);font-size:.96rem}
.venture .site{font-size:.88rem;font-weight:500;margin-top:auto;padding-top:.35rem}
.where{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.35rem}
.where a{font-size:.8rem;line-height:1;padding:.4rem .62rem;border:1px solid var(--rule);border-radius:999px;color:var(--ink);background:var(--paper)}
.where a:hover{border-color:var(--accent);color:var(--accent);text-decoration:none}
.venture.wide{grid-column:1/-1}

/* link groups */
.groups{display:grid;gap:.6rem}
@media(min-width:900px){.groups{grid-template-columns:1fr 1fr;gap:.6rem 1.6rem;align-items:start}}
details.group{background:var(--surface);border:1px solid var(--rule);border-radius:var(--radius);overflow:hidden}
details.group[open]{border-color:var(--rule-strong)}
@media(min-width:900px){details.group[open]{grid-column:1/-1}}
details.group summary{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.85rem 1.05rem;cursor:pointer;list-style:none;font-weight:500;font-size:1.02rem}
details.group summary::-webkit-details-marker{display:none}
details.group summary:hover{background:#F7F9F8}
.count{font-size:.82rem;color:var(--muted);font-variant-numeric:tabular-nums;display:flex;align-items:center;gap:.55rem;flex:0 0 auto}
.count svg{width:11px;height:11px;stroke:var(--muted);stroke-width:2.2;fill:none;transition:transform .18s ease}
details[open] .count svg{transform:rotate(180deg)}
.group ul{list-style:none;margin:0;padding:.15rem .5rem .75rem;columns:17rem;column-gap:1rem}
.group li{break-inside:avoid}
.group li a{display:block;padding:.38rem .55rem;border-radius:6px;font-size:.96rem;color:var(--ink);line-height:1.4}
.group li a:hover{background:var(--accent-soft);color:var(--accent);text-decoration:none}
mark{background:#F6E7B4;color:inherit;border-radius:2px;padding:0 .1em}
.empty{max-width:var(--text);padding:1.6rem 0;color:var(--muted)}

/* gallery */
.gallery{columns:2;column-gap:.7rem}
@media(min-width:640px){.gallery{columns:3;column-gap:.85rem}}
@media(min-width:1000px){.gallery{columns:4;column-gap:.9rem}}
.gallery button{display:block;width:100%;padding:0;margin:0 0 .85rem;border:0;background:#DFE5E3;border-radius:8px;overflow:hidden;cursor:zoom-in;break-inside:avoid;line-height:0}
.gallery img{width:100%;height:auto;display:block}
.gallery button:hover img{opacity:.88}
.more{margin-top:1.4rem;font:inherit;font-size:.96rem;font-weight:500;background:var(--surface);color:var(--ink);border:1px solid var(--rule);border-radius:999px;padding:.6rem 1.5rem;cursor:pointer;display:inline-block}
.more:hover{border-color:var(--accent);color:var(--accent);text-decoration:none}

/* lightbox */
.lb{position:fixed;inset:0;z-index:300;display:none;background:#08140F;touch-action:pan-y}
.lb.on{display:block}
.lb .stage{position:absolute;inset:3.75rem .5rem 3.25rem;display:flex;align-items:center;justify-content:center}
.lb img{max-width:100%;max-height:100%;border-radius:4px;object-fit:contain;user-select:none;-webkit-user-drag:none}
.lb .bar{position:absolute;top:0;left:0;right:0;height:3.75rem;display:flex;align-items:center;justify-content:space-between;padding:0 .75rem 0 1.1rem;z-index:3;color:#A9BDB6;font-size:.88rem;font-variant-numeric:tabular-nums}
.lb .close{display:flex;align-items:center;gap:.4rem;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:#fff;border-radius:999px;padding:.5rem .95rem;font:500 .92rem/1 var(--sans);cursor:pointer}
.lb .close:hover{background:rgba(255,255,255,.18)}
.lb .close svg{width:15px;height:15px;stroke:currentColor;stroke-width:2.4;fill:none}
.lb .nav{position:absolute;top:50%;transform:translateY(-50%);z-index:2;width:3rem;height:3rem;border-radius:50%;border:1px solid rgba(255,255,255,.22);background:rgba(14,36,30,.6);color:#fff;font-size:1.6rem;line-height:1;cursor:pointer;display:grid;place-items:center}
.lb .nav:hover{background:rgba(255,255,255,.16)}
.lb .prev{left:.75rem}.lb .next{right:.75rem}
.lb .foot{position:absolute;bottom:0;left:0;right:0;height:3.25rem;display:flex;align-items:center;justify-content:center;gap:1rem;font-size:.85rem}
.lb .foot a{color:#CFE0D9}

/* forms */
.form{display:grid;gap:1rem;max-width:34rem}
.form label{display:grid;gap:.35rem;font-weight:500;font-size:.95rem}
.form input,.form textarea{font:inherit;font-size:1rem;color:var(--ink);background:var(--surface);border:1px solid var(--rule);border-radius:9px;padding:.7rem .85rem;width:100%}
.form textarea{min-height:9rem;resize:vertical}
.form input:focus,.form textarea:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 3px rgba(31,111,99,.15)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;font:500 1rem/1 var(--sans);background:var(--board);color:var(--chalk);border:0;border-radius:999px;padding:.85rem 1.6rem;cursor:pointer;justify-self:start}
.btn:hover{background:var(--accent);text-decoration:none;color:#fff}
.contact-grid{display:grid;gap:2.5rem}
@media(min-width:860px){.contact-grid{grid-template-columns:1fr 1.15fr}}
.dl{display:grid;gap:1.1rem;margin:0}
.dl dt{font-size:.78rem;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:500}
.dl dd{margin:.15rem 0 0;font-size:1.08rem}
.note{background:var(--surface);border:1px solid var(--rule);border-left:3px solid var(--brass);border-radius:8px;padding:.9rem 1.1rem;max-width:var(--text);color:var(--muted);font-size:.95rem}

/* resume */
.resume{display:grid;gap:2rem;max-width:var(--text)}
.resume h2{font-family:var(--serif);font-weight:500;font-size:1.4rem;margin:0 0 .5rem;padding-bottom:.4rem;border-bottom:1px solid var(--rule)}
.resume p{margin:0 0 .5rem}
.resume .role{font-weight:600}
.resume .when{color:var(--muted);font-size:.92rem}

/* blog */
.post-list{display:grid;gap:1rem;max-width:var(--text)}
.post-card{display:block;background:var(--surface);border:1px solid var(--rule);border-radius:12px;padding:1.3rem 1.4rem;color:var(--ink)}
.post-card:hover{border-color:var(--accent);text-decoration:none}
.post-card time{font-size:.85rem;color:var(--muted)}
.post-card h2{font-family:var(--serif);font-weight:500;font-size:1.5rem;margin:.25rem 0 .5rem;line-height:1.2}
.post-card p{margin:0;color:var(--muted)}
.article{max-width:40rem;font-size:1.08rem;line-height:1.75}
.article p{margin:0 0 1.2rem}

/* ---------- footer ---------- */
footer.site{background:var(--board);color:var(--chalk-dim);padding:clamp(2.75rem,6vw,4rem) 0 2.5rem}
footer.site h2{font-family:var(--serif);font-weight:500;color:var(--chalk);font-size:clamp(1.6rem,3.5vw,2.1rem);margin:0 0 1.2rem}
footer.site a{color:var(--chalk)}
.foot-grid{display:grid;gap:2rem;margin-bottom:2.5rem}
@media(min-width:760px){.foot-grid{grid-template-columns:1.1fr 1fr 1fr 1fr}}
.foot-grid h4{margin:0 0 .7rem;font-size:.95rem;font-weight:600;color:var(--chalk)}
.foot-grid ul{list-style:none;margin:0;padding:0;display:grid;gap:.4rem;font-size:.95rem}
.fine{border-top:1px solid var(--board-line);padding-top:1.5rem;font-size:.85rem;display:flex;flex-wrap:wrap;gap:.4rem 1.5rem;justify-content:space-between}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
