/* ============================================================
   site.css — Emirhan Topcuoğlu portfolyo + blog ortak tasarım katmanı
   Tüm sayfalar (portfolio / blog / post / 404 / error) bunu kullanır.
   ============================================================ */

:root {
  --bg: #fafaf8;
  --bg-alt: #f2f2ef;
  --panel: #ffffff;
  --border: #e4e4e0;
  --text: #1a1a18;
  --text-muted: #6b6b65;
  --accent: oklch(0.50 0.13 250);
  --accent-bg: oklch(0.95 0.03 250);
  --on-accent: #ffffff;
  --radius: 6px;
  --radius-lg: 10px;
  --nav-h: 60px;
  --max-w: 860px;
  --transition: 0.25s ease;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 10px 30px -18px rgba(0,0,0,0.22);
}

[data-theme="dark"] {
  --bg: #0f0f0e;
  --bg-alt: #1a1a18;
  --panel: #17171510;
  --border: #2e2e2b;
  --text: #eaeae5;
  --text-muted: #8a8a82;
  --accent: oklch(0.68 0.13 250);
  --accent-bg: oklch(0.18 0.04 250);
  --on-accent: #0f0f0e;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 30px -16px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-bg); }

/* ---------- NAV ---------- */
body > nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border); z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1rem, 5vw, 2.5rem);
  transition: background var(--transition), border-color var(--transition);
}
.nav-logo { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.03em; color: var(--text); }
a.nav-logo:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: clamp(0.6rem, 2vw, 1.4rem); }
.nav-links a { font-size: 0.875rem; color: var(--text-muted); letter-spacing: 0.01em; transition: color var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.nav-controls { display: flex; align-items: center; gap: 0.5rem; }

.toggle-btn {
  display: flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.65rem;
  border: 1px solid var(--border); border-radius: 20px; background: transparent;
  color: var(--text-muted); font-size: 0.78rem; font-family: inherit; cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  letter-spacing: 0.02em;
}
.toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.toggle-btn svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.toggle-btn [data-theme-icon] { display: flex; }

.hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.mobile-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--bg); border-bottom: 1px solid var(--border);
  flex-direction: column; padding: 1rem 1.5rem 1.5rem; gap: 0.2rem; z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-size: 1rem; color: var(--text-muted); padding: 0.5rem 0; border-bottom: 1px solid var(--border); transition: color var(--transition); }
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--text); text-decoration: none; }

main { padding-top: var(--nav-h); }

/* ---------- SECTIONS ---------- */
section { padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 5vw, 2.5rem); max-width: var(--max-w); margin: 0 auto; }
section.full-bleed { max-width: 100%; background: var(--bg-alt); }
section.full-bleed > .inner { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(1rem, 5vw, 2.5rem); }
.section-label { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 0.5rem; }
.section-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin-bottom: 2rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-size: 0.875rem; font-weight: 600; font-family: inherit;
  padding: 0.6rem 1.15rem; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { border-color: var(--border); color: var(--text-muted); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); text-decoration: none; }

/* ---------- HERO ---------- */
#hero { min-height: calc(100svh - var(--nav-h)); display: flex; flex-direction: column; justify-content: center; padding-top: clamp(2rem, 8vw, 5rem); padding-bottom: clamp(2rem, 8vw, 5rem); }
.hero-available { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.hero-available::before { content: ''; display: block; width: 7px; height: 7px; border-radius: 50%; background: #4caf7d; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.hero-name { font-size: clamp(2.2rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: -0.05em; line-height: 1.08; color: var(--text); margin-bottom: 0.4rem; }
.hero-title { font-size: clamp(1rem, 2.5vw, 1.3rem); color: var(--accent); font-weight: 500; letter-spacing: -0.01em; margin-bottom: 1.2rem; }
.hero-bio { font-size: clamp(0.95rem, 1.8vw, 1.05rem); color: var(--text-muted); max-width: 520px; margin-bottom: 2rem; line-height: 1.75; }
.hero-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.social-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); transition: border-color var(--transition), color var(--transition), background var(--transition); }
.social-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); text-decoration: none; }
.social-icon svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- ABOUT / SKILLS / PROJECTS / EDU / CONTACT ---------- */
#about p { font-size: clamp(0.95rem, 1.5vw, 1.05rem); color: var(--text-muted); max-width: 640px; margin-bottom: 1.1rem; line-height: 1.8; }
#about p:last-child { margin-bottom: 0; }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.skill-category { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; background: var(--bg); transition: border-color var(--transition); }
.skill-category:hover { border-color: var(--accent); }
.skill-cat-name { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 0.9rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-tag { font-size: 0.8rem; background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 0.15rem 0.55rem; transition: background var(--transition), color var(--transition); }
.skill-category:hover .skill-tag { background: var(--accent-bg); color: var(--accent); border-color: transparent; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.project-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem; background: var(--bg); display: flex; flex-direction: column; gap: 0.6rem; transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition); }
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.12); }
.project-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.project-name { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.project-links { display: flex; gap: 0.5rem; flex-shrink: 0; }
.project-link { color: var(--text-muted); transition: color var(--transition); }
.project-link:hover { color: var(--accent); text-decoration: none; }
.project-link svg { width: 16px; height: 16px; fill: currentColor; }
.project-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.65; flex: 1; }
.project-techs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.3rem; }
.tech-tag { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); background: var(--accent-bg); border-radius: 4px; padding: 0.15rem 0.5rem; }

.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 2.2rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -2rem; top: 6px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); margin-left: -4px; }
.timeline-years { font-size: 0.78rem; color: var(--accent); font-weight: 600; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.timeline-school { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin-bottom: 0.15rem; }
.timeline-dept { font-size: 0.875rem; color: var(--text-muted); }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem; max-width: 560px; }
.contact-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); font-size: 0.875rem; transition: border-color var(--transition), color var(--transition), background var(--transition); }
.contact-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); text-decoration: none; }
.contact-item svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.contact-label { font-weight: 600; font-size: 0.8rem; }
.contact-value { font-size: 0.78rem; color: inherit; word-break: break-all; }

/* ---------- FOOTER ---------- */
footer { border-top: 1px solid var(--border); padding: 1.6rem clamp(1rem, 5vw, 2.5rem); transition: border-color var(--transition); }
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; font-size: 0.78rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.1rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ---------- BLOG (kartlar / filtre) ---------- */
.blog-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.blog-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.blog-filter button { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 0.25rem 0.8rem; cursor: pointer; transition: var(--transition); font-family: inherit; }
.blog-filter button:hover { border-color: var(--accent); color: var(--accent); }
.blog-filter button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.1rem; }
.blog-card { text-align: left; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; font-family: inherit; padding: 0; transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition); color: inherit; }
.blog-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 24px -8px rgba(0,0,0,0.14); text-decoration: none; }
.blog-cover { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block; background: var(--bg-alt); }
.blog-cover-ph { aspect-ratio: 16 / 9; width: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-bg), var(--bg-alt)); color: var(--accent); font-size: 2rem; font-weight: 800; letter-spacing: -0.04em; }
.blog-body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.blog-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; color: var(--text-muted); }
.blog-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.blog-card-title { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); line-height: 1.35; }
.blog-excerpt { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; flex: 1; }
.blog-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }
.blog-tag { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.03em; color: var(--accent); background: var(--accent-bg); border-radius: 4px; padding: 0.12rem 0.45rem; }

.load-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; margin-top: 2.2rem; }
.load-more-count { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- BLOG LIST / PAGE HEADER ---------- */
.page-hero { max-width: var(--max-w); margin: 0 auto; padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1rem, 5vw, 2.5rem) 0; }
.page-hero .eyebrow { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 0.6rem; }
.page-hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; color: var(--text); margin-bottom: 0.7rem; }
.page-hero p { font-size: clamp(0.95rem, 1.8vw, 1.1rem); color: var(--text-muted); max-width: 560px; }
.page-body { max-width: var(--max-w); margin: 0 auto; padding: 2rem clamp(1rem, 5vw, 2.5rem) clamp(4rem, 9vw, 6rem); }

/* ---------- ARTICLE / PROSE (post detay) ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 1.5rem clamp(1rem, 5vw, 2.5rem) clamp(4rem, 9vw, 6rem); }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 1.6rem; transition: var(--transition); }
.back-link:hover { color: var(--accent); text-decoration: none; gap: 0.55rem; }
.back-link svg { width: 15px; height: 15px; fill: currentColor; }
.article-cover { width: 100%; border-radius: var(--radius-lg); margin-bottom: 1.8rem; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-alt); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.article-title { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.12; color: var(--text); margin-bottom: 1.1rem; text-wrap: balance; }
.article-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.8rem; }
.prose p { font-size: 1.07rem; line-height: 1.85; color: var(--text); margin-bottom: 1.25rem; }
.prose p:last-child { margin-bottom: 0; }
.prose figure { margin: 1.8rem 0; }
.prose figure img { width: 100%; border-radius: var(--radius-lg); display: block; background: var(--bg-alt); }
.prose figure figcaption { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 0.55rem; }
.prose .fig-ph { width: 100%; aspect-ratio: 16/9; border: 1px dashed var(--border); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.85rem; }

.share-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.share-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-right: 0.2rem; }
.share-btn { width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); }
.share-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); text-decoration: none; }
.share-btn svg { width: 16px; height: 16px; fill: currentColor; }
.copied-toast { font-size: 0.78rem; color: #2e9e6a; font-weight: 600; opacity: 0; transition: opacity 0.2s; }
.copied-toast.show { opacity: 1; }

/* önceki / sonraki yazı */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.6rem; }
.post-nav a { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; transition: var(--transition); display: flex; flex-direction: column; gap: 0.3rem; }
.post-nav a:hover { border-color: var(--accent); background: var(--accent-bg); text-decoration: none; }
.post-nav .dir { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.post-nav .ptitle { font-size: 0.92rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; line-height: 1.3; }
.post-nav a.next { text-align: right; align-items: flex-end; }

/* ---------- SKELETON ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--bg-alt); border-radius: var(--radius); }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 7%, transparent), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sk-cover { aspect-ratio: 16/9; }
.sk-body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: 0.55rem; }
.sk-line { height: 12px; border-radius: 4px; }

/* ---------- STATUS (404 / error / empty) ---------- */
.status-wrap { min-height: calc(100svh - var(--nav-h)); display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem 4rem; }
.status-card { text-align: center; max-width: 460px; }
.status-code { font-size: clamp(4.5rem, 16vw, 8rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--text-muted))); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 0.6rem; }
.status-title { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin-bottom: 0.7rem; }
.status-text { font-size: 0.98rem; color: var(--text-muted); margin-bottom: 1.8rem; line-height: 1.7; }
.status-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }

.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--text-muted); }
.empty-state .emoji { font-size: 2.2rem; margin-bottom: 0.6rem; opacity: 0.7; }
.empty-state p { font-size: 0.95rem; }

/* önizleme modu: nav kontrollerini gizle */
body.preview .nav-controls, body.preview .hamburger { display: none; }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
}
@media (max-width: 400px) { .skills-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
