/* =========================================================================
   UYAN — BASE: reset, giriş ekranı, mod anahtarı, ortak bileşenler
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; transition: background-color .4s; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
i { font-style: normal; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
pre { margin: 0; }
pre, code, kbd, samp { font-family: inherit; } /* tarayıcının varsayılan monospace fontunu ez */
[hidden] { display: none !important; }

html[data-mode="code"] body { background: #000; color: #e6fff4; }
html[data-mode="fit"]  body { background: #fff; color: #0a0a0a; }

/* ---- worlds ---- */
.world { display: none; min-height: 100vh; }
html[data-mode="code"] .world-code { display: block; }
html[data-mode="fit"]  .world-fit  { display: block; }

.container { width: min(1240px, 100% - 48px); margin-inline: auto; }
.container.narrow { width: min(860px, 100% - 48px); }

/* ---- reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* =========================================================================
   GİRİŞ EKRANI
   ========================================================================= */
.intro { --ip: clamp(24px, 5vw, 72px); position: fixed; inset: 0; z-index: 2000; display: flex; overflow: hidden; transition: opacity .7s ease, visibility .7s; }
.intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-half {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--ip); text-align: left; overflow: hidden;
  transition: flex-grow .7s cubic-bezier(.7,0,.2,1);
}
.intro-half:hover, .intro-half:focus-visible { flex-grow: 1.5; outline: none; }
.intro-code { background: #000; color: #00ff9c; font-family: "JetBrains Mono", monospace; }
.intro-fit  { background: #fff; color: #0a0a0a; font-family: "Inter Tight", sans-serif; align-items: flex-end; text-align: right; }
.intro-fit .ih-kicker { margin-bottom: clamp(24px, 3.4vw, 52px); }
.ih-kicker { font-size: 12px; letter-spacing: .25em; opacity: .6; margin-bottom: 14px; }
.ih-title { font-size: clamp(64px, 13vw, 200px); line-height: .85; font-weight: 800; letter-spacing: -.04em; position: relative; z-index: 1; }
.intro-code .ih-title { text-shadow: 0 0 40px rgba(0,255,156,.45); font-weight: 800; }
.intro-fit .ih-title { font-weight: 900; letter-spacing: -.06em; }
.ih-sub { margin-top: 18px; font-size: clamp(12px, 1.2vw, 15px); opacity: .7; position: relative; z-index: 1; }
.ih-enter { margin-top: 28px; font-size: 13px; letter-spacing: .08em; display: inline-flex; gap: 10px; align-items: center; position: relative; z-index: 1; }
.ih-enter b { transition: transform .3s; }
.intro-half:hover .ih-enter b { transform: translateX(8px); }
.intro-code .ih-enter { border: 1px solid rgba(0,255,156,.5); padding: 10px 16px; }
.intro-fit .ih-enter { border-bottom: 2px solid #0a0a0a; padding-bottom: 4px; font-weight: 700; }
.ih-code-rain {
  position: absolute; inset: 0; font-size: 12px; line-height: 1.5; color: rgba(0,255,156,.12);
  white-space: pre; overflow: hidden; pointer-events: none; padding: 20px; word-break: break-all;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.intro-center {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  color: #fff; mix-blend-mode: difference; z-index: 3;
}
.intro-logo { font-family: "Inter Tight", sans-serif; font-weight: 900; font-size: clamp(56px, 9vw, 130px); letter-spacing: -.05em; line-height: 1;
  display: grid; grid-template-columns: 1fr 1fr; column-gap: .08em; }
.intro-logo span:first-child { justify-self: end; }
.intro-logo span:last-child { justify-self: start; }
/* logo ek yeri, genişleyen yarıyla birlikte kayar */
.intro-center { transition: left .7s cubic-bezier(.7,0,.2,1); }
@media (min-width: 721px) {
  .intro:has(.intro-code:hover) .intro-center, .intro:has(.intro-code:focus-visible) .intro-center { left: calc(var(--ip) * 2 + (100% - var(--ip) * 4) * .6); }
  .intro:has(.intro-fit:hover) .intro-center, .intro:has(.intro-fit:focus-visible) .intro-center { left: calc(var(--ip) * 2 + (100% - var(--ip) * 4) * .4); }
}
.intro-name { font-family: "JetBrains Mono", monospace; font-size: 13px; letter-spacing: .5em; margin-top: 10px; }
.intro-hint { font-family: "JetBrains Mono", monospace; font-size: 11px; letter-spacing: .3em; margin-top: 28px; opacity: .8; animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

@media (max-width: 720px) {
  .intro { flex-direction: column; }
  .intro-half { justify-content: center; }
  .intro-fit { justify-content: center; }
  .intro-center { top: 50%; }
  .intro-logo { font-size: 64px; }
  .ih-title { font-size: 76px; }
}

/* =========================================================================
   MOD ANAHTARI
   ========================================================================= */
.mode-switch {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 1500; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px;
  border-radius: 999px; font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  transition: background .4s, color .4s, box-shadow .4s, border-color .4s, transform .3s;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.mode-switch:hover { transform: translateX(-50%) translateY(-3px); }
@media (max-width: 640px) { .mode-switch { font-size: 11px; gap: 8px; padding: 6px 8px 6px 12px; } .ms-track { width: 46px; height: 24px; } .ms-knob { width: 18px; height: 18px; } html[data-mode="fit"] .ms-knob { transform: translateX(22px); } }
.mode-switch i { font-style: normal; }
.ms-opt { transition: opacity .3s; white-space: nowrap; }
.ms-track { position: relative; width: 54px; height: 28px; border-radius: 999px; transition: background .4s; }
.ms-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; transition: transform .5s cubic-bezier(.7,0,.2,1), background .4s, box-shadow .4s; }
.ms-fit { padding-right: 8px; }

html[data-mode="code"] .mode-switch { background: rgba(0,0,0,.72); color: #00ff9c; border: 1px solid rgba(0,255,156,.45); box-shadow: 0 0 0 1px rgba(0,255,156,.08), 0 0 30px rgba(0,255,156,.2); }
html[data-mode="code"] .ms-track { background: rgba(0,255,156,.12); box-shadow: inset 0 0 0 1px rgba(0,255,156,.4); }
html[data-mode="code"] .ms-knob { background: #00ff9c; box-shadow: 0 0 14px #00ff9c; }
html[data-mode="code"] .ms-fit { opacity: .45; }

html[data-mode="fit"] .mode-switch { background: rgba(255,255,255,.8); color: #0a0a0a; border: 1.5px solid #0a0a0a; box-shadow: 0 12px 40px rgba(0,0,0,.12); font-family: "Inter Tight", sans-serif; font-weight: 800; }
html[data-mode="fit"] .ms-track { background: #0a0a0a; }
html[data-mode="fit"] .ms-knob { background: #fff; transform: translateX(26px); }
html[data-mode="fit"] .ms-code { opacity: .4; }

.mode-switch::after {
  content: "Shift + M"; position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(6px);
  font-size: 10px; letter-spacing: .15em; opacity: 0; pointer-events: none; transition: .3s; white-space: nowrap;
}
.mode-switch:hover::after { opacity: .6; transform: translateX(-50%); }
@media (hover: none) { .mode-switch::after { display: none; } }

/* ---- geçiş perdesi ---- */
.switch-overlay {
  position: fixed; inset: 0; z-index: 1800; pointer-events: none; display: grid; place-items: center;
  clip-path: circle(0px at var(--x, 50%) var(--y, 100%)); visibility: hidden;
}
.switch-overlay.run { visibility: visible; transition: clip-path .75s cubic-bezier(.7,0,.25,1); clip-path: circle(150vmax at var(--x, 50%) var(--y, 100%)); }
.switch-overlay.fade { visibility: visible; clip-path: circle(150vmax at var(--x, 50%) var(--y, 100%)); opacity: 0; transition: opacity .55s ease .1s; }
.switch-overlay.to-code { background: #000; color: #00ff9c; font-family: "JetBrains Mono", monospace; }
.switch-overlay.to-fit  { background: #fff; color: #0a0a0a; font-family: "Inter Tight", sans-serif; }
.so-text { font-size: clamp(22px, 4vw, 48px); font-weight: 800; letter-spacing: -.02em; }
.to-code .so-text { text-shadow: 0 0 30px rgba(0,255,156,.6); font-weight: 500; }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%) translateY(20px); z-index: 1900;
  padding: 12px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .35s cubic-bezier(.2,.7,.2,1);
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
html[data-mode="code"] .toast { background: #001a10; color: #00ff9c; border: 1px solid #00ff9c; font-family: "JetBrains Mono", monospace; font-size: 13px; box-shadow: 0 0 30px rgba(0,255,156,.25); }
html[data-mode="fit"] .toast { background: #0a0a0a; color: #fff; font-family: "Inter Tight", sans-serif; font-weight: 600; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.toast a { text-decoration: underline; margin-left: 6px; }

/* ---- imleç ışığı (kod modu) ---- */
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  pointer-events: none; z-index: 1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle, rgba(0,255,156,.07), transparent 60%);
}
html[data-mode="code"] .cursor-glow.on { opacity: 1; }
@media (hover: none) { .cursor-glow { display: none; } }

/* ---- burger ---- */
.burger { display: none; width: 44px; height: 44px; position: relative; z-index: 3; }
.burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: currentColor; transition: .3s; }
.burger span:first-child { top: 17px; } .burger span:last-child { top: 25px; }
.burger.open span:first-child { top: 21px; transform: rotate(45deg); }
.burger.open span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---- faq ortak ---- */
.faq details { overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; transition: transform .3s; flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }

.link-btn { text-align: left; }
kbd { font-family: "JetBrains Mono", monospace; font-size: .9em; padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; opacity: .85; }

/* ekran okuyucu */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* =========================================================================
   DİL SEÇİCİ
   ========================================================================= */
.lang { display: flex; align-items: center; flex: none; }
.lang button { transition: color .2s, background .2s, opacity .2s, border-color .2s; }
.lang-intro {
  position: absolute; top: max(20px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 4;
  color: #fff; mix-blend-mode: difference; gap: 4px; font-family: "JetBrains Mono", monospace; font-size: 12px; font-weight: 700; letter-spacing: .15em;
}
.lang-intro button { padding: 7px 11px; opacity: .5; border: 1px solid transparent; }
.lang-intro button:hover { opacity: .85; }
.lang-intro button.on { opacity: 1; border-color: currentColor; }
