:root {
  --base: #0e0e16; --mantle: #161622; --surface: #1c1c2b; --overlay: #2c2d40; --overlay2: #3b3d55;
  --coral: #ff6b6b; --teal: #4ecdc4;
  --text: #e8eaf4; --text-2: #bfc3d6; --muted: #9399b2; --border: rgba(255,255,255,.08);
  --win: rgba(22, 22, 34, .97); --bar: rgba(14, 14, 22, .86);
  --term-fg: #cdd6f4; --radius: 12px; --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: Inter, system-ui, sans-serif; font-size: 15px; color: var(--text); background-color: var(--base);
  -webkit-font-smoothing: antialiased;
}
body::before { /* devre kartı nokta ızgarası */
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1.5px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
a { color: var(--teal); text-underline-offset: 3px; }
kbd { font-family: var(--mono); font-size: .9em; background: var(--overlay); padding: 1px 6px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
svg { flex: none; }

/* Hareketli arka plan: yavaş kayan renk bulutları + devre kartı canvas'ı (bg.js) */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .22; }
.aurora span:first-child { background: var(--coral); top: -30vmax; right: -15vmax; animation: drift1 26s ease-in-out infinite alternate; }
.aurora span:last-child { background: var(--teal); bottom: -35vmax; left: -20vmax; animation: drift2 32s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-18vw, 14vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(22vw, -12vh) scale(.9); } }
#desktop { z-index: 1; }

/* Uygulama kutucuğu (ikon) */
.tile {
  --tint: var(--overlay2);
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--tint) 100%, #fff 18%), color-mix(in srgb, var(--tint) 100%, #000 30%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px -6px color-mix(in srgb, var(--tint) 70%, transparent);
}

/* Açılış */
#boot { position: fixed; inset: 0; z-index: 9999; background: #000; display: grid; place-items: center; transition: opacity .4s; cursor: pointer; }
#boot.done { opacity: 0; pointer-events: none; }
#boot-log { font-family: var(--mono); color: #a6e3a1; font-size: 14px; width: min(560px, 90vw); white-space: pre-wrap; }

/* Masaüstü */
#desktop { position: fixed; inset: 0 0 52px 0; }
#icons {
  position: absolute; top: 16px; left: 16px; bottom: 16px;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 100px); gap: 4px; align-content: start;
}
.icon {
  width: 92px; height: 98px; border: 1px solid transparent; border-radius: 10px; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 4px; text-align: center;
  transition: background .15s, border-color .15s;
}
.icon .tile { width: 52px; height: 52px; border-radius: 14px; transition: transform .15s var(--ease); }
.icon:hover, .icon:focus-visible { background: rgba(255,255,255,.06); border-color: var(--border); outline: none; }
.icon:hover .tile { transform: translateY(-2px); }
.icon:active .tile { transform: scale(.95); }
.icon .label { font-size: 12px; font-weight: 500; line-height: 1.25; text-shadow: 0 1px 4px #000; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Tanıtım widget'ı */
#hello {
  position: absolute; right: 5vw; bottom: 7vh; width: min(460px, 40vw); padding: 28px;
  background: rgba(22, 22, 34, .55); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 18px;
}
#hello h1 { margin: 6px 0 0; font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -.03em; line-height: 1.08;
  background: linear-gradient(90deg, var(--coral), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#hello-title { margin: 8px 0 0; color: var(--text-2); font-size: 16px; line-height: 1.5; }
#hello .row { margin-top: 20px; }
#hello .contact { margin-top: 14px; }
#hello .hint { font-size: 12.5px; color: var(--muted); margin: 18px 0 0; }
.status { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--text-2);
  padding: 4px 10px; border-radius: 99px; background: rgba(34,197,94,.10); border: 1px solid rgba(34,197,94,.3); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

/* Panel (KDE tarzı) */
#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 52px; z-index: 5000;
  display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: var(--bar); backdrop-filter: blur(16px); border-top: 1px solid var(--border);
}
#start { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--teal)); transition: filter .15s; }
#start:hover { filter: brightness(1.1); }
#tasks { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.task { display: flex; align-items: center; gap: 8px; height: 42px; background: none; border: 0; border-radius: 8px; padding: 0 12px; font-size: 13px; white-space: nowrap; color: var(--text-2); position: relative; transition: background .15s; }
.task:hover { background: rgba(255,255,255,.06); }
.task.active { background: rgba(78,205,196,.12); color: var(--text); }
.task.active::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 3px; height: 2px; border-radius: 2px; background: var(--teal); }
#cv-quick { display: flex; align-items: center; gap: 6px; height: 38px; text-decoration: none; color: var(--text); font-size: 13px; font-weight: 600; padding: 0 12px; border-radius: 8px; background: rgba(255,107,107,.16); border: 1px solid rgba(255,107,107,.4); transition: background .15s; }
#cv-quick:hover { background: rgba(255,107,107,.26); }
#clock { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 0 6px; }
#startmenu {
  position: fixed; left: 8px; bottom: 60px; z-index: 5001; width: 280px; padding: 8px;
  background: var(--win); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .14s var(--ease);
}
.sm-head { padding: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); font-weight: 600; }
.sm-head small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
#startmenu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; background: none; border: 0; border-radius: 8px; padding: 6px 8px; text-align: left; }
#startmenu button .tile { width: 30px; height: 30px; border-radius: 8px; }
#startmenu button:hover { background: rgba(255,255,255,.06); }

/* Pencereler */
.win {
  position: absolute; min-width: 320px; min-height: 200px; display: flex; flex-direction: column;
  background: var(--win); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.45); overflow: hidden; resize: both; animation: pop .18s var(--ease);
}
.win.focused { border-color: rgba(255,255,255,.14); box-shadow: 0 30px 90px rgba(0,0,0,.65), 0 0 0 1px rgba(78,205,196,.15); }
.win.closing { animation: out .12s ease-in forwards; pointer-events: none; }
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: 0; } }
@keyframes out { to { transform: scale(.97); opacity: 0; } }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
.win.min { display: none; }
.titlebar {
  display: flex; align-items: center; height: 40px; padding: 0 4px 0 14px; flex: none;
  background: var(--mantle); border-bottom: 1px solid var(--border); cursor: grab; user-select: none; touch-action: none;
}
.titlebar:active { cursor: grabbing; }
.titlebar .t { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.win.focused .titlebar .t { color: var(--text); }
.wbtn { display: flex; gap: 2px; }
.wbtn button { width: 36px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); transition: background .15s, color .15s; }
.wbtn button:hover { background: rgba(255,255,255,.08); color: var(--text); }
.wbtn .c:hover { background: #e5484d; color: #fff; }
.body { flex: 1; overflow: auto; padding: 24px 28px; line-height: 1.65; outline: none; scrollbar-width: thin; scrollbar-color: var(--overlay2) transparent; }

/* İçerik */
.body > p, .cv p, .lead { max-width: 68ch; color: var(--text-2); }
.lead { font-size: 15.5px; }
.hero { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.hero img { border-radius: 50%; border: 2px solid var(--teal); background: var(--overlay); }
.hero p { margin: 2px 0 0; }
.meta { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0; list-style: none; }
.chips li { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 99px; color: var(--text-2); background: rgba(255,255,255,.05); border: 1px solid var(--border); }
.muted { color: var(--muted); }
.err { color: #f38ba8; }
h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
h3 { margin: 22px 0 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--coral); }
.timeline { border-left: 2px solid var(--overlay2); padding-left: 18px; margin-left: 4px; }
.timeline > div { position: relative; margin-bottom: 16px; color: var(--text-2); }
.timeline > div::before { content: ""; position: absolute; left: -24px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--base); border: 2px solid var(--coral); }
.timeline b { display: block; color: var(--text); }
.timeline .muted { font-size: 13px; font-family: var(--mono); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; padding: 18px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--border); transition: border-color .2s, transform .2s var(--ease), background .2s; }
.card:hover { border-color: rgba(78,205,196,.4); background: rgba(255,255,255,.04); transform: translateY(-2px); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.card h4 { margin: 0; font-size: 16px; line-height: 1.3; }
.card p { margin: 0 0 4px; font-size: 14px; line-height: 1.6; color: var(--text-2); flex: 1; }
.card .links { display: flex; gap: 16px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13.5px; font-weight: 500; }
.card .links a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; min-height: 28px; }
.card .links a:hover { text-decoration: underline; }
.repos { display: grid; gap: 8px; }
.repo { display: grid; gap: 3px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.025); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.repo:hover { border-color: rgba(78,205,196,.4); background: rgba(255,255,255,.04); }
.repo span { font-size: 13.5px; color: var(--text-2); }
.repo small { font-family: var(--mono); font-size: 11.5px; color: var(--teal); }
.contact { display: flex; flex-wrap: wrap; gap: 8px; }
.social { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; text-decoration: none; color: var(--text); background: rgba(255,255,255,.05); border: 1px solid var(--border); font-size: 14px; transition: border-color .15s, background .15s; }
.social:hover { border-color: rgba(78,205,196,.5); background: rgba(78,205,196,.08); }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; background: linear-gradient(135deg, var(--coral), #e8577f); color: #fff; border: 0; border-radius: 10px; padding: 0 16px; font-weight: 600; font-size: 14px; text-decoration: none; transition: filter .15s, transform .1s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--overlay); color: var(--text); }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
@media print {
  body * { visibility: hidden; } .cv, .cv * { visibility: visible; }
  .cv { position: absolute; inset: 0; color: #000; padding: 24px; } .cv p, .cv .muted, .timeline > div { color: #333; } .cv h3 { color: #b33; }
}

/* CV (PDF) */
.body:has(.pdf) { display: flex; flex-direction: column; padding: 0; }
.cvbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--mantle); }
.cvbar > span { display: flex; align-items: center; gap: 6px; margin-right: auto; font-size: 13px; }
.cvbar .btn { min-height: 36px; font-size: 13px; }
.pdf { flex: 1; width: 100%; border: 0; background: #525659; }
.cvmobile { padding-top: 20px; }

/* Terminal */
.term { background: #0a0a10; font-family: var(--mono); font-size: 14px; color: var(--term-fg); padding: 16px 18px; line-height: 1.55; }
.term .out { white-space: pre-wrap; word-break: break-word; }
.term .line { display: flex; gap: 8px; }
.term .ps { color: var(--teal); font-weight: 600; white-space: nowrap; } .term .pc { color: var(--coral); margin-left: -8px; }
.term input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: inherit; font: inherit; caret-color: var(--coral); }
.term .acc { color: var(--coral); }
.neo { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 6px; }
.neo .logo { margin: 0; color: var(--coral); }
.neo .k { color: var(--teal); font-weight: 600; } .neo .dim { color: var(--overlay2); }

/* Tablet: widget masaüstü ikonlarıyla çakışmasın */
@media (max-width: 1100px) { #hello { width: min(400px, 50vw); padding: 22px; } }

/* Telefon */
@media (max-width: 700px) {
  #icons { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, 86px); grid-template-rows: none; right: 12px; justify-content: center; bottom: auto; }
  #hello { position: absolute; left: 12px; right: 12px; bottom: 12px; width: auto; padding: 20px; }
  #hello .hint { display: none; }
  .win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
  .body { padding: 20px 18px; }
  .task span, #clock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
