:root{
  --bg:#EFEDE8; --card:#FBFAF7; --ink:#14161B; --muted:#5B616B; --line:#DAD6CE; --chip:#EAE6DD;
  --accent:#0F7B63; --accent-ink:#FFFFFF; --glow:rgba(15,123,99,.14);
  --sans:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0C0D10; --card:#14161B; --ink:#ECEDEF; --muted:#9097A1; --line:#272B33; --chip:#1B1E25;
  --accent:#7EE0C3; --accent-ink:#0C0D10; --glow:rgba(126,224,195,.16); color-scheme:dark;}}
:root[data-theme="dark"]{
  --bg:#0C0D10; --card:#14161B; --ink:#ECEDEF; --muted:#9097A1; --line:#272B33; --chip:#1B1E25;
  --accent:#7EE0C3; --accent-ink:#0C0D10; --glow:rgba(126,224,195,.16); color-scheme:dark;}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--sans);line-height:1.5;
  background-image:radial-gradient(60% 40% at 50% 100%,var(--glow),transparent 70%);background-repeat:no-repeat;background-attachment:fixed;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.btn{font:inherit;font-weight:700;font-size:16px;min-height:48px;padding:0 20px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--ink);display:inline-flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;text-decoration:none;white-space:nowrap}
.btn.round{width:48px;padding:0;flex:none}
.top{display:flex;justify-content:flex-end;gap:10px;padding:2px 0 12px}
.btn.sq{border-radius:14px}
.kicker{display:flex;align-items:center;gap:14px;font-family:var(--mono);font-size:14px;letter-spacing:.2em;text-transform:uppercase;color:var(--accent);font-weight:700}
.kicker .bars{margin:0;gap:6px}.kicker .bars i{width:24px;height:5px}
.brand{display:flex;align-items:center;gap:14px;color:var(--muted);font-family:var(--mono);font-size:12px;letter-spacing:.18em;text-transform:uppercase;text-decoration:none;background:none;border:0;cursor:pointer;padding:0;min-height:48px}
.brand .mark{width:44px;height:44px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px}
h1.big{margin:0;font-size:clamp(32px,8vw,56px);line-height:1.05;font-weight:800;letter-spacing:-.03em;text-wrap:balance}
.btn.accent{background:var(--accent);color:var(--accent-ink);border-color:transparent}
.btn:focus-visible,a:focus-visible,.tag{font-family:var(--mono);font-size:12px;letter-spacing:.18em;text-transform:uppercase;color:var(--muted)}
.mark{width:56px;height:56px;color:var(--accent)}

html,body{height:100%}body.home{overflow:hidden}
body.home .wrap{max-width:480px;margin:0 auto;height:100dvh;display:flex;flex-direction:column;gap:14px;padding-block:14px}
.stage{flex:1 1 0;min-height:0;perspective:1400px}
.card{position:relative;height:100%;transition:transform .7s cubic-bezier(.2,.7,.2,1);transform-style:preserve-3d;cursor:pointer}
.card.flipped{transform:rotateY(180deg)}
.face{position:absolute;inset:0;border-radius:24px;border:1px solid var(--line);background:var(--card);padding:clamp(20px,4vh,30px) 26px;display:flex;flex-direction:column;backface-visibility:hidden;-webkit-backface-visibility:hidden;overflow:hidden}
.back{transform:rotateY(180deg);background:var(--accent);color:var(--accent-ink);border-color:transparent;align-items:center;justify-content:center;text-align:center;gap:18px}
.back .mark{width:140px;height:140px;color:var(--accent-ink)}.back .tag{color:var(--accent-ink);opacity:.85}
.row{display:flex;justify-content:space-between;align-items:flex-start}
.name{margin:auto 0 8px;font-size:clamp(34px,9vw,52px);line-height:1.02;font-weight:800;letter-spacing:-.03em;text-wrap:balance}
.role{font-family:var(--mono);font-weight:700;font-size:13px;letter-spacing:.16em;text-transform:uppercase;color:var(--accent);margin:0 0 clamp(12px,3vh,26px)}
dl{margin:0 0 clamp(12px,3vh,20px);display:grid;grid-template-columns:auto 1fr;gap:8px 18px;font-family:var(--mono);font-size:13.5px}
dt{color:var(--muted);letter-spacing:.14em;text-transform:uppercase;font-size:12px;align-self:center}
dd{margin:0;overflow-wrap:anywhere}dd a{color:inherit;text-decoration:none;border-bottom:1px solid var(--line)}
.stack{font-family:var(--mono);font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.bars{display:flex;gap:8px;margin-top:10px}.bars i{display:block;width:48px;height:6px;border-radius:6px;background:var(--accent)}.bars i:nth-child(2){background:var(--ink);opacity:.85}
.actions{display:flex;gap:10px;flex:none}.actions .grow{flex:1 1 0;min-width:0;padding:0 12px}
footer{text-align:center;font-family:var(--mono);font-size:12px;color:var(--muted);padding:6px 0}

body.about .wrap{max-width:780px;margin:0 auto;padding-block:10px 56px;display:flex;flex-direction:column;gap:26px}
.head{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.head .mark{width:48px;height:48px}
.head h1{margin:0;font-size:clamp(28px,7vw,44px);line-height:1.05;font-weight:800;letter-spacing:-.03em}
.head .sub{font-family:var(--mono);font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:var(--accent);margin-top:6px}
.cvactions{display:flex;gap:10px;flex-wrap:wrap}
.layout{display:grid;grid-template-columns:1fr;gap:30px}
@media (min-width:900px){.layout{grid-template-columns:290px 1fr;gap:48px}.side{position:sticky;top:76px;align-self:start}}
.side,.main{display:flex;flex-direction:column;gap:28px;min-width:0}
h2{margin:0 0 12px;font-family:var(--mono);font-size:12px;letter-spacing:.2em;text-transform:uppercase;color:var(--muted);font-weight:500;display:flex;align-items:center;gap:12px}
h2:before{content:"";width:22px;height:4px;border-radius:4px;background:var(--accent)}
p{margin:0}.lead{font-size:18px;line-height:1.7}
.contact{display:flex;flex-direction:column;gap:6px;font-family:var(--mono);font-size:13.5px}
.contact a{color:inherit;text-decoration:none;border-bottom:1px solid var(--line);align-self:flex-start;overflow-wrap:anywhere}
.skill{margin-bottom:14px}.skill b{display:block;font-size:13px;color:var(--muted);font-weight:500;margin-bottom:6px}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none}
.chips li{font-family:var(--mono);font-size:12.5px;padding:4px 10px;border-radius:999px;background:var(--chip);border:1px solid var(--line)}
.job{padding-left:16px;border-left:2px solid var(--line);display:flex;flex-direction:column;gap:6px;margin-bottom:26px}
.job h3{margin:0;font-size:18px}.job .when{font-family:var(--mono);font-size:12px;color:var(--muted)}
.job ul{margin:6px 0 0;padding-left:18px;color:var(--ink);display:flex;flex-direction:column;gap:8px;font-size:15px}
.job li span.w{font-family:var(--mono);font-size:12px;color:var(--muted)}
.hint{font-family:var(--mono);font-size:12px;color:var(--muted)}

.job a,p a,.lead a{color:inherit;text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:3px;text-decoration-thickness:2px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:24px}@media (max-width:560px){.two{grid-template-columns:1fr}}
.lead{margin:0}
.links{display:flex;flex-wrap:wrap;gap:10px;margin-top:6px}
.job a.lp{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--ink);text-decoration:none;font-weight:700;font-size:15px}
.job a.lp:hover{border-color:var(--accent)}.job a.lp span{color:var(--accent)}
@media (prefers-reduced-motion: reduce){.card{transition:none}}

.card{-webkit-tap-highlight-color:transparent}

/* tall windows: the portrait card never stretches beyond a business-card proportion */
body.home .stage{display:flex;align-items:center;justify-content:center}
body.home .card{width:100%;max-height:720px}

/* wide windows: a landscape business card (7:4) with name on the left and details on the right */
@media (min-width:900px) and (min-height:520px){
  body.home .wrap{max-width:820px;justify-content:center}
  body.home .stage{flex:0 0 auto}
  body.home .card{width:min(760px,100%);height:auto;max-height:none;aspect-ratio:7/4}
  body.home #front{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto 1fr auto auto;column-gap:32px;padding:30px 36px}
  body.home #front .row{grid-column:1/-1;flex-direction:row-reverse}
  body.home #front .name{grid-column:1/-1;grid-row:2;align-self:end;margin:0 0 8px;font-size:clamp(34px,4.6vw,52px)}
  body.home #front .role{grid-column:1/-1;grid-row:3;margin:0 0 clamp(18px,4vh,34px)}
  body.home #front dl{grid-column:1;grid-row:4;align-self:end;margin:0;font-size:14px}
  body.home #front .stack{grid-column:2;grid-row:4;align-self:end;text-align:right}
  body.home #front .bars{justify-content:flex-end}
  body.home .back .mark{width:110px;height:110px}
  body.home .actions{width:min(760px,100%);margin:0 auto;flex:none}
  body.home footer{flex:none}
}

/* glow around the card */
:root{--aglow:rgba(15,123,99,.28)}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--aglow:rgba(126,224,195,.38)}}
:root[data-theme="dark"]{--aglow:rgba(126,224,195,.38)}
body.home .face{box-shadow:0 0 0 1px var(--line),0 24px 90px -26px var(--aglow),0 0 60px -30px var(--aglow)}

/* desktop: smaller card, compact centred buttons (like trajce.com) */
@media (min-width:900px) and (min-height:520px){
  body.home .card{width:min(640px,100%);aspect-ratio:8/5}
  body.home #front{padding:26px 32px;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr)}
  body.home #front .name{font-size:clamp(30px,3.8vw,44px)}
  body.home #front .mark{width:48px;height:48px}
  body.home .actions{width:auto;justify-content:center;gap:8px}
  body.home .actions .btn{min-height:40px;font-size:14px;padding:0 18px;flex:none}
  body.home .actions .btn.round{width:40px;padding:0}
  body.home .actions .grow{flex:none}
  body.home .back .mark{width:96px;height:96px}
}

.btn .lbl{display:inline}
body.home .actions #flip{width:auto;padding:0 18px;border-radius:999px}

/* phone in landscape: like trajce.com. Card on the left, button column on the right, everything in one screen, no scroll. */
@media (orientation:landscape) and (max-height:519px){
  body.home .wrap{max-width:none;height:100dvh;display:grid;grid-template-columns:minmax(0,1fr) 176px;grid-template-rows:1fr auto;column-gap:18px;row-gap:0;align-content:center;padding:10px max(14px,env(safe-area-inset-right)) 10px max(14px,env(safe-area-inset-left))}
  body.home .stage{grid-column:1;grid-row:1/3;flex:none;display:flex;align-items:center;justify-content:center;min-height:0}
  body.home .card{width:auto;height:auto;max-height:100%;max-width:100%;aspect-ratio:8/5;height:min(100%,calc((100vw - 232px) / 1.6))}
  body.home #front{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);grid-template-rows:auto 1fr auto auto;column-gap:16px;padding:14px 20px}
  body.home #front .row{grid-column:1/-1;flex-direction:row-reverse}
  body.home #front .mark{width:clamp(34px,7cqw,52px);height:clamp(34px,7cqw,52px)}
  body.home .card{container-type:size}
  body.home #front .name{grid-column:1/-1;grid-row:2;align-self:end;margin:0 0 6px;font-size:calc((100cqw - 44px) / 13.2);white-space:nowrap}
  body.home #front .role{grid-column:1/-1;grid-row:3;margin:0 0 clamp(8px,3cqh,18px);font-size:clamp(11px,2cqw,14px)}
  body.home #front dl{grid-column:1/-1;grid-row:4;margin:0;font-size:clamp(11.5px,2.1cqw,15px);gap:clamp(4px,1.4cqh,9px) 14px}
  body.home #front .stack{display:none}
  body.home .actions{grid-column:2;grid-row:1;align-self:center;display:grid;grid-template-columns:44px 1fr;gap:8px;width:auto;margin:0}
  body.home .actions .grow{grid-column:1/-1;grid-row:1;order:0}
  body.home .actions .btn{min-height:44px;font-size:15px;padding:0;width:100%;justify-content:center}
  body.home .actions #theme{grid-row:2;grid-column:1;width:44px}
  body.home .actions #flip{grid-row:2;grid-column:2;width:100%;padding:0 12px}
  body.home footer{grid-column:2;grid-row:2;align-self:end;font-size:11px;padding:0;text-align:center;display:none}
  body.home .back .mark{width:clamp(40px,26cqh,76px);height:clamp(40px,26cqh,76px)}
  body.home .back #back-about{margin-top:clamp(6px,3cqh,14px);min-height:clamp(32px,13cqh,44px);padding:0 18px;font-size:clamp(13px,5.2cqh,16px)}
  body.home .back .tg{bottom:clamp(8px,3.5cqh,14px);font-size:clamp(11px,4.6cqh,14px)}
}

@media (orientation:landscape) and (max-height:519px) and (min-width:700px) and (max-width:799px){
  body.home .card{aspect-ratio:2/1;height:min(100%,calc((100vw - 232px) / 2))}
}
@media (orientation:landscape) and (max-height:519px) and (min-width:800px){
  body.home .card{aspect-ratio:2.4/1;height:min(100%,calc((100vw - 232px) / 2.4))}
  body.home #front dl{grid-column:1}
  body.home #front .stack{display:block;grid-column:2;grid-row:4;align-self:end;text-align:right;font-size:10.5px}
  body.home #front .bars{justify-content:flex-end}
  body.home #front .bars i{width:34px;height:5px}
}

/* buttons: portrait phones keep the three buttons across the card; desktop and phones in landscape get a compact centred row */
@media (min-width:900px) and (min-height:520px){
  body.home .actions{justify-content:center}
  body.home .actions .grow{flex:none;padding:0 28px}
}

/* About page: no glow */
body.about{background-image:none}

/* tagline under the role */
.role .tagline{display:block;margin-top:10px;font-family:var(--sans);font-weight:500;font-size:17px;letter-spacing:0;text-transform:none;color:var(--ink);opacity:.85}
@media (orientation:landscape) and (max-height:519px){body.home #front .role .tagline{font-size:13px;margin-top:4px}}

/* tagline on the colour side, pinned to the bottom of the card */
.back .tg{position:absolute;left:20px;right:20px;bottom:26px;margin:0;text-align:center;font-size:17px;font-weight:600;line-height:1.25;color:var(--accent-ink);opacity:.9}

/* colour side: the logo sits exactly in the centre of the card, About below it, tagline at the bottom */
body.home .back{display:grid;grid-template-rows:1fr auto 1fr;justify-items:center;align-content:stretch;gap:0}
body.home .back .mark{grid-row:2;align-self:center}
body.home .back #back-about{grid-row:3;align-self:start;margin-top:18px}
