/* ============================================================
   Faiez Portfolio Theme — Dark Developer Aesthetic
   ============================================================ */

:root {
  --bg:           #111113;
  --bg-subtle:    #18181b;
  --bg-hover:     #1f1f23;
  --border:       #27272a;
  --text:         #d4d4d8;
  --text-muted:   #71717a;
  --text-heading: #f4f4f5;
  --accent:       #38bdf8;
  --accent-dim:   rgba(56, 189, 248, 0.08);
  --green:        #4ade80;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --radius:       6px;
  --max-w:        700px;
  --ease:         0.15s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background:              var(--bg);
  color:                   var(--text);
  font-family:             var(--font-sans);
  font-size:               16px;
  line-height:             1.75;
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin:    0 auto;
  padding:   0 1.5rem;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  color:       var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }

p { margin-bottom: 1rem; color: var(--text); }

a {
  color:      var(--accent);
  text-decoration: none;
  transition: color var(--ease);
}
a:hover { color: #7dd3fc; }

strong { color: var(--text-heading); font-weight: 600; }
em     { font-style: italic; }

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

ul, ol {
  margin: 0.5rem 0 1rem 1.4rem;
}
li { margin-bottom: 0.3rem; }

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Code ───────────────────────────────────────────────── */
code {
  font-family:   var(--font-mono);
  font-size:     0.87em;
  background:    var(--bg-subtle);
  border:        1px solid var(--border);
  border-radius: 3px;
  padding:       0.1em 0.4em;
  color:         var(--accent);
}

pre {
  background:    var(--bg-subtle);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1.25rem;
  overflow-x:    auto;
  margin:        1.5rem 0;
}
pre code {
  background: none;
  border:     none;
  padding:    0;
  color:      var(--text);
  font-size:  0.9em;
}

/* ── Header & Nav ───────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  padding:       1rem 0;
  margin-bottom: 3rem;
  position:      sticky;
  top:           0;
  background:    var(--bg);
  z-index:       10;
  backdrop-filter: blur(8px);
}

nav {
  display:     flex;
  align-items: center;
  gap:         0.15rem;
  flex-wrap:   wrap;
}

.nav-home {
  font-family:  var(--font-mono);
  font-size:    0.92rem;
  color:        var(--accent);
  margin-right: auto;
  font-weight:  500;
  padding:      0.25rem 0;
}
.nav-home:hover { color: #7dd3fc; }

nav a:not(.nav-home) {
  color:         var(--text-muted);
  font-size:     0.88rem;
  padding:       0.25rem 0.6rem;
  border-radius: var(--radius);
  transition:    color var(--ease), background var(--ease);
}
nav a:not(.nav-home):hover,
nav a.active {
  color:      var(--text);
  background: var(--bg-subtle);
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: 4.5rem 0 5rem;
}

.hero-prefix {
  font-family:   var(--font-mono);
  color:         var(--accent);
  font-size:     0.88rem;
  margin-bottom: 1rem;
  opacity:       0.7;
}

.hero h1 {
  font-size:     clamp(1.9rem, 5vw, 2.8rem);
  color:         var(--text-heading);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.hero .tagline {
  color:         var(--text-muted);
  font-size:     1.05rem;
  margin-bottom: 2.5rem;
}

.hero-links {
  display:   flex;
  gap:       0.6rem;
  flex-wrap: wrap;
}

.hero-links a {
  font-family:   var(--font-mono);
  font-size:     0.85rem;
  color:         var(--text-muted);
  border:        1px solid var(--border);
  padding:       0.4rem 0.9rem;
  border-radius: var(--radius);
  transition:    color var(--ease), border-color var(--ease), background var(--ease);
}
.hero-links a:hover {
  color:        var(--accent);
  border-color: var(--accent);
  background:   var(--accent-dim);
}

/* ── Page header ────────────────────────────────────────── */
.page-header {
  margin-bottom:  2.5rem;
  padding-bottom: 1.5rem;
  border-bottom:  1px solid var(--border);
}
.page-header h1 { font-size: 1.6rem; }
.page-header .page-desc {
  color:      var(--text-muted);
  margin-top: 0.4rem;
  font-size:  0.95rem;
}

/* ── Skills ─────────────────────────────────────────────── */
.skills-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap:                   1rem;
}

.skill-category {
  background:    var(--bg-subtle);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       1.2rem;
  transition:    border-color var(--ease);
}
.skill-category:hover { border-color: #3f3f46; }

.skill-category h3 {
  font-family:    var(--font-mono);
  font-size:      0.78rem;
  color:          var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin:         0 0 0.8rem;
}

.skill-tags {
  display:   flex;
  flex-wrap: wrap;
  gap:       0.35rem;
}

.tag {
  font-family:   var(--font-mono);
  font-size:     0.78rem;
  background:    var(--bg-hover);
  border:        1px solid var(--border);
  border-radius: 3px;
  padding:       0.15rem 0.5rem;
  color:         var(--text);
}

/* ── Experience ─────────────────────────────────────────── */
.experience-list { margin-top: 0.5rem; }

.exp-item {
  border-left: 2px solid var(--border);
  padding:     0 0 2.5rem 1.75rem;
  position:    relative;
}
.exp-item:last-child { padding-bottom: 0; }

.exp-item::before {
  content:      '';
  position:     absolute;
  left:         -5px;
  top:          7px;
  width:        8px;
  height:       8px;
  border-radius: 50%;
  background:   var(--accent);
  box-shadow:   0 0 0 3px var(--bg);
}

.exp-title {
  font-size:   1rem;
  font-weight: 600;
  color:       var(--text-heading);
}

.exp-company {
  font-family: var(--font-mono);
  font-size:   0.83rem;
  color:       var(--accent);
  margin-top:  0.1rem;
}

.exp-period {
  font-size:     0.8rem;
  color:         var(--text-muted);
  margin:        0.2rem 0 0.75rem;
  font-family:   var(--font-mono);
}

.exp-desc {
  font-size: 0.95rem;
  color:     var(--text);
  line-height: 1.7;
}

/* ── Blog list ──────────────────────────────────────────── */
.blog-list { margin-top: 0.5rem; }

.post-item {
  display:         flex;
  align-items:     baseline;
  gap:             1rem;
  padding:         0.9rem 0.5rem;
  border-bottom:   1px solid var(--border);
  border-radius:   var(--radius);
  text-decoration: none;
  transition:      background var(--ease), padding-left var(--ease);
}
.post-item:first-child { padding-top: 0.5rem; }
.post-item:hover {
  background:   var(--bg-subtle);
  padding-left: 0.9rem;
}

.post-date {
  font-family: var(--font-mono);
  font-size:   0.78rem;
  color:       var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-title {
  color:      var(--text);
  font-size:  0.97rem;
  transition: color var(--ease);
}
.post-item:hover .post-title { color: var(--accent); }

.empty-state {
  color:       var(--text-muted);
  font-family: var(--font-mono);
  font-size:   0.9rem;
  padding:     1.5rem 0;
}

/* ── Single post ────────────────────────────────────────── */
.post-header {
  margin-bottom:  2.5rem;
  padding-bottom: 1.5rem;
  border-bottom:  1px solid var(--border);
}
.post-header h1 { font-size: 1.7rem; letter-spacing: -0.01em; }

.post-meta {
  font-family: var(--font-mono);
  font-size:   0.8rem;
  color:       var(--text-muted);
  margin-top:  0.5rem;
}

.post-content { line-height: 1.8; }
.post-content h2 { font-size: 1.25rem; }
.post-content p  { color: var(--text); }

.back-link {
  display:     inline-flex;
  align-items: center;
  gap:         0.4rem;
  font-family: var(--font-mono);
  font-size:   0.83rem;
  color:       var(--text-muted);
  margin-top:  3rem;
  transition:  color var(--ease);
}
.back-link:hover { color: var(--accent); }

/* ── Contact ────────────────────────────────────────────── */
.contact-section { margin-top: 0.5rem; }

.contact-item {
  display:         flex;
  align-items:     center;
  gap:             0.75rem;
  padding:         0.9rem 1.1rem;
  background:      var(--bg-subtle);
  border:          1px solid var(--border);
  border-radius:   var(--radius);
  margin-bottom:   0.65rem;
  transition:      border-color var(--ease), background var(--ease);
  text-decoration: none;
}
.contact-item:hover {
  border-color: var(--accent);
  background:   var(--accent-dim);
}

.contact-label {
  font-family:  var(--font-mono);
  font-size:    0.78rem;
  color:        var(--text-muted);
  width:        72px;
  flex-shrink:  0;
}

.contact-value {
  color:     var(--text);
  font-size: 0.95rem;
  flex:      1;
}

.contact-arrow {
  color:     var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--ease);
}
.contact-item:hover .contact-arrow { color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding:    2rem 0;
  margin-top: 5rem;
}

.footer-inner {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  flex-wrap:       wrap;
  gap:             0.5rem;
}

.footer-text {
  font-family: var(--font-mono);
  font-size:   0.78rem;
  color:       var(--text-muted);
}

.footer-link {
  transition: color var(--ease);
}
.footer-link:hover { color: var(--accent); }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar            { width: 7px; height: 7px; }
::-webkit-scrollbar-track      { background: var(--bg); }
::-webkit-scrollbar-thumb      { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

/* ── Selection ──────────────────────────────────────────── */
::selection {
  background: rgba(56, 189, 248, 0.2);
  color:      var(--text-heading);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  header { margin-bottom: 2rem; }

  nav a:not(.nav-home) {
    font-size: 0.82rem;
    padding:   0.2rem 0.45rem;
  }

  .hero          { padding: 2.5rem 0 3.5rem; }
  .skills-grid   { grid-template-columns: 1fr 1fr; }
  .post-date     { display: none; }
}

@media (max-width: 420px) {
  .skills-grid { grid-template-columns: 1fr; }
}
