/* ============================================================
   zeinzulaziz.github.io — style.css
   Vanilla CSS, no frameworks. Dark amber theme.
   ============================================================ */

:root {
  --bg: #0c0c0e;
  --bg-soft: #101014;
  --surface: #141419;
  --surface-2: #1b1b22;
  --border: #24242c;
  --border-strong: #34343e;

  --text: #f4f4f5;
  --text-dim: #a0a0ac;

  --accent: #ffc53d;
  --accent-bright: #ffd66b;
  --accent-ink: #131313;
  --accent-soft: rgba(255, 197, 61, 0.12);

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 8px 28px -10px rgba(255, 197, 61, 0.35);

  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

/* ---------- Scroll reveal (JS adds .js on <html>, .is-in on targets) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: var(--d, 0ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-inner > * {
    animation: none !important;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  box-shadow: var(--shadow-md);
}

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

.nav-brand {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-brand .brand-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.4rem;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}

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

.nav-links a.is-active,
.nav-links a:hover {
  border-color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 7rem 0 5rem;
  border-bottom: 1px solid var(--border);
  background-image: radial-gradient(circle, #1d1d23 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  right: -140px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 197, 61, 0.13) 0%, transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--bg));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-inner > * {
  animation: rise 0.7s var(--ease) backwards;
}

.hero-inner > *:nth-child(1) { animation-delay: 0.02s; }
.hero-inner > *:nth-child(2) { animation-delay: 0.1s; }
.hero-inner > *:nth-child(3) { animation-delay: 0.18s; }
.hero-inner > *:nth-child(4) { animation-delay: 0.26s; }
.hero-inner > *:nth-child(5) { animation-delay: 0.34s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-overline {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.hero-overline::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: var(--accent);
  flex: none;
}

.hero-title {
  font-size: clamp(2.3rem, 6.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.1rem;
}

.hero-title .title-dot {
  color: var(--accent);
}

.hero-subtitle {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.92rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  margin-bottom: 1.3rem;
}

.hero-desc {
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 2.1rem;
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.66rem 1.4rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.4;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background 0.18s, color 0.18s, border-color 0.18s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: var(--accent-ink);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -10px rgba(255, 197, 61, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}

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

/* ---------- Sections ---------- */
section {
  padding: 4.5rem 0;
}

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

.section-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.95rem;
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--text-dim);
  margin-bottom: 2.25rem;
  font-size: 0.95rem;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}

.projects-loading {
  grid-column: 1 / -1;
  color: var(--text-dim);
  text-align: center;
  padding: 3rem 0;
}

.projects-loading a {
  color: var(--accent);
}

/* Skeleton placeholders shown while the GitHub API responds */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-preview {
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--border);
}

.skeleton-line {
  height: 0.85rem;
  margin: 1.1rem 1.25rem 0;
  border-radius: 4px;
}

.skeleton-line:last-child {
  margin-bottom: 1.4rem;
  width: 55%;
}

.skeleton-preview,
.skeleton-line {
  background: linear-gradient(
    100deg,
    var(--surface-2) 40%,
    #23232b 50%,
    var(--surface-2) 60%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.project-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.project-card:hover::before {
  opacity: 1;
}

.project-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92);
  transition: transform 0.5s var(--ease), filter 0.3s;
}

.project-card:hover .project-preview img {
  transform: scale(1.045);
  filter: saturate(1.05);
}

.preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 12px, #17171c 12px 24px);
  color: var(--border-strong);
  font-family: var(--mono);
  font-size: 2.2rem;
  font-weight: 800;
}

.preview-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.project-body {
  padding: 1.2rem 1.3rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.project-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s;
}

.project-title a:hover {
  color: var(--accent);
}

.project-desc {
  color: var(--text-dim);
  font-size: 0.88rem;
  flex: 1;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

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

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.35rem;
}

.project-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
  transition: color 0.18s, border-color 0.18s;
}

.project-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Blog ---------- */
.blog-head {
  position: relative;
  padding: 5.5rem 0 3rem;
  border-bottom: 1px solid var(--border);
  background-image: radial-gradient(circle, #1d1d23 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: hidden;
}

.blog-head::before {
  content: "";
  position: absolute;
  top: -180px;
  left: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 197, 61, 0.1) 0%, transparent 65%);
  pointer-events: none;
}

.blog-head-inner {
  position: relative;
  max-width: 680px;
}

.blog-count {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.blog {
  padding: 3rem 0 4.5rem;
}

.blog-list {
  display: grid;
  gap: 1.1rem;
  max-width: 740px;
}

.blog-empty {
  color: var(--text-dim);
  padding: 2.5rem 0;
}

.post-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.post-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.post-card.is-note {
  border-left: 2px solid var(--accent);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.55rem;
}

.post-meta span + span::before {
  content: "·";
  margin-right: 0.9rem;
}

.post-card-title {
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
}

.post-card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s;
}

.post-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

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

.post-card-desc {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.post-tags {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.post-tags span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--accent-soft);
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  transition: border-color 0.18s;
}

.post-card:hover .post-tags span {
  border-color: rgba(255, 197, 61, 0.4);
}

/* ---------- Post ---------- */
.post-page {
  padding: 3.5rem 0 4.5rem;
}

.post-container {
  max-width: 740px;
}

.post-back {
  display: inline-block;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.82rem;
  margin-bottom: 2rem;
  transition: color 0.18s, transform 0.18s var(--ease);
}

.post-back:hover {
  color: var(--accent);
  transform: translateX(-3px);
}

.post-title {
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

/* ---------- Prose (markdown output) ---------- */
.prose {
  margin-top: 2rem;
  color: var(--text);
  font-size: 1rem;
}

.prose > * + * {
  margin-top: 1.1rem;
}

.prose h2,
.prose h3,
.prose h4 {
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 2.4rem;
  scroll-margin-top: 84px;
}

.prose h2 {
  font-size: 1.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-size: 1.15rem;
}

.prose h4 {
  font-size: 1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.md-anchor {
  color: var(--accent);
  text-decoration: none;
  opacity: 0;
  margin-left: -1.1em;
  padding-right: 0.35em;
  font-weight: 400;
}

.prose h2:hover .md-anchor,
.prose h3:hover .md-anchor,
.prose h4:hover .md-anchor {
  opacity: 1;
}

.prose p,
.prose li {
  color: #d9d9de;
}

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 197, 61, 0.35);
  transition: border-color 0.18s;
}

.prose a:hover {
  border-bottom-color: var(--accent);
}

.prose strong {
  color: var(--text);
  font-weight: 700;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose ul ul,
.prose ol ol,
.prose ul ol,
.prose ol ul {
  margin-top: 0.4rem;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.md-task {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.5em;
  border: 1px solid #44444e;
  border-radius: 3px;
  vertical-align: -0.05em;
  position: relative;
  top: 0.05em;
}

.md-task.is-done {
  background: var(--accent);
  border-color: var(--accent);
}

.md-task.is-done::after {
  content: "";
  position: absolute;
  left: 0.28em;
  top: 0.08em;
  width: 0.22em;
  height: 0.45em;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1.1rem;
  color: var(--text-dim);
}

.prose blockquote > * + * {
  margin-top: 0.8rem;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.12em 0.38em;
}

.prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  position: relative;
}

.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #d8d8de;
}

.prose pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 var(--radius-sm) 0 var(--radius-sm);
  padding: 0.15rem 0.5rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: block;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.md-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.prose th {
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.prose tr:last-child td {
  border-bottom: 0;
}

/* ---------- About / Contact ---------- */
.about {
  border-top: 1px solid var(--border);
}

.about-inner,
.contact-inner {
  max-width: 680px;
}

.about p,
.contact-inner p {
  color: var(--text-dim);
  font-size: 1.02rem;
}

.contact-inner p {
  margin-bottom: 1.5rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 2.2rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

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

.footer-inner a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.18s;
}

.footer-inner a:hover {
  color: var(--accent);
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .container {
    padding: 0 1.1rem;
  }
  .nav {
    height: 56px;
  }
  .nav-links {
    gap: 0.9rem;
  }
  .nav-links a {
    font-size: 0.8rem;
  }
  .hero {
    padding: 4.5rem 0 3.5rem;
  }
  section {
    padding: 3rem 0;
  }
  .blog {
    padding: 2rem 0 3rem;
  }
  .post-page {
    padding: 2.5rem 0 3rem;
  }
  .post-card {
    padding: 1.2rem 1.25rem;
  }
  .md-anchor {
    display: none;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
