:root{--idx-w:260px;--sh:420px;--pad:48px}
.idx{position:fixed;inset:0 auto 0 0;width:var(--idx-w);border-right:1px solid var(--line);padding:28px 22px 22px;display:flex;flex-direction:column;background:var(--page);z-index:5;overflow-y:auto}
.who{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--text);min-height:44px}
.who img{width:44px;height:44px;border-radius:4px;object-fit:cover;object-position:50% 30%;flex:none}
.who strong{display:block;font-size:15px;line-height:1.25}
.role{display:block;font-size:12.5px;line-height:1.4;color:var(--sec)}
.menu{margin-top:30px}
.menu a{display:flex;align-items:center;min-height:44px;padding:0 0 0 14px;color:var(--sec);text-decoration:none;font-size:18px;border-left:2px solid transparent;transition:color .15s}
.menu a:hover{color:var(--text)}
.menu a[aria-current]{color:var(--text);border-left-color:var(--sig)}
.menu .subs{margin:2px 0 6px 14px;border-left:1px solid var(--line)}
.menu .subs a{font-size:15px;min-height:44px;padding-left:12px;border-left:0;justify-content:flex-start;gap:8px}
.menu .subs a[aria-current]{box-shadow:inset 2px 0 var(--sig);margin-left:-1px}
.menu .m-projects>a[aria-current]{border-left-color:var(--sig)}
[data-section=projects] .m-projects>a{color:var(--text)}
.tg{font-size:12px;color:var(--dim)}
.ext{margin-top:auto;display:flex;flex-wrap:wrap;gap:0 4px}
.ext a{display:inline-flex;align-items:center;min-height:44px;padding:0 6px;font-size:13.5px;color:var(--sec);text-decoration:none}
.ext a:hover{color:var(--text)}
.ext li:first-child a{padding-left:0}

main{margin-left:var(--idx-w)}
/* one scroll surface: the page. No view, panel or widget scrolls on its own (27 Nov, interactive pass) */
.view{min-height:100vh}
.view[hidden]{display:none}
.vin{min-height:100vh;padding:36px var(--pad) 28px;display:flex;flex-direction:column}
.vh{font-size:clamp(34px,3.6vw,48px);margin:8px 0 22px}
.ph1{font-size:clamp(26px,2.8vw,38px);max-width:30ch;margin:6px 0 10px;letter-spacing:-.015em}
.proj .ph1{max-width:40ch;font-size:clamp(26px,2.5vw,34px);line-height:1.25}
.lead{font-size:clamp(17px,1.5vw,20px);line-height:1.5;color:var(--text);max-width:62ch}
.crumb{font-size:14px;color:var(--sec)}
.crumb a{color:var(--sec)}

/* about */
.about-in{display:flex;flex-direction:column;padding-top:32px}
.about-text{margin:auto 0;width:100%;max-width:1440px;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);column-gap:64px;align-items:start}
.about-text>.name-big,.about-text>.roleline{grid-column:1/-1}
.about-text>.lead,.about-text>.body{grid-column:1}
.about-text>.now{grid-column:2;grid-row:3/span 2;margin-top:6px;max-width:none}
.about-text > .ph-tag{margin-bottom:16px}
.about .name-big{font-size:clamp(56px,7.4vw,132px);margin:4px 0 20px}
.roleline{font-size:17px;color:var(--text);display:flex;flex-direction:column;gap:4px;margin-bottom:22px}
.side{color:var(--sec)}
.about .lead{margin-bottom:12px}
.body p{font-size:15px;line-height:1.55;color:var(--sec);max-width:66ch;margin-bottom:8px}
.now{margin-top:12px;max-width:760px}

/* projects overview */
.plist{border-bottom:1px solid var(--line)}
.prow{display:grid;grid-template-columns:minmax(200px,28%) 1fr 32px;gap:24px;align-items:center;min-height:88px;padding:14px 4px;border-top:1px solid var(--line);color:var(--text);text-decoration:none;transition:color .15s}
.prow:hover{color:var(--sig)}
.pt{font-size:clamp(22px,2.2vw,30px);font-weight:700;letter-spacing:-.01em}
.ps{color:var(--sec);font-size:15.5px;max-width:60ch}
.pgo{color:var(--sig);font-size:20px;text-align:right}
.pnote{margin-top:18px;max-width:70ch}

/* project view */
.proj .vin{padding-top:24px}
.proj{--sh:330px}
.leadrow{margin:0 0 18px}
.leadrow .ph-tag{margin-bottom:6px}
.pbody{flex:1 0 auto;display:grid;grid-template-columns:minmax(0,62fr) minmax(0,38fr);gap:36px;align-items:start;padding-bottom:6px}
.pfacts{border-bottom:1px solid var(--line)}
.pbody.pwide{grid-template-columns:minmax(0,1fr);gap:20px}
.pbody.pwide .pfacts{max-width:760px}
.pfacts dt{padding-right:12px}
.pager{display:flex;justify-content:space-between;gap:16px;border-top:1px solid var(--line);margin-top:12px;padding-top:4px;flex:none}
.pager a{display:inline-flex;align-items:center;min-height:44px;color:var(--sec);text-decoration:none;font-size:15px}
.pager a:hover{color:var(--text)}

/* experience */
.cols{display:grid;grid-template-columns:1fr 1fr;gap:0 56px}
.job{display:grid;grid-template-columns:110px 1fr;gap:16px;padding:14px 0;border-top:1px solid var(--line)}
.when{font-size:14px;color:var(--sec)}
.job h2{font-size:18px}
.job .sec{font-size:14.5px;margin-bottom:4px}
.bl{margin:6px 0 0}
.bl li{font-size:14px;line-height:1.5;color:var(--sec);padding-left:14px;position:relative;margin-bottom:5px}
.bl li::before{content:"";position:absolute;left:0;top:.7em;width:6px;border-top:1px solid var(--dim)}
.skills{margin-top:10px}

/* contact */
.contact{max-width:640px;margin-top:20px}
.contact dt,.contact dd{padding:14px 0;font-size:16px}
.foot{margin-top:auto}

.tabs{display:none}

@media (prefers-reduced-motion:no-preference){
  .view:not([hidden]){animation:vin .15s ease-out}
  @keyframes vin{from{opacity:0}to{opacity:1}}
}

/* short desktop screens: tighter top */
@media (min-width:761px) and (max-height:820px){
  .about .name-big{font-size:clamp(48px,6.2vw,84px)}
  .vin{padding-top:24px}
}

@media (max-width:1100px) and (min-width:761px){
  :root{--pad:32px}
  .about-text{grid-template-columns:minmax(0,1fr)}
  .about-text>.now{grid-column:1;grid-row:auto;margin-top:16px}
  .pbody{grid-template-columns:minmax(0,1fr)}
  .cols{grid-template-columns:1fr}
}

/* phone: clip sideways overflow without breaking the fixed index (hidden on body can) */
@media (max-width:760px), (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  html,body{overflow-x:clip}
}

/* phone (and short landscape phones: the 260px sidebar left only ~130px of a 390px-high screen) */
@media (max-width:760px), (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  :root{--sh:320px;--pad:16px}
  .proj{--sh:320px}
  .topbar{position:sticky;top:calc(-1 * var(--who-h,64px));z-index:30;background:var(--page);padding-top:env(safe-area-inset-top);border-bottom:1px solid var(--line)}
  main{margin-left:0;height:auto;overflow:visible;padding-top:0}
  h1,h2,h3,.slot,.hv-transport,.pg-params{scroll-margin-top:calc(var(--tabs-h,49px) + 8px)}
  .view{min-height:0}
  .vin{min-height:0;padding:22px var(--pad) 28px}
  .idx{position:static;width:auto;height:auto;border:0;padding:14px var(--pad) 10px;flex-direction:row;overflow:visible}
  .idx .menu,.idx .ext{display:none}
  .who{gap:12px}
  .tabs{display:grid;grid-template-columns:repeat(5,1fr);position:static;top:auto;z-index:auto;background:transparent;border-top:1px solid var(--line);border-bottom:0}
  .tabs a{display:flex;align-items:center;justify-content:center;min-height:48px;color:var(--sec);text-decoration:none;font-size:14.5px;border-bottom:2px solid transparent}
  .tabs a[aria-current]{color:var(--text);border-bottom-color:var(--sig)}
  .about-in{display:block;padding-top:22px;overflow:visible}
  .about-text{display:block}
  .about .name-big{font-size:clamp(44px,15vw,64px)}
  .roleline{flex-direction:column}
  .body p{font-size:15.5px}
  .prow{grid-template-columns:1fr 24px;gap:4px 12px;min-height:84px}
  .pt{grid-column:1}.ps{grid-column:1;font-size:15px}.pgo{grid-column:2;grid-row:1/3}
  .pbody{display:flex;flex-direction:column;gap:20px}
  .pager{flex-direction:column;gap:0;margin-top:24px}
  .pager a{border-bottom:1px solid var(--line)}
  .cols{display:block}
  .job{grid-template-columns:1fr;gap:4px}
  .ph1{font-size:26px}
  .vh{font-size:34px}
  .contact dt,.contact dd{padding:12px 0}
  .foot{margin-top:28px}
  .facts{grid-template-columns:minmax(88px,30%) 1fr}
}

/* dissertation results table + AI work view (19 Nov) */
.rtable{padding:4px 0}
.rtable table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}
.rtable caption{text-align:left;font-size:.85em;opacity:.75;padding-bottom:8px}
.rtable th,.rtable td{text-align:left;padding:8px 12px 8px 0;border-bottom:1px solid currentColor;border-bottom-color:rgba(127,127,127,.35)}
.rtable td{text-align:right}
.rtable thead th:not(:first-child){text-align:right}
.rtable .small{margin-top:14px}
#v-ai-work .prose p{max-width:62ch;margin:0 0 1em}
#v-ai-work .prose h2{font-size:17px;line-height:1.3;margin:1.3em 0 .35em;color:var(--text)}
#v-ai-work .prose h2:first-child{margin-top:0}
/* dissertation: build, results, next steps as titled sections in one column */
#v-dissertation .pdemo,#v-dissertation #dd-results{max-width:860px}
#v-dissertation .dsec{margin-top:10px}
#v-dissertation .dsec h2{font-size:20px;line-height:1.3;margin:22px 0 10px;letter-spacing:-.01em;color:var(--text)}
#v-dissertation .dsec .body p{margin-bottom:12px}
#v-dissertation #dd-results{margin-top:14px}
#v-dissertation .dnext{max-width:66ch;margin:0 0 14px}
#v-dissertation .dnext li{font-size:15px;margin-bottom:8px}
.view h1[tabindex="-1"]:focus{outline:none;box-shadow:none}

/* ---- phone UX pass (28 Nov): thumb targets, quick actions, press feedback. Desktop rules above are untouched. ---- */
.about-links{display:none}
@media (max-width:760px), (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  /* breadcrumb is the way back to the list: make the whole row a 44px target */
  .crumb{display:flex;align-items:center;flex-wrap:wrap;gap:0 6px;min-height:44px;margin:-8px 0 -4px}
  .crumb a{display:inline-flex;align-items:center;min-height:44px}
  /* contact rows: each link fills a 48px row */
  .contact dt,.contact dd{display:flex;align-items:center;min-height:48px;padding:0}
  .contact dd a{display:inline-flex;align-items:center;min-height:48px}
  /* links inside project fact tables: bigger hit area without changing line spacing */
  .pfacts dd a{padding:11px 0}
  /* About: the CV, LinkedIn and GitHub sit in the header on desktop and are hidden on phones; give them a place on the first screen */
  .about-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:4px 0 18px}
  .about-links a{display:flex;align-items:center;justify-content:center;min-height:44px;padding:0 8px;border:1px solid rgba(134,197,176,.55);border-radius:6px;color:var(--sig);font-size:14px;font-weight:700;text-decoration:none;text-align:center;line-height:1.2}
  .tabs a,.prow,.pager a{-webkit-tap-highlight-color:transparent}
}
/* touch screens have no hover: show a pressed state instead */
@media (hover:none){
  .btn:active,.about-links a:active{background:rgba(134,197,176,.18)}
  .seg label:active span{background:rgba(134,197,176,.2)}
  .tabs a:active,.pager a:active,.crumb a:active{color:var(--text)}
  .prow:active{background:rgba(134,197,176,.06);color:var(--sig)}
}

/* short landscape phones: name and tabs share one row (one 49px strip instead of two) */
@media (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  .topbar{display:flex;align-items:center;top:0}
  .idx{flex:0 0 auto;padding:4px var(--pad)}
  .tabs{flex:1 1 auto;border-top:0}
  .role{display:none}
}
