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


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

:root {
  --bg: #f5f7fb;
  --bg-code: #e8edf5;
  --text: #18222e;
  --text-muted: #5c6e82;
  /* --accent: #f6287e; */
  --accent: #f23252;
  --accent-soft: rgba(246, 40, 126, 0.08);
  --border: #cfdce9;
  --max-width: 1200px;
  --font-display: 'Cabin', sans-serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="dark"] {
  --bg: #0c0c12;
  --bg-code: #13131c;
  --text: #dee9f2;
  --text-muted: #6b7d90;
  --border: #1e2030;
  --accent-soft: rgba(246, 40, 126, 0.12);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.25s, color 0.25s;
}

/* ── Header ──────────────────────────────────────────────── */

header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.2s;
}

.logo::after {
  content: '.';
  color: var(--accent);
}

.logo:hover {
  color: var(--accent);
}

.nav-links {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2rem;
}

header nav a:not(.logo):not(.search-result-item) {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.2s;
}

header nav a:not(.logo):not(.search-result-item):hover {
  color: var(--accent);
}

/* ── Main ────────────────────────────────────────────────── */

main {
  max-width: var(--max-width);
  width: 100%;
  margin: 4rem auto;
  padding: 0 2rem;
  flex: 1;
}

/* ── Footer ──────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer::before {
  content: '✦';
  display: block;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-size: 0.65rem;
}

/* ── Tags ────────────────────────────────────────────────── */

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

.tag {
  color: var(--accent);
  border: 1px solid currentColor;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  opacity: 0.7;
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  animation: fadeSlideUp 0.5s ease both;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

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

/* .hero-title em:hover {
  color: blueviolet;
  /* transition-duration: 0.5s; */
} */

.hero-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-sub-note {
  opacity: 0.55;
}

.hero-sub-sub-note {
  opacity: 0.45;
  font-size: 0.80rem;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  padding-bottom: 0.2rem;
}

.hero-count {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(4rem, 10vw, 7rem);
  color: var(--accent);
  opacity: 0.12;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.hero-count-label {
  font-size: 0.6rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  opacity: 0.5;
  margin-top: 0.2rem;
}

/* ── Hero featured ───────────────────────────────────────── */

.hero-featured {
  flex-shrink: 0;
  margin-left: auto;
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.hero-featured-img {
  width: 100%;
  max-width: 450px;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.hero-featured-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hero-featured-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hero-featured-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--text);
  transition: color 0.18s;
}

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

.hero-featured-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Blog index ──────────────────────────────────────────── */


.blog-index-header {
  padding: 2rem 0 1.25rem;
}

.blog-index-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

/* ── Search ──────────────────────────────────────────────── */

.search-wrapper {
  flex: 0 1 400px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.75rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 100;
  max-height: 480px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--accent-soft);
}

.search-result-item:hover .search-result-title {
  color: var(--accent);
}

.search-result-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text);
  transition: color 0.15s;
}

.search-result-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-no-results {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.hidden {
  display: none;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── Article card ────────────────────────────────────────── */

.article-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  animation: fadeSlideUp 0.4s ease both;
}

.article-preview:nth-child(1)  { animation-delay: 0.05s; }
.article-preview:nth-child(2)  { animation-delay: 0.10s; }
.article-preview:nth-child(3)  { animation-delay: 0.15s; }
.article-preview:nth-child(4)  { animation-delay: 0.20s; }
.article-preview:nth-child(5)  { animation-delay: 0.25s; }
.article-preview:nth-child(6)  { animation-delay: 0.30s; }
.article-preview:nth-child(7)  { animation-delay: 0.35s; }
.article-preview:nth-child(8)  { animation-delay: 0.40s; }
.article-preview:nth-child(9)  { animation-delay: 0.45s; }
.article-preview:nth-child(10) { animation-delay: 0.50s; }

.article-preview:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(246, 40, 126, 0.15);
}

.article-preview-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Cover image area */
.article-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--bg-code);
  background-image:
    radial-gradient(ellipse at 30% 50%, var(--accent-soft) 0%, transparent 65%),
    radial-gradient(ellipse at 75% 30%, rgba(246, 40, 126, 0.04) 0%, transparent 55%);
  position: relative;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.article-preview:hover .article-cover img {
  transform: scale(1.04);
}

/* Card body */
.article-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-preview .article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.meta-sep {
  opacity: 0.4;
}

.article-preview h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: 0.6rem;
  color: var(--text);
  transition: color 0.18s;
}

.article-preview:hover h2 {
  color: var(--accent);
}

.article-body > p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
  flex: 1;
}

/* ── Animations ──────────────────────────────────────────── */

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Article page ────────────────────────────────────────── */

article > h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 2.25rem;
  line-height: 1.25;
  margin-bottom: 1.25rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-description {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
  font-style: italic;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* ── Article cover image ─────────────────────────────────── */

.article-cover-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 3rem;
}

/* ── Article content ─────────────────────────────────────── */

.article-content h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-left: 0.875rem;
  border-left: 2px solid var(--accent);
}

.article-content h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.article-content p {
  margin-bottom: 1.25rem;
}

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

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

.article-content a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.article-content code {
  font-family: var(--font-mono);
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.87em;
}

.article-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.article-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.65;
}

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

.article-content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1.5rem 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

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

.article-content th {
  background: var(--bg-code);
  font-weight: 500;
}

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

/* ── Theme toggle ────────────────────────────────────────── */

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.5;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle::before {
  content: "nuit";
}

[data-theme="dark"] .theme-toggle::before {
  content: "jour";
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 960px) {
  .article-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 950px) {
  .hero-featured {
    display: none;
  }
}

@media (max-width: 600px) {
  main {
    margin: 2.5rem auto;
    padding: 0 1.25rem;
  }

  article > h1 {
    font-size: 1.75rem;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding-bottom: 2rem;
  }

  .hero-aside {
    flex-direction: row;
    align-items: baseline;
    gap: 0.6rem;
  }

  .article-list {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .article-preview h2 {
    font-size: 1.1rem;
  }

  header nav {
    gap: 1rem;
    padding: 0 1.25rem;
  }

  .search-wrapper {
    flex: 1;
    margin: 0;
  }

  .nav-links a {
    display: none;
  }
}

.small {
  font-size: 0.80rem;
}

.ultra-small {
  font-size: 0.60rem;
}