:root{
  --bg:#FAFAF8; --surface:#F1F0EC; --ink:#1D2028; --muted:#5F636B; --line:#DFDED8;
  --brick:#8E2B23; --brick-soft:#F3E4E1;
  --head:"Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body:"Source Serif 4", Georgia, "Times New Roman", serif;
  color-scheme: light;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#16181C; --surface:#1F2227; --ink:#ECECE8; --muted:#A3A6AC; --line:#2F3238;
    --brick:#E48A7E; --brick-soft:#3A2522; color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --bg:#16181C; --surface:#1F2227; --ink:#ECECE8; --muted:#A3A6AC; --line:#2F3238;
  --brick:#E48A7E; --brick-soft:#3A2522; color-scheme: dark;
}
*,*::before,*::after{box-sizing:inherit}
html{scroll-behavior:smooth; scroll-padding-top:calc(env(safe-area-inset-top,0px) + 72px)}
@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--body);font-size:1.0625rem;line-height:1.7;-webkit-font-smoothing:antialiased}
img{max-width:100%;display:block}
a{color:inherit}
:focus-visible{outline:2px solid var(--brick);outline-offset:3px;border-radius:4px}
.wrap{width:min(1080px,100% - 2.5rem);margin-inline:auto}
h1,h2,h3{font-family:var(--head);line-height:1.1;margin:0;font-weight:700;letter-spacing:-0.02em}

/* header */
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:10;background:var(--bg)}
header.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:9;background:color-mix(in srgb,var(--bg) 92%,transparent);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
header.top .wrap{display:flex;align-items:center;justify-content:space-between;height:64px;gap:1rem}
.brand{font-family:var(--head);font-weight:600;text-decoration:none;font-size:1.05rem;display:flex;align-items:center;gap:.7rem;flex-shrink:0;margin-right:auto}
.brand img{height:26px;width:auto}
/* theme toggle */
.theme-toggle{flex-shrink:0;width:38px;height:38px;display:grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--ink);cursor:pointer;transition:border-color .2s,color .2s}
.theme-toggle:hover{border-color:var(--brick);color:var(--brick)}
.theme-toggle svg{width:18px;height:18px}
/* logo artwork: UNP mark is black, badge is white; flip each to match the theme.
   Light: dark logo + moon icon. Dark: white logo + sun icon. */
.badge{filter:brightness(0);opacity:.9}
.theme-toggle .icon-sun{display:none}
@media (prefers-color-scheme: dark){
  :root[data-theme="light"] .brand img{filter:invert(1)}
  :root:not([data-theme="light"]) .badge{filter:none;opacity:1}
  :root:not([data-theme="light"]) .theme-toggle .icon-sun{display:block}
  :root:not([data-theme="light"]) .theme-toggle .icon-moon{display:none}
}
:root[data-theme="dark"] .brand img{filter:invert(0)}
:root[data-theme="dark"] .badge{filter:none;opacity:1}
:root[data-theme="dark"] .theme-toggle .icon-sun{display:block}
:root[data-theme="dark"] .theme-toggle .icon-moon{display:none}
nav ul{list-style:none;display:flex;gap:1.5rem;margin:0;padding:0;font-family:var(--head);font-size:.95rem}
nav a{text-decoration:none;color:var(--muted)}
nav a:hover{color:var(--ink)}
@media (max-width:600px){nav ul{gap:.85rem;font-size:.88rem} .brand span{display:none} .brand img{height:22px} header.top .wrap{gap:.75rem} .theme-toggle{width:34px;height:34px}}
@media (max-width:420px){nav ul{gap:.6rem;font-size:.82rem} .brand img{height:20px} header.top .wrap{gap:.6rem}}
@media (max-width:359px){.brand{display:none} header.top .wrap{justify-content:center}}

/* hero */
.hero{padding:clamp(3rem,8vw,6.5rem) 0 clamp(3rem,7vw,5rem)}
.hero .wrap{display:grid;grid-template-columns:1.25fr 1fr;gap:clamp(2rem,5vw,4.5rem);align-items:end}
.hero h1{font-size:clamp(3.2rem,9vw,6.6rem);letter-spacing:-0.04em;line-height:.92}
.hero h1 span{display:block}
.hero h1 .last{color:var(--brick)}
.role{font-family:var(--head);font-size:clamp(1.05rem,1.8vw,1.25rem);color:var(--muted);margin:1.6rem 0 0;max-width:34ch;line-height:1.45}
blockquote{margin:2.2rem 0 0;padding:0 0 0 1.2rem;border-left:3px solid var(--brick);font-style:italic;font-size:1.15rem;max-width:40ch;line-height:1.6}
.portrait{margin:0;position:relative;justify-self:end;width:100%;max-width:400px}
.portrait img{width:100%;aspect-ratio:4/5;object-fit:cover;object-position:50% 20%;border-radius:2px}
.portrait figcaption{font-family:var(--head);font-size:.82rem;color:var(--muted);margin-top:.6rem}
.social{display:flex;gap:.6rem;margin-top:2rem;flex-wrap:wrap}
.social a{width:42px;height:42px;border:1px solid var(--line);border-radius:50%;display:grid;place-items:center;color:var(--ink);transition:border-color .2s,color .2s}
.social a:hover{border-color:var(--brick);color:var(--brick)}
.social svg{width:18px;height:18px}
@media (max-width:820px){
  .hero .wrap{grid-template-columns:1fr}
  .portrait{justify-self:start;max-width:320px;order:-1}
}

/* sections */
section.block{padding:clamp(3.5rem,8vw,6rem) 0;border-top:1px solid var(--line)}
.split{display:grid;grid-template-columns:220px 1fr;gap:clamp(1.5rem,5vw,4rem)}
@media (max-width:760px){.split{grid-template-columns:1fr}}
.split > h2{font-size:clamp(1.6rem,3vw,2rem);position:sticky;top:96px;align-self:start}
@media (max-width:760px){.split > h2{position:static}}
.prose{max-width:64ch}
.prose p{margin:0 0 1.2em}
.prose strong{font-weight:600}

/* experience */
.timeline{list-style:none;margin:0;padding:0;max-width:68ch}
.timeline li{display:grid;grid-template-columns:150px 1fr;gap:1.5rem;padding:1.6rem 0;border-bottom:1px solid var(--line)}
.timeline li:first-child{padding-top:0}
.timeline li:last-child{border-bottom:0}
.when{font-family:var(--head);font-size:.9rem;color:var(--muted);padding-top:.2rem}
.timeline h3{font-size:1.2rem;font-weight:600;letter-spacing:-0.01em}
.timeline .org{color:var(--brick);font-family:var(--head);font-size:1rem;margin:.2rem 0 .6rem}
.timeline p.desc{margin:0;color:var(--muted)}
@media (max-width:560px){.timeline li{grid-template-columns:1fr;gap:.3rem}}
h3.sub{font-size:1.05rem;color:var(--muted);font-weight:600;margin:3rem 0 1.2rem}

/* beyond */
.beyond{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2rem 3rem;max-width:68ch}
.beyond h3{font-size:1.1rem;font-weight:600;margin-bottom:.35rem}
.beyond p{margin:0;color:var(--muted)}
@media (max-width:560px){.beyond{grid-template-columns:1fr}}

/* gallery */
.gallery-head{display:flex;justify-content:space-between;align-items:end;gap:1rem;flex-wrap:wrap;margin-bottom:2rem}
.gallery-head h2{font-size:clamp(1.6rem,3vw,2rem)}
.gallery-head p{margin:0;color:var(--muted);max-width:44ch}
.grid{display:grid;grid-template-columns:1.6fr 1fr;grid-template-rows:auto auto;gap:1rem}
.grid figure{margin:0}
.grid button{all:unset;cursor:zoom-in;display:block;width:100%;overflow:hidden;border-radius:2px}
.grid button:focus-visible{outline:2px solid var(--brick);outline-offset:3px}
.grid img{width:100%;height:100%;object-fit:cover}
.grid .big{grid-row:span 2}
.grid .big{display:flex;flex-direction:column}.grid .big button{flex:1;position:relative;min-height:320px}.grid .big img{position:absolute;inset:0}
.grid figcaption{font-family:var(--head);font-size:.85rem;color:var(--muted);margin-top:.5rem;height:1.5rem}
.grid .small button{aspect-ratio:4/3}
@media (max-width:680px){.grid{grid-template-columns:1fr}.grid .big{grid-row:auto}.grid .big button{flex:none;min-height:0;aspect-ratio:4/3}}
dialog{border:0;padding:0;background:transparent;max-width:min(96vw,1100px)}
dialog::backdrop{background:rgba(10,10,12,.85)}
dialog img{max-height:86vh;width:auto;margin:auto}
dialog p{color:#eee;font-family:var(--head);text-align:center;margin:.8rem 0 0;font-size:.9rem}
dialog .close{position:fixed;top:calc(env(safe-area-inset-top,0px) + 1rem);right:1rem;background:#fff;color:#111;border:0;border-radius:50%;width:40px;height:40px;font-size:1.3rem;cursor:pointer}

/* contact */
.contact{text-align:left}
.contact .wrap{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:clamp(2rem,6vw,5rem);align-items:center}
.contact .badge{width:clamp(150px,17vw,190px);height:auto}
@media (max-width:760px){.contact .wrap{grid-template-columns:1fr}.contact .badge{width:120px}}
.contact h2{font-size:clamp(2rem,5vw,3.4rem);letter-spacing:-0.03em;max-width:16ch}
.contact .mail{display:inline-block;margin-top:1.5rem;font-family:var(--head);font-size:clamp(1.1rem,2.6vw,1.6rem);color:var(--brick);text-decoration:none;border-bottom:2px solid currentColor;word-break:break-all}
.contact p{color:var(--muted);max-width:50ch}
footer{padding:2rem 0 2.5rem;border-top:1px solid var(--line);font-family:var(--head);font-size:.85rem;color:var(--muted)}
footer .wrap{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap}
