:root {
  --bg: #0a0e0f;
  --bg-alt: #0d1214;
  --surface: #10171a;
  --surface-2: #141d20;
  --border: #1f2c30;
  --text: #d3dcdc;
  --text-dim: #8a9a9a;
  --accent: #39ff9d;
  --accent-dim: #1e9a5f;
  --accent-2: #58c4ff;
  --red: #ff5f56;
  --yellow: #ffbd2e;
  --green: #27c93f;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: #05100a;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { color: #f2f6f6; margin: 0; font-family: var(--font-mono); }

code, pre {
  font-family: var(--font-mono);
}

pre {
  background: #060909;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  color: #b9f5d0;
}

pre code { background: none; padding: 0; }

p code, li code {
  background: #0f1719;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.88em;
  color: var(--accent);
}

.accent { color: var(--accent); }

.cursor-blink {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- NAVBAR ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 15, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: #f2f6f6;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text);
  font-size: 0.9rem;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.prompt {
  font-family: var(--font-mono);
  color: var(--accent-dim);
  margin-right: 4px;
}

.nav-cta {
  border: 1px solid var(--accent-dim);
  border-radius: 4px;
  padding: 6px 12px !important;
}
.nav-cta:hover {
  border-color: var(--accent);
  background: rgba(57, 255, 157, 0.08);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--accent);
  display: block;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 90px 0 70px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(57, 255, 157, 0.07), transparent 45%),
    radial-gradient(circle at 85% 60%, rgba(88, 196, 255, 0.06), transparent 40%);
  pointer-events: none;
}

.hero-inner { position: relative; }

.terminal-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-red { background: var(--red); }
.dot-yellow { background: var(--yellow); }
.dot-green { background: var(--green); }

.terminal-title {
  margin-left: 12px;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.terminal-body {
  padding: 32px 28px 36px;
  font-family: var(--font-mono);
}

.term-prompt { color: var(--accent); }
.term-path { color: var(--accent-2); margin-right: 6px; }

.glitch-name {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  margin: 14px 0 10px;
  letter-spacing: -0.5px;
}

.typed-line {
  color: var(--accent);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  min-height: 1.6em;
  margin: 0 0 20px;
}

.hero-desc {
  color: var(--text-dim);
  max-width: 60ch;
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: 6px;
  border: 1px solid var(--accent-dim);
  cursor: pointer;
  display: inline-block;
}

.btn-primary {
  background: var(--accent);
  color: #05100a;
  border-color: var(--accent);
  font-weight: 700;
}
.btn-primary:hover { background: #5dffb3; text-decoration: none; }

.btn-ghost {
  color: var(--accent);
  background: transparent;
}
.btn-ghost:hover { background: rgba(57, 255, 157, 0.08); text-decoration: none; }

/* ---------- SECTIONS ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin-bottom: 36px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-num { color: var(--accent); font-size: 0.9rem; }

.section-sub {
  color: var(--text-dim);
  margin-top: -20px;
  margin-bottom: 32px;
  font-size: 0.92rem;
}

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p { color: var(--text); margin: 0 0 18px; }
.about-text strong { color: var(--accent); font-weight: 600; }

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.stat-num small { font-size: 0.9rem; color: var(--text-dim); margin-left: 4px; }
.stat-label { font-size: 0.8rem; color: var(--text-dim); }

/* ---------- SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  transition: border-color 0.2s;
}
.skill-card:hover { border-color: var(--accent-dim); }

.skill-card h3 {
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.skill-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-card li {
  color: var(--text);
  font-size: 0.9rem;
  padding-left: 16px;
  position: relative;
}
.skill-card li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent-dim);
}

/* ---------- CERTS ---------- */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cert-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
}

.cert-icon {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.cert-item h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.cert-item p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.cert-note {
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-style: italic;
}

.cert-link {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-dim);
}
.cert-link:hover { color: var(--accent); }

/* ---------- CTF / PROJECTS ---------- */
.ctf-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ctf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  padding: 22px 24px;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s;
}
.ctf-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  text-decoration: none;
}

.ctf-card-head {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-htb { background: rgba(158, 255, 90, 0.12); color: #9eff5a; border: 1px solid rgba(158, 255, 90, 0.3); }
.badge-thm { background: rgba(88, 196, 255, 0.12); color: var(--accent-2); border: 1px solid rgba(88, 196, 255, 0.3); }
.badge-otw { background: rgba(255, 189, 46, 0.12); color: var(--yellow); border: 1px solid rgba(255, 189, 46, 0.3); }

.badge-status { margin-left: auto; }
.badge-done { background: rgba(57, 255, 157, 0.1); color: var(--accent); border: 1px solid rgba(57, 255, 157, 0.3); }
.badge-progress { background: rgba(255, 95, 86, 0.1); color: #ff8f88; border: 1px solid rgba(255, 95, 86, 0.3); }

.ctf-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.difficulty {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.diff-easy { background: rgba(39, 201, 63, 0.12); color: var(--green); }
.diff-medium { background: rgba(255, 189, 46, 0.12); color: var(--yellow); }
.diff-hard { background: rgba(255, 95, 86, 0.12); color: var(--red); }

.ctf-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 0 10px;
}

.expand-hint {
  color: var(--accent-dim);
  font-size: 0.78rem;
}

.ctf-lesson {
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  color: var(--text-dim) !important;
  font-style: italic;
}

/* ---------- HOME: INTRO + EXPLORE ---------- */
.intro-section { padding: 70px 0 60px; }

.intro-text {
  max-width: 68ch;
  margin: 0 auto;
  text-align: left;
}
.intro-text p { margin: 0 0 18px; }
.intro-text strong { color: var(--accent); font-weight: 600; }

.intro-more {
  color: var(--accent);
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 4px;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.explore-card {
  padding: 24px;
}
.explore-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

/* ---------- GENERIC SUB-PAGE HERO ---------- */
.page-hero {
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.page-hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); margin-bottom: 14px; }
.page-hero .writeup-summary { margin-bottom: 0; }

.rss-link {
  font-family: var(--font-mono);
  display: inline-block;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--yellow);
  border: 1px solid rgba(255, 189, 46, 0.3);
  border-radius: 4px;
  padding: 5px 12px;
}
.rss-link:hover {
  border-color: var(--yellow);
  background: rgba(255, 189, 46, 0.08);
  text-decoration: none;
}

/* ---------- WRITEUP DETAIL PAGES ---------- */
.back-link {
  display: inline-block;
  color: var(--accent-dim);
  font-size: 0.85rem;
  margin-bottom: 22px;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.writeup-hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.writeup-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.writeup-summary {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 70ch;
  margin: 0 0 20px;
}

.meta-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.writeup-content {
  max-width: 760px;
  padding-top: 44px;
  padding-bottom: 20px;
}

.writeup-content h2 {
  font-size: 1.3rem;
  color: var(--accent);
  margin: 44px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.writeup-content h2:first-child { margin-top: 0; }

.writeup-content p, .writeup-content li {
  font-size: 0.96rem;
  color: var(--text);
}

.writeup-content pre { margin: 16px 0; }

.writeup-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.88rem;
}
.writeup-content th, .writeup-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.writeup-content th {
  background: var(--surface-2);
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.writeup-content ul, .writeup-content ol {
  padding-left: 22px;
}

.resource-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resource-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.85rem;
}
.resource-list a { word-break: break-all; }

.writeup-footer-nav {
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.writeup-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.writeup-pager a { color: var(--accent-dim); }
.writeup-pager a:hover { color: var(--accent); text-decoration: none; }
.writeup-pager .pager-next { margin-left: auto; text-align: right; }

/* ---------- EMPTY STATE (Makaleler) ---------- */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 40px 32px;
  text-align: center;
}
.empty-state pre {
  display: inline-block;
  text-align: left;
  margin: 0 0 20px;
}
.empty-state p {
  color: var(--text-dim);
  max-width: 55ch;
  margin: 0 auto 20px;
}

.topic-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.topic-tags .badge { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }

/* ---------- CONTACT ---------- */
.contact-inner { text-align: center; }
.contact-sub { margin-left: auto; margin-right: auto; max-width: 50ch; }

.contact-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.contact-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
  transition: border-color 0.2s, transform 0.2s;
}
.contact-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.contact-icon {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}

.contact-sub-text {
  color: var(--text-dim);
  font-size: 0.82rem;
}
.contact-sub-text em { color: var(--text-dim); font-style: italic; }

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
}
.site-footer p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.footer-mono { font-family: var(--font-mono); color: var(--accent-dim); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .terminal-body { padding: 26px 18px 30px; }
}
