/* ==========================================================================
   GÜNEŞ DİLİ — "Güneş Katmanı" (enhance.css)
   Orijinal sayfaların üzerine biner; orijinal CSS/JS'e dokunmaz.
   ========================================================================== */

:root {
  --sx-gold: #FFD700;
  --sx-amber: #FF9800;
  --sx-cyan: #00E5FF;
  --sx-ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Okuma ilerleme çubuğu ---------- */
#sx-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--sx-amber), var(--sx-gold) 45%, var(--sx-cyan));
  box-shadow: 0 0 14px rgba(255, 215, 0, .8), 0 0 4px rgba(0, 229, 255, .8);
  pointer-events: none;
}

/* ---------- Yıldız / kıvılcım alanı ---------- */
#sx-stars {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
}

/* ---------- İmleç ışığı ---------- */
#sx-cursor {
  position: fixed; left: 0; top: 0; width: 460px; height: 460px; margin: -230px 0 0 -230px;
  border-radius: 50%; pointer-events: none; z-index: 0; opacity: 0;
  background: radial-gradient(circle, rgba(255, 200, 40, .10) 0%, rgba(255, 150, 0, .045) 38%, transparent 68%);
  transition: opacity .6s; mix-blend-mode: screen; will-change: transform;
}
#sx-cursor.on { opacity: 1; }

/* ---------- Açılış: gün doğumu ---------- */
#sx-intro {
  position: fixed; inset: 0; z-index: 5000; overflow: hidden; cursor: pointer;
  background: #03050a;
  display: grid; place-items: center;
  transition: opacity .9s ease .1s, visibility 0s linear 1s;
}
#sx-intro.out { opacity: 0; visibility: hidden; }
#sx-intro .horizon {
  position: absolute; left: 50%; bottom: -55vmin; width: 110vmin; height: 110vmin; margin-left: -55vmin;
  border-radius: 50%;
  background: radial-gradient(circle, #fff7c2 0%, #ffd700 28%, #ff9800 52%, rgba(255, 120, 0, .25) 66%, transparent 72%);
  filter: blur(2px);
  animation: sx-rise 2.1s cubic-bezier(.22, .8, .25, 1) forwards;
}
#sx-intro .sky {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(255, 140, 0, .55), rgba(255, 80, 0, .12) 35%, transparent 70%);
  opacity: 0; animation: sx-sky 2.1s ease forwards;
}
#sx-intro .mark { position: relative; text-align: center; opacity: 0; animation: sx-mark 1.4s ease .55s forwards; }
#sx-intro .mark img { width: clamp(84px, 14vmin, 130px); filter: drop-shadow(0 0 30px rgba(255, 215, 0, .8)); }
#sx-intro .mark b {
  display: block; margin-top: 14px; font: 800 clamp(20px, 4vmin, 34px) 'Cinzel', Georgia, serif;
  letter-spacing: .5em; text-indent: .5em; color: #ffe57f; text-shadow: 0 0 24px rgba(255, 190, 0, .7);
}
#sx-intro .mark small { display: block; margin-top: 8px; font: 500 11px 'IBM Plex Mono', monospace; letter-spacing: .3em; color: #8f9bb3; }
@keyframes sx-rise { from { transform: translateY(46vmin) scale(.6); } to { transform: translateY(-34vmin) scale(1); } }
@keyframes sx-sky { to { opacity: 1; } }
@keyframes sx-mark { from { opacity: 0; transform: translateY(14px); letter-spacing: .1em; } to { opacity: 1; transform: none; } }

/* ---------- Hero: canlı güneş ---------- */
.hero { isolation: isolate; }
#sx-fractal {
  position: absolute; left: 50%; top: -60px; width: 120%; height: calc(100% + 60px); transform: translateX(-50%);
  z-index: -1; pointer-events: none; opacity: .34;
  -webkit-mask-image: radial-gradient(ellipse 50% 56% at 50% 34%, #000 12%, transparent 72%);
          mask-image: radial-gradient(ellipse 50% 56% at 50% 34%, #000 12%, transparent 72%);
  filter: blur(.6px) saturate(1.15);
}
.hero { padding-top: 108px !important; }
.hero-logo-wrap { overflow: visible; width: 210px !important; height: 210px !important; }
.hero-logo-wrap img { position: relative; z-index: 2; pointer-events: none; border-radius: 50%; object-fit: cover; }
#sx-sun {
  position: absolute; left: 50%; top: 50%; width: 640px; height: 640px; max-width: 150vw;
  transform: translate(-50%, -50%); z-index: 1; cursor: pointer; touch-action: manipulation;
}
.sx-sun-hint {
  position: absolute; left: 50%; top: 26px; transform: translateX(-50%); white-space: nowrap;
  font: 600 11px 'IBM Plex Mono', monospace; letter-spacing: .22em; text-transform: uppercase; color: var(--gold, #ffd700);
  opacity: .0; z-index: 3; pointer-events: none; transition: opacity .6s;
  text-shadow: 0 0 12px rgba(255, 215, 0, .5);
}
.sx-sun-hint.show { opacity: .75; animation: sx-blink 2.6s ease-in-out infinite; }
@keyframes sx-blink { 50% { opacity: .35; } }
.hero-logo-wrap { margin-bottom: 104px !important; }

/* Başlık: giriş + parıltı */
.hero h1 { animation: sx-title-in 1.5s var(--sx-ease) both .15s; }
.hero h1 span {
  background-size: 220% 100% !important;
  animation: sx-shimmer 6s linear infinite;
  filter: drop-shadow(0 0 22px rgba(255, 190, 0, .35));
}
@keyframes sx-title-in { from { opacity: 0; letter-spacing: .38em; filter: blur(14px); transform: translateY(18px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes sx-shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* Yazı makinesi */
.sx-ticker {
  position: relative; z-index: 1; min-height: 34px; margin: -8px auto 26px;
  font: 600 clamp(13px, 1.6vw, 16.5px) 'IBM Plex Mono', monospace; letter-spacing: .06em; color: var(--accent-cyan, #00e5ff);
}
.sx-ticker::before { content: '❯ '; color: var(--gold, #ffd700); }
.sx-ticker i { display: inline-block; width: 9px; height: 1.1em; margin-left: 3px; vertical-align: -.18em; background: var(--gold, #ffd700); animation: sx-caret 1s steps(2) infinite; }
@keyframes sx-caret { 50% { opacity: 0; } }

/* Rozet çubuğu: hafif süzülme */
.badge-pill { transition: transform .3s var(--sx-ease), box-shadow .3s, border-color .3s; }
.badge-pill:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(255, 215, 0, .18); }

/* Düğmeler: ışık süpürmesi */
.btn { position: relative; overflow: hidden; isolation: isolate; will-change: transform; }
.btn::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -80%; width: 55%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-20deg); transition: left .7s var(--sx-ease);
}
.btn:hover::before { left: 130%; }

/* Aksiyom kutusu: dönen kenar ışığı */
.axiom-banner { position: relative; }
.axiom-banner::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--sx-a, 0deg), transparent 0 70%, rgba(255, 215, 0, .9) 85%, rgba(0, 229, 255, .9) 95%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: sx-spin 7s linear infinite;
}
@property --sx-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes sx-spin { to { --sx-a: 360deg; } }

/* ---------- Kaydırma ile belirme ---------- */
html.sx .sx-r {
  opacity: 0; transform: translateY(34px) scale(.98); filter: blur(5px);
  transition: opacity .9s var(--sx-ease), transform .9s var(--sx-ease), filter .9s var(--sx-ease);
  transition-delay: var(--d, 0ms); will-change: opacity, transform;
}
html.sx .sx-r.sx-in { opacity: 1; transform: none; filter: none; }
html.sx .sx-r.sx-done { will-change: auto; transition-delay: 0ms; }

/* Bölüm başlığı alt çizgisi */
.section-header { position: relative; }
.section-header::after, #telemetri > .section-title::after {
  content: ''; display: block; height: 2px; width: 0; margin: 20px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--sx-gold), var(--sx-cyan), transparent);
  transition: width 1.4s var(--sx-ease) .25s;
}
.section-header.sx-in::after, #telemetri > .section-title.sx-in::after { width: min(380px, 70%); }
.section-title { text-shadow: 0 0 26px rgba(255, 200, 60, .22); transition: text-shadow .4s; }
.section-title:hover { text-shadow: 0 0 34px rgba(255, 200, 60, .55); }

/* ---------- Kart: ışıldak + eğim ---------- */
.sx-spot {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .35s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 215, 0, .13), transparent 60%);
}
.sx-has-spot:hover > .sx-spot { opacity: 1; }
.sx-has-spot > *:not(.sx-spot) { position: relative; z-index: 1; }
.sx-tilt { transform-style: preserve-3d; transition: transform .25s ease-out, border-color .25s, box-shadow .25s; }

/* Sayaç bitince parıltı */
.stat-num.sx-pop { animation: sx-pop .7s var(--sx-ease); }
@keyframes sx-pop { 40% { transform: scale(1.14); text-shadow: 0 0 34px rgba(255, 215, 0, .95); } }

/* ---------- Koma çarkı: halo ---------- */
.wheel-canvas-wrap::before {
  content: ''; position: absolute; width: min(100%, 440px); aspect-ratio: 1; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from var(--sx-a, 0deg), transparent 0 55%, rgba(255, 215, 0, .35) 78%, rgba(0, 229, 255, .35) 92%, transparent);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%, #000 65%, transparent 66%);
          mask: radial-gradient(circle, transparent 62%, #000 63%, #000 65%, transparent 66%);
  animation: sx-spin 10s linear infinite; opacity: .8;
}
.wheel-canvas-wrap::after {
  content: ''; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, rgba(255, 190, 0, .14), transparent 68%); animation: sx-breathe 5s ease-in-out infinite;
}
@keyframes sx-breathe { 50% { transform: scale(1.18); opacity: .6; } }

/* Simülatör çıktısı: yenilenince parlama */
.sx-flash { animation: sx-flash .9s ease-out; }
@keyframes sx-flash { 0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, .0); } 25% { box-shadow: 0 0 0 1px rgba(255, 215, 0, .8), 0 0 30px rgba(255, 215, 0, .35); background-color: rgba(255, 215, 0, .07); } 100% { box-shadow: none; } }

/* Görseller: büyütme */
img.sx-zoomable { cursor: zoom-in; transition: transform .6s var(--sx-ease), filter .4s; }
img.sx-zoomable:hover { transform: scale(1.025); filter: brightness(1.08) drop-shadow(0 0 22px rgba(255, 215, 0, .25)); }
#sx-lightbox {
  position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 3vmin;
  background: rgba(2, 4, 8, .9); backdrop-filter: blur(10px); opacity: 0; visibility: hidden; cursor: zoom-out;
  transition: opacity .35s, visibility 0s linear .35s;
}
#sx-lightbox.on { opacity: 1; visibility: visible; transition-delay: 0s; }
#sx-lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 12px; border: 1px solid rgba(255, 215, 0, .4); box-shadow: 0 30px 90px rgba(0, 0, 0, .9), 0 0 60px rgba(255, 215, 0, .15); transform: scale(.94); transition: transform .5s var(--sx-ease); }
#sx-lightbox.on img { transform: none; }

/* ---------- Bölüm rayı ---------- */
#sx-rail {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 900;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
}
#sx-rail a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 2px; color: #8f9bb3; text-decoration: none; text-shadow: none !important;
  font: 600 10.5px 'IBM Plex Mono', monospace; letter-spacing: .1em; text-transform: uppercase;
}
#sx-rail a span { opacity: 0; transform: translateX(8px); transition: all .3s var(--sx-ease); white-space: nowrap; background: rgba(5, 7, 11, .85); padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(255, 215, 0, .25); pointer-events: none; }
#sx-rail a i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 215, 0, .22); border: 1px solid rgba(255, 215, 0, .5); transition: all .3s var(--sx-ease); }
#sx-rail a:hover span, #sx-rail a.on span { opacity: 1; transform: none; }
#sx-rail a:hover i { background: var(--sx-gold); }
#sx-rail a.on { color: var(--sx-gold); }
#sx-rail a.on i { background: var(--sx-gold); transform: scale(1.5); box-shadow: 0 0 14px rgba(255, 215, 0, .95); }
@media (max-width: 1280px) { #sx-rail { display: none; } }

/* ---------- Yukarı çık: güneş ---------- */
#sx-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 950; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 20px; color: #1a1200; font-weight: 900;
  background: conic-gradient(var(--sx-gold) calc(var(--p, 0) * 1turn), rgba(255, 215, 0, .15) 0);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: all .45s var(--sx-ease);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .6), 0 0 22px rgba(255, 215, 0, .25);
}
#sx-top::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe57f, #ff9800); }
#sx-top span { position: relative; }
#sx-top.on { opacity: 1; transform: none; pointer-events: auto; }
#sx-top:hover { transform: translateY(-4px) scale(1.06); box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 36px rgba(255, 215, 0, .55); }

/* ---------- Alt bilgi: ufuk ---------- */
footer { position: relative; overflow: hidden; isolation: isolate; }
footer::before {
  content: ''; position: absolute; left: 50%; bottom: -330px; width: 900px; height: 520px; margin-left: -450px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 170, 0, .34), rgba(255, 110, 0, .12) 40%, transparent 70%);
  animation: sx-breathe 7s ease-in-out infinite;
}

/* ---------- Wiki / IDE / Rapor ortak ---------- */
body[data-page="wiki"] .wiki-section, body[data-page="wiki"] .info-card { position: relative; }
.sx-copy {
  position: absolute; top: 8px; right: 8px; z-index: 3; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  font: 600 11px 'IBM Plex Mono', monospace; color: var(--gold, #ffd700); background: rgba(5, 7, 11, .8); border: 1px solid rgba(255, 215, 0, .35);
  opacity: 0; transition: opacity .25s, background .2s;
}
.sx-copy-host { position: relative; }
.sx-copy-host:hover > .sx-copy { opacity: 1; }
.sx-copy:hover { background: rgba(255, 215, 0, .18); }
.sx-copy.ok { color: #00e676; border-color: #00e676; opacity: 1; }
@media (hover: none) { .sx-copy { opacity: .85; } }

body[data-page="wiki"] .sidebar-nav a { transition: all .25s var(--sx-ease); }
body[data-page="wiki"] .sidebar-nav a.sx-on { color: var(--gold, #ffd700); background: rgba(255, 215, 0, .1); border-color: rgba(255, 215, 0, .45); transform: translateX(4px); box-shadow: inset 3px 0 0 var(--gold, #ffd700); }

body[data-page="ide"] .ide-header { position: relative; }
body[data-page="ide"] .ide-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--sx-gold), var(--sx-cyan), var(--sx-gold), transparent); background-size: 200% 100%;
  animation: sx-flow 5s linear infinite;
}
@keyframes sx-flow { to { background-position: -200% 0; } }
body[data-page="ide"] #runBtn { animation: sx-runpulse 2.8s ease-in-out infinite; }
body[data-page="ide"] #runBtn:hover { animation: none; }
@keyframes sx-runpulse { 50% { box-shadow: 0 0 0 6px rgba(255, 215, 0, 0); box-shadow: 0 0 22px rgba(255, 215, 0, .55); } }
body[data-page="ide"] .console-line { animation: sx-line .35s var(--sx-ease) both; }
@keyframes sx-line { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
body[data-page="ide"] .brand-wrap img { animation: sx-glow 4s ease-in-out infinite alternate; }
@keyframes sx-glow { to { filter: drop-shadow(0 0 16px rgba(255, 215, 0, .8)); } }

body[data-page="paper"] .header { position: relative; overflow: hidden; }
body[data-page="paper"] .header > * { position: relative; z-index: 1; }
body[data-page="paper"] .header::after {
  content: ''; position: absolute; right: -90px; top: -90px; width: 260px; height: 260px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(251, 191, 36, .5), rgba(251, 146, 60, .16) 50%, transparent 70%); animation: sx-breathe 6s ease-in-out infinite;
}
body[data-page="paper"] #sx-progress { height: 4px; }
body[data-page="paper"] table.academic-table tbody tr { transition: background .25s, transform .25s var(--sx-ease); }
body[data-page="paper"] table.academic-table tbody tr:hover { transform: translateX(4px); }

/* ---------- Hareket azaltma ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html.sx .sx-r { opacity: 1 !important; transform: none !important; filter: none !important; }
  #sx-intro, #sx-cursor { display: none !important; }
}
@media print { #sx-progress, #sx-stars, #sx-cursor, #sx-rail, #sx-top, #sx-intro, #sx-lightbox { display: none !important; } html.sx .sx-r { opacity: 1 !important; transform: none !important; filter: none !important; } }
@media (max-width: 720px) { #sx-sun { width: 128vw; } .hero-logo-wrap { margin-bottom: 96px !important; width: 170px !important; height: 170px !important; } #sx-top { right: 14px; bottom: 14px; } }
