/* =========================================================
   Nicolò Marana — Blog
   Dark / Tech theme · Mobile-first
   ========================================================= */

:root {
  --bg: #0b0f17;
  --bg-soft: #111726;
  --bg-card: #131a2a;
  --border: #1f2940;
  --text: #e6ebf5;
  --text-soft: #9aa6bf;
  --text-dim: #6b7691;
  --accent: #5eead4;        /* teal */
  --accent-2: #818cf8;      /* indigo */
  --accent-glow: rgba(94, 234, 212, 0.15);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 720px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 100% -5%, rgba(129, 140, 248, 0.10), transparent 60%),
    radial-gradient(700px 450px at -10% 0%, rgba(94, 234, 212, 0.08), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

/* --- Layout --- */
.site-main {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 23, 0.72);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.brand-name { font-size: 1.02rem; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
}
.nav-links a:hover {
  color: var(--text);
  background: var(--bg-soft);
  text-decoration: none;
}

/* --- Hero --- */
.hero { padding: 30px 0 18px; }
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 14px;
  text-transform: uppercase;
}
.hero-title {
  font-size: clamp(2rem, 7vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  font-weight: 700;
}
.accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  font-size: clamp(1.15rem, 4.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 18px;
}
.hero-text {
  color: var(--text-soft);
  font-size: 1.08rem;
  margin: 0 0 26px;
  max-width: 46ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b0f17;
}
.btn-ghost {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); }

/* --- Section --- */
.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 44px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* --- Post list --- */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s ease, transform .12s ease, background .2s ease;
}
.post-card:hover {
  border-color: rgba(94, 234, 212, 0.45);
  transform: translateY(-2px);
}
.post-card-link { display: block; padding: 20px 22px; color: inherit; }
.post-card-link:hover { text-decoration: none; }
.post-card-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.post-card-title {
  font-size: 1.22rem;
  line-height: 1.3;
  margin: 8px 0 8px;
  color: var(--text);
  letter-spacing: -0.015em;
}
.post-card-desc { margin: 0 0 12px; color: var(--text-soft); font-size: 0.97rem; }
.post-card-tags { display: flex; flex-wrap: wrap; gap: 7px; }

.tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--accent);
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.18);
  padding: 2px 9px;
  border-radius: 100px;
  margin-right: 4px;
}

.empty-state {
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

/* --- Single post --- */
.post-header { margin: 8px 0 34px; }
.back-link { font-size: 0.9rem; color: var(--text-soft); font-weight: 500; }
.post-title {
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 18px 0 14px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.84rem;
}
.meta-sep { opacity: 0.5; }

/* --- Article content (typography) --- */
.post-content { font-size: 1.06rem; }
.post-content > *:first-child { margin-top: 0; }
.post-content h2 {
  font-size: 1.5rem; margin: 38px 0 14px; letter-spacing: -0.015em; line-height: 1.25;
}
.post-content h3 { font-size: 1.22rem; margin: 30px 0 12px; }
.post-content p { margin: 0 0 20px; }
.post-content ul, .post-content ol { margin: 0 0 20px; padding-left: 1.4em; }
.post-content li { margin-bottom: 8px; }
.post-content a { text-decoration: underline; text-underline-offset: 3px; }
.post-content strong { color: #fff; }
.post-content blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft);
}
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
}
.post-content pre {
  background: #0a0e16;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 22px;
  font-size: 0.9rem;
}
.post-content pre code { background: none; border: none; padding: 0; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
.post-content img { display: block; margin: 24px auto; border: 1px solid var(--border); }
.post-content table {
  width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 0.95rem;
}
.post-content th, .post-content td {
  border: 1px solid var(--border); padding: 9px 12px; text-align: left;
}
.post-content th { background: var(--bg-soft); }

.post-footer { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); }

.cta-row { margin: 22px 0 8px; }

/* --- Page --- */
.page-header { margin: 8px 0 30px; }
.page-title {
  font-size: clamp(1.8rem, 6vw, 2.3rem); letter-spacing: -0.02em; margin: 0 0 8px;
}
.page-subtitle { color: var(--accent); font-family: var(--mono); font-size: 0.9rem; margin: 0; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-soft); }

/* --- Tablet / desktop --- */
@media (min-width: 720px) {
  body { font-size: 18px; }
  .hero { padding: 48px 0 24px; }
  .nav-links { gap: 6px; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
