/* =========================================================
   Laboratuvar & görsel efektler
   ========================================================= */

main { position: relative; }

/* Hero arka planı: grid + tarama çizgisi */
.hero-bg {
  position: absolute; top: calc(var(--header-h) * -1); left: 0; right: 0; height: calc(100vh + 40px);
  pointer-events: none; overflow: hidden; z-index: 0;
  background-image:
    linear-gradient(rgba(121, 192, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(121, 192, 255, .06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 75%);
}
.scanline {
  position: absolute; left: 0; right: 0; height: 160px; top: -160px;
  background: linear-gradient(180deg, transparent, rgba(63, 185, 80, .10) 70%, rgba(63, 185, 80, .45) 99%, transparent);
  animation: scan 7s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes scan { 0% { transform: translateY(0); } 70%, 100% { transform: translateY(calc(100vh + 200px)); } }
.hero { position: relative; z-index: 1; }

/* İmleci takip eden ışık + grain */
body.has-glow::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, -999px) var(--my, -999px), rgba(63, 185, 80, .07), transparent 45%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 95; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.section, .site-footer { position: relative; z-index: 1; }

/* Kartlarda imleç spotlight'ı */
.suite, .contact-link, .lab-btn {
  background-image: radial-gradient(360px circle at var(--x, -999px) var(--y, -999px), rgba(63, 185, 80, .10), transparent 45%);
}
.card {
  background-image:
    radial-gradient(360px circle at var(--x, -999px) var(--y, -999px), rgba(63, 185, 80, .10), transparent 45%),
    linear-gradient(180deg, var(--panel), var(--bg-2));
  transition: border-color .2s, opacity .6s ease, transform .6s ease;
}
.card:hover { border-color: var(--border-strong); }

/* İsimde RGB-split glitch (hover) */
.hero h1 { position: relative; }
.hero h1:hover { animation: rgb-split .5s steps(2) 2; }
@keyframes rgb-split {
  0% { text-shadow: 3px 0 rgba(255, 123, 114, .8), -3px 0 rgba(121, 192, 255, .8); }
  50% { text-shadow: -2px 1px rgba(255, 123, 114, .8), 2px -1px rgba(63, 185, 80, .8); }
  100% { text-shadow: none; }
}

/* Coverage ölçer */
.cov { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.cov-bar { position: relative; width: 64px; height: 6px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; }
.cov-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--yellow), var(--green)); border-radius: 99px; transition: width .6s cubic-bezier(.2, 1, .3, 1); }
.cov-text { font-size: 12px; color: var(--muted); min-width: 7ch; }
.cov.full .cov-text { color: var(--green); }
.cov.full .cov-bar { border-color: rgba(63, 185, 80, .5); box-shadow: 0 0 12px rgba(63, 185, 80, .35); }

/* Laboratuvar: terminalin altında sakin bir satır */
.hero-side { display: grid; gap: 14px; min-width: 0; }
.lab { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 0 4px; }
.lab-title { font-size: 13px; color: var(--muted); font-weight: 500; margin-right: 2px; }
.lab-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  font: 500 13px var(--font-body); color: var(--muted); background-color: transparent;
  border: 1px solid var(--border); transition: border-color .15s, color .15s;
}
.lab-btn:hover { border-color: var(--green); color: var(--text); }
.lab-btn[aria-pressed="true"] { border-color: var(--blue); color: var(--text); background-color: rgba(121, 192, 255, .12); }
.lab-danger:hover { border-color: var(--red); }
.lab-icon { color: var(--green); font-weight: 700; font-size: 12px; }

/* Kayan araç şeridi */
.marquee {
  position: relative; z-index: 1; overflow: hidden; padding: 16px 0;
  border-block: 1px solid var(--border); background: rgba(15, 20, 27, .7);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; gap: 36px; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.mq-item { display: inline-block; font: 500 15px var(--font-mono); color: var(--muted); white-space: nowrap; }
.mq-tick { color: var(--green); margin-right: 10px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Kaos */
body.chaos { animation: chaos-shake .35s linear 3; }
body.chaos .hero-bg { filter: hue-rotate(-120deg) saturate(2.5); }
@keyframes chaos-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.glitch { animation: glitch .25s steps(2) infinite; color: var(--red) !important; }
@keyframes glitch {
  0% { text-shadow: 3px 0 rgba(255, 123, 114, .9), -3px 0 rgba(121, 192, 255, .9); clip-path: inset(0 0 40% 0); }
  50% { text-shadow: -3px 0 rgba(255, 123, 114, .9), 3px 0 rgba(63, 185, 80, .9); clip-path: inset(30% 0 0 0); }
  100% { text-shadow: none; clip-path: none; }
}

.ci {
  position: fixed; z-index: 80; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 14px;
  background: rgba(10, 14, 19, .96); border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .9);
}
.ci[hidden] { display: none; }
.ci[data-state="failed"] { border-color: var(--red); }
.ci[data-state="passed"] { border-color: var(--green); }
.ci-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.ci-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); animation: blink .8s steps(1) infinite; flex: none; }
.ci[data-state="failed"] .ci-dot { background: var(--red); }
.ci[data-state="passed"] .ci-dot { background: var(--green); animation: none; }
.ci-lines { display: grid; gap: 4px; font-size: 13px; }
.ci-lines .fail { color: var(--red); }
.ci-lines .pass { color: var(--green-strong); }

/* Locator modu */
body.inspecting, body.inspecting * { cursor: crosshair !important; }
.inspect-box {
  position: fixed; z-index: 85; pointer-events: none;
  background: rgba(121, 192, 255, .14); outline: 1px solid var(--blue); border-radius: 3px;
  transition: all .08s ease-out;
}
.inspect-label {
  position: fixed; z-index: 86; pointer-events: none; max-width: calc(100vw - 16px);
  padding: 6px 10px; border-radius: 7px; font-size: 12.5px; line-height: 1.45;
  background: #0d1520; color: var(--blue); border: 1px solid var(--blue);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .9); overflow-wrap: anywhere;
}
.inspect-box[hidden], .inspect-label[hidden] { display: none; }
.inspect-size { display: block; color: var(--muted); font-size: 11.5px; }

/* Terminal */
.term {
  width: min(820px, calc(100vw - 24px)); height: min(560px, calc(100vh - 48px)); padding: 0;
  background: #0a0e13; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .9);
  flex-direction: column; overflow: hidden;
}
.term[open] { display: flex; }
.term::backdrop { background: rgba(4, 7, 10, .65); backdrop-filter: blur(4px); }
.term .terminal-bar { flex: none; }
.term-close { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.term-close:hover { color: var(--text); }
.term-out { flex: 1; overflow-y: auto; padding: 16px 18px 4px; font-size: 13.5px; line-height: 1.6; }
.tl { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.6em; }
.tl-banner { line-height: 1.15; min-height: 0; overflow-wrap: normal; white-space: pre; }
.tl-cmd { color: var(--text); margin-top: 6px; }
.tl-green { color: var(--green-strong); }
.tl-red { color: var(--red); }
.tl-warn { color: var(--yellow); }
.tl-dim { color: var(--muted); }
.tl-blue { color: var(--blue); }
.tl-strong { font-weight: 600; }
.tl-json { color: var(--purple); }
.tl a { color: var(--blue); }
.term-form { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--border); }
.term-prompt { color: var(--green); font-weight: 700; }
.term-input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--text); font: 15px var(--font-mono); caret-color: var(--green); }
.term-input:focus { outline: none; }
.term-input::placeholder { color: var(--faint); }

@media (max-width: 900px) {
  .cov-bar { width: 44px; }
}
@media (max-width: 600px) {
  .cov-text { display: none; }
  .term-out { font-size: 12px; padding: 12px; }
  .tl-banner { font-size: 10px; }
  .hero-bg { background-size: 40px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .scanline, .marquee-track { animation: none !important; }
}

/* Bug avı paneli: kapalı / açık durum */
.bh .bh-live, .bh.active .bh-idle { display: none; }
.bh.active .bh-live { display: block; }
.bh #bh-count { display: none; }
.bh.active #bh-count { display: inline; }
.bh.active .bh-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bh-pill { position: relative; }
.btn-go { background: var(--green); color: #04110a; border-color: var(--green); }
.btn-go:hover { background: var(--green-strong); border-color: var(--green-strong); }
