:root {
  --bg: #f4f3ef; --panel: #ffffff; --text: #1b1b1f; --muted: #6a6a72; --line: #e0ded6;
  --accent: #3b5bdb; --accent-soft: #e7ecff; --accent-text: #ffffff;
  --ok: #1f8a4c; --ok-bg: #e4f4ea; --bad: #c0392b; --bad-bg: #fbe9e6;
  --f0: #ffe3e3; --f1: #d3f9d8; --f2: #d0ebff; --f3: #fff3bf; --f4: #e5dbff; --f5: #ffd8a8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131318; --panel: #1d1d24; --text: #ececf1; --muted: #9a9aa6; --line: #32323c;
    --accent: #8aa4ff; --accent-soft: #232a4a; --accent-text: #0f1220;
    --ok: #5fd08c; --ok-bg: #173022; --bad: #ff8a7a; --bad-bg: #3a1f1c;
    --f0: #5c2b2b; --f1: #23482b; --f2: #1f3f5c; --f3: #554a17; --f4: #3b2f66; --f5: #5c3d17;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.55 -apple-system, "Segoe UI", system-ui, sans-serif; }
main { max-width: 780px; margin: 0 auto; padding: 24px 16px 80px; }
h1 { font-size: 27px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 28px 0 10px; }
h3 { font-size: 19px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
small { font-size: 13px; }
.muted { color: var(--muted); font-size: 14px; }
.mono, code, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 12px; }
.enter { animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
@keyframes flash { from { background: var(--accent); color: var(--accent-text); } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat { text-align: center; padding: 14px 8px; margin: 0; }
.stat b { display: block; font-size: 28px; line-height: 1.2; }
.big { font-size: 44px; line-height: 1; margin-bottom: 8px; animation: pop .4s; }

button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 10px 16px; transition: border-color .15s, transform .1s, background .15s; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: scale(.98); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.wide { width: 100%; padding: 14px; }
button.link { border: 0; background: none; color: var(--muted); padding: 4px 0; }
button.ghost { border-style: dashed; margin-top: 10px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.row button { flex: 1; min-width: 110px; }

.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.course { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; }
.course .bar { margin: 8px 0 0; }
.path { margin-top: 16px; }
.lesson { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; margin-top: 8px; padding: 14px 16px; border-radius: 14px; }
.lesson .grow { flex: 1; display: flex; flex-direction: column; }
.dot { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.lesson.done .dot { background: var(--ok-bg); color: var(--ok); }
.badge { font-size: 13px; color: var(--muted); }
.lesson.done .badge { color: var(--ok); font-weight: 600; }

.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 10px 0 18px; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .35s; }
.kind { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; margin-bottom: 6px; }

.opt { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; margin-top: 8px; }
.key { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; color: var(--muted); flex: none; }
.opt.right { border-color: var(--ok); background: var(--ok-bg); animation: pop .25s; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.feedback { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); animation: rise .2s; }
.feedback.ok { background: var(--ok-bg); }
.feedback.no { background: var(--bad-bg); }
input[type=text], textarea { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
input.mono, textarea.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; }
textarea { min-height: 110px; resize: vertical; }

/* İngilizce desteği: sözlük kelimesi ve Türkçe ipucu */
g { border-bottom: 2px dotted var(--accent); cursor: help; position: relative; }
g:hover::after, g:focus::after { content: attr(t); position: absolute; left: 0; bottom: 100%; background: var(--text); color: var(--bg); padding: 3px 9px; border-radius: 6px; font-size: 13px; white-space: nowrap; z-index: 5; font-weight: 400; }
.tr-btn { font-size: 13px; padding: 4px 10px; border-radius: 99px; color: var(--muted); margin: 4px 0; }
.tr { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin-top: 6px; font-size: 15px; animation: rise .2s; }

.content svg { max-width: 100%; height: auto; display: block; margin: 12px auto; }
.content table { border-collapse: collapse; margin: 10px 0; }
.content th, .content td { border: 1px solid var(--line); padding: 6px 12px; text-align: center; }
.content ul, .content ol { padding-left: 22px; margin: 0 0 12px; }
code, pre { font-size: 15px; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; margin: 8px 0; }
pre code { border: 0; padding: 0; background: none; }
.widget { margin-top: 14px; }
.cards4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.cards4 div { background: var(--accent-soft); border-radius: 10px; padding: 12px; animation: pop .3s backwards; }
.cards4 div:nth-child(2) { animation-delay: .1s; } .cards4 div:nth-child(3) { animation-delay: .2s; } .cards4 div:nth-child(4) { animation-delay: .3s; }
.cards4 b { display: block; }

/* flow */
.flow { display: flex; align-items: stretch; gap: 4px; flex-wrap: wrap; }
.stage { flex: 1; min-width: 104px; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; text-align: center; }
.stage small { color: var(--muted); }
.stage.active { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.stage.here { box-shadow: 0 0 0 2px var(--accent); }
.stage.here::before { content: 'you are here'; font-size: 11px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.arr { align-self: center; color: var(--muted); }
.flow-detail { min-height: 8px; margin-top: 10px; }
.pop { animation: rise .25s; }

/* decoder */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { font-family: ui-monospace, Menlo, monospace; font-size: 13px; padding: 5px 10px; border-radius: 99px; }
.fields { display: flex; gap: 4px; margin: 10px 0 6px; overflow-x: auto; }
.field { min-width: 78px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 4px; border-radius: 10px; animation: pop .3s backwards; }
.field code { background: none; border: 0; font-size: 16px; font-weight: 600; letter-spacing: .04em; color: inherit; }
.field small { opacity: .8; text-align: center; }
.c0 { background: var(--f0); } .c1 { background: var(--f1); } .c2 { background: var(--f2); } .c3 { background: var(--f3); } .c4 { background: var(--f4); } .c5 { background: var(--f5); }

/* kod alıştırması */
.code-wrap { display: grid; grid-template-columns: 1fr 190px; gap: 10px; margin-top: 12px; }
@media (max-width: 600px) { .code-wrap { grid-template-columns: 1fr; } }
textarea.code { min-height: 190px; line-height: 1.6; tab-size: 4; }
.regs { display: flex; flex-direction: column; gap: 4px; }
.reg { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.reg.flash { animation: flash .9s; }

.grow { transform-box: fill-box; transform-origin: left; animation: growx .9s ease-out backwards; }
.grow:nth-of-type(2) { animation-delay: .2s; } .grow:nth-of-type(3) { animation-delay: .4s; }
@keyframes growx { from { transform: scaleX(0); } }

/* üst satır, beceriler */
.top { display: flex; justify-content: space-between; align-items: center; }
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 12px; }
.skill { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; text-align: left; padding: 12px 14px; border-radius: 12px; }
.skill .grow { flex: 1; display: flex; flex-direction: column; }
.skill .bar { flex-basis: 100%; margin: 4px 0 0; }
.skill.done .badge { color: var(--ok); font-weight: 600; }
.skill.done .bar i { background: var(--ok); }
.opt > span:last-child { flex: 1; }

/* scene */
.scene-stage { min-height: 120px; }
.scene-say { margin: 10px 0; }
.scene-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.dots i.on { background: var(--accent); transform: scale(1.3); }

/* machine */
.machine { position: relative; display: flex; gap: 12px; flex-wrap: wrap; }
.m-col { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 4px; }
.m-col h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.m-code { flex: 2; min-width: 230px; }
.m-line { display: flex; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 8px; }
.m-line code { border: 0; background: none; white-space: pre; }
.m-pc { visibility: hidden; color: var(--accent); }
.m-line.now { background: var(--accent-soft); }
.m-line.now .m-pc { visibility: visible; }
.picking .reg { cursor: pointer; border-color: var(--accent); border-style: dashed; }
.chipfly { position: absolute; z-index: 3; background: var(--accent); color: var(--accent-text); border-radius: 8px; padding: 4px 10px; font: 600 14px ui-monospace, Menlo, monospace; pointer-events: none; }
.m-say { min-height: 52px; }

/* datapath */
.dp { width: 100%; height: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; }
.dp .wire { fill: none; stroke: var(--muted); stroke-width: 1.3; opacity: .45; }
.dp .wire.ctl { stroke-dasharray: 3 3; }
.dp .wire.on { stroke: #e8590c; stroke-width: 3; opacity: 1; stroke-dasharray: 9 6; animation: dash .7s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -15; } }
.dp .blocks > * { fill: var(--panel); stroke: var(--text); stroke-width: 1.4; }
.dp .blocks .ctlb { stroke: var(--accent); }
.dp .labels { fill: var(--text); }
.dp .tiny { font-size: 8.5px; fill: var(--muted); }
.dp .sig text { fill: var(--accent); font-weight: 600; font-size: 10px; }
.dp-steps { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dp-steps button { padding: 5px 14px; border-radius: 99px; font-weight: 600; }
.dp-steps button.on, .chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.dp-steps span { color: var(--muted); }
.dp-sig { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 12px; }
@media (max-width: 640px) { .dp-sig { grid-template-columns: repeat(4, 1fr); } }
.sigcell { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 8px; }
.sigcell small { font-size: 10.5px; color: var(--muted); }
.sigcell b { font-family: ui-monospace, Menlo, monospace; }
.sigcell.right { background: var(--ok-bg); border-color: var(--ok); }
.sigcell.wrong { background: var(--bad-bg); border-color: var(--bad); }
