:root {
  --bg: #1c1130;
  --surface: #2a1c48;
  --surface-hover: #35245a;
  --border: #4a3670;
  --text: #f3eefc;
  --text-muted: #a596c4;
  --text-dim: #6f6386;
  --primary: #8b5cf6;
  --primary-dark: #6d28d9;
  --primary-light: #c4b5fd;
  --radius: 12px;
  --maxw: 1080px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .logo, .tag {
  font-family: "Space Grotesk", sans-serif;
}

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

img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: 90%;
  max-width: var(--maxw);
  margin: 0 auto;
}

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 26px 0;
  border-bottom: 1px solid transparent;
  transition: 0.3s;
}

.nav.scrolled {
  padding: 16px 0;
  background: var(--bg);
  border-bottom-color: var(--border);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.logo-subtitle {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  gap: 32px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nav-links a {
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 100px 0 60px;
  border-bottom: 1px solid var(--border);
  background-image: url(../img/bg.png);
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(69, 42, 122, 0.68);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero .role {
  font-size: 1.35rem;
  color: var(--text-muted);
  margin-bottom: 34px;
}

.hero-social {
  display: flex;
  gap: 30px;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--text-muted);
}

.hero-social a {
  transition: color 0.2s;
}

.hero-social a:hover {
  color: var(--primary-light);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 1;
  padding: 14px 26px;
  color: var(--text-muted);
  font-size: 1.1rem;
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

.intro {
  padding: 150px 0 60px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.intro-content {
  max-width: 620px;
  margin: 0 auto;
}

.intro-text {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  line-height: 1.6;
  margin: 12px 0 28px;
}

/* ---------- SECTIONS ---------- */
section {
  padding: 90px 0;
}

.section-head {
  margin-bottom: 48px;
}

.section-tag {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-light);
  margin-bottom: 12px;
  display: block;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- PROJECTS (uniform grid) ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}

.project {
  display: flex;
  flex-direction: column;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-topbar {
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  background: #211436;
  border-bottom: 1px solid var(--border);
}

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

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

.card-media {
  height: 220px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 22px 24px 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 18px;
}

.stack {
  display: flex;
  gap: 12px;
  font-size: 1.5rem;
  margin-bottom: 18px;
  color: var(--text-muted);
}

.stack img {
  width: 24px;
  height: 24px;
  align-self: center;
}

.project-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-actions a {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 18px;
  border-top-left-radius: 10px;
  border-bottom-right-radius: 10px;
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  background: var(--primary-dark);
  color: #fff;
  transition: 0.4s;
}

.project-actions a:hover {
  border-top-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 10px;
  background: var(--primary);
}

/* ---------- BLOG PREVIEW ---------- */
.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: background 0.25s;
}

.post-card:hover {
  background: var(--surface-hover);
}

.post-card-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-family: "JetBrains Mono", monospace;
}

.tag {
  font-size: 0.72rem;
  color: var(--primary-light);
  background: rgba(139, 92, 246, 0.18);
  padding: 4px 10px;
  border-radius: 6px;
  align-self: flex-start;
  margin-bottom: 12px;
}

.post-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.35;
}

.post-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 16px;
}

.read-more {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--primary-light);
  font-weight: 500;
}

.view-all {
  margin-top: 40px;
}

.view-all a {
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
  transition: 0.2s;
}

.view-all a:hover {
  color: var(--primary-light);
  border-color: var(--primary-light);
}

/* ---------- CONTACT / FOOTER ---------- */
.contact-section {
  text-align: center;
}

.contact-section .hero-social {
  margin-top: 32px;
}

.contact-section h2 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin-bottom: 14px;
  font-weight: 600;
}

.contact-section .role {
  color: var(--text-muted);
  margin-bottom: 32px;
}

.contact-email {
  display: inline-block;
  max-width: 100%;
  font-size: clamp(1rem, 2.6vw, 1.3rem);
  font-family: "JetBrains Mono", monospace;
  color: var(--primary-light);
  padding: 14px 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
}

footer .wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-social {
  display: flex;
  gap: 18px;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.footer-social a:hover {
  color: var(--primary-light);
}

/* ---------- BLOG INDEX ---------- */
.blog-hero {
  padding: 140px 0 50px;
  border-bottom: 1px solid var(--border);
}

.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.blog-hero p {
  color: var(--text-muted);
  max-width: 480px;
}

.blog-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.filter-btn {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.post-card.disabled {
  cursor: default;
  opacity: 0.55;
}

.post-card.disabled:hover {
  background: var(--surface);
}

.soon-badge {
  font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 6px;
  margin-left: 6px;
}

.post-card.hidden {
  display: none;
}

/* ---------- POST ARTICLE ---------- */
.post-hero {
  padding: 140px 0 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 26px;
  transition: 0.2s;
}

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

.post-hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 720px;
  margin-bottom: 18px;
}

article.post-body {
  padding-top: 0;
  padding-bottom: 90px;
}

.post-body .wrap {
  max-width: 700px;
}

.post-body p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 24px;
}

.post-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 40px 0 16px;
  color: var(--text);
}

.post-body ul, .post-body ol {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 24px;
  padding-left: 22px;
}

.post-body li {
  margin-bottom: 8px;
}

.post-body code {
  font-family: "JetBrains Mono", monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.9em;
  color: var(--primary-light);
}

.post-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 28px;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: #d9d2ef;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
  .projects-grid { grid-template-columns: 1fr; }
  .journal-grid { grid-template-columns: 1fr; }

  .nav-links {
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 28px;
    font-size: 1.3rem;
    transform: translateX(100%);
    transition: 0.35s;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: flex; }

  footer .wrap { flex-direction: column; text-align: center; }
}

@media (max-width: 400px) {
  .contact-email {
    font-size: 0.85rem;
    padding: 10px 16px;
  }
}
