/* Version 4 layout refinements. Loaded after styles.css. */
:root{
  --v4-blue:#18358f;
  --v4-blue-deep:#10295f;
  --v4-navy:#0b2540;
  --v4-teal:#118a8f;
  --v4-green:#54d844;
  --v4-cyan:#42b9ff;
  --v4-gold:#f2bd69;
  --v4-bg:#f4f6f8;
  --v4-card:#ffffff;
  --v4-line:#dce4e9;
  --v4-copy:#4e6372;
  --v4-shadow:0 18px 45px rgba(10,33,56,.10);
}

/* Header */
.site-header{background:rgba(255,255,255,.96);box-shadow:0 1px 0 rgba(10,33,56,.05)}
.brand{min-width:0}
.brand-avatar{border:0;box-shadow:none;background:transparent;object-fit:contain}
.brand small{letter-spacing:.01em}
.nav{height:72px}
.nav-links{gap:24px}

/* Home hero, inspired by the original portfolio without copying its layout literally */
.v4-hero{
  position:relative;
  overflow:hidden;
  color:#fff;
  background:
    radial-gradient(circle at 14% 16%,rgba(36,142,202,.34),transparent 30%),
    radial-gradient(circle at 83% 18%,rgba(54,57,177,.42),transparent 37%),
    linear-gradient(118deg,#123557 0%,#182f77 49%,#161b64 100%);
}
.v4-hero:before,.v4-hero:after{
  content:"";
  position:absolute;
  pointer-events:none;
  border:1px solid rgba(87,180,255,.14);
  border-radius:50%;
  filter:blur(.2px);
}
.v4-hero:before{width:880px;height:300px;left:-330px;bottom:-170px;transform:rotate(-10deg)}
.v4-hero:after{width:720px;height:240px;right:-260px;top:-120px;transform:rotate(18deg)}
.v4-hero-grid{
  position:relative;
  z-index:1;
  min-height:560px;
  display:grid;
  grid-template-columns:minmax(0,1.18fr) minmax(330px,.82fr);
  align-items:center;
  gap:70px;
  padding:64px 0 70px;
}
.v4-hero-copy{max-width:760px}
.v4-hero h1{
  margin:0;
  color:#fff;
  font-size:clamp(4rem,7vw,6.2rem);
  line-height:.94;
  letter-spacing:-.055em;
  font-weight:650;
}
.v4-discipline{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  margin:28px 0 0;
  font-size:clamp(1.22rem,2.15vw,1.75rem);
  font-weight:780;
  letter-spacing:-.02em;
}
.v4-discipline b{color:rgba(255,255,255,.86);font-weight:450}
.v4-discipline .finance{color:var(--v4-green)}
.v4-discipline .strategy{color:var(--v4-cyan)}
.v4-discipline .automation{color:var(--v4-gold)}
.v4-hero-copy>p{
  max-width:680px;
  margin:28px 0 30px;
  color:rgba(255,255,255,.82);
  font-size:1.07rem;
  line-height:1.65;
}
.v4-primary-button,.v4-outline-button,.v4-role-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  border-radius:12px;
  padding:0 20px;
  font-size:.86rem;
  font-weight:850;
  transition:transform .18s ease,box-shadow .18s ease,background .18s ease;
}
.v4-primary-button{background:#2ca8ff;color:#fff;box-shadow:0 10px 24px rgba(5,22,61,.25)}
.v4-primary-button:hover{transform:translateY(-2px);background:#45b4ff}
.v4-portrait-block{justify-self:center;text-align:center}
.v4-portrait-frame{
  width:clamp(320px,31vw,430px);
  aspect-ratio:1;
  border-radius:50%;
  overflow:hidden;
  background:#12276f;
  box-shadow:0 26px 70px rgba(2,12,44,.28);
}
.v4-portrait-frame img{width:100%;height:100%;object-fit:cover}
.v4-social-row{display:flex;justify-content:center;gap:14px;margin-top:24px}
.v4-social-row a{
  width:44px;height:44px;border-radius:50%;display:grid;place-items:center;
  color:#fff;background:#2ca8ff;border:1px solid rgba(255,255,255,.15);
  box-shadow:0 8px 20px rgba(4,17,49,.18);transition:.18s ease;
}
.v4-social-row a:hover{transform:translateY(-2px);background:#44b4ff}
.v4-social-row svg{width:20px;height:20px;fill:currentColor}

/* Recruiter role-fit card */
.v4-role-strip{position:relative;z-index:3;background:var(--v4-bg);padding:0 0 24px}
.v4-role-card{
  transform:translateY(-30px);
  display:grid;
  grid-template-columns:58px minmax(0,1fr) auto;
  align-items:center;
  gap:20px;
  min-height:126px;
  padding:22px 24px;
  border:1px solid var(--v4-line);
  border-radius:20px;
  background:#fff;
  box-shadow:0 16px 42px rgba(10,33,56,.12);
}
.v4-role-icon{width:54px;height:54px;display:grid;place-items:center;border-radius:16px;background:#e5f6f5}
.v4-role-icon img{width:38px;height:38px}
.v4-role-copy>span,.v4-section-heading span,.v4-page-hero>div>span,.v4-project-group-head span,.v4-skills-title>span{
  color:var(--v4-teal);font-size:.68rem;font-weight:900;text-transform:uppercase;letter-spacing:.13em
}
.v4-role-copy h2{margin:3px 0 3px;color:var(--v4-navy);font-size:1.25rem;letter-spacing:-.025em}
.v4-role-copy p{margin:0;color:var(--v4-copy);font-size:.8rem}
.v4-role-button{border:0;background:var(--v4-navy);color:#fff;white-space:nowrap;box-shadow:0 8px 20px rgba(11,37,64,.16)}
.v4-role-button:hover{transform:translateY(-2px);background:#143a5f}

/* Home and project listing */
.v4-section{padding:68px 0}
.v4-section-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-bottom:24px}
.v4-section-heading h2,.v4-skills-title h2{margin:5px 0 0;color:var(--v4-navy);font-size:clamp(2rem,3.4vw,2.85rem);line-height:1.05;letter-spacing:-.04em}
.v4-section-heading>a{color:var(--v4-teal);font-size:.8rem;font-weight:850}
.v4-section-heading>a:hover{text-decoration:underline}
.v4-featured-projects,.v4-project-page-grid.featured{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.v4-project-card{display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--v4-line);border-radius:18px;background:#fff;min-width:0;transition:.18s ease}
.v4-project-card:hover{transform:translateY(-3px);box-shadow:var(--v4-shadow);border-color:#c7d5dc}
.v4-project-image{display:block;position:relative;height:205px;overflow:hidden;background:#edf2f5}
.v4-project-image>img{width:100%;height:100%;object-fit:cover;transition:transform .25s ease}
.v4-project-card:hover .v4-project-image>img{transform:scale(1.02)}
.v4-project-image.v4-ai-cover>img,.v4-project-image.v4-trading-cover>img{object-fit:cover}
.v4-project-copy{display:flex;flex-direction:column;flex:1;padding:18px 19px 20px}
.v4-tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.v4-tags span{padding:5px 8px;border-radius:99px;background:#e8f1f3;color:#486373;font-size:.57rem;font-weight:850;text-transform:uppercase;letter-spacing:.045em}
.v4-tags span:first-child{background:#dff6f4;color:#0d777b}
.v4-project-copy h3{margin:0 0 8px;color:var(--v4-navy);font-size:1.18rem;line-height:1.18;letter-spacing:-.025em}
.v4-project-copy p{margin:0;color:var(--v4-copy);font-size:.79rem;line-height:1.52}
.v4-card-link{margin-top:auto;padding-top:15px;color:var(--v4-teal);font-size:.76rem;font-weight:850}
.v4-more-row{text-align:center;margin-top:25px}
.v4-outline-button{border:1px solid #b9cad3;color:var(--v4-navy);background:#fff}
.v4-outline-button:hover{transform:translateY(-2px);border-color:var(--v4-teal);color:var(--v4-teal);box-shadow:0 8px 20px rgba(10,33,56,.08)}
.v4-tool-fallback,.v4-assistant-cover>div{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;text-align:center;padding:24px;background:linear-gradient(145deg,#e7f4f4,#eef2ff);color:var(--v4-navy)}
.v4-tool-fallback img,.v4-assistant-cover img{width:72px;height:72px;object-fit:contain}
.v4-tool-fallback strong,.v4-assistant-cover strong{font-size:1.05rem}
.v4-tool-fallback span,.v4-assistant-cover span{font-size:.72rem;color:var(--v4-copy)}
.v4-credential-preview{background:var(--v4-bg);padding-top:62px;padding-bottom:72px}
.v4-cert-preview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.v4-cert-mini{display:flex;align-items:center;gap:14px;min-height:108px;padding:15px 16px;border:1px solid var(--v4-line);border-radius:16px;background:#fff;transition:.18s ease}
.v4-cert-mini:hover{transform:translateY(-2px);box-shadow:0 12px 30px rgba(10,33,56,.08);border-color:#c6d4da}
.v4-cert-mini img{width:64px;height:64px;object-fit:contain;flex:0 0 auto}
.v4-cert-mini strong{display:block;color:var(--v4-navy);font-size:.81rem;line-height:1.25}
.v4-cert-mini span{display:block;color:var(--v4-copy);font-size:.68rem;margin-top:4px}

/* Interior page heroes */
.v4-page-hero{background:linear-gradient(180deg,#f7fafb,#fff);padding:64px 0 40px;border-bottom:1px solid #edf1f3}
.v4-page-hero h1{margin:7px 0 0;max-width:900px;color:var(--v4-navy);font-size:clamp(2.8rem,5.2vw,4.6rem);line-height:.98;letter-spacing:-.055em}
.v4-page-hero p{max-width:720px;margin:18px 0 0;color:var(--v4-copy);font-size:.98rem}
.v4-project-group-head{margin-bottom:15px}
.v4-project-group-head.secondary{margin-top:44px}
.v4-project-page-grid.secondary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.v4-project-page .v4-project-image{height:235px}

/* Certifications */
.v4-certs-section{background:var(--v4-bg)}
.v4-cert-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}
.v4-cert-card{min-height:330px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;text-align:center;padding:25px 20px 22px;border:1px solid var(--v4-line);border-radius:20px;background:#fff;transition:.18s ease}
.v4-cert-card:hover{transform:translateY(-3px);box-shadow:var(--v4-shadow);border-color:#c3d2d9}
.v4-cert-card>img{width:175px;height:175px;object-fit:contain}
.v4-cert-card>div>span{color:var(--v4-copy);font-size:.7rem;text-transform:uppercase;letter-spacing:.075em;font-weight:800}
.v4-cert-card h2{margin:6px 0 9px;color:var(--v4-navy);font-size:1.08rem;line-height:1.24}
.v4-cert-card b{color:var(--v4-teal);font-size:.74rem}
.v4-skills-title{margin:68px 0 23px}
.v4-skill-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.v4-skill-card{min-height:425px;padding:29px 28px;border:1px solid var(--v4-line);border-radius:20px;background:#fff}
.v4-skill-kicker{display:flex;align-items:center;gap:10px;color:var(--v4-teal);font-size:.69rem;font-weight:900;text-transform:uppercase;letter-spacing:.13em}
.v4-skill-kicker i{display:block;width:31px;height:2px;background:var(--v4-teal)}
.v4-skill-card h3{margin:23px 0 22px;color:var(--v4-navy);font-size:1.4rem;line-height:1.18;letter-spacing:-.025em}
.v4-skill-card ul{list-style:none;margin:0;padding:0}
.v4-skill-card li{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:57px;border-bottom:1px solid #e5ebee;color:#2e5570;font-size:.9rem}
.v4-skill-card li:last-child{border-bottom:0}
.v4-skill-card li>span{display:flex;align-items:center;gap:9px;min-width:0}
.v4-skill-card li img{width:25px;height:25px;object-fit:contain;flex:0 0 auto}
.v4-skill-card li b{color:#66829a;font-size:.67rem;font-weight:600;white-space:nowrap}

/* Contact form remains compact and clear */
.contact-form{box-shadow:none}

/* Persistent assistant */
.ai-fab{box-shadow:0 14px 35px rgba(10,33,56,.22)}
.ai-fab img{background:transparent}
.drawer-note{font-size:.64rem;line-height:1.35}

@media(max-width:1000px){
  .v4-hero-grid{grid-template-columns:1fr 360px;gap:32px;min-height:520px}
  .v4-featured-projects,.v4-project-page-grid.featured{grid-template-columns:repeat(2,minmax(0,1fr))}
  .v4-featured-projects .v4-project-card:last-child,.v4-project-page-grid.featured .v4-project-card:last-child{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr}
  .v4-featured-projects .v4-project-card:last-child .v4-project-image,.v4-project-page-grid.featured .v4-project-card:last-child .v4-project-image{height:100%;min-height:230px}
  .v4-cert-preview-grid,.v4-cert-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .v4-skill-grid{grid-template-columns:1fr}
  .v4-skill-card{min-height:0}
}

@media(max-width:760px){
  .container{width:min(100% - 30px,var(--container))}
  .v4-hero-grid{grid-template-columns:1fr;gap:35px;min-height:0;padding:50px 0 62px;text-align:center}
  .v4-hero-copy{margin:auto}
  .v4-hero h1{font-size:clamp(3.3rem,17vw,5rem)}
  .v4-discipline{justify-content:center;font-size:1.08rem;gap:8px}
  .v4-hero-copy>p{font-size:.94rem;margin:23px auto 26px}
  .v4-portrait-block{order:-1}
  .v4-portrait-frame{width:min(76vw,340px)}
  .v4-social-row{margin-top:16px}
  .v4-role-card{transform:translateY(-22px);grid-template-columns:48px 1fr;gap:14px;padding:18px}
  .v4-role-icon{width:46px;height:46px}
  .v4-role-icon img{width:33px;height:33px}
  .v4-role-copy h2{font-size:1.03rem}
  .v4-role-copy p{font-size:.73rem}
  .v4-role-button{grid-column:1/-1;width:100%}
  .v4-section{padding:54px 0}
  .v4-section-heading{align-items:flex-start}
  .v4-section-heading h2,.v4-skills-title h2{font-size:2rem}
  .v4-featured-projects,.v4-project-page-grid.featured,.v4-project-page-grid.secondary{grid-template-columns:1fr}
  .v4-featured-projects .v4-project-card:last-child,.v4-project-page-grid.featured .v4-project-card:last-child{grid-column:auto;display:flex}
  .v4-featured-projects .v4-project-card:last-child .v4-project-image,.v4-project-page-grid.featured .v4-project-card:last-child .v4-project-image{height:205px;min-height:0}
  .v4-cert-preview-grid,.v4-cert-grid{grid-template-columns:1fr}
  .v4-cert-mini{min-height:90px}
  .v4-cert-card{min-height:275px}
  .v4-cert-card>img{width:145px;height:145px}
  .v4-page-hero{padding:48px 0 32px}
  .v4-page-hero h1{font-size:2.7rem}
  .v4-skill-card{padding:23px 21px}
  .v4-skill-card h3{font-size:1.2rem}
  .ai-fab span{display:none}
  .ai-fab{width:54px;height:54px;padding:0;justify-content:center;border-radius:50%}
}

/* Small final refinements */
[hidden]{display:none!important}
.v4-discipline b{margin:0 3px}
.v4-page-hero{padding:48px 0 34px}
.v4-page-hero h1{font-size:clamp(2.75rem,4.4vw,3.8rem);max-width:760px}
.v4-page-hero p{margin-top:13px;max-width:760px}
