/*
  Marka sınavı başvuru introsu — Sınav Link / Genel Link sayfası açılınca bir kez oynayan tam ekran sahne.
  Yalnız /Basvuru/{kod} sayfasında, yayında «Sınav İntrosu» açıksa yüklenir (_MarkaIntro).
  Giriş sayfasındaki Zekai introsuyla aynı dili konuşur (ızgara, ağ, radar, şifre çözme) ama ayrı dosyadır.

  Sahne (~8 sn; bursluluk-marka-intro.js zamanlar, aşama sınıfı obi-step-N):
    1  Yayın logosu beyaz plakada ışık süpürmesiyle gelir
    2  Fırça darbesi açılır, başlık harf harf şifre çözülür gibi oturur
    3  Şok dalgası; kep konar, kalem başlığın altını çizer
    4  Sınıf rozeti harf harf yazılır
    5  «Hemen Başvur!» gelir, oklar yükselir
  Tarih ve slogan yoktur. Sahne her iki temada da koyudur.

  Renkler: --obi-bg, --obi-mid, --obi-accent logodan okunur (JS satır içi yazar). Logo okunamazsa
  --orion-… belirteçleri kullanılır. rgba() değerleri koyu sahne üstündeki saydam örtülerdir.
*/

html.obb-intro-open,
html.obb-intro-open body {
  overflow: hidden;
}

.obb-intro {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--orion-blue-fill);
  color: var(--orion-text-on-accent);
  opacity: 1;
  transition: opacity 0.7s ease, visibility 0.7s;
}

.obb-intro.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ───────── Zemin ───────── */
.obb-intro-tint,
.obb-intro-veil {
  position: absolute;
  inset: 0;
}

.obb-intro-tint {
  background: var(--obi-bg, var(--orion-blue-fill));
  opacity: 0;
  transition: opacity 0.5s ease;
}

.obb-intro.has-brand .obb-intro-tint {
  opacity: 1;
}

.obb-intro-veil {
  background: radial-gradient(ellipse at 50% 44%, rgba(0, 0, 0, 0.08) 0, rgba(0, 0, 0, 0.68) 80%);
}

.obb-intro-grid {
  position: absolute;
  inset: -10% -10% -30%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 0, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 0, transparent 70%);
  transform: perspective(600px) rotateX(55deg);
  transform-origin: 50% 100%;
  opacity: 0;
  animation: obi-fade 1.2s ease-out 0.1s forwards, obi-grid 6s linear infinite;
}

.obb-intro-net {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.obb-intro-net line {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: obi-link 1.8s ease-out forwards;
}

.obb-intro-net circle {
  fill: rgba(255, 255, 255, 0.55);
}

.obb-intro-net .obi-packet {
  fill: var(--obi-accent, var(--orion-intro-accent));
  opacity: 0;
}

.obb-intro-radar {
  position: absolute;
  width: 140vmax;
  height: 140vmax;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 300deg, rgba(255, 255, 255, 0.03) 330deg, rgba(255, 255, 255, 0.1) 360deg);
  opacity: 0;
  animation: obi-fade 1s ease-out 0.4s forwards, obi-spin 7s linear infinite;
}

.obb-intro-orbit {
  --obi-orbit: min(92vmin, 640px);
  position: absolute;
  width: var(--obi-orbit);
  height: var(--obi-orbit);
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  opacity: 0;
  animation: obi-fade 1s ease 0.8s forwards, obi-spin 18s linear infinite;
}

.obb-intro-orbit span {
  position: absolute;
  top: -5px;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--obi-accent, var(--orion-intro-accent));
  box-shadow: 0 0 12px var(--obi-accent, var(--orion-intro-accent));
  transform-origin: 5px calc(var(--obi-orbit) / 2 + 5px);
}

.obb-intro-orbit span:nth-child(2) { transform: rotate(120deg); }
.obb-intro-orbit span:nth-child(3) { transform: rotate(240deg); }

/* Afişlerdeki çizgili kenar bantları */
.obb-intro-stripe {
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  background: repeating-linear-gradient(-45deg, var(--obi-mid, var(--orion-blue-fill)) 0 14px, rgba(255, 255, 255, 0.16) 14px 28px);
  transform: scaleX(0);
  transition: transform 0.9s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.obb-intro-stripe.is-top { top: 0; transform-origin: 0 50%; }
.obb-intro-stripe.is-bottom { bottom: 4px; transform-origin: 100% 50%; }

.obb-intro.obi-step-1 .obb-intro-stripe {
  transform: scaleX(1);
}

/* Yükselen oklar */
.obb-intro-fly span {
  position: absolute;
  bottom: -12vh;
  width: clamp(16px, 2.6vw, 34px);
  aspect-ratio: 1 / 1.5;
  background: var(--orion-text-on-accent);
  clip-path: polygon(50% 0, 100% 42%, 68% 42%, 68% 100%, 32% 100%, 32% 42%, 0 42%);
  opacity: 0;
}

.obb-intro-fly span:nth-child(2n) { background: var(--obi-accent, var(--orion-intro-accent)); }
.obb-intro-fly span:nth-child(1) { left: 4%; }
.obb-intro-fly span:nth-child(2) { left: 11%; }
.obb-intro-fly span:nth-child(3) { left: 17%; }
.obb-intro-fly span:nth-child(4) { left: 25%; }
.obb-intro-fly span:nth-child(5) { left: 73%; }
.obb-intro-fly span:nth-child(6) { left: 81%; }
.obb-intro-fly span:nth-child(7) { left: 88%; }
.obb-intro-fly span:nth-child(8) { left: 95%; }

.obb-intro.obi-step-5 .obb-intro-fly span {
  animation: obi-rise 2.6s cubic-bezier(0.25, 0.6, 0.4, 1) infinite;
}

.obb-intro.obi-step-5 .obb-intro-fly span:nth-child(2n) { animation-delay: 0.45s; animation-duration: 3.1s; }
.obb-intro.obi-step-5 .obb-intro-fly span:nth-child(3n) { animation-delay: 0.9s; animation-duration: 2.3s; }

/* Şok dalgası: başlık oturunca */
.obb-intro-shock {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 2px solid var(--obi-accent, var(--orion-intro-accent));
  opacity: 0;
}

.obb-intro.obi-step-3 .obb-intro-shock {
  animation: obi-shock 1.3s ease-out forwards;
}

.obb-intro.obi-step-3 .obb-intro-shock.is-late {
  animation-delay: 0.22s;
}

/* ───────── Sahne ───────── */
.obb-intro-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 2vh, 1.1rem);
  width: min(94vw, 1040px);
  text-align: center;
}

/* Logo her temada beyaz plakada: renkli ya da koyu logolar okunur kalır */
.obb-intro-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(0.5rem, 1.6vh, 0.9rem) clamp(1rem, 3vw, 1.8rem);
  border-radius: 18px;
  background: var(--orion-text-on-accent);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(-34px) scale(0.92);
  transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

/* Yükseklik sabit: logo geç yüklense de sahne yüksekliği baştan bellidir, başlık doğru ölçeklenir. */
.obb-intro-logo {
  display: block;
  height: clamp(52px, 13vh, 112px);
  max-width: min(70vw, 380px);
  width: auto;
  object-fit: contain;
}

.obb-intro-wordmark {
  display: none;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--obi-bg, var(--orion-blue-fill));
}

.obb-intro-brand.is-nologo .obb-intro-wordmark {
  display: block;
}

.obb-intro-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.85) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}

.obb-intro.obi-step-1 .obb-intro-brand {
  opacity: 1;
  transform: none;
}

.obb-intro.obi-step-1 .obb-intro-brand::after {
  animation: obi-sweep 1.1s ease-out 0.35s forwards;
}

/* Başlık */
.obb-intro-titlewrap {
  position: relative;
}

.obb-intro-brush {
  position: absolute;
  inset: -7% -6%;
  width: 112%;
  height: 114%;
  overflow: visible;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.6s cubic-bezier(0.3, 0.8, 0.3, 1);
}

.obb-intro-brush path {
  fill: var(--obi-mid, var(--orion-blue-fill));
}

.obb-intro.obi-step-2 .obb-intro-brush {
  clip-path: inset(-5% -5% -5% -5%);
}

.obb-intro-title {
  position: relative;
  margin: 0;
  font-family: Impact, Haettenschweiler, "Avenir Next Condensed", "Roboto Condensed", "sans-serif-condensed", "Arial Narrow", sans-serif;
  font-size: min(15vw, 17vh);
  font-weight: 900;
  font-synthesis: none;
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--orion-text-on-accent);
  text-shadow: 0 0.05em 0 rgba(0, 0, 0, 0.38);
}

.obb-intro-word {
  display: block;
  white-space: nowrap;
}

.obb-intro-word:last-child:not(:first-child) {
  color: var(--obi-accent, var(--orion-intro-accent));
}

.obb-intro-ch {
  display: inline-block;
  text-align: center;
  opacity: 0;
}

.obb-intro-ch.is-scramble {
  opacity: 0.6;
}

.obb-intro-ch.is-set {
  opacity: 1;
  animation: obi-set 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

/* Kep */
.obb-intro-cap {
  position: absolute;
  top: -11%;
  right: -4.5%;
  width: clamp(44px, 9vmin, 96px);
  height: auto;
  overflow: visible;
  opacity: 0;
  transform: translateY(-70px) rotate(-24deg);
}

.obb-intro-cap-board { fill: var(--orion-text-on-accent); }
.obb-intro-cap-base { fill: var(--obi-accent, var(--orion-intro-accent)); }
.obb-intro-cap-tassel { fill: var(--obi-accent, var(--orion-intro-accent)); }

.obb-intro.obi-step-3 .obb-intro-cap {
  animation: obi-cap 0.6s cubic-bezier(0.3, 0.9, 0.3, 1.3) forwards;
}

/* Kalemin çizdiği alt çizgi */
.obb-intro-underline {
  position: relative;
  width: min(62%, 560px);
  height: 6px;
  margin-top: 0.1rem;
}

.obb-intro-line {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--orion-text-on-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.obb-intro-pencil {
  position: absolute;
  left: 0;
  bottom: 0;
  width: clamp(34px, 6vmin, 58px);
  height: auto;
  margin-left: -4px;
  opacity: 0;
}

.obb-intro-pencil-body { fill: var(--obi-accent, var(--orion-intro-accent)); }
.obb-intro-pencil-wood { fill: var(--orion-text-on-accent); }
.obb-intro-pencil-lead { fill: var(--obi-mid, var(--orion-blue-fill)); }
.obb-intro-pencil-end { fill: var(--orion-text-on-accent); }

.obb-intro.obi-step-3 .obb-intro-line {
  animation: obi-draw 0.7s ease-in-out 0.1s forwards;
}

.obb-intro.obi-step-3 .obb-intro-pencil {
  animation: obi-pencil 0.7s ease-in-out 0.1s forwards;
}

/* Sınıf rozeti */
.obb-intro-badge {
  max-width: 100%;
  padding: 0.45rem clamp(1rem, 3vw, 1.7rem);
  border: 2px solid var(--obi-accent, var(--orion-intro-accent));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--orion-text-on-accent);
  font-size: clamp(1rem, 3.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(14px) scale(0.94);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.obb-intro.obi-step-4 .obb-intro-badge {
  opacity: 1;
  transform: none;
}

.obb-intro-badge .obi-c {
  opacity: 0;
}

.obb-intro-badge .obi-c.is-on {
  opacity: 1;
}

.obb-intro-badge .obi-c.is-cur {
  box-shadow: 2px 0 0 var(--obi-accent, var(--orion-intro-accent));
}

/* «Hemen Başvur!» */
.obb-intro-apply {
  margin-top: 0.2rem;
  padding: clamp(0.5rem, 1.6vh, 0.75rem) 2rem;
  border: 0;
  border-radius: 999px;
  background: var(--orion-text-on-accent);
  color: var(--obi-bg, var(--orion-blue-fill));
  font-size: clamp(1.05rem, 3.6vw, 1.5rem);
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  opacity: 0;
  transform: translateY(18px) scale(0.9);
}

.obb-intro.obi-step-5 .obb-intro-apply {
  animation: obi-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3) forwards, obi-beat 1.3s ease-in-out 0.9s infinite;
}

.obb-intro-apply:focus-visible {
  outline: 3px solid var(--obi-accent, var(--orion-intro-accent));
  outline-offset: 3px;
}

/* İlerleme ve Atla */
.obb-intro-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.16);
}

.obb-intro-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--obi-accent, var(--orion-intro-accent));
  animation: obi-progress var(--obi-duration, 8s) linear forwards;
}

.obb-intro-skip {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  padding: 0.35rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--orion-text-on-accent);
  font-size: 0.85rem;
  opacity: 0;
  animation: obi-fade 0.5s ease 1s forwards;
}

.obb-intro-skip:hover,
.obb-intro-skip:focus-visible {
  background: rgba(0, 0, 0, 0.5);
  outline: none;
}

/* ───────── Kareler ───────── */
@keyframes obi-fade { to { opacity: 1; } }
@keyframes obi-spin { to { transform: rotate(360deg); } }
@keyframes obi-grid { to { background-position: 0 48px, 0 48px; } }
@keyframes obi-link { to { stroke-dashoffset: 0; } }
@keyframes obi-sweep { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@keyframes obi-set { from { transform: translateY(-0.12em) scale(1.18); } to { transform: none; } }
@keyframes obi-shock { 0% { opacity: 0.9; transform: scale(0.4); } 100% { opacity: 0; transform: scale(6); } }
@keyframes obi-cap { to { opacity: 1; transform: rotate(12deg); } }
@keyframes obi-draw { to { transform: scaleX(1); } }
@keyframes obi-pencil { 0% { left: 0; opacity: 1; } 100% { left: 100%; opacity: 1; } }
@keyframes obi-in { to { opacity: 1; transform: none; } }
@keyframes obi-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes obi-rise { 0% { opacity: 0; transform: translateY(0); } 18% { opacity: 0.75; } 100% { opacity: 0; transform: translateY(-105vh); } }
@keyframes obi-progress { to { width: 100%; } }

/* Hareket azaltma: bitmiş hâl, kısa süre, sonra kapanır */
@media (prefers-reduced-motion: reduce) {
  .obb-intro *,
  .obb-intro *::after {
    animation: none !important;
    transition: none !important;
  }

  .obb-intro-brand,
  .obb-intro-ch,
  .obb-intro-badge,
  .obb-intro-badge .obi-c,
  .obb-intro-apply,
  .obb-intro-skip { opacity: 1 !important; transform: none !important; }
  .obb-intro-cap { opacity: 1 !important; transform: rotate(12deg) !important; }
  .obb-intro-brush { clip-path: none !important; }
  .obb-intro-line { transform: none !important; }
  .obb-intro-pencil { opacity: 1 !important; left: 100% !important; }
  .obb-intro-stripe { transform: none !important; }
  .obb-intro-grid,
  .obb-intro-radar,
  .obb-intro-orbit { opacity: 0.6 !important; }
  .obb-intro-fly { display: none; }
  .obb-intro-progress span { width: 100%; }
}
