@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

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

:root {
  --black: #0a0a0a;
  --white: #fafafa;
  --grey: #999;
  --light-grey: #e4e4e4;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

/* ── HEADER ── */
header {
  padding: 1.75rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
  position: relative;
}

.site-title {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

nav a {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.45;
  transition: opacity 0.15s;
}

nav a:hover {
  opacity: 1;
}

/* ── MAIN ── */
main {
  flex: 1;
  padding: 3.5rem 3rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ── GALLERY ── */
.gallery-heading {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 2.5rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2px;
}

.post-card {
  display: block;
  background: var(--white);
  overflow: hidden;
}

.post-card-image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--light-grey);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.post-card:hover .post-card-image img {
  transform: scale(1.04);
  opacity: 0.88;
}

.post-card-body {
  padding: 1rem 0 2rem;
}

.post-card-meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--grey);
  margin-bottom: 0.4rem;
}

.post-card-title {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* ── POST PAGE ── */
.post-cover {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
  margin-bottom: 3rem;
}

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--light-grey);
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--grey);
  margin-bottom: 0.75rem;
}

.post-title {
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.post-content {
  max-width: 660px;
  font-size: 0.975rem;
  line-height: 1.85;
  font-weight: 400;
}

/* Rendered markdown */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.9rem;
  line-height: 1.25;
}

.post-content h1 { font-size: 1.6rem; }
.post-content h2 { font-size: 1.25rem; }
.post-content h3 { font-size: 1.05rem; }
.post-content h4 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 400; }

.post-content p {
  margin-bottom: 1.4rem;
}

.post-content a {
  border-bottom: 1px solid var(--light-grey);
  transition: border-color 0.15s;
}

.post-content a:hover {
  border-bottom-color: var(--black);
}

.post-content strong {
  font-weight: 500;
}

.post-content em {
  font-style: italic;
}

.post-content blockquote {
  border-left: 1px solid var(--black);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: #555;
  font-size: 0.95rem;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: #f0f0f0;
  padding: 0.1em 0.4em;
}

.post-content pre {
  background: var(--black);
  color: var(--white);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.75rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.82rem;
  color: inherit;
}

.post-content ul,
.post-content ol {
  padding-left: 1.25rem;
  margin-bottom: 1.4rem;
}

.post-content li {
  margin-bottom: 0.35rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--light-grey);
  margin: 2.5rem 0;
}

.post-content img {
  margin: 2rem 0;
}

/* ── BACK LINK ── */
.back-link {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 2.5rem;
  transition: color 0.15s;
}

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

/* ── STATIC PAGES ── */
.page-content {
  max-width: 580px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--light-grey);
}

.page-body {
  font-size: 0.975rem;
  line-height: 1.85;
  font-weight: 400;
}

.page-body p {
  margin-bottom: 1.4rem;
}

.page-body a {
  border-bottom: 1px solid var(--light-grey);
  transition: border-color 0.15s;
}

.page-body a:hover {
  border-bottom-color: var(--black);
}

/* ── FOOTER ── */
footer {
  padding: 1.5rem 3rem;
  border-top: none;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--grey);
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--black);
}

/* ── LOADING STATE ── */
.loading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--grey);
  padding: 4rem 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  header {
    padding: 1.5rem;
  }

  main {
    padding: 2.5rem 1.5rem;
  }

  footer {
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .post-title {
    font-size: 1.5rem;
  }
}

/* ── POST COUNTER ── */
.post-count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 300;
  color: var(--grey);
  letter-spacing: 0.04em;
}

/* ── GRADIENT BORDERS ── */
header::after,
footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
}

header::after {
  bottom: 0;
  background: linear-gradient(to right, #35E3D1, #8401B0);
}

footer::before {
  top: 0;
  background: linear-gradient(to right, #8401B0, #35E3D1);
}
