/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --bg:          #1D1E20;
  --bg-card:     #2E2E33;
  --bg-card-hover: #38383F;
  --text:        #F0F0F0;
  --text-muted:  #9A9AA8;
  --accent:      #22D3EE;
  --accent-dark: #0EA5C9;
  --border:      #3C3C44;
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-heading:'Outfit', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --radius:      8px;
  --radius-lg:   16px;
  --transition:  0.2s ease;
  --max-w:       1100px;
  --max-w-narrow:720px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

ul { list-style: none; }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 1000;
}
.skip-link:focus { top: 1rem; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: var(--max-w-narrow);
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(29, 30, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.nav__logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav__logo:hover { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 2rem;
}

.nav__links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav__links a:hover { color: var(--text); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: 6rem 1.5rem;
}

.hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.hero__name {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero__subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  border: 2px solid transparent;
}

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

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.25);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.page-intro, .page-content {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.about {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.about__text {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.8;
}

.blog-preview {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.blog-preview .btn { margin-top: 2rem; }

.page-section {
  padding: 5rem 0;
}

/* ============================================================
   POST CARDS
   ============================================================ */
.post-list {
  display: grid;
  gap: 1.25rem;
}

.post-list--full {
  grid-template-columns: 1fr;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.post-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.post-card__link {
  display: block;
  padding: 1.5rem;
  color: inherit;
}
.post-card__link:hover { color: inherit; }
.post-card__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-lg);
}

.post-card__date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: block;
  margin-bottom: 0.5rem;
}

.post-card__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.post-card__summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.tag {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(34, 211, 238, 0.2);
}

/* ============================================================
   PROJECT CARDS
   ============================================================ */
.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.project-card__link {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  height: 100%;
  color: inherit;
}
.project-card__link:hover { color: inherit; }
.project-card__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-lg);
}

.project-card__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.project-card__desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.project-card__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: auto;
}

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

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.contact__intro {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  transition: border-color var(--transition);
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
  resize: vertical;
  min-height: 130px;
}

.form-status {
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

.form-status--success {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-status--error {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================================
   SINGLE POST (PROSE)
   ============================================================ */
.post-single {
  padding: 5rem 0;
}

.post-single__header {
  margin-bottom: 3rem;
}

.post-single__date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.post-single__title {
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.prose {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-heading);
  color: var(--text);
  margin: 2.5rem 0 1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.prose h2 { font-size: 1.5rem; font-weight: 600; }
.prose h3 { font-size: 1.2rem; font-weight: 600; }

.prose p { margin-bottom: 1.4rem; }

.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-dark); }

.prose ul, .prose ol {
  margin: 0 0 1.4rem 1.5rem;
  list-style: revert;
}

.prose li { margin-bottom: 0.4rem; }

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

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-card);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

.prose pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.prose img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.post-single__footer { margin-top: 3rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 5rem;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer__links a:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .nav__links { gap: 1.25rem; }
  .hero { padding: 4rem 1.5rem; }
  .hero__cta { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .project-list { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}
