/* REDESIGN — clean white page, bold red diagonal behind the portrait, black accents, geometric display type.
   Loaded last so it overrides the earlier gold/desert theme without rewriting those files. */
@import url('https://fonts.googleapis.com/css2?family=Jura:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* 1. TOKENS ---------------------------------------------------------------------------------- */
:root,:root[data-theme='light'],:root:not([data-theme]){
  --red:#1F1F22;--red-soft:#BDBDC2;--red-tint:#DADADD;--black:#141414;--grey:#ECECEC;
  --bg:#FFFFFF;--surface:#FFFFFF;--raise:#F3F3F3;--text:#141414;--ink:#141414;--muted:#5C5C63;
  --accent:var(--red);--gold:var(--red);--accent-text:#4A4A51;--gold-ink:#4A4A51;--accent-ink:#FFFFFF;
  --line:transparent;--grid:transparent;--faint:rgba(20,20,20,.12);--edge:rgba(20,20,20,.10);--sheen:transparent;
  --name-base:#141414;--name-highlight:#141414;--name-deep:#141414;--control-line:#8C8C92;--sun:transparent;
  --logo-filter:none;--chip-bg:var(--grey);--chip-text:#141414;--pill-bg:#ECECEC;--pill-text:#141414;
  --card-1:#ECECEC;--card-2:var(--red-tint);--card-3:#F5F5F5;--card-text:#141414;--card-muted:#3D3D42;
  --badge-bg:#141414;--badge-text:#FFFFFF;
  --elevation:0 1px 2px rgba(0,0,0,.04),0 14px 34px -22px rgba(0,0,0,.22);
  --elevation-hover:0 2px 4px rgba(0,0,0,.05),0 22px 44px -22px rgba(0,0,0,.3);
  --portrait-shadow:none;
  --display:'Jura','Inter','Segoe UI',sans-serif;--display-wide:var(--display);--font-handdrawn:var(--display);
  color-scheme:light;
}
:root[data-theme='dark']{
  --bg:#0F0F10;--surface:#17171A;--raise:#202024;--text:#F3F3F3;--ink:#F3F3F3;--muted:#A6A6AD;
  --red:#3A3A40;--red-soft:#6B6B72;--red-tint:#2A2A2F;
  --accent:var(--red);--gold:var(--red);--accent-text:#C8C8CE;--gold-ink:#C8C8CE;--accent-ink:#FFFFFF;
  --faint:rgba(255,255,255,.12);--edge:rgba(255,255,255,.10);
  --name-base:#F3F3F3;--name-highlight:#F3F3F3;--name-deep:#F3F3F3;--control-line:#6E6E75;
  --logo-filter:invert(1);--chip-bg:#2A2A2F;--chip-text:#F3F3F3;--pill-bg:#26262B;--pill-text:#F3F3F3;
  --card-1:#1D1D21;--card-2:#26262B;--card-3:#17171A;--card-text:#F3F3F3;--card-muted:#C4C4CA;
  --badge-bg:#F3F3F3;--badge-text:#141414;
  --elevation:0 1px 2px rgba(0,0,0,.3),0 14px 34px -22px rgba(0,0,0,.7);
  --elevation-hover:0 2px 4px rgba(0,0,0,.35),0 22px 44px -22px rgba(0,0,0,.8);
  color-scheme:dark;
}

/* 2. BASE ------------------------------------------------------------------------------------ */
html{overflow-x:clip}
body{background:var(--bg);background-image:none;color:var(--text);overflow-x:clip}
.desert-grid,.sand-grain,.progress{display:none}
::selection{background:#C8C8CE;color:#141414}
:root[data-theme="dark"] ::selection{background:#5A5A61;color:#FFFFFF}
html body .hero h1::selection,html body .hero h1 *::selection{background:#C8C8CE;color:#141414;-webkit-text-fill-color:#141414}
:focus-visible{outline:2px solid var(--red);outline-offset:3px}
a{color:var(--accent-text)}
html body :is(h1,h2,h3,h4),html body .hero h1 .thin{font-family:var(--display);letter-spacing:-.01em}
html body :is(h2,.rail h2,#education .rail h2,.contact h2){font-family:var(--display);font-weight:700}
html body :is(h3,h4,.job h3,.edu h3,.card h3,.certificate-card h3,#education .degree-card h3,.diploma-card h3,.learning-heading h3,.why-item h4,.work-principle h4){font-family:var(--display);font-weight:700}

/* 3. NAV — links left, round logo centred, Contact Me pill right; hamburger on phones ---------- */
.nav{background:var(--bg);border-bottom:0;box-shadow:none}
.nav::before,.nav::after{content:none;display:none}
.nav .shell{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;padding-block:14px}
.nav .brand{grid-column:2;grid-row:1;width:52px;height:52px;padding:0;border-radius:50%;background:var(--text);color:var(--bg);display:grid;place-items:center}
.nav .brand svg{width:26px;height:26px}
.nav-actions{grid-column:3;grid-row:1;display:flex;align-items:center;justify-content:flex-end;gap:8px}
.links{order:0;flex-basis:auto;grid-column:1;grid-row:1;display:flex;justify-content:flex-start;gap:4px}
.links li{flex:0 0 auto}
.links a{color:var(--text);font:500 .85rem/1 var(--body);letter-spacing:0;text-transform:none;padding:6px 10px;border-radius:999px}
.links a:hover,.links a:focus-visible{color:var(--accent-text);background:transparent}
.links a::after{background:var(--red);left:10px;right:10px;bottom:6px}
.btn.nav-contact{background:var(--pill-bg);color:var(--pill-text);border-color:transparent;padding:12px 22px;font-size:.82rem;font-weight:600}
.btn.nav-contact:hover{background:var(--red);color:#fff;border-color:var(--red)}
#theme-toggle{margin:0;width:44px;height:44px;min-height:44px;padding:0;font-size:0;border-radius:50%;border-color:var(--faint);color:var(--text);background:transparent}
#theme-toggle .theme-icon{margin:auto}
.menu-toggle{display:none;grid-column:1;grid-row:1;justify-self:start;width:44px;height:44px;padding:0;border:0;background:transparent;color:var(--text);cursor:pointer;flex-direction:column;justify-content:center;gap:7px}
.menu-toggle span{display:block;width:30px;height:2px;background:currentColor;border-radius:2px;transition:transform .25s ease}
.nav.menu-open .menu-toggle span:first-child{transform:translateY(4.5px) rotate(45deg)}
.nav.menu-open .menu-toggle span:last-child{transform:translateY(-4.5px) rotate(-45deg)}
@media(max-width:820px){
  .menu-toggle{display:flex}
  .links{grid-column:1/-1;grid-row:2;display:none;flex-direction:column;gap:2px;padding:8px 0 4px;border-top:1px solid var(--edge)}
  .nav.menu-open .links{display:flex}
  .links li,.links li:not(:last-child){display:block}
  .links a{justify-content:flex-start;font-size:1rem;padding:12px 4px}
  .btn.nav-contact{padding:11px 16px}
}
@media(max-width:480px){.nav-actions{gap:4px}#theme-toggle{width:38px;height:38px;min-height:38px}.btn.nav-contact{padding:10px 13px;font-size:.76rem}.nav .brand{width:46px;height:46px}}

/* 4. BUTTONS & CHIPS ------------------------------------------------------------------------- */
.btn{border-radius:999px;border:1px solid transparent;background:var(--pill-bg);color:var(--pill-text);font-family:var(--body);font-weight:600;box-shadow:none}
.btn:hover{border-color:var(--text);box-shadow:none}
.btn.primary{background:var(--red);background-image:none;border-color:var(--red);color:#fff;box-shadow:0 10px 24px -12px color-mix(in srgb,var(--red) 70%,transparent)}
.btn.primary:hover{background:#000;border-color:#000}
:root[data-theme='dark'] .btn.primary:hover{background:#4A4A51;border-color:#4A4A51}
.chip,.tag{border-radius:6px;border:0;background:var(--chip-bg);color:var(--chip-text);font-weight:500}
.skill:hover .chip{background:var(--chip-bg)}

/* 5. HERO ------------------------------------------------------------------------------------ */
.hero::before{content:none}
.hero h1{margin:0;font-family:var(--display);font-weight:700;text-transform:none;letter-spacing:-.01em;line-height:1.02;
  font-size:clamp(3rem,7vw,5.6rem);background:none;color:var(--text);-webkit-text-fill-color:currentColor;filter:none}
.hero h1 .h1-light{font-weight:400}
.hero h1 .h1-line{display:block}
.aka{margin-top:14px}
.aka .label{color:var(--muted)}
.nick{font-family:var(--display);font-weight:700;color:var(--accent-text)}
.professional-title{font-family:var(--display);font-weight:700;color:var(--text);font-size:clamp(1.15rem,2vw,1.45rem);margin:22px 0 8px}
.exploring-line{color:var(--accent-text);margin:0 0 6px}
.lede{color:var(--muted);font-size:.95rem;max-width:46ch;margin-top:10px}
.cta{margin-top:26px}
.hero-skills{list-style:none;margin:40px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:12px;max-width:380px}
.hero-skills li{font:500 clamp(1.25rem,2.2vw,1.65rem)/1 var(--display);padding:12px 20px;border-radius:4px}
.hs-soft{background:var(--red-soft);color:#141414}
.hs-red{background:var(--red);color:#fff}
.hs-ink{background:#6B6B72;color:#fff}
.hs-grey{background:#E4E4E4;color:#141414}
:root[data-theme='dark'] .hs-ink{background:#F3F3F3;color:#141414}
:root[data-theme='dark'] .hs-soft{color:#fff}
:root[data-theme='dark'] .hs-grey{background:#2A2A2F;color:#F3F3F3}

/* Portrait: cut-out photo inside a round-bottomed frame, a red diagonal band behind, black badge on the left. */
.hero-portrait{position:relative;isolation:isolate;width:100%;max-width:720px;margin:0;justify-self:end;align-self:end;overflow:visible}
.hero-portrait::before,.hero-portrait::after{content:none;display:none}
/* One large red panel: fills the right side up under the nav and off the right edge, with a wide curved bottom-left corner. */
.portrait-band{position:absolute;z-index:-1;left:20%;right:-60vw;top:-60vh;bottom:0;background:var(--red);border-radius:0;pointer-events:none}
.portrait-frame{position:relative;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
.portrait-frame::before,.portrait-frame::after{content:none;display:none}
.portrait-frame img{display:block;width:112%;max-width:none;margin-left:-2%;height:auto;aspect-ratio:1/1;object-fit:contain;object-position:50% 100%;filter:drop-shadow(0 26px 34px rgba(0,0,0,.28))}
@media(hover:hover) and (pointer:fine){html .portrait-frame:hover img{transform:none}}
.portrait-caption{display:none}
@media(hover:hover) and (pointer:fine){.portrait-frame:hover{border:0;box-shadow:none}}
@media(min-width:821px){
  .hero{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);padding-block:56px 0;align-items:center}

  .hero{margin-bottom:64px}
  .hero-portrait{order:0}
}
@media(max-width:820px){
  .hero{padding-block:16px 48px;gap:36px}
  .hero-portrait{order:-1;justify-self:center;max-width:460px}
}
@media(max-width:820px){.portrait-band{left:22%;bottom:0}}
@media(max-width:620px){.hero-portrait{max-width:360px}.hero .cta .btn{width:auto}.hero-skills{margin-top:30px}}

/* 6. SECTIONS -------------------------------------------------------------------------------- */
.sec::before,.sec::after{content:none;display:none}
.sec{border-bottom:0}
.rail h2,#education .rail h2{color:var(--text);font-size:clamp(1.8rem,3vw,2.5rem);line-height:1.15}
.rail .idx{display:flex;color:var(--accent-text);font-family:var(--body);font-weight:600;font-size:.72rem}
.rail .idx::before{background:var(--red);clip-path:none;width:18px;height:3px;border-radius:2px;opacity:1}

/* Metrics */
.metrics{border:0;border-radius:18px;background:#ECECEE;box-shadow:none;color:#141414}
:root[data-theme='dark'] .metrics{background:#2A2A2F;border:1px solid var(--edge);color:#F3F3F3}
.metrics .metric + .metric{border-left-color:rgba(0,0,0,.1)}
@media(max-width:820px){.metrics .metric:nth-child(n+3){border-top-color:rgba(0,0,0,.1)}}
.metrics .metric b{font-family:var(--display);font-weight:600;letter-spacing:-.02em;color:inherit}
.metrics .metric b sup{color:#6B6B72}
.metrics .metric > span{color:#4A4A51}
:root[data-theme='dark'] .metrics .metric b sup{color:#A6A6AD}
:root[data-theme='dark'] .metrics .metric > span{color:#C8C8CE}
:root[data-theme='dark'] .metrics .metric + .metric,:root[data-theme='dark'] .metrics .metric:nth-child(n+3){border-color:rgba(255,255,255,.1)}

/* Cards share one flat finish */
:is(.metric,.job,.skill,.why-item,.card,.edu,.certificate-card,.vault-panel,.work-principle,.project-card){background-image:none}
:is(.job,.skill,.why-item,.card,.edu,.certificate-card,.vault-panel,.work-principle,.project-card,.row){border-color:var(--edge);box-shadow:var(--elevation)}
:is(.card,.why-item,.skill,.edu,.row,.certificate-card)::after{background:radial-gradient(360px circle at var(--glow-x,50%) var(--glow-y,50%),color-mix(in srgb,var(--red) 6%,transparent),transparent 75%)}
@media(hover:hover) and (pointer:fine){:is(.job,.skill,.why-item,.card,.edu,.certificate-card):hover{border-color:color-mix(in srgb,var(--red) 55%,var(--edge));box-shadow:var(--elevation-hover)}}
.job{border-left:4px solid var(--red)}
.job .title,.skill .label,.card .label{color:var(--accent-text)}
.confidential-note,.exploring-box{border-color:color-mix(in srgb,var(--red) 45%,transparent);background:color-mix(in srgb,var(--red) 4%,var(--surface))}
#skills .skillgrid>.skill:first-child{border-color:color-mix(in srgb,var(--red) 40%,var(--edge));background-color:color-mix(in srgb,var(--red) 5%,var(--surface))}
.diploma-card{background:color-mix(in srgb,var(--red) 8%,var(--surface));border-color:color-mix(in srgb,var(--red) 35%,var(--edge))}
.grade-track{background:color-mix(in srgb,var(--red) 18%,transparent)}
.grade-track span{background:var(--red)}
.education-icon,.work-principle svg{color:var(--accent-text)}

/* Projects: numbered tiles 01 / 02 / 03, staggered like a gallery */
.project-grid{counter-reset:project;gap:40px;padding-bottom:28px}
.project-card{counter-increment:project;position:relative;border:0;border-radius:18px;background:var(--card-1);color:var(--card-text);padding:28px 28px 40px;overflow:visible}
.project-card:nth-child(3n+2){background:var(--card-2)}
.project-card:nth-child(3n+3){background:var(--card-3);border:1px solid var(--edge)}
.project-card p{color:var(--card-text)}
.project-card .planned-tools{color:var(--card-muted)}
.project-card h3{font-size:1.4rem;line-height:1.25}
.project-card .btn{background:var(--text);color:var(--bg);border-color:var(--text)}
.project-card .btn:hover{background:var(--red);border-color:var(--red);color:#fff}
.project-card::after{content:counter(project,decimal-leading-zero);position:absolute;right:-14px;bottom:-24px;min-width:74px;padding:12px 10px;border-radius:10px;
  background:var(--badge-bg);color:var(--badge-text);font:600 2.3rem/1 var(--display);text-align:center;box-shadow:0 12px 24px -14px rgba(0,0,0,.5)}
.status-badge{border-color:var(--red);color:var(--accent-text);background:var(--surface)}
@media(min-width:1000px){
  .project-grid{align-items:start;padding-bottom:110px}
  .project-card:nth-child(3n+2){margin-top:56px}
  .project-card:nth-child(3n+3){margin-top:112px}
}
@media(max-width:620px){.project-card::after{right:-6px;font-size:1.9rem;min-width:62px}}

/* Contact & footer */
.contact h2{font-size:clamp(2.4rem,6vw,4.6rem);line-height:1.05}
.contact h2 span{color:var(--accent-text);font-weight:700}
.mashrabiya{display:none}
#contact-linkedin .v{color:var(--accent-text)}
.copy:hover,.copy.done{color:var(--accent-text);border-color:var(--red)}
footer .brand{color:var(--text)}
.scroll-pyramid .pyramid-outline{fill:var(--bg);stroke:var(--red)}
.scroll-pyramid .pyramid-fill{fill:var(--red)}
summary{color:var(--accent-text)}
.workshops{border-color:var(--edge)}

/* Logo card on the "Beyond" section warms to red instead of gold */
@media(prefers-reduced-motion:no-preference){@keyframes fourth-draw{to{stroke-dashoffset:0}}@keyframes fourth-glow{to{stroke:color-mix(in srgb,var(--red) 45%,var(--surface))}}}

/* Secondary pages (project plan, certificate vault) keep a simple flex nav */
.nav .shell:not(:has(.brand)){display:flex;justify-content:space-between}

/* Framed black-and-white portrait: a tall card floating inside the red panel. */
.hero-portrait{padding:40px 0 56px}
.portrait-frame{width:min(100%,640px);margin-inline:auto 0;border-radius:8px;overflow:hidden;background:#111;
  box-shadow:0 30px 60px -24px rgba(0,0,0,.55),0 0 0 8px rgba(255,255,255,.9)}
.portrait-frame img{width:100%;margin:0;aspect-ratio:4/5;object-fit:cover;object-position:50% 16%;filter:none}
.portrait-frame::before{content:"";display:block;position:absolute;z-index:1;inset:60% 0 0;background:linear-gradient(transparent,rgba(0,0,0,.75));pointer-events:none}
.portrait-caption{display:block;position:absolute;z-index:2;left:22px;right:22px;bottom:18px;color:#fff;font:600 1.05rem/1.2 var(--display);letter-spacing:.06em}
@media(hover:hover) and (pointer:fine){html .portrait-frame:hover img{transform:scale(1.03)}}
@media(max-width:820px){.hero-portrait{padding:24px 0 40px}.portrait-frame{margin-inline:auto;width:min(100%,460px)}}
html.motion-ready .hero-portrait.reveal .portrait-frame,html.motion-ready .hero-portrait.reveal.is-visible .portrait-frame{clip-path:none;opacity:1}
.portrait-band{display:none}
.rail .idx{display:none}
/* Desktop: the photo matches the text column exactly - top at "My name", bottom at the skill blocks. */
@media(min-width:821px){
  .hero{align-items:stretch;padding-top:72px}
  .hero-portrait{align-self:stretch;padding:0;max-width:none;min-height:0}
  .hero-portrait .portrait-frame{position:absolute;top:clamp(8px,1.2vw,18px);bottom:0;right:0;height:auto;width:auto;max-width:100%;aspect-ratio:4/5;margin:0}
  .hero-portrait .portrait-frame img{width:100%;height:100%;aspect-ratio:auto}
}
/* Project Roadmap intro: larger and closer to its heading. */
#projects{row-gap:12px}
#projects .sec-body > p:first-child{margin:0;font-size:clamp(1.1rem,1.5vw,1.35rem);line-height:1.6;color:var(--text);max-width:70ch}
/* Tool logos inside skill chips. */
.chip.has-logo{display:inline-flex;align-items:center;gap:8px}
.chip-logo{width:18px;height:18px;flex:0 0 18px;object-fit:contain;display:block}
:root[data-theme='dark'] .chip.has-logo{background:#3A3A40}
.chip-logo.chip-logo-lg{width:24px;height:24px;flex-basis:24px}
/* Stats bar: larger descriptions under the numbers. */
html .metrics .metric > span{font-size:clamp(1rem,1.25vw,1.15rem);line-height:1.5;max-width:28ch;color:#3D3D42}
:root[data-theme='dark'] .metrics .metric > span{color:#D4D4DA}
@media(max-width:400px){html .metrics .metric > span{font-size:.92rem}}
/* Contact: GitHub link styled like LinkedIn; the last row fills the leftover space so no empty grey cell shows. */
#contact-github .v{color:var(--accent-text)}
@media(min-width:621px){.contact .rows .row:last-child:nth-child(odd){grid-column:1 / -1}}
/* Contact bubbles: a dark panel of floating round links; one big "Let's Talk" bubble. */
.contact-head{display:grid;grid-template-columns:minmax(0,1fr);gap:28px;align-items:center}
@media(min-width:821px){.contact-head{grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}}
.bubbles{position:relative;height:clamp(300px,34vw,400px);border-radius:24px;background:#18181A;overflow:hidden;isolation:isolate}
.bubble{--size:clamp(64px,7vw,92px);position:absolute;left:var(--x);top:var(--y);width:var(--size);height:var(--size);margin:calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  display:grid;place-items:center;border-radius:50%;color:#D6D6DA;text-decoration:none;
  background:radial-gradient(circle at 35% 28%,#4A4A50,#303034 55%,#26262A);
  box-shadow:inset 0 2px 6px rgba(255,255,255,.08),inset 0 -8px 18px rgba(0,0,0,.35),0 14px 30px -12px rgba(0,0,0,.7);
  transform:translate(var(--mx,0px),var(--my,0px)) scale(var(--hs,1));transition:transform .35s cubic-bezier(.2,.7,.2,1),color .25s,background .25s}
.bubble svg{width:40%;height:40%}
.bubble-main{--size:clamp(150px,17vw,210px);color:#fff;z-index:1}
.bubble-text{font:500 clamp(1.5rem,2.4vw,2.1rem)/1.05 var(--display);letter-spacing:-.01em;text-align:left}
.bubble-arrow{display:inline-block;color:#BDBDC2;transition:transform .35s ease}
.bubble:hover,.bubble:focus-visible{--hs:1.08;color:#fff;background:radial-gradient(circle at 35% 28%,#5A5A61,#38383D 55%,#2A2A2F)}
.bubble-main:hover .bubble-arrow,.bubble-main:focus-visible .bubble-arrow{transform:translate(3px,-3px)}
.bubble:focus-visible{outline:2px solid #fff;outline-offset:4px}
@media(prefers-reduced-motion:no-preference){
  .bubble{animation:bubble-bob 5.5s ease-in-out var(--d,0s) infinite alternate}
  @keyframes bubble-bob{from{translate:0 -7px}to{translate:0 7px}}
  .motion-ready .contact.reveal .bubble{scale:0;transition:transform .35s cubic-bezier(.2,.7,.2,1),scale .6s cubic-bezier(.34,1.56,.64,1),color .25s,background .25s}
  .motion-ready .contact.reveal.is-visible .bubble{scale:1}
  .motion-ready .contact.reveal.is-visible .bubble:nth-child(2){transition-delay:0s,.12s,0s,0s}
  .motion-ready .contact.reveal.is-visible .bubble:nth-child(3){transition-delay:0s,.22s,0s,0s}
  .motion-ready .contact.reveal.is-visible .bubble:nth-child(4){transition-delay:0s,.32s,0s,0s}
  .motion-ready .contact.reveal.is-visible .bubble:nth-child(5){transition-delay:0s,.42s,0s,0s}
}
@media(max-width:620px){.bubbles{height:300px}.bubble{--size:62px}.bubble-main{--size:140px}}
/* Organisation logos at the top of each experience card. */
.job-logo{grid-column:1/-1;grid-row:auto;justify-self:start;display:flex;align-items:center;height:84px;padding:8px 14px;margin-bottom:10px;border-radius:12px;background:#fff;border:1px solid rgba(20,20,20,.08)}
.job-logo img{display:block;height:100%;width:auto;max-width:260px;object-fit:contain}
.job-logo-square{padding:6px;width:84px;justify-content:center}
.job .org{grid-row:auto}
#contact-github .v{display:inline-flex;align-items:center;gap:10px}
.link-logo{width:22px;height:22px;flex:0 0 22px;color:var(--text)}
/* Bubbles that are buttons look the same as link bubbles. */
button.bubble{border:0;padding:0;cursor:pointer;font:inherit}
/* Contact window for email / phone. */
.contact-dialog{width:min(92vw,420px);padding:28px;border:0;border-radius:20px;background:var(--surface);color:var(--text);box-shadow:0 30px 70px -20px rgba(0,0,0,.5)}
.contact-dialog::backdrop{background:rgba(10,10,12,.55);backdrop-filter:blur(4px)}
.contact-dialog[open]{animation:dialog-in .28s cubic-bezier(.2,.7,.2,1)}
@keyframes dialog-in{from{opacity:0;transform:translateY(12px) scale(.97)}}
.contact-dialog .label{margin:0 0 10px}
.contact-dialog-value{display:block;font:600 clamp(1.15rem,3.6vw,1.45rem)/1.3 var(--body);color:var(--text);text-decoration:none;overflow-wrap:anywhere;user-select:all}
.contact-dialog-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}
.contact-dialog .copy{min-height:44px;padding:12px 20px;font-size:.85rem;text-transform:none;letter-spacing:0;color:#fff}
.contact-dialog .copy.done{background:#3A3A40;border-color:#3A3A40;color:#fff}
.contact-dialog-close{position:absolute;top:12px;right:12px;margin:0}
.contact-dialog-close button{width:36px;height:36px;border:0;border-radius:50%;background:var(--raise);color:var(--text);font-size:1.3rem;line-height:1;cursor:pointer}
.contact-dialog-close button:hover{background:var(--chip-bg)}
.contact-dialog{position:fixed}
/* Currently Exploring: two quietly labelled groups of compact chips inside the existing box. */
.exploring-box h3{margin:0 0 6px}
.exploring-box .explore-intro{margin:0 0 20px;color:var(--muted);max-width:62ch}
.explore-group + .explore-group{margin-top:18px}
.explore-label{margin:0 0 10px;font-size:.68rem}
.explore-chips{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.explore-chip{min-height:38px;padding:8px 14px;border-radius:999px;gap:9px;font-size:.9rem;line-height:1.3;
  background:var(--surface);border:1px solid var(--edge);color:var(--text);
  transition:background-color .18s ease,border-color .18s ease,transform .18s ease}
.explore-chip .chip-logo{width:20px;height:20px;flex:0 0 20px}
.explore-chip .chip-icon{color:var(--muted)}
:root[data-theme='dark'] .explore-chip{background:var(--raise)}
@media(hover:hover) and (pointer:fine){
  .explore-chip:hover{background:var(--raise);border-color:color-mix(in srgb,var(--text) 22%,transparent)}
  :root[data-theme='dark'] .explore-chip:hover{background:#2C2C31}
}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){.explore-chip:hover{transform:translateY(-1px)}}
@media(max-width:620px){.explore-chip{min-height:34px;padding:6px 12px;font-size:.84rem;gap:7px}.explore-chip .chip-logo{width:18px;height:18px;flex-basis:18px}}
/* Qatar University logo in the top-right corner of the degree card (white tile keeps the logo legible in dark mode). */
.education-logo{position:absolute;top:24px;right:24px;display:flex;align-items:center;height:60px;padding:8px 14px;border-radius:12px;background:#fff;border:1px solid rgba(20,20,20,.08)}
.education-logo img{display:block;height:100%;width:auto;max-width:min(210px,40vw)}
@media(max-width:620px){.education-logo{position:static;align-self:flex-start;height:52px;margin-bottom:4px}}
/* Workshops list + certificate gallery: same dark panel and soft "bubble" surfaces as the contact block. */
html details.workshops{margin-top:24px;padding:24px clamp(18px,2.4vw,30px) 28px;border:0;border-radius:24px;background:#2C2C31;color:#E8E8EC}
details.workshops > summary{color:#FFFFFF;font-weight:600;min-height:44px}
details.workshops > summary::marker{color:#8C8C92}
details.workshops #certificate-status,details.workshops > p{color:#BDBDC2}
/* Raised dark surfaces, shaded like the contact bubbles. */
html details.workshops :is(#education .certs li,.certs li,.certificate-card){
  border:0;border-radius:18px;color:#E8E8EC;
  background:radial-gradient(130% 120% at 22% 0%,#4A4A51,#3A3A40 55%,#333338);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07),inset 0 -10px 22px rgba(0,0,0,.28),0 16px 32px -18px rgba(0,0,0,.55);
  transition:background .18s ease,transform .18s ease,box-shadow .18s ease}
html details.workshops :is(.certs li,.certificate-card)::after{content:none}
html #education details.workshops .certs li span:first-child{color:#FFFFFF}
html #education details.workshops .certs li span:last-child,html #education details.workshops .certs li::before{color:#B8B8BE}
html details.workshops .certificate-card h3{color:#FFFFFF}
html details.workshops .certificate-card :is(p,.label){color:#B4B4BA}
html details.workshops .certificate-preview{border-color:rgba(255,255,255,.08)}
@media(hover:hover) and (pointer:fine){
  html details.workshops :is(.certs li,.certificate-card):hover{border-color:transparent;
    background:radial-gradient(130% 120% at 22% 0%,#57575E,#434349 55%,#3A3A40);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.09),inset 0 -10px 22px rgba(0,0,0,.28),0 20px 38px -18px rgba(0,0,0,.85)}
}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){html details.workshops :is(.certs li,.certificate-card):hover{transform:translateY(-2px)}}
/* Buttons become small round-edged bubbles. */
html details.workshops .btn{border:0;color:#FFFFFF;background:radial-gradient(circle at 35% 25%,#66666D,#4C4C52 60%,#434349);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 8px 18px -10px rgba(0,0,0,.8)}
html details.workshops .btn:hover{background:radial-gradient(circle at 35% 25%,#76767D,#56565C 60%,#4C4C52);border:0}
html details.workshops .btn:focus-visible{outline:2px solid #fff;outline-offset:3px}
/* AMIT logo: small source image, so it is shown near its native size to stay sharp. */
.diploma-card{position:relative}
.education-logo.education-logo-amit{height:auto;padding:14px 18px}
.education-logo-amit img{height:31px;width:auto}
/* Hero portrait per theme: colour photo in light mode, black-and-white crowd photo in dark mode. */
.portrait-frame .portrait-dark{display:none}
:root[data-theme='dark'] .portrait-frame .portrait-light{display:none}
:root[data-theme='dark'] .portrait-frame .portrait-dark{display:block}
.portrait-frame .portrait-light{object-position:46% 0;background:#fff}
:root:not([data-theme='dark']) .portrait-frame{background:#fff}
:root:not([data-theme='dark']) .portrait-frame::before{inset:78% 0 0;background:linear-gradient(transparent,rgba(0,0,0,.55))}

/* ---------- Language switch + Arabic (RTL) ---------- */
.btn.lang-toggle{min-height:44px;padding:10px 16px;font-size:.82rem;background:transparent;border:1px solid var(--faint);color:var(--text)}
.btn.lang-toggle:hover{border-color:var(--text)}
.lang-toggle .lang-short{display:none}
.lang-toggle [lang],.lang-toggle{font-family:var(--body)}
@media(max-width:480px){.lang-toggle .lang-long{display:none}.lang-toggle .lang-short{display:inline}.btn.lang-toggle{width:38px;min-height:38px;height:38px;padding:0;border-radius:50%}}
.btn.lang-toggle[lang='ar']{font-family:'IBM Plex Sans Arabic',var(--body)}

/* Arabic typography: one Arabic family for body and headings (Latin product names render in its Latin set). */
html[lang='ar']{--body:'IBM Plex Sans Arabic','Segoe UI',Tahoma,sans-serif;--display:'IBM Plex Sans Arabic','Segoe UI',Tahoma,sans-serif;--mono:'IBM Plex Sans Arabic','Segoe UI',Tahoma,sans-serif}
html[lang='ar'] body{font-family:var(--body);line-height:1.85}
html[lang='ar'] :is(.label,.idx,.why-k,.education-eyebrow,.job .title,.job .when,.explore-label,.skill .label,.card .label,.rail .idx,footer .label){letter-spacing:0;text-transform:none}
html[lang='ar'] .hero h1{letter-spacing:0;line-height:1.25}
html[lang='ar'] .hero h1 .h1-light{font-weight:300}
html[lang='ar'] :is(h1,h2,h3,h4){letter-spacing:0}
html[lang='ar'] .bubble-text{text-align:right;line-height:1.3}
html[lang='ar'] .contact h2{line-height:1.3}

/* RTL: mirror everything that was positioned with physical left/right. */
html[dir='rtl'] .job{border-left:1px solid var(--edge);border-right:4px solid var(--red)}
html[dir='rtl'] .job li{padding-left:0;padding-right:22px}
html[dir='rtl'] .job li::before{left:auto;right:0}
html[dir='rtl'] .approach-list{padding-left:0;padding-right:24px}
html[dir='rtl'] .plan-section ul{padding-left:0;padding-right:24px}
html[dir='rtl'] .education-logo{right:auto;left:24px}
html[dir='rtl'] .project-card::after{right:auto;left:-14px}
@media(max-width:620px){html[dir='rtl'] .project-card::after{left:-6px}}
html[dir='rtl'] .contact-dialog-close{right:auto;left:12px}
html[dir='rtl'] .skip-link{left:auto;right:16px}
html[dir='rtl'] .metrics .metric + .metric{border-left:0;border-right:1px solid rgba(0,0,0,.1)}
:root[data-theme='dark'][dir='rtl'] .metrics .metric + .metric{border-right-color:rgba(255,255,255,.1)}
@media(max-width:820px){html[dir='rtl'] .metrics .metric:nth-child(3){border-right:0}}
html[dir='rtl'] .job-logo,html[dir='rtl'] .education-logo-amit{justify-self:start}
@media(min-width:821px){html[dir='rtl'] .hero-portrait .portrait-frame{right:auto;left:0}}
html[dir='rtl'] .portrait-caption{text-align:right}
html[dir='rtl'] .bubble-arrow{transform:scaleX(-1)}
html[dir='rtl'] .bubble-main:hover .bubble-arrow,html[dir='rtl'] .bubble-main:focus-visible .bubble-arrow{transform:scaleX(-1) translate(3px,-3px)}
/* Email, phone and numbers stay left-to-right inside Arabic text. */
html[dir='rtl'] :is(.contact-dialog-value,.metric b,.diploma-result strong,.when,time){direction:ltr;unicode-bidi:isolate}
html[dir='rtl'] .contact-dialog-value{text-align:right}
/* Mixed Arabic/English labels: each chip takes its direction from its first strong letter, so English names stay in order. */
html[dir='rtl'] :is(.chip,.tag,.hero-skills li,.status-badge){unicode-bidi:plaintext}
.btn.nav-contact{white-space:nowrap}

/* ---------- Theme toggle: centred icon + day/night transition ---------- */
/* .btn has a 10px gap for icon+label; the label here is hidden (font-size:0), so the gap pushed the icon off-centre. */
#theme-toggle{gap:0;justify-content:center;align-items:center;display:inline-flex}
#theme-toggle .theme-icon{margin:0}
/* The new theme is revealed as a growing circle (script drives the clip-path); no default cross-fade underneath. */
::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}
::view-transition-new(root){z-index:2}
::view-transition-old(root){z-index:1}
/* Icon turns as it swaps between sun and moon. */
@media(prefers-reduced-motion:no-preference){
  .theme-icon.is-turning{animation:theme-icon-turn .6s cubic-bezier(.34,1.56,.64,1)}
  @keyframes theme-icon-turn{from{transform:rotate(-120deg) scale(.4);opacity:0}to{transform:none;opacity:1}}
}
/* Fallback for browsers without View Transitions: colours fade instead of snapping. */
html.theme-fading,html.theme-fading *,html.theme-fading *::before,html.theme-fading *::after{
  transition:background-color .45s ease,color .45s ease,border-color .45s ease,fill .45s ease,stroke .45s ease,box-shadow .45s ease!important}

/* ---------- Phone layout refinements ---------- */
@media(max-width:620px){
  /* Tighter rhythm between sections. */
  .sec{padding-block:36px;gap:18px}
  .hero{padding-bottom:32px}
  .contact{padding-block:48px}
  .project-grid{gap:36px;margin-top:20px}
  /* Workshops: compact cards. */
  html #education details.workshops .certs{gap:10px}
  html #education details.workshops .certs li{padding:16px 18px}
  /* Certificate gallery: one horizontal swipe row instead of a 4000px column. */
  html details.workshops .certificate-grid{display:grid;grid-auto-flow:column;grid-auto-columns:82%;grid-template-columns:none;gap:14px;
    overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;padding:4px 2px 14px;margin-inline:-2px;scrollbar-width:thin}
  html details.workshops .certificate-grid > .certificate-card{scroll-snap-align:start}
}
