/* ===========================================================
   Abdikafi Ahmed - portfolio layer
   Waxay dul fadhiisaa css/style.css (midabka iyo qaabka Solaris).
   =========================================================== */

section[id] { scroll-margin-top: calc(var(--nav-h) - 6px); }

/* ---------- Brand + language ---------- */
.brand .mark { background: none; }
.brand .mark { width: 40px; height: 40px; flex: 0 0 40px; }
.brand .mark svg { width: 40px; height: 40px; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; font-size: 1.12rem; }
.brand-name b { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .01em; }
.lang-switch { display: flex; align-items: center; gap: .25rem; margin: 0 .35rem; }
.lang-switch a {
  font-family: var(--ff-head); font-weight: 600; font-size: .82rem;
  color: var(--ink-3); padding: .35rem .6rem; border-radius: 8px;
}
.lang-switch a:hover { color: var(--ink); background: var(--mist); }
.lang-switch a.on { background: var(--ink); color: #fff; }
@media (max-width: 991px) { .lang-switch { margin: .5rem .9rem; } }

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 4.5rem; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 3rem;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.04;
  margin-bottom: 1.1rem;
}
.hero-role {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--ff-head); font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--ink);
  margin-bottom: 1.1rem;
}
.hero-role .bolt {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px;
  background: var(--sun); color: var(--ink);
  display: grid; place-items: center;
}
.hero-role .bolt svg { width: 18px; height: 18px; }
.hero-sub { max-width: 52ch; margin-bottom: 2rem; }

/* portrait stage with circuit traces */
.stage { position: relative; width: 100%; max-width: 520px; margin-inline: auto; aspect-ratio: 1 / 1; }
.traces { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.trace {
  stroke: var(--sun); stroke-width: 2.5;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: draw 1.3s cubic-bezier(.5, 0, .2, 1) forwards;
}
.trace.t2 { animation-delay: .15s; }
.trace.t3 { animation-delay: .3s; }
.nodes circle { fill: var(--sun); opacity: 0; animation: fadein .3s ease 1.3s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: 1; } }

.portrait {
  position: absolute; left: 50%; top: 50%;
  width: 54%; aspect-ratio: 620 / 690;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #fff;
  box-shadow: 0 0 0 4px var(--sun), var(--shadow-lg);
  background: #8896a3;
}
.chip {
  position: absolute;
  left: calc(var(--x) / 520 * 100%);
  top: calc(var(--y) / 520 * 100%);
  transform: translate(-50%, -50%);
  background: #fff; color: var(--ink);
  border: 1.5px solid var(--sun); border-radius: 100px;
  padding: .38rem .85rem;
  font-family: var(--ff-head); font-weight: 600; font-size: .8rem; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  opacity: 0; animation: fadein .5s ease 1.2s forwards;
}
.award {
  position: absolute; left: 0; bottom: 1%;
  max-width: 58%;
  display: flex; align-items: center; gap: .75rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: .75rem .95rem;
  opacity: 0; animation: fadein .5s ease 1.4s forwards;
}
.award .ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px;
  background: var(--sun-soft); color: var(--sun-deep);
  display: grid; place-items: center;
}
.award .ico svg { width: 20px; height: 20px; }
.award .big { display: block; font-family: var(--ff-head); font-weight: 700; font-size: .86rem; line-height: 1.2; color: var(--ink); }
.award .lbl { display: block; font-size: .72rem; line-height: 1.3; color: var(--ink-3); margin-top: .15rem; }

@media (prefers-reduced-motion: reduce) {
  .trace { animation: none; stroke-dashoffset: 0; }
  .nodes circle, .chip, .award { animation: none; opacity: 1; }
}
@media (max-width: 991px) {
  .hero { padding: 2.5rem 0 3.5rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .stage { max-width: 440px; }
}
@media (max-width: 480px) {
  .chip { font-size: .7rem; padding: .3rem .65rem; }
  .chip.c-power { transform: translate(-6%, -50%); }
  .chip.c-solar, .chip.c-emb { transform: translate(-90%, -50%); }
  .stage { margin-bottom: 4rem; }
  .award { left: 4%; bottom: -17%; max-width: 92%; }
}

/* ---------- About ---------- */
.about-grid {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 4.5rem; align-items: start;
}
.about-copy h2, .section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.about-photo { margin: 2rem 0 0; }
.about-photo img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 30%;
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}
.about-photo figcaption { font-size: .85rem; color: var(--ink-3); margin-top: .6rem; }
.skills-h { font-size: 1.3rem; margin-bottom: 1rem; }
.skill-list { list-style: none; border-top: 1px solid var(--line); }
.skill-list li {
  display: grid; grid-template-columns: 44px 1fr; gap: 1.1rem;
  padding: 1.2rem 0; border-bottom: 1px solid var(--line);
}
.skill-list .ico {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--sun-wash); color: var(--sun-deep);
  display: grid; place-items: center;
}
.skill-list .ico svg { width: 22px; height: 22px; }
.skill-list h4 { font-size: 1.02rem; margin-bottom: .25rem; }
.skill-list p { font-size: .95rem; margin: 0; }
@media (max-width: 991px) { .about-grid { grid-template-columns: 1fr; gap: 3rem; } }

/* ---------- Projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.proj {
  appearance: none; font: inherit; text-align: left; cursor: pointer;
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.proj:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.proj:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.proj.hide { display: none; }
.proj-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--mist-2); }
.proj-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.proj:hover .proj-img img { transform: scale(1.05); }
.proj-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.15rem 1.3rem 1.45rem; }
.proj-tag {
  align-self: flex-start;
  font-family: var(--ff-head); font-weight: 600; font-size: .74rem;
  color: var(--leaf-deep); background: var(--leaf-soft);
  padding: .2rem .65rem; border-radius: 100px;
}
.proj-title { font-family: var(--ff-head); font-weight: 700; font-size: 1.12rem; line-height: 1.25; color: var(--ink); letter-spacing: -0.015em; }
.proj-sum {
  font-size: .93rem; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.proj-none { grid-column: 1 / -1; text-align: center; color: var(--ink-3); }
@media (max-width: 991px) { .proj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .proj-grid { grid-template-columns: 1fr; } }

/* project modal */
#projModal .modal-content { border: 0; border-radius: var(--r-lg); overflow: hidden; }
.pm-close {
  position: absolute; top: .9rem; right: .9rem; z-index: 5;
  background-color: #fff; border-radius: 50%; padding: .75rem; opacity: 1;
  box-shadow: var(--shadow-sm);
}
.pm-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.pm-media { background: var(--mist); padding: 1rem; }
.pm-main {
  width: 100%; height: min(60vh, 520px); object-fit: contain;
  border-radius: var(--r-md); background: #fff;
}
.pm-thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.pm-thumbs button {
  padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden;
  width: 68px; height: 52px; background: #fff; cursor: pointer; opacity: .75;
}
.pm-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.pm-thumbs button.on, .pm-thumbs button:hover { opacity: 1; border-color: var(--sun); }
.pm-info { padding: 2.2rem 2.2rem 2.4rem; }
.pm-title { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin: .8rem 0 .5rem; }
.pm-loc { color: var(--ink-3); font-size: .9rem; margin-bottom: 1rem; }
.pm-sum { font-size: 1rem; line-height: 1.7; }
.pm-toolsh { font-family: var(--ff-head); font-weight: 700; font-size: .9rem; color: var(--ink); margin: 1.5rem 0 .6rem; }
.pm-tools { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; }
.pm-tools li {
  background: var(--mist); border: 1px solid var(--line); color: var(--ink);
  font-size: .82rem; font-weight: 600; padding: .3rem .7rem; border-radius: 100px;
}
@media (max-width: 767px) {
  .pm-grid { grid-template-columns: 1fr; }
  .pm-main { height: 300px; }
  .pm-info { padding: 1.5rem 1.4rem 1.8rem; }
}

/* ---------- Experience ---------- */
.exp {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3.5rem; align-items: center; margin-bottom: 4.5rem;
}
.exp:last-child { margin-bottom: 0; }
.exp.flip .exp-collage { order: 2; }
.exp-meta { font-family: var(--ff-head); font-weight: 600; font-size: .88rem; color: var(--leaf-deep); margin-bottom: .45rem; }
.exp-text h3 { font-size: clamp(1.5rem, 2.8vw, 2.05rem); }
.ticks { list-style: none; margin-top: 1.2rem; }
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: .8rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: .7rem; height: .7rem; border-radius: 3px; background: var(--sun);
}
.exp-collage img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.exp-collage.c5 {
  display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(3, 132px); gap: .6rem;
}
.exp-collage.c5 .a { grid-column: 1 / 3; grid-row: 1 / 4; }
.exp-collage.c5 .b { grid-column: 3 / 7; grid-row: 1 / 2; }
.exp-collage.c5 .c { grid-column: 3 / 5; grid-row: 2 / 4; }
.exp-collage.c5 .d { grid-column: 5 / 7; grid-row: 2 / 4; }
.exp-collage.c2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.exp-collage.c2 img { aspect-ratio: 4 / 5; }
.exp-collage.c2 .b { margin-top: 2.2rem; }
@media (max-width: 991px) {
  .exp { grid-template-columns: 1fr; gap: 1.8rem; margin-bottom: 3.5rem; }
  .exp.flip .exp-collage { order: 0; }
  .exp-collage.c5 { grid-template-rows: repeat(3, 110px); }
}

/* ---------- Events ---------- */
.events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.event {
  display: grid; grid-template-columns: 38% 1fr;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.event img { width: 100%; height: 100%; min-height: 230px; object-fit: cover; }
.event-body { padding: 1.4rem 1.5rem 1.5rem; }
.event h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.event p:last-child { font-size: .93rem; margin: 0; }
@media (max-width: 991px) { .events { grid-template-columns: 1fr; } }
@media (max-width: 575px) {
  .event { grid-template-columns: 1fr; }
  .event img { aspect-ratio: 16 / 10; min-height: 0; height: auto; }
}

/* ---------- Certificates ---------- */
.certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.cert {
  appearance: none; font: inherit; text-align: left; cursor: zoom-in;
  display: flex; flex-direction: column; gap: .15rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: .75rem .75rem 1rem;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cert:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.cert:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.cert-img { display: block; aspect-ratio: 4 / 3; background: var(--mist); border-radius: 10px; overflow: hidden; }
.cert-img img { width: 100%; height: 100%; object-fit: contain; }
.cert-title { font-family: var(--ff-head); font-weight: 700; font-size: .95rem; line-height: 1.3; color: var(--ink); margin-top: .65rem; }
.cert-meta { font-size: .8rem; color: var(--ink-3); }
.lightbox-cap { max-width: 80vw; margin-inline: auto; }

/* ---------- Contact ---------- */
.contact { color: rgba(255, 255, 255, .78); }
.contact h2 { color: #fff; font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.contact .lead { color: rgba(255, 255, 255, .78); max-width: 44ch; }
.contact-grid {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 4rem; align-items: start;
}
.contact-list { list-style: none; margin-top: 2rem; }
.contact-list li { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.contact-list svg { width: 20px; height: 20px; color: var(--sun); flex: 0 0 20px; }
.contact-list .in { width: 20px; flex: 0 0 20px; text-align: center; font-weight: 800; font-size: .8rem; color: var(--sun); }
.contact-list span:not(.in) { color: rgba(255, 255, 255, .6); min-width: 4.5rem; }
.contact-list a { color: #fff; font-weight: 600; word-break: break-all; }
.contact-list a:hover { color: var(--sun); }
.contact-card {
  background: #fff; color: var(--ink-2);
  border-radius: var(--r-lg); padding: 2rem; box-shadow: var(--shadow-lg);
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status.err { display: block; background: #fdecea; color: #b42318; }
@media (max-width: 991px) { .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; } }
@media (max-width: 575px) { .contact-card { padding: 1.4rem; } }

/* ---------- Footer ---------- */
.footer-about { max-width: 42ch; }

/* ---------- QR tile (footer) ---------- */
.qr-tile { display: flex; align-items: center; gap: .9rem; margin-top: 1.25rem; color: #c9d3df; font-size: .85rem; max-width: 260px; }
.qr-tile img { width: 88px; height: 88px; border-radius: 12px; background: #fff; padding: 5px; flex: 0 0 88px; transition: transform .2s; }
.qr-tile:hover { color: #fff; }
.qr-tile:hover img { transform: scale(1.05); }
