/* Keep all 36 original 1080px frames; never squeeze the logo into a short box.
   The inline SVG clarity filter sharpens display edges without re-encoding. */
.uploaded-logo.animated-logo { filter: none; }
:root { scroll-padding-top: 112px; }
.header { height: 124px; }
.header.is-scrolled { height: 96px; }
.header .brand {
  width: 330px;
  height: auto;
  max-width: 48%;
  flex-shrink: 1;
  transition: width .35s var(--ease);
}
.header.is-scrolled .brand { width: 264px; }
.header .brand .brand-logo,
.header.is-scrolled .brand .brand-logo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: contain;
  image-rendering: auto;
}
.header-role {
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .11em;
  white-space: nowrap;
  margin-right: clamp(12px, 3vw, 48px);
}
.hero-eyebrow { font-size: clamp(10px, 1.05vw, 14px); letter-spacing: .1em; }
.about-copy .overline {
  display: inline-block;
  font: 700 clamp(15px, 1.2vw, 18px) / 1.5 var(--display);
  letter-spacing: .12em;
}
.intro .intro-mark.uploaded-logo { aspect-ratio: 3 / 1; }
.footer-brand .footer-logo { width: 288px; height: auto; aspect-ratio: 3 / 1; }

/* Real section links, with enough space to read and tap each label. */
.portrait figcaption {
  position: relative;
  inset: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: -8px;
  padding: 18px 0 24px;
  font-size: 12px;
  border-top-color: #67e4ed66;
  z-index: 4;
}
.portrait figcaption > .portrait-name { display: block; margin: 0; letter-spacing: .12em; }
.portrait-links { display: flex; flex-wrap: wrap; gap: 8px; }
.portrait-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #67e4ed70;
  border-radius: 2px;
  background: #0d1820e6;
  color: #b9f5fa;
  font: 700 clamp(13px, 1.15vw, 16px) / 1.3 var(--display);
  letter-spacing: .08em;
  white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s, box-shadow .2s;
}
.portrait-links a:hover, .portrait-links a:focus-visible {
  color: #ffe1b5;
  border-color: #ffb35c;
  background: #30241a;
  box-shadow: 0 0 20px #ffb35c24;
}
.portrait-links a:focus-visible { outline: 2px solid #a2f6ff; outline-offset: 4px; }
.portrait-links a:active { background: #493321; }

/* A supporting portrait beside the copy, rather than an oversized hero.
   Resizing one shared stage keeps the photo, masks and SVG effects aligned. */
.about-grid { min-height: 0; }
.portrait {
  width: 100%;
  max-width: 520px;
  align-self: center;
  justify-self: center;
}
.portrait-frame {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: visible;
}

/* The outer layer owns the scroll entrance; the inner layer owns the loop. */
.portrait-entrance {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  bottom: 0;
}
.portrait-loop {
  position: absolute;
  inset: 0;
  isolation: isolate;
  animation: portrait-hover 6.8s ease-in-out infinite;
  animation-play-state: paused;
}
.portrait .portrait-entrance .portrait-cutout {
  width: 100%;
  left: 0;
  z-index: 1;
  filter: drop-shadow(-3px 0 3px #67e4edbb) drop-shadow(3px 1px 4px #ffb35caa) drop-shadow(0 0 12px #67e4ed55) drop-shadow(8px 7px 24px #02081288);
}
.portrait-aura, .portrait-hologram, .portrait-circuits, .portrait-lightning {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.portrait-aura {
  z-index: 0;
  background: radial-gradient(ellipse at 38% 38%, #67e4ed50, transparent 57%), radial-gradient(ellipse at 70% 65%, #ffb35c38, transparent 49%);
  opacity: .75;
  animation: portrait-aura 6.8s ease-in-out infinite;
  animation-play-state: paused;
}
.portrait-hologram, .portrait-lightning {
  z-index: 2;
  overflow: hidden;
  mask: url('../images/mustafa-cutout.webp') center bottom / contain no-repeat;
  -webkit-mask: url('../images/mustafa-cutout.webp') center bottom / contain no-repeat;
}
.portrait-hologram:before {
  content: '';
  position: absolute;
  inset: -55% 0;
  background: linear-gradient(173deg, transparent 42%, #67e4ed00 47%, #67e4ed45 49.7%, #d4fbff80 50%, #67e4ed24 50.5%, transparent 54%, #ffb35c28 55%, transparent 57%);
  opacity: 0;
  transform: translateY(-38%);
  animation: portrait-scan 6.8s ease-in-out infinite;
  animation-play-state: paused;
}
.portrait-hologram:after {
  content: '';
  position: absolute;
  inset: 25% 0 0;
  background: repeating-linear-gradient(0deg, transparent 0 7px, #a1f6ff12 7px 8px);
  opacity: .28;
}
.portrait-circuits { z-index: 4; overflow: visible; }
.portrait-trace {
  fill: none;
  stroke: #67e4ed;
  stroke-width: 3;
  opacity: .55;
}
.portrait-trace.is-amber { stroke: #ffb35c; }
.portrait-packet {
  fill: none;
  stroke: #8cf4ff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 10 90;
  filter: drop-shadow(0 0 8px #67e4ed);
  animation: portrait-current 6.8s linear infinite;
  animation-play-state: paused;
}
.portrait-packet.is-amber { stroke: #ffd295; filter: drop-shadow(0 0 8px #ffb35c); animation-delay: -3.4s; }
.portrait-node {
  fill: #a7f6ff;
  stroke: #67e4ed;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px #67e4ed);
  animation: portrait-node 3.4s ease-in-out infinite;
  animation-play-state: paused;
}
.portrait-node.is-amber { fill: #ffe1b8; stroke: #ffb35c; filter: drop-shadow(0 0 8px #ffb35c); animation-delay: -1.7s; }
.portrait-arc {
  fill: none;
  stroke: #b9f8ff;
  stroke-width: 4;
  stroke-linejoin: round;
  opacity: 0;
  filter: drop-shadow(0 0 8px #67e4ed);
  animation: portrait-arc 6.8s ease-in-out infinite;
  animation-play-state: paused;
}
.portrait-arc.is-amber { stroke: #ffdcab; filter: drop-shadow(0 0 8px #ffb35c); animation-delay: -3.4s; }

/* Each path is authored from head to hands. A single dash travels down it.
   The alpha mask keeps the bolts inside the photograph, including branches. */
.portrait-lightning {
  z-index: 3;
  -webkit-mask-image: url('../images/mustafa-cutout.webp'), linear-gradient(#000 90%, transparent);
  mask-image: url('../images/mustafa-cutout.webp'), linear-gradient(#000 90%, transparent);
  -webkit-mask-size: contain, 100% 100%;
  mask-size: contain, 100% 100%;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.portrait-bolt { color: #67e4ed; }
.portrait-bolt.is-amber { color: #ffb35c; }
.portrait-bolt use {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 28 104;
  stroke-dashoffset: 28;
  opacity: 0;
  animation: portrait-lightning-down 6s linear infinite;
  animation-delay: var(--bolt-delay);
  animation-play-state: paused;
}
.portrait-bolt .bolt-halo { stroke-width: 16; stroke-opacity: .4; filter: blur(2px); }
.portrait-bolt .bolt-core { stroke: #d5fcff; stroke-width: 4.5; filter: drop-shadow(0 0 6px #67e4ed); }
.portrait-bolt.is-amber .bolt-core { stroke: #fff0d7; filter: drop-shadow(0 0 6px #ffb35c); }
.portrait-bolt .bolt-branch { animation-delay: calc(var(--bolt-delay) + .8s); }
.portrait-bolt .bolt-branch.bolt-core { stroke-width: 3; }
.portrait.is-looping .portrait-loop,
.portrait.is-looping .portrait-aura,
.portrait.is-looping .portrait-hologram:before,
.portrait.is-looping .portrait-packet,
.portrait.is-looping .portrait-node,
.portrait.is-looping .portrait-arc,
.portrait.is-looping .portrait-bolt use { animation-play-state: running; }

@keyframes portrait-hover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes portrait-aura {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}
@keyframes portrait-scan {
  0%, 8% { transform: translateY(-38%); opacity: 0; }
  18% { opacity: .85; }
  62% { opacity: .65; }
  76%, 100% { transform: translateY(38%); opacity: 0; }
}
@keyframes portrait-current { to { stroke-dashoffset: -100; } }
@keyframes portrait-node {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}
@keyframes portrait-arc {
  0%, 24%, 43%, 100% { opacity: 0; }
  32% { opacity: 1; }
  37% { opacity: .4; }
}
@keyframes portrait-lightning-down {
  0% { stroke-dashoffset: 28; opacity: 0; }
  4% { opacity: .95; }
  38% { stroke-dashoffset: -100; opacity: .95; }
  43%, 100% { stroke-dashoffset: -100; opacity: 0; }
}

@media (max-width: 900px) {
  :root { scroll-padding-top: 108px; }
  .header { height: 108px; }
  .header.is-scrolled { height: 92px; }
  .header .brand { width: 288px; }
  .header.is-scrolled .brand { width: 240px; }
  .portrait { max-width: 420px; }
}
@media (max-width: 600px) {
  :root { scroll-padding-top: 100px; }
  .header { height: 92px; padding-inline: 16px; gap: 12px; }
  .header.is-scrolled { height: 84px; }
  .header .brand { width: 216px; max-width: calc(100% - 116px); }
  .header.is-scrolled .brand { width: 198px; }
  .header-actions { flex-shrink: 0; gap: 16px; }
  .portrait { max-width: 340px; }
  .portrait figcaption { padding-bottom: 20px; }
  .portrait-links a { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-entrance { transform: none !important; opacity: 1 !important; filter: none !important; clip-path: none !important; }
  .portrait-loop, .portrait-aura, .portrait-packet, .portrait-node, .portrait-arc,
  .portrait-hologram:before, .portrait-bolt use { animation: none !important; }
  .portrait-hologram, .portrait-circuits, .portrait-lightning { display: none; }
}
@media print {
  .portrait-loop { animation: none; transform: none; }
  .portrait-aura, .portrait-hologram, .portrait-circuits, .portrait-lightning { display: none; }
}
