/* ==== Reset & variables ==== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --background: #f7f8fa;
  --background-alt: #eef1f5;
  --surface: #ffffff;
  --foreground: #171923;
  --muted: #5c6470;
  --border: #e2e5ea;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #e6edfd;
  --danger: #dc2626;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #0b0e14;
    --background-alt: #11151d;
    --surface: #151a23;
    --foreground: #e7eaf0;
    --muted: #9299a8;
    --border: #232a37;
    --accent: #5b8def;
    --accent-strong: #7ea6f5;
    --accent-soft: #17233b;
  }
}

/* Kullanicinin acikca sectigi tema (tema dugmesi), sistem tercihini gecersiz kilar */
:root[data-theme="dark"] {
  --background: #0b0e14;
  --background-alt: #11151d;
  --surface: #151a23;
  --foreground: #e7eaf0;
  --muted: #9299a8;
  --border: #232a37;
  --accent: #5b8def;
  --accent-strong: #7ea6f5;
  --accent-soft: #17233b;
}

:root[data-theme="light"] {
  --background: #f7f8fa;
  --background-alt: #eef1f5;
  --surface: #ffffff;
  --foreground: #171923;
  --muted: #5c6470;
  --border: #e2e5ea;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #e6edfd;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; margin: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 0.95rem; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

/* ==== Buttons & links ==== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.5rem; border-radius: 999px; font-weight: 500; font-size: 0.9rem;
  border: 1px solid transparent; transition: background-color .15s, border-color .15s;
}
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-outline { border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: var(--surface); }
.btn-secondary { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-lg { padding: 0.9rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.link-accent { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; background: none; border: none; padding: 0; font-size: 0.9rem; }
.link-danger { color: var(--danger); text-decoration: underline; text-underline-offset: 2px; background: none; border: none; padding: 0; font-size: 0.9rem; }

/* ==== Header / nav ==== */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--background) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; }
.brand { font-family: var(--font-serif); font-weight: 600; font-size: 1.1rem; }
.main-nav { display: none; align-items: center; gap: 1.75rem; }
.main-nav a { font-size: 0.9rem; color: var(--muted); }
.main-nav a.active, .main-nav a:hover { color: var(--accent); }
.locale-switch { border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.theme-switch { display: inline-flex; align-items: center; justify-content: center; width: 1.85rem; height: 1.85rem; border: 1px solid var(--border); border-radius: 999px; font-size: 0.95rem; line-height: 1; background: none; color: var(--foreground); }
.theme-switch:hover { border-color: var(--accent); }
.blank-theme-switch, .admin-theme-switch { position: fixed; top: 1.25rem; right: 1.25rem; background: var(--surface); z-index: 50; }
.nav-toggle { background: none; border: none; font-size: 1.4rem; }
.mobile-nav { display: flex; flex-direction: column; border-top: 1px solid var(--border); padding: 0.5rem 1.5rem 1rem; }
.mobile-nav a { padding: 0.6rem 0; font-size: 0.95rem; color: var(--muted); }
.mobile-nav:not(.open) { display: none; }

@media (min-width: 780px) {
  .main-nav { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ==== Hero ==== */
.hero { border-bottom: 1px solid var(--border); background: var(--background-alt); }
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.5rem; padding: 5rem 1.5rem; }
.avatar { width: 8rem; height: 8rem; border-radius: 999px; object-fit: cover; border: 4px solid var(--surface); box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.hero-inner h1 { font-size: 2.25rem; }
.hero-title { color: var(--accent); font-size: 1.1rem; margin-top: 0.4rem; }
.hero-bio { max-width: 620px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* ==== Sections ==== */
.section { padding: 4.5rem 0; }
.section-narrow { max-width: 720px; }
.section-alt { background: var(--background-alt); }
.section-title { text-align: center; font-size: 1.6rem; margin-bottom: 2.5rem; }
.section-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2.5rem; }
.page-header { text-align: center; margin-bottom: 2.5rem; }
.page-header h1 { font-size: 2rem; }
.page-header p { color: var(--muted); margin-top: 0.6rem; }
.cta-section { text-align: center; }

/* ==== Skills ==== */
.skills-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 780px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }
.skills-subheading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 1rem; }
.skill-bar { margin-bottom: 1rem; }
.skill-bar-label { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 0.3rem; }
.skill-bar-track { height: 0.45rem; border-radius: 999px; background: var(--background-alt); overflow: hidden; }
.skill-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }

/* ==== Cards ==== */
.card-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid-3, .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card { display: block; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); overflow: hidden; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.card-image { aspect-ratio: 16/10; background: var(--background-alt); overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-image-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 1rem; text-align: center; }
.card-body { padding: 1.25rem; }
.card-eyebrow { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--accent); letter-spacing: .03em; }
.card-title { font-size: 1.1rem; margin-top: 0.4rem; }
.card-text { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* ==== Testimonials ==== */
.testimonial-card { border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); padding: 1.5rem; }
.testimonial-quote { font-size: 0.92rem; color: color-mix(in srgb, var(--foreground) 90%, transparent); }
.testimonial-author { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.testimonial-author img { width: 2.5rem; height: 2.5rem; border-radius: 999px; object-fit: cover; }
.avatar-placeholder { width: 2.5rem; height: 2.5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.testimonial-name { font-size: 0.9rem; font-weight: 600; }
.testimonial-title { font-size: 0.8rem; color: var(--muted); }

/* ==== Portfolio filters ==== */
.filter-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-bottom: 2.5rem; }
.pill { border: 1px solid var(--border); border-radius: 999px; padding: 0.4rem 1rem; font-size: 0.85rem; color: var(--muted); }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.empty-state { text-align: center; color: var(--muted); padding: 2rem 0; }

/* ==== Detail pages ==== */
.detail-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 1rem; margin-top: 1.5rem; }
.detail-title { font-size: 1.8rem; margin-top: 0.5rem; }
.detail-description { margin-top: 1.5rem; color: color-mix(in srgb, var(--foreground) 85%, transparent); }
.prose { line-height: 1.7; }
.prose :first-child { margin-top: 0; }

/* ==== Timeline ==== */
.timeline-grid { display: grid; gap: 3rem; grid-template-columns: 1fr; }
@media (min-width: 780px) { .timeline-grid { grid-template-columns: repeat(2, 1fr); } }
.timeline-heading { font-size: 1.2rem; margin-bottom: 1.75rem; }
.timeline-list { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 1px solid var(--border); }
.timeline-item { margin-bottom: 2.25rem; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -1.6875rem; top: 0.35rem; width: 0.6rem; height: 0.6rem; border-radius: 999px; background: var(--accent); }
.timeline-range { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--accent); letter-spacing: .03em; }
.timeline-title { font-size: 1.05rem; margin-top: 0.3rem; }
.timeline-role { font-size: 0.88rem; color: var(--muted); }
.timeline-description { font-size: 0.88rem; margin-top: 0.4rem; color: color-mix(in srgb, var(--foreground) 80%, transparent); }

/* ==== Contact ==== */
.contact-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .contact-grid { grid-template-columns: 1fr 1.3fr; } }
.contact-info p { margin: 0 0 0.75rem; font-size: 0.92rem; }
.contact-form { display: flex; flex-direction: column; gap: 0.25rem; }
.contact-form label { font-size: 0.85rem; font-weight: 500; margin-top: 0.6rem; }
.contact-form input, .contact-form textarea { padding: 0.6rem 0.85rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface); color: var(--foreground); margin-top: 0.25rem; }
.contact-form button { margin-top: 1.25rem; align-self: flex-start; }
.form-success { color: var(--accent-strong); font-size: 0.9rem; margin-top: 0.75rem; }
.form-error { color: var(--danger); font-size: 0.9rem; margin-top: 0.75rem; }

/* ==== Footer ==== */
.site-footer { margin-top: 6rem; border-top: 1px solid var(--border); background: var(--background-alt); padding: 3rem 0; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.footer-grid a:not(.btn) { display: block; font-size: 0.88rem; color: var(--muted); margin-top: 0.4rem; }
.footer-grid a:not(.btn):hover { color: var(--accent); }
.footer-grid .btn { margin-top: 0.75rem; }
.footer-heading { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.footer-copy { text-align: center; font-size: 0.75rem; color: var(--muted); margin-top: 2.5rem; }

/* ==== Error pages ==== */
.error-page { text-align: center; padding: 6rem 0; }
.error-page h1 { font-size: 3rem; }
.error-page p { color: var(--muted); margin: 1rem 0 2rem; }

/* ==== Login ==== */
.blank-layout { background: var(--background-alt); }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 24rem; background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; padding: 2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.login-card h1 { font-size: 1.3rem; }
.login-subtitle { color: var(--muted); font-size: 0.88rem; margin-bottom: 1rem; }
.login-card label { font-size: 0.85rem; font-weight: 500; margin-top: 0.5rem; }
.login-card input { padding: 0.6rem 0.85rem; border: 1px solid var(--border); border-radius: 0.5rem; background: var(--background); color: var(--foreground); }
.login-card button { margin-top: 1.25rem; }
.login-forgot-link { margin-top: 0.9rem; text-align: center; font-size: 0.82rem; color: var(--muted); }
.login-forgot-link:hover { color: var(--accent); }

/* ==== Admin shell ==== */
.admin-body { background: var(--background-alt); }
.admin-shell { display: flex; flex-direction: column; min-height: 100vh; }
.admin-nav { width: 100%; background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-nav-head { padding: 1.25rem; }
.admin-nav-sub { font-size: 0.75rem; color: var(--muted); }
.admin-nav nav { display: flex; gap: 0.25rem; overflow-x: auto; padding: 0 0.75rem 0.75rem; }
.admin-nav nav a { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.88rem; color: var(--muted); }
.admin-nav nav a.active, .admin-nav nav a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 0.7rem; padding: 0.1rem 0.45rem; }
.admin-logout { padding: 0.75rem; }
.admin-logout button { background: none; border: none; color: var(--muted); text-decoration: underline; font-size: 0.75rem; }
.admin-content { flex: 1; padding: 1.5rem; max-width: 1100px; width: 100%; margin: 0 auto; }

@media (min-width: 900px) {
  .admin-shell { flex-direction: row; }
  .admin-nav { width: 15rem; border-bottom: none; border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
  .admin-nav nav { flex-direction: column; overflow: visible; padding: 0 0.75rem; flex: 1; }
  .admin-content { padding: 2.5rem; }
}

.admin-title { font-size: 1.5rem; }
.admin-subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; margin-bottom: 2rem; }
.admin-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }

.admin-two-col { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .admin-two-col { grid-template-columns: 1fr 1.2fr; } }

.admin-card { border: 1px solid var(--border); border-radius: 0.9rem; background: var(--surface); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-card h2 { font-size: 1.05rem; margin-bottom: 1rem; }
.admin-hint { font-size: 0.82rem; color: var(--muted); margin-bottom: 1rem; }
.admin-form label { display: block; font-size: 0.85rem; font-weight: 500; margin: 0.9rem 0 0.3rem; }
.admin-form input[type="text"], .admin-form input[type="email"], .admin-form input[type="password"],
.admin-form input[type="date"], .admin-form input[type="number"], .admin-form select, .admin-form textarea {
  width: 100%; padding: 0.6rem 0.85rem; border: 1px solid var(--border); border-radius: 0.5rem;
  background: var(--background); color: var(--foreground);
}
.admin-form input[type="file"] { margin-top: 0.4rem; font-size: 0.85rem; }
.form-grid-2 { display: grid; gap: 0 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.form-col-2 { grid-column: 1 / -1; }
.checkbox-row label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.admin-form button[type="submit"], .admin-form .btn { margin-top: 1.5rem; }
.field-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; }

.admin-thumb { max-width: 8rem; border-radius: 0.5rem; margin-bottom: 0.6rem; object-fit: cover; }
.admin-thumb-round { border-radius: 999px; width: 5rem; height: 5rem; }
.admin-thumb-sm { width: 2.5rem; height: 2.5rem; object-fit: cover; }

.admin-list { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-list-row { display: flex; align-items: center; gap: 0.9rem; border: 1px solid var(--border); border-radius: 0.75rem; background: var(--surface); padding: 0.9rem 1.1rem; }
.admin-list-main { flex: 1; min-width: 0; }
.admin-list-title { font-size: 0.95rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-list-meta { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-list-eyebrow { font-size: 0.7rem; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.admin-list-actions { display: flex; align-items: center; gap: 0.9rem; flex-shrink: 0; }
.drag-handle { cursor: grab; color: var(--muted); flex-shrink: 0; padding: 0 0.2rem; touch-action: none; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.admin-list-row.dragging { opacity: 0.4; }
.admin-list-row.drag-over { border-color: var(--accent); border-style: dashed; }
.reorder-status { font-size: 0.78rem; color: var(--muted); min-height: 1.1em; }
.reorder-status.saved { color: var(--accent-strong); }
.reorder-status.error { color: var(--danger); }

.dashboard-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .dashboard-grid { grid-template-columns: repeat(3, 1fr); } }
.dashboard-card { display: block; border: 1px solid var(--border); border-radius: 0.9rem; background: var(--surface); padding: 1.5rem; }
.dashboard-card:hover { border-color: var(--accent); }
.dashboard-value { font-size: 1.8rem; font-weight: 700; }
.dashboard-label { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }

/* ==== Rich text editor ==== */
.rich-editor { margin-bottom: 1.25rem; }
.rich-editor-toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; border: 1px solid var(--border); border-bottom: none; border-radius: 0.5rem 0.5rem 0 0; background: var(--background-alt); padding: 0.4rem; }
.rich-editor-toolbar button { border: none; background: none; padding: 0.35rem 0.6rem; border-radius: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.rich-editor-toolbar button:hover { background: var(--surface); color: var(--foreground); }
.rich-editor-content { min-height: 140px; border: 1px solid var(--border); border-radius: 0 0 0.5rem 0.5rem; background: var(--surface); padding: 0.75rem 0.9rem; }
.rich-editor-content:focus { outline: none; border-color: var(--accent); }

/* ==== Messages inbox ==== */
.message-card { border: 1px solid var(--border); border-radius: 0.9rem; background: var(--surface); padding: 1.1rem 1.25rem; display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.message-unread { border-color: var(--accent); background: var(--accent-soft); }
.message-from { font-weight: 600; font-size: 0.92rem; }
.message-email { font-weight: 400; color: var(--muted); }
.message-subject { font-size: 0.88rem; font-weight: 500; margin-top: 0.3rem; }
.message-text { font-size: 0.88rem; margin-top: 0.5rem; white-space: pre-line; }
.message-date { font-size: 0.75rem; color: var(--muted); margin-top: 0.5rem; }
.message-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; flex-shrink: 0; }
.message-actions form { margin: 0; }
.message-list-row { cursor: pointer; text-decoration: none; }
.message-list-row:hover { border-color: var(--accent); }
.message-list-row.message-unread { border-color: var(--accent); background: var(--accent-soft); }

/* ==== Sohbet tarzi mesaj thread'i ==== */
.thread-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.thread-meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }
.thread-log { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 2rem; }
.bubble-row { display: flex; }
.bubble-row.from-user { justify-content: flex-start; }
.bubble-row.from-admin { justify-content: flex-end; }
.bubble { max-width: 32rem; border-radius: 1rem; padding: 0.8rem 1.05rem; font-size: 0.9rem; white-space: pre-line; }
.bubble-row.from-user .bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 0.25rem; }
.bubble-row.from-admin .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 0.25rem; }
.bubble-meta { font-size: 0.72rem; opacity: 0.75; margin-top: 0.4rem; }
.reply-form textarea { width: 100%; min-height: 7rem; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 0.6rem; background: var(--surface); color: var(--foreground); }
.reply-form-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 0.75rem; }
.imap-hint { font-size: 0.78rem; color: var(--muted); }
