/* =================================================================
   UTF ÖDEVİ — sayfaya özel bileşenler (page.css üzerine)
   ================================================================= */
:root {
  --emmet: #1f5a8f;               /* temadaki vurgu yeşili yerine UTF mavisi */
  --emmet-dim: rgba(31,90,143,0.1);
  --u8: #1f5a8f;  --u8-dim: rgba(31,90,143,0.1);  --u8-n: #7fb0e0;
  --u16: #4a6a2e; --u16-dim: rgba(74,106,46,0.1); --u16-n: #a9c98a;
  --u32: #6b3f7a; --u32-dim: rgba(107,63,122,0.1); --u32-n: #c9a3d8;
  --mark: #e07a52;   /* işaret bitleri (gece) */
}
.c8 { color: var(--u8); } .c16 { color: var(--u16); } .c32 { color: var(--u32); }
.section--dark .c8 { color: var(--u8-n); } .section--dark .c16 { color: var(--u16-n); } .section--dark .c32 { color: var(--u32-n); }

/* ---------- HERO: kodlayıcı penceresi ---------- */
.enc-glyph { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.1rem; }
.enc-glyph .g {
  font-family: var(--f-display); font-size: 3.6rem; line-height: 1; color: #fff; min-width: 1.2em;
  animation: pop 420ms var(--ease);
}
.enc-glyph .cp { color: var(--syn-op); font-size: 1rem; }
.enc-glyph .nm { color: var(--night-mute); font-size: .72rem; display: block; margin-top: .3rem; }
.enc-row { display: grid; grid-template-columns: 4.6rem 1fr; align-items: center; gap: .8rem; padding: .5rem 0; border-top: 1px dashed var(--night-rule); }
.enc-row .k { font-size: .72rem; font-weight: 600; letter-spacing: .04em; }
.enc-row .k small { display: block; color: var(--night-mute); font-weight: 400; }
.enc-bytes { display: flex; flex-wrap: wrap; gap: 5px; }
.bx {
  font-size: .78rem; padding: .28rem .45rem; border-radius: 5px; border: 1px solid; min-width: 2.4rem; text-align: center;
  animation: tokIn 380ms var(--ease) both;
}
.bx--8 { color: var(--u8-n); border-color: rgba(127,176,224,.45); background: rgba(127,176,224,.08); }
.bx--16 { color: var(--u16-n); border-color: rgba(169,201,138,.45); background: rgba(169,201,138,.08); }
.bx--32 { color: var(--u32-n); border-color: rgba(201,163,216,.45); background: rgba(201,163,216,.08); }
.bx--zero { opacity: .45; }
.bx--sur { border-style: dashed; }
@keyframes tokIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

/* ---------- §01 katmanlar ---------- */
.layers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 3rem; border: 1px solid var(--rule-strong); border-radius: 14px; overflow: hidden; background: #fff8ee; }
.layer { padding: 1.5rem 1.4rem; position: relative; border-right: 1px solid var(--rule); }
.layer:last-child { border-right: 0; }
.layer:not(:last-child)::after {
  content: '→'; position: absolute; right: -.75rem; top: 50%; transform: translateY(-50%);
  width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-size: .75rem; z-index: 2;
}
.layer .mini-label { margin-bottom: .5rem; }
.layer .big { font-family: var(--f-display); font-size: 2.6rem; line-height: 1.1; }
.layer .big.mono { font-family: var(--f-mono); font-size: 1.15rem; padding-top: .9rem; }
.layer p { font-size: .86rem; color: var(--ink-mute); margin-top: .6rem; }

/* ---------- Plane haritası ---------- */
.planes { margin-top: 3rem; }
.plane-bar { display: flex; height: 58px; border-radius: 10px; overflow: hidden; border: 1px solid var(--rule-strong); }
.plane-bar div { display: grid; place-items: center; font-family: var(--f-mono); font-size: .7rem; border-right: 1px solid rgba(255,255,255,.4); color: #fff; }
.plane-bar .bmp { flex: 6; background: var(--u8); }
.plane-bar .smp { flex: 2; background: var(--u16); }
.plane-bar .sip { flex: 2; background: #8a6a2e; }
.plane-bar .rest { flex: 7; background: repeating-linear-gradient(45deg, var(--paper-dim), var(--paper-dim) 6px, var(--paper-deep) 6px, var(--paper-deep) 12px); color: var(--ink-mute); }
.plane-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin-top: .9rem; font-size: .84rem; color: var(--ink-mute); }
.plane-legend b { color: var(--ink); }

/* ---------- Kart üçlüsü ---------- */
.enc-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.enc-card { border: 1px solid var(--rule); border-top: 4px solid var(--c); border-radius: 12px; background: #fffaf2; padding: 1.6rem; transition: transform 250ms var(--ease), box-shadow 250ms var(--ease); }
.enc-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(23,20,18,.4); }
.enc-card .name { font-family: var(--f-mono); font-weight: 600; color: var(--c); font-size: .9rem; }
.enc-card .size { font-family: var(--f-display); font-size: 2.3rem; line-height: 1.1; margin: .4rem 0 1rem; }
.enc-card ul li { font-size: .9rem; padding: .45rem 0; border-top: 1px dashed var(--rule); color: var(--ink-mute); }
.enc-card ul li strong { color: var(--ink); }

/* ---------- §03 UTF-8 bit laboratuvarı (koyu) ---------- */
.lab { display: grid; grid-template-columns: 1fr 1.25fr; gap: 1.5rem; }
.lab-panel { background: var(--night-2); border: 1px solid var(--night-rule); border-radius: 14px; padding: 1.4rem; }
.lab-input { display: flex; gap: .6rem; align-items: center; }
.lab-input input {
  width: 5.5rem; font: 400 2.6rem var(--f-display); text-align: center; padding: .3rem; border-radius: 10px;
  background: var(--night); color: #fff; border: 1px solid var(--night-rule); outline: none;
}
.lab-input input:focus { border-color: var(--u8-n); box-shadow: 0 0 0 4px rgba(127,176,224,.15); }
.lab-meta { font-family: var(--f-mono); font-size: .8rem; color: var(--night-mute); line-height: 1.7; }
.lab-meta b { color: var(--syn-op); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.chips button {
  font-family: var(--f-mono); font-size: .8rem; padding: .35rem .7rem; border-radius: 6px;
  border: 1px solid var(--night-rule); color: var(--night-ink); transition: all 180ms var(--ease);
}
.chips button:hover { border-color: var(--u8-n); color: #fff; background: var(--night-3); }
.chips--light button { border-color: var(--rule); color: var(--ink); background: #fffaf2; }
.chips--light button:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.range-table { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: .78rem; margin-top: 1.2rem; }
.range-table td { padding: .5rem .5rem; border-top: 1px solid var(--night-rule); color: var(--night-mute); }
.range-table tr.on td { color: #fff; background: rgba(127,176,224,.1); }
.range-table tr.on td:first-child { box-shadow: inset 3px 0 0 var(--u8-n); }
.bitflow { font-family: var(--f-mono); }
.bitflow .step { padding: .9rem 0; border-bottom: 1px dashed var(--night-rule); }
.bitflow .step:last-child { border: 0; }
.bitflow .lbl { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--night-mute); margin-bottom: .55rem; }
.bits { display: flex; flex-wrap: wrap; gap: .6rem; }
.bbyte { display: inline-flex; flex-direction: column; align-items: center; gap: .25rem; }
.bbyte .row { display: flex; gap: 1px; }
.bit {
  width: 1.15rem; height: 1.5rem; display: grid; place-items: center; font-size: .78rem; border-radius: 3px;
  background: var(--night-3); color: var(--night-ink); animation: tokIn 300ms var(--ease) both;
}
.bit--m { background: rgba(224,122,82,.2); color: var(--mark); font-weight: 600; }
.bit--d { background: rgba(127,176,224,.18); color: var(--u8-n); font-weight: 600; }
.bit--p { background: transparent; color: var(--night-mute); opacity: .55; }
.bbyte .hx { font-size: .85rem; color: #fff; font-weight: 600; }
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .75rem; color: var(--night-mute); margin-top: .9rem; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; vertical-align: -1px; margin-right: .35rem; }

/* ---------- Süper güçler ---------- */
.powers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2rem; }
.power { border: 1px solid var(--night-rule); border-radius: 12px; padding: 1.3rem; background: var(--night-2); }
.power h4 { font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; margin: .3rem 0 .4rem; color: #fff; }
.power p { font-size: .88rem; color: var(--night-mute); }
.power .ico { font-family: var(--f-mono); color: var(--u8-n); font-size: .8rem; }

/* ---------- §04 UTF-16 vekil hesap makinesi ---------- */
.sur { display: grid; grid-template-columns: 1fr 1.3fr; gap: 1.5rem; align-items: start; }
.sur-card { background: #fffaf2; border: 1px solid var(--rule); border-radius: 14px; padding: 1.5rem; }
.sur-steps { font-family: var(--f-mono); font-size: .85rem; }
.sur-steps .s { display: grid; grid-template-columns: 1.8rem 1fr; gap: .6rem; padding: .75rem 0; border-top: 1px dashed var(--rule); animation: tokIn 380ms var(--ease) both; }
.sur-steps .s:first-child { border-top: 0; }
.sur-steps .n { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--u16); color: #fff; display: grid; place-items: center; font-size: .72rem; }
.sur-steps .t { color: var(--ink-mute); font-family: var(--f-body); font-size: .85rem; }
.sur-steps .v { color: var(--ink); margin-top: .15rem; overflow-wrap: anywhere; }
.sur-steps .v b { color: var(--u16); }
.sur-steps .v .hi { color: #b2401f; }
.sur-pair { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.sur-pair span { font-family: var(--f-mono); font-size: 1.15rem; padding: .55rem .9rem; border-radius: 8px; border: 2px dashed var(--u16); color: var(--u16); background: var(--u16-dim); }
.sur-pair span.single { border-style: solid; }
.trap { margin-top: 1.25rem; }
.trap .code { font-size: .82rem; }
.trap .ok { color: var(--syn-str); } .trap .bad { color: #e0604c; }
.endian { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2.5rem; }
.endian > div { border: 1px solid var(--rule); border-radius: 12px; padding: 1.3rem; background: #fffaf2; }
.endian h4 { font-family: var(--f-display); font-weight: 500; font-size: 1.15rem; margin-bottom: .5rem; }
.endian .mem { display: flex; gap: 4px; margin: .8rem 0; }
.endian .mem span { font-family: var(--f-mono); font-size: .9rem; padding: .4rem .6rem; border-radius: 5px; background: var(--u16-dim); color: var(--u16); border: 1px solid rgba(74,106,46,.3); }
.endian .mem span.lo { background: var(--paper-dim); color: var(--ink-mute); border-color: var(--rule); }
.endian p { font-size: .88rem; color: var(--ink-mute); }

/* ---------- §05 UTF-32 cetvel ---------- */
.ruler { margin-top: 2rem; display: grid; gap: .6rem; }
.ruler-row { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; align-items: center; }
.ruler-row .k { font-family: var(--f-mono); font-size: .78rem; font-weight: 600; }
.cells { display: flex; flex-wrap: wrap; gap: 3px; }
.cell { width: 1.6rem; height: 1.6rem; border-radius: 4px; display: grid; place-items: center; font-size: .65rem; font-family: var(--f-mono); }
.cell.c-8 { background: var(--u8); color: #fff; }
.cell.c-16 { background: var(--u16); color: #fff; }
.cell.c-32 { background: var(--u32); color: #fff; }
.cell.waste { opacity: .28; }
.cell.gap { width: .5rem; background: none; }

/* ---------- §06 Bellek şeridi (koyu) ---------- */
.strip-tool { background: var(--night-2); border: 1px solid var(--night-rule); border-radius: 16px; padding: clamp(1.1rem, 3vw, 1.8rem); }
.strip-input {
  width: 100%; font: 500 1.5rem var(--f-body); padding: .8rem 1rem; border-radius: 10px;
  background: var(--night); color: #fff; border: 1px solid var(--night-rule); outline: none;
}
.strip-input:focus { border-color: var(--u8-n); box-shadow: 0 0 0 4px rgba(127,176,224,.15); }
.meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.4rem 0; }
.meter { border: 1px solid var(--night-rule); border-radius: 12px; padding: 1rem 1.1rem; background: var(--night); }
.meter .k { font-family: var(--f-mono); font-size: .75rem; font-weight: 600; }
.meter .v { font-family: var(--f-display); font-size: 2.4rem; line-height: 1.1; color: #fff; }
.meter .v small { font-size: .9rem; color: var(--night-mute); font-family: var(--f-mono); margin-left: .3rem; }
.meter .track { height: 6px; background: var(--night-3); border-radius: 3px; margin-top: .6rem; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 3px; transition: width 400ms var(--ease); }
.meter .win-tag { font-family: var(--f-mono); font-size: .65rem; color: var(--syn-op); margin-left: .4rem; }
.strip-counts { font-family: var(--f-mono); font-size: .78rem; color: var(--night-mute); display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.strip-counts b { color: var(--syn-op); font-weight: 500; }
.strips { display: grid; gap: 1.1rem; margin-top: 1.4rem; }
.strip .mini-label { margin-bottom: .45rem; }
.strip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.grp { display: inline-flex; flex-direction: column; gap: 3px; padding: 4px; border-radius: 7px; border: 1px solid var(--night-rule); cursor: default; transition: background 150ms; }
.grp .bs { display: flex; gap: 2px; }
.grp .ch { font-size: .75rem; text-align: center; color: var(--night-mute); line-height: 1.2; }
.grp.hl { background: var(--night-3); border-color: var(--syn-op); }
.grp .bx { font-size: .7rem; padding: .18rem .3rem; min-width: 1.8rem; animation: none; }

/* ---------- Tablolar ---------- */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--rule-strong); border-radius: 14px; background: #fffaf2; }
.cmp { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .9rem; }
.cmp th, .cmp td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cmp th { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); background: var(--paper-dim); }
.cmp tr:last-child td { border-bottom: 0; }
.cmp td:first-child { font-weight: 600; }
.cmp td.mono { font-family: var(--f-mono); font-size: .84rem; }
.cmp td small { color: var(--ink-soft); font-family: var(--f-mono); }
.cmp .best { background: rgba(178,64,31,.06); }
.cmp-gap { height: 1.5rem; }

/* ---------- §07 Mojibake makinesi ---------- */
.moji { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1.2rem; align-items: stretch; }
.moji-box { border: 1px solid var(--rule); border-radius: 14px; padding: 1.3rem; background: #fffaf2; display: flex; flex-direction: column; gap: .6rem; }
.moji-box textarea {
  width: 100%; min-height: 110px; resize: vertical; font: 500 1.3rem var(--f-body); padding: .7rem .8rem; border-radius: 8px;
  border: 1px solid var(--rule); background: #fff; outline: none; color: var(--ink);
}
.moji-box textarea:focus { border-color: var(--ink); }
.moji-out { min-height: 110px; font: 500 1.3rem var(--f-body); padding: .7rem .8rem; border-radius: 8px; background: var(--night); color: #f2b8a3; overflow-wrap: anywhere; }
.moji-mid { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .5rem; font-family: var(--f-mono); font-size: .72rem; color: var(--ink-soft); text-align: center; }
.moji-mid .arrow { font-size: 1.6rem; color: var(--accent); }
.moji select { font: 500 .85rem var(--f-mono); padding: .45rem .6rem; border-radius: 6px; border: 1px solid var(--rule-strong); background: #fff; color: var(--ink); }
.moji-bytes { font-family: var(--f-mono); font-size: .75rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.moji-note { margin-top: 1.5rem; }

/* ---------- §08 Quiz ---------- */
.kq { background: var(--night-2); border: 1px solid var(--night-rule); border-radius: 16px; padding: clamp(1.2rem, 3vw, 2rem); }
.kq-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-family: var(--f-mono); font-size: .8rem; color: var(--night-mute); }
.kq-dots { display: flex; gap: 6px; }
.kq-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--night-3); }
.kq-dots i.ok { background: var(--syn-str); } .kq-dots i.no { background: #e0604c; } .kq-dots i.cur { background: var(--syn-op); }
.kq-score strong { color: var(--syn-op); font-size: 1.1rem; }
.kq-body { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; margin-top: 1.5rem; }
.kq-glyph { width: 9rem; height: 9rem; border-radius: 16px; background: var(--night); border: 1px solid var(--night-rule); display: grid; place-items: center; font-family: var(--f-display); font-size: 4.4rem; color: #fff; }
.kq-q { font-family: var(--f-display); font-size: clamp(1.3rem, 2.5vw, 1.8rem); line-height: 1.25; color: #fff; }
.kq-q .enc { font-family: var(--f-mono); font-size: .8em; padding: .05em .35em; border-radius: 6px; }
.kq-hint { font-family: var(--f-mono); font-size: .8rem; color: var(--night-mute); margin-top: .4rem; }
.kq-opts { display: flex; gap: .7rem; margin-top: 1.2rem; flex-wrap: wrap; }
.kq-opts button {
  font: 600 1.2rem var(--f-mono); width: 4.2rem; height: 3.4rem; border-radius: 10px;
  border: 1px solid var(--night-rule); background: var(--night); color: #fff; transition: all 160ms var(--ease);
}
.kq-opts button:hover:not(:disabled) { border-color: var(--syn-op); transform: translateY(-2px); }
.kq-opts button.right { background: rgba(156,196,122,.2); border-color: var(--syn-str); color: var(--syn-str); }
.kq-opts button.wrong { background: rgba(224,96,76,.18); border-color: #e0604c; color: #e0604c; }
.kq-opts button:disabled { cursor: default; }
.kq-msg { margin-top: 1rem; min-height: 3rem; font-size: .92rem; color: var(--night-ink); }
.kq-msg code { background: var(--night-3); color: var(--syn-op); padding: .1em .4em; border-radius: 4px; font-size: .85em; }
.kq-actions { display: flex; gap: .7rem; margin-top: .6rem; }
.kq-end { text-align: center; padding: 2rem 0; }
.kq-end .big { font-family: var(--f-display); font-size: 4rem; color: var(--syn-op); line-height: 1; }

/* ---------- Seçim rehberi ---------- */
.pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.pick > div { border-radius: 14px; padding: 1.5rem; border: 1px solid var(--rule); background: #fffaf2; }
.pick .q { font-family: var(--f-display); font-size: 1.15rem; line-height: 1.3; margin-bottom: .8rem; }
.pick .a { display: inline-block; font-family: var(--f-mono); font-weight: 600; font-size: .85rem; padding: .3rem .7rem; border-radius: 6px; color: #fff; }
.pick p { font-size: .88rem; color: var(--ink-mute); margin-top: .8rem; }

/* tip'lerde temanın yeşil "good" rengini koru */
.tip-good { background: rgba(74,122,46,.1); color: #4a7a2e; }
.tip code { overflow-wrap: anywhere; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layers { grid-template-columns: 1fr 1fr; }
  .layer:nth-child(2) { border-right: 0; }
  .layer:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .layer:nth-child(2)::after { display: none; }
  .enc-cards, .powers, .pick { grid-template-columns: 1fr; }
  .lab, .sur { grid-template-columns: 1fr; }
  .moji { grid-template-columns: 1fr; }
  .moji-mid { flex-direction: row; }
  .moji-mid .arrow { transform: rotate(90deg); }
}
@media (max-width: 640px) {
  .layers { grid-template-columns: 1fr; }
  .layer { border-right: 0; border-bottom: 1px solid var(--rule); }
  .layer::after { display: none; }
  .meters { grid-template-columns: 1fr; }
  .endian { grid-template-columns: 1fr; }
  .kq-body { grid-template-columns: 1fr; gap: 1rem; }
  .kq-glyph { width: 6.5rem; height: 6.5rem; font-size: 3.2rem; }
  .ruler-row { grid-template-columns: 1fr; gap: .3rem; }
  .enc-glyph .g { font-size: 2.8rem; }
  .plane-bar div { font-size: .55rem; }
}

/* ---------- Baskı (PDF) ---------- */
@page { size: A4; margin: 13mm 12mm; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html { font-size: 11.5px; }
  body::before, .progress, .nav, .crumb, .hero-cta, .hero-demo, .no-print, .footer { display: none !important; }
  .hero-grid { grid-template-columns: 1fr; }
  .fade-in { opacity: 1 !important; transform: none !important; }
  .section { padding: 2rem 0; }
  .hero { padding: 0 0 1rem; }
  .stats { margin-top: 1.5rem; padding: 1.2rem 0; }
  .section--dark { background: var(--paper) !important; color: var(--ink) !important; }
  .section--dark::before { display: none; }
  .section-head--dark p, .section--dark .section-head p { color: var(--ink-mute) !important; }
  .section--dark h2 { color: var(--ink) !important; }
  .power { background: #fffaf2; border-color: var(--rule); }
  .power h4 { color: var(--ink); } .power p { color: var(--ink-mute); }
  .section--dark .c8 { color: var(--u8); } .section--dark .c16 { color: var(--u16); } .section--dark .c32 { color: var(--u32); }
  .cmp-wrap, .enc-card, .tip, .tl, .layers, .powers, .endian, .sur-card, .pick > div, .code, .conclusion { break-inside: avoid; }
  .enc-card:hover { transform: none; }
  .resources .res::after { content: attr(href); display: block; font-size: .7rem; color: var(--ink-soft); word-break: break-all; margin-top: .3rem; }
  .print-break { break-before: page; }
}
