/* ------------------------------------------------------------------
   07enesavci — minimal terminal-style blog theme
   Cyber Security & UAV/SİHA Systems
------------------------------------------------------------------ */

:root {
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --radius: 6px;
  --wrap-width: 720px;
}

:root[data-theme="dark"] {
  --bg: #0a0e12;
  --bg-elevated: #10161c;
  --fg: #d9e2e6;
  --muted: #8a9aa5;
  --accent: #39ff9d;
  --accent-dim: #24b374;
  --border: rgba(255, 255, 255, 0.1);
  --code-bg: #10161c;
  --selection: rgba(57, 255, 157, 0.25);
}

:root[data-theme="light"] {
  --bg: #f7f9f8;
  --bg-elevated: #ffffff;
  --fg: #12181b;
  --muted: #56666d;
  --accent: #0a8f5c;
  --accent-dim: #0a8f5c;
  --border: rgba(0, 0, 0, 0.12);
  --code-bg: #eef1f0;
  --selection: rgba(10, 143, 92, 0.2);
}

/* ---------------- Skins (accent presetleri) ----------------
   data-theme (koyu/acik) uzerine binen renk paletleri.
   Varsayilan "matrix" (yesil) icin override gerekmez. */
:root[data-skin="cyber"] {
  --accent: #22d3ee;
  --accent-dim: #0ea5b7;
  --selection: rgba(34, 211, 238, 0.25);
}
:root[data-skin="synthwave"] {
  --accent: #ff3ca6;
  --accent-dim: #c026d3;
  --selection: rgba(255, 60, 166, 0.25);
}
:root[data-skin="amber"] {
  --accent: #ffb000;
  --accent-dim: #cc8800;
  --selection: rgba(255, 176, 0, 0.22);
}
:root[data-skin="ice"] {
  --accent: #7dd3fc;
  --accent-dim: #38bdf8;
  --selection: rgba(125, 211, 252, 0.22);
}
:root[data-skin="blood"] {
  --accent: #ff4d5e;
  --accent-dim: #d61f3a;
  --selection: rgba(255, 77, 94, 0.22);
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--selection);
}

html {
  color-scheme: dark light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: var(--wrap-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  background: var(--bg-elevated);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------------- Header ---------------- */

.site-header {
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  position: relative;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg);
}

.brand::before {
  content: "~/";
  color: var(--accent);
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 0.4rem;
}

.menu-btn .icon {
  width: 22px;
  height: 22px;
  display: block;
}

.menu-btn .menu-icon-close {
  display: none;
}

.menu-btn[aria-expanded="true"] .menu-icon-open {
  display: none;
}

.menu-btn[aria-expanded="true"] .menu-icon-close {
  display: block;
}

.nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--muted);
  transition: color 0.15s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--accent);
}

.icon-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.icon-link:hover {
  color: var(--accent);
}

.icon-link svg {
  width: 20px;
  height: 20px;
}

.theme-btn .icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-btn .icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-btn .icon-moon {
  display: block;
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.hero .prompt {
  font-size: 1.9rem;
  margin: 0 0 1rem;
}

.hero .prompt::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.1rem;
  background: var(--accent);
  margin-left: 0.35rem;
  vertical-align: -0.15em;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero p {
  color: var(--fg);
  max-width: 60ch;
}

.hero .disclaimer {
  color: var(--muted);
  font-size: 0.9rem;
  border-left: 2px solid var(--border);
  padding-left: 0.9rem;
}

.socials {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

.socials a {
  color: var(--muted);
}

.socials a:hover {
  color: var(--accent);
}

.socials svg {
  width: 22px;
  height: 22px;
}

/* ---------------- Interactive terminal ---------------- */

.terminal {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.55;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.term-dot-red { background: #ff5f56; }
.term-dot-yellow { background: #ffbd2e; }
.term-dot-green { background: #27c93f; }

.term-bar-title {
  margin-left: 0.6rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.term-output {
  padding: 1rem 1.1rem 0.4rem;
  max-height: 420px;
  overflow-y: auto;
}

.term-row {
  white-space: pre-wrap;
  word-break: break-word;
}

.term-row a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.term-echo .term-prompt {
  color: var(--accent-dim);
}

.term-title { color: var(--fg); font-weight: 600; }
.term-muted { color: var(--muted); }
.term-err { color: #ff6b6b; }
.term-cmd-name,
.term-file-post { color: var(--accent); }
.term-dir { color: #6cb6ff; font-weight: 600; }
.term-file { color: var(--fg); }
.term-ls-item { display: inline-block; }

.term-banner {
  color: var(--accent);
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  line-height: 1.2;
  overflow-x: auto;
}

.term-input-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1.1rem 1rem;
}

.term-prompt {
  color: var(--accent-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: inherit;
  font-size: inherit;
  caret-color: var(--accent);
  padding: 0;
}

.term-bar-links {
  margin-left: auto;
  display: flex;
  gap: 1rem;
}

.term-bar-links a {
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.term-bar-links a:hover {
  color: var(--accent);
}

/* ---- Full-screen terminal (home page) ---- */

body.is-terminal {
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
}

.terminal-main {
  height: 100vh;
  height: 100dvh;
  padding: 0;
  max-width: none;
  margin: 0;
}

.terminal.terminal-full {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.95rem;
  position: relative;
}

/* Futuristik CRT tarama cizgileri (cok hafif) */
.terminal.terminal-full::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    rgba(127, 255, 200, 0.035) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

/* Ust kenarda ince accent parlama cizgisi */
.terminal.terminal-full::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 4;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
  box-shadow: 0 0 12px var(--accent);
}

/* Accent metinlere neon parlama */
.term-banner,
.terminal-full .term-prompt {
  text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 55%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .hero .prompt::after { animation: none; }
}

.terminal-full .term-output {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  padding: 1.25rem 1.5rem 0.5rem;
}

.terminal-full .term-input-line {
  flex: 0 0 auto;
  padding: 0.5rem 1.5rem 1.5rem;
}

.terminal-full .term-bar {
  flex: 0 0 auto;
}

.home-fallback {
  padding: 2.5rem 1.25rem;
  max-width: 800px;
  margin: 0 auto;
}

/* ---------------- Post list ---------------- */

.recent-posts,
.posts-index {
  padding: 2.5rem 0;
}

h2 {
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  margin: 1.75rem 0;
  padding-bottom: 1.75rem;
  border-bottom: 1px dashed var(--border);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list li.empty {
  color: var(--muted);
}

.post-title {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px dashed var(--accent-dim);
}

.post-title:hover {
  border-bottom-style: solid;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.4rem 0 0.6rem;
}

.post-meta .tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

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

a.tag:hover {
  color: var(--accent);
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

.more-link svg {
  width: 18px;
  height: 18px;
}

/* ---------------- Post / Page content ---------------- */

.post,
.page {
  padding: 2.5rem 0 3.5rem;
}

.post h1,
.page h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.post-content,
.page-content {
  margin-top: 1.75rem;
}

.post-content h2,
.page-content h2 {
  margin-top: 2.2rem;
  font-size: 1.25rem;
}

.post-content h3,
.page-content h3 {
  margin-top: 1.8rem;
  font-size: 1.05rem;
}

.post-content p,
.page-content p {
  margin: 1rem 0;
}

.post-content ul,
.post-content ol,
.page-content ul,
.page-content ol {
  padding-left: 1.4rem;
}

.post-content li,
.page-content li {
  margin: 0.35rem 0;
}

.post-content a,
.page-content a {
  color: var(--accent);
  border-bottom: 1px dashed var(--accent-dim);
}

.post-content blockquote {
  margin: 1.25rem 0;
  padding: 0.4rem 1rem;
  border-left: 3px solid var(--accent-dim);
  color: var(--muted);
}

.post-content code,
.page-content code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

.post-content pre,
.page-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}

.post-content pre code,
.page-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-content img,
.page-content img {
  max-width: 100%;
  border-radius: var(--radius);
}

.post-content table,
.page-content table {
  border-collapse: collapse;
  width: 100%;
  display: block;
  overflow-x: auto;
}

.post-content th,
.post-content td,
.page-content th,
.page-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--muted);
}

.back-link:hover {
  color: var(--accent);
}

/* ---------------- Tags / Archives ---------------- */

.tag-group {
  margin: 2rem 0;
}

.tag-group h3 {
  color: var(--accent);
  font-size: 1.05rem;
}

.tag-group ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.tag-group li {
  margin: 0.5rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.tag-group time {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.archive-year {
  margin: 2rem 0;
  font-size: 1.3rem;
  color: var(--accent);
}

.archive-list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.archive-list li {
  display: flex;
  gap: 1rem;
  margin: 0.6rem 0;
}

.archive-list time {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 6.5rem;
}

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  padding: 1.75rem 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer-inner .socials {
  margin-top: 0;
}

.sep {
  margin: 0 0.35rem;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 640px) {
  .menu-btn {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
  }

  .nav.open {
    display: block;
  }

  .nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.25rem 1.25rem;
  }

  .nav ul li {
    width: 100%;
    padding: 0.6rem 0;
  }

  .hero .prompt {
    font-size: 1.5rem;
  }

  .terminal-full .term-output {
    padding: 1rem 1rem 0.5rem;
  }

  .terminal-full .term-input-line {
    padding: 0.5rem 1rem 1rem;
  }

  .term-bar-links {
    display: none;
  }

  .terminal-full {
    font-size: 0.9rem;
  }
}
