@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

/* ── Variables ──────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #21262d;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --accent:      #9fef00;
  --accent-glow: rgba(159, 239, 0, 0.12);
  --link:        #79c0ff;
  --tag-bb:      #ff6b6b;
  --tag-ctf:     #9fef00;
  --tag-certs:   #ffaf00;
  --tag-misc:    #79c0ff;
}

/* ── Reset & Base ───────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

main {
  flex: 1;
  padding: 2rem 0 4rem;
}

/* ── Header ─────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  background-color: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.site-brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
}

.site-brand .brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.site-brand .brand-name::before {
  content: '> ';
  color: var(--text-muted);
  font-weight: 300;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s;
  position: relative;
  white-space: nowrap;
}

.site-nav a::before {
  content: '~/';
  color: var(--accent);
  opacity: 0.7;
}

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

.site-nav a.active::before {
  opacity: 1;
}

.site-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

/* ── Hero / Terminal Block ───────────────────────── */
.hero {
  margin: 2.5rem 0;
}

.terminal-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.terminal-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-dot.red    { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }

.terminal-title {
  margin-left: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.875rem;
}

.terminal-line {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.prompt {
  color: var(--accent);
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.cmd {
  color: var(--text);
}

.output {
  color: var(--text-muted);
  padding-left: 1rem;
  margin-bottom: 0.75rem;
  line-height: 1.7;
  border-left: 2px solid var(--border);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Section Cards ───────────────────────────────── */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  display: block;
}

.section-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-2px);
}

.section-card .section-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  display: block;
}

.section-card .section-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-card .section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.section-card .section-count {
  margin-top: 1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Section Heading ─────────────────────────────── */
.section-heading {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2.5rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Post List ───────────────────────────────────── */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.post-card > a {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 1.1rem 1.4rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.post-tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.post-tag.bug-bounty {
  background: rgba(255, 107, 107, 0.12);
  color: var(--tag-bb);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.post-tag.ctf {
  background: rgba(159, 239, 0, 0.08);
  color: var(--tag-ctf);
  border: 1px solid rgba(159, 239, 0, 0.25);
}

.post-tag.certs {
  background: rgba(255, 175, 0, 0.1);
  color: var(--tag-certs);
  border: 1px solid rgba(255, 175, 0, 0.3);
}

.post-tag.misc {
  background: rgba(121, 192, 255, 0.1);
  color: var(--tag-misc);
  border: 1px solid rgba(121, 192, 255, 0.3);
}

.post-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}

.post-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  transition: color 0.15s;
  line-height: 1.4;
}

.post-card:hover .post-title {
  color: var(--accent);
}

.post-excerpt {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Tag Label (inline tags on list pages) ───────── */
.tag-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Post Cover Image ────────────────────────────── */
.post-cover {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  display: block;
}

/* ── Single Post ─────────────────────────────────── */
.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-header .post-tag {
  display: inline-block;
  margin-bottom: 1rem;
}

.post-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.85rem;
  color: var(--text);
}

.post-header .post-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.post-header .post-info span::before {
  content: '// ';
  color: var(--border);
}

/* ── Post Content ────────────────────────────────── */
.post-content {
  font-size: 0.925rem;
  line-height: 1.9;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin: 2.25rem 0 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

.post-content h1 {
  font-size: 1.5rem;
  color: var(--accent);
}

.post-content h2 {
  font-size: 1.2rem;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
}

.post-content h3 {
  font-size: 1.05rem;
  color: var(--text);
}

.post-content h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.post-content a:hover {
  border-bottom-color: var(--link);
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.25rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content li::marker {
  color: var(--accent);
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.75rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.post-content img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 1.25rem 0;
  display: block;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  display: block;
  overflow-x: auto;
}

.post-content th {
  background: var(--surface-2);
  color: var(--accent);
  padding: 0.6rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}

.post-content td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  color: var(--text);
}

.post-content tr:nth-child(even) td {
  background: var(--surface);
}

/* ── Code ────────────────────────────────────────── */
.post-content code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2);
  color: var(--accent);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  font-size: 0.85em;
  border: 1px solid var(--border);
}

.post-content pre {
  background: var(--surface) !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.65;
}

/* Hugo highlight shortcode */
.highlight {
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.highlight > pre,
.highlight > .chroma {
  margin: 0;
  border: none;
  border-radius: 0;
  padding: 1.1rem 1.25rem;
  background: var(--surface) !important;
}

/* Line numbers */
.lntd pre {
  padding: 0;
  border: none;
  border-radius: 0;
  margin: 0;
}

/* ── List Page ───────────────────────────────────── */
.list-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.list-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.list-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ── Post Tags (bottom of post) ──────────────────── */
.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-tags a {
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}

.post-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── About Page ──────────────────────────────────── */
.about-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ── Social Links ────────────────────────────────── */
.social-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.social-links a {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, filter 0.2s;
}

.social-links a:hover {
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(159, 239, 0, 0.5));
  text-decoration: none;
}

.social-links svg {
  width: 18px;
  height: 18px;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ── Selection ───────────────────────────────────── */
::selection {
  background: rgba(159, 239, 0, 0.18);
  color: var(--accent);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 640px) {
  .site-nav {
    gap: 0.85rem;
  }

  .site-nav a::before {
    content: none;
  }

  .post-header h1 {
    font-size: 1.35rem;
  }

  .sections-grid {
    grid-template-columns: 1fr;
  }

  .terminal-body {
    font-size: 0.8rem;
  }
}
