/* =========================================================
   Portfolio Theme — Design System
   "IDE / terminal" aesthetic for a backend engineer's site
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Palette */
  --bg-ink: #0B0E14;
  --bg-surface: #12161F;
  --bg-card: #161B26;
  --border-subtle: #1F2632;
  --border-strong: #2A3242;
  --text-primary: #E8E6E1;
  --text-muted: #8B92A5;
  --text-faint: #565E70;
  --accent: #F4B740;
  --accent-hover: #FFCB5E;
  --accent-ink: #1A1300;
  --mint: #3DDC97;
  --danger: #E5566D;

  /* Type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --max-width: 1160px;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-ink);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(244,183,64,0.06), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(61,220,151,0.04), transparent 35%);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.font-mono { font-family: var(--font-mono); }

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

/* Bootstrap's .text-muted defaults to #6c757d, which is calibrated for
   light backgrounds and reads too dim/low-contrast on our dark theme.
   Override it site-wide to the theme's own muted tone. */
.text-muted { color: var(--text-muted) !important; }

/* Bootstrap's default .btn-close (used in dismissible alerts) renders a
   dark X glyph with no dark-mode variant, making it invisible on our
   dark alert backgrounds. Bootstrap 5.3 ships a --bs-btn-close-color-dark
   filter for this — but since we don't set data-bs-theme, force the
   filter manually so any dismissible alert's close button stays visible. */
.btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container-narrow {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* -----------------------------------------------------------
   Route-label — used instead of numbered markers (01/02/03)
   because this is a dev site: real "paths" carry meaning here
   ----------------------------------------------------------- */
.route-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}
.route-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* -----------------------------------------------------------
   Navbar
   ----------------------------------------------------------- */
.site-navbar {
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-navbar .navbar-brand {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-primary);
  font-size: 1.05rem;
}
.site-navbar .navbar-brand .brand-dot { color: var(--accent); }
.site-navbar .nav-link {
  color: var(--text-muted) !important;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem !important;
  transition: color 0.15s ease;
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
  color: var(--text-primary) !important;
}
.site-navbar .nav-link.active { color: var(--accent) !important; }

/* -----------------------------------------------------------
   Buttons
   ----------------------------------------------------------- */
.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-accent:hover { background: var(--accent-hover); color: var(--accent-ink); transform: translateY(-1px); }

.btn-outline-mono {
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-outline-mono:hover {
  border-color: var(--accent);
  background: rgba(244,183,64,0.06);
  color: var(--text-primary);
}

/* -----------------------------------------------------------
   Hero / Terminal block
   ----------------------------------------------------------- */
.hero-section { padding: 6rem 0 5rem; }

.terminal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.red { background: #E5566D; }
.terminal-dot.yellow { background: var(--accent); }
.terminal-dot.green { background: var(--mint); }
.terminal-titlebar-label {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--mint);
  min-height: 3.2rem;
}
.terminal-body .prompt { color: var(--text-muted); }
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-title {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  line-height: 1.08;
  margin-bottom: 1rem;
}
.hero-title .highlight { color: var(--accent); }
.hero-subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 46ch; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mint);
  border: 1px solid rgba(61,220,151,0.3);
  background: rgba(61,220,151,0.06);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 6px var(--mint); }

/* -----------------------------------------------------------
   Sections
   ----------------------------------------------------------- */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-surface); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.5rem; }
.section-intro { color: var(--text-muted); max-width: 60ch; margin-bottom: 2.5rem; }

/* -----------------------------------------------------------
   Cards
   ----------------------------------------------------------- */
.card-base {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.card-base:hover { transform: translateY(-3px); border-color: var(--border-strong); }

.project-card { overflow: hidden; }
.project-card .thumb-wrap {
  aspect-ratio: 16/10;
  background: var(--bg-surface);
  overflow: hidden;
  position: relative;
}
.project-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.project-card:hover .thumb-wrap img { transform: scale(1.04); }
.project-card .body { padding: 1.25rem 1.4rem 1.5rem; }
.project-card .category-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.project-card h3 { font-size: 1.15rem; margin: 0.35rem 0 0.5rem; }
.project-card p { color: var(--text-muted); font-size: 0.92rem; }

.tech-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  margin: 0.15rem 0.25rem 0.15rem 0;
}

.skill-card { padding: 1.4rem; }
.skill-card .skill-name { font-weight: 600; font-size: 0.98rem; }
.skill-bar-track { height: 5px; background: var(--border-subtle); border-radius: 999px; overflow: hidden; margin-top: 0.6rem; }
.skill-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--mint)); border-radius: 999px; }

.timeline-item { position: relative; padding-left: 2rem; padding-bottom: 2.2rem; border-left: 1px solid var(--border-subtle); }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(244,183,64,0.15);
}
.timeline-item .period { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); }
.timeline-item h4 { margin: 0.25rem 0 0.15rem; font-size: 1.05rem; }
.timeline-item .company { color: var(--accent); font-size: 0.92rem; }

.testimonial-card { padding: 1.75rem; }
.testimonial-card .stars { color: var(--accent); font-size: 0.9rem; margin-bottom: 0.75rem; }
.testimonial-card .quote { color: var(--text-primary); font-size: 0.98rem; }
.testimonial-card .client { display: flex; align-items: center; gap: 0.7rem; margin-top: 1.25rem; }
.testimonial-card .client img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.testimonial-card .client-name { font-weight: 600; font-size: 0.9rem; }
.testimonial-card .client-role { color: var(--text-faint); font-size: 0.8rem; }

.service-card { padding: 1.75rem; text-align: left; }
.service-card .icon-wrap {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(244,183,64,0.08);
  border: 1px solid rgba(244,183,64,0.25);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.stat-block { text-align: center; padding: 1.5rem 1rem; }
.stat-block .number { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: var(--accent); }
.stat-block .label { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* -----------------------------------------------------------
   Blog
   ----------------------------------------------------------- */
.blog-card .cover-wrap { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-surface); }
.blog-card .cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.blog-card .meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); margin-bottom: 0.5rem; }
.blog-card h3 { font-size: 1.1rem; }
.blog-post-content { font-size: 1.05rem; line-height: 1.8; color: var(--text-primary); }
.blog-post-content h2, .blog-post-content h3 { margin-top: 2rem; }
.blog-post-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.blog-post-content code {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}
.blog-post-content img { max-width: 100%; border-radius: var(--radius-sm); }

/* -----------------------------------------------------------
   Forms
   ----------------------------------------------------------- */
.form-control-dark {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
}
.form-control-dark:focus {
  background: var(--bg-surface);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(244,183,64,0.12);
}
.form-control-dark::placeholder { color: var(--text-faint); }
label.form-label-mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: block;
}

/* -----------------------------------------------------------
   Native form controls that Bootstrap/browsers render with a
   light background by default: <select>, checkboxes, radios,
   range sliders, and date/datetime pickers. Without explicit
   dark styling here, these show dark text on a white control
   (inherited from body color), which is unreadable.
   ----------------------------------------------------------- */
select.form-control-dark {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%238B92A5' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  appearance: none;
  -webkit-appearance: none;
}
select.form-control-dark option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.form-check-input {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
}
.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}
.form-check-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244,183,64,0.15);
}
.form-check-label {
  color: var(--text-primary);
}

.form-range::-webkit-slider-runnable-track {
  background: var(--border-subtle);
  height: 5px;
  border-radius: 999px;
}
.form-range::-moz-range-track {
  background: var(--border-subtle);
  height: 5px;
  border-radius: 999px;
}
.form-range::-webkit-slider-thumb {
  background: var(--accent);
  border: none;
  margin-top: -6px;
}
.form-range::-moz-range-thumb {
  background: var(--accent);
  border: none;
}

/* Date/datetime-local inputs: force the native calendar icon to render
   light-colored so it's visible against our dark input background. */
input[type="date"].form-control-dark::-webkit-calendar-picker-indicator,
input[type="datetime-local"].form-control-dark::-webkit-calendar-picker-indicator {
  filter: invert(0.7) brightness(1.5);
  cursor: pointer;
}
input[type="date"].form-control-dark,
input[type="datetime-local"].form-control-dark {
  color-scheme: dark;
}

/* File inputs: Bootstrap renders these with a light "Browse" button by
   default even under .form-control-dark, so restyle the button part too. */
input[type="file"].form-control-dark::file-selector-button {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  margin-right: 0.75rem;
  font-family: var(--font-body);
}
input[type="file"].form-control-dark::file-selector-button:hover {
  background: var(--bg-surface);
}

/* -----------------------------------------------------------
   Footer
   ----------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 2rem;
  color: var(--text-faint);
  font-size: 0.9rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  margin-right: 0.5rem;
  color: var(--text-muted);
}
.footer-social a:hover { border-color: var(--accent); color: var(--accent); }

/* -----------------------------------------------------------
   Scroll reveal
   ----------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* -----------------------------------------------------------
   Pagination override (bootstrap)
   ----------------------------------------------------------- */
.pagination .page-link {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.pagination .page-item.active .page-link {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.pagination .page-link:hover { color: var(--text-primary); background: var(--bg-surface); }

/* Badges */
.badge-status-published { background: rgba(61,220,151,0.12); color: var(--mint); border: 1px solid rgba(61,220,151,0.3); }
.badge-status-draft { background: rgba(139,146,165,0.12); color: var(--text-muted); border: 1px solid var(--border-strong); }