@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #fefefe;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #3d3d3d;
  --text-dim: #888;
  --border: #e8e8e8;
  --accent-1: #5b9bd5;
  --accent-2: #7ab8e8;
  --accent-3: #4a8bc4;
  --accent-4: #6aaedd;
  --gradient: linear-gradient(135deg, #5b9bd5, #7ab8e8, #4a8bc4, #6aaedd);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.8;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-1); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-3); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
  transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header .header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 28px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              justify-content 0.5s;
}

header.scrolled .header-inner {
  max-width: 220px;
  padding: 8px 24px;
  justify-content: center;
  transition-delay: 0.15s;
}

header nav {
  display: flex;
  gap: 28px;
  transition: opacity 0.15s ease, max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s, gap 0.3s;
  max-width: 300px;
  overflow: hidden;
}

header.scrolled nav {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
  gap: 0;
}

header h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

header h1 a { color: var(--text); }
header h1 a:hover { color: var(--text); }
header h1 span {
  color: #5b9bd5;
}

header nav a { color: var(--text-dim); font-size: 14px; font-weight: 500; }
header nav a:hover { color: var(--text-secondary); }

/* ── Hero section with Vanta background ── */
.hero-wrap {
  position: relative;
  overflow: hidden;
}

.hero-vanta {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
}

.hero {
  position: relative;
  z-index: 1;
  padding: 120px 0 80px;
  text-align: center;
}

.hero h2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 58px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  color: var(--text);
}

.hero p {
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 44px;
}

.meta-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  border-radius: 100px;
  position: relative;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
}

.meta-note::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 100px;
  padding: 1px;
  background: var(--gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
}

.meta-note span { font-size: 14px; }

/* ── Section divider ── */
.prismatic-divider {
  height: 1px;
  border: none;
  background: var(--gradient);
  opacity: 0.2;
  margin: 0 auto;
  max-width: 600px;
}

/* ── Project Grid ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
  padding: 60px 0 100px;
}

.project-card {
  background: transparent;
  padding: 28px 0 28px 20px;
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  border: none;
}

/* card border removed */

.project-card:hover {
  transform: translateX(6px);
}

.project-card .date {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 6px;
}

.project-card .tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.project-card h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.01em;
  padding-bottom: 8px;
  background-image: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
}

.project-card p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
  flex: 1;
}

.project-card .read-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 13px;
  color: #999;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.project-card:hover .read-cta {
  color: #666;
}

.project-card .stats {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tag-ai { color: var(--accent-1); }
.tag-infra { color: #059669; }
.tag-dj { color: #6366f1; }
.tag-hardware { color: #d97706; }
.tag-life { color: var(--accent-2); }
.tag-meta { color: #64748b; }

/* ── Article Hero ── */
.article-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 0;
}

.article-hero .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 32px;
}
.article-hero .back:hover { color: var(--text-secondary); }

.article-hero .diagram-wrap {
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 12px;
  position: relative;
  background: #fafafa;
}

.article-hero .diagram-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: var(--gradient);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.3;
  animation: borderShift 8s ease-in-out infinite;
}

.article-hero .diagram-wrap img {
  width: 100%;
  display: block;
  border-radius: 12px;
}

.article-hero figcaption {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
  padding: 10px 0 0;
}

/* ── Article Body ── */
.article {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 32px 100px;
}

.article h2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
  color: var(--text);
}

.article .subtitle {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-style: italic;
  color: var(--text-dim);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 48px;
  line-height: 1.5;
}

.article p {
  margin-bottom: 22px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.85;
}

.article h3 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 56px 0 18px;
  color: var(--text);
  position: relative;
  display: inline-block;
}

.article h3::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--gradient);
  opacity: 0.25;
}

.article h3:first-of-type { margin-top: 0; }

.article ul, .article ol {
  margin: 0 0 22px 24px;
  color: var(--text-secondary);
}
.article li { margin-bottom: 8px; line-height: 1.85; }

.article code {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 15px;
  font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
  color: var(--accent-1);
}

/* Legacy diagram in article body */
.article .diagram { margin: 44px 0; text-align: center; }
.article .diagram img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.article .diagram figcaption { color: var(--text-dim); font-size: 13px; font-style: italic; margin-top: 10px; }

/* ── Footer ── */
footer {
  padding: 40px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  position: relative;
}

footer::before {
  content: '';
  display: block;
  height: 1px;
  background: var(--gradient);
  opacity: 0.15;
  max-width: 400px;
  margin: 0 auto 40px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding: 0 20px; }

  .hero { padding: 60px 0 24px; }
  .hero h2 { font-size: 40px; }
  .hero p { font-size: 16px; }

  .projects-grid {
    grid-template-columns: 1fr;
    padding: 20px 0 32px;
    gap: 10px;
  }

  .project-card p {
    display: block;
  }
  .project-card .card-subtitle {
    display: none;
  }

  .article-hero { padding: 32px 20px 0; }
  .article-hero .diagram-wrap { padding: 16px; border-radius: 14px; }

  .article { padding: 36px 20px 64px; }
  .article h2 { font-size: 34px; }
  .article .subtitle { font-size: 17px; margin-bottom: 32px; }
  .article h3 { margin-top: 40px; }
  .article .diagram { margin: 32px 0; }
}

.signature-question, .signature-question strong { color: var(--accent-1) !important; font-weight: 700; }

/* ── Copy Architecture Button ── */
.copy-arch-wrap {
  text-align: center;
  margin-top: 56px;
}
.copy-arch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border: none;
  border-radius: 100px;
  background: var(--accent-1);
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}
.copy-arch:hover {
  opacity: 0.85;
}
.copy-arch svg {
  width: 16px;
  height: 16px;
  min-width: 16px;
  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.copy-arch svg rect,
.copy-arch svg path {
  fill: none;
}

.article-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 12px;
}
.article-meta .date {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}
.article-meta .tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Newsletter Inline ── */
.newsletter-inline {
  text-align: center;
  padding: 0;
}
.newsletter-inline > p {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 14px;
}
.newsletter-pill {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--accent-1);
  border-radius: 100px;
  overflow: hidden;
  max-width: 360px;
  margin: 0 auto;
}
.newsletter-pill input {
  border: none;
  outline: none;
  padding: 12px 20px;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  flex: 1;
  min-width: 200px;
}
.newsletter-pill input::placeholder {
  color: var(--text-dim);
}
.newsletter-pill button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--accent-1);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin: 3px;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.newsletter-pill button:hover {
  opacity: 0.85;
}
.newsletter-thanks {
  color: var(--accent-1);
  font-weight: 600;
  font-size: 14px;
}

/* ── Article Newsletter ── */
.article-newsletter {
  text-align: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.article-newsletter p {
  color: var(--text-dim) !important;
  font-size: 14px !important;
  margin-bottom: 14px !important;
}

/* Fix newsletter pill rendering */
.newsletter-pill input[type="email"] {
  border: none !important;
  outline: none !important;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.article-newsletter .newsletter-pill {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--accent-1);
  border-radius: 100px;
  overflow: hidden;
  max-width: 360px;
}

/* ── Profiles ── */
.profiles {
  padding: 48px 0;
}
.profiles-grid {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 300px;
}
.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--accent-1);
  margin-bottom: 12px;
}
.profile-info strong {
  font-size: 15px;
  color: var(--text);
}
.profile-info p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 4px 0 8px;
}
.profile-links {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.profile-links a {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-1);
}

/* Card subtitles not used */
.card-subtitle {
  display: none;
}

/* Favorite Tools Section */
.tools-section {
  padding: 0 0 16px;
  margin: -36px 0 -28px;
  text-align: center;
}
.tools-section h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: lowercase;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
}
.tools-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.tools-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.7;
}
.tools-grid a:hover {
  transform: scale(1.1);
  opacity: 1;
}
.tools-grid a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 600px) {
  .tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 56px);
    gap: 20px;
    justify-content: center;
  }
  .tools-grid a {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }
}

/* ── Author Byline ── */
.article-byline {
  font-size: 12px;
  font-weight: 500;
  color: #888 !important;
  margin-top: 4px;
  margin-bottom: 0;
  letter-spacing: 0.02em;
}

/* ── Share Bar ── */
.share-bar {
  display: flex;
  gap: 8px;
  margin: 8px 0 0;
  flex-wrap: wrap;
}
.share-bar-top {
  gap: 6px;
  margin: 4px 0 0;
}
.share-bar-top button,
.share-bar-top a {
  padding: 4px 10px !important;
  font-size: 11px !important;
  border-width: 1px !important;
}
.share-bar button,
.share-bar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1.5px solid #ccc;
  border-radius: 999px;
  background: transparent;
  color: #555;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1;
}
.share-bar button:hover,
.share-bar a:hover {
  border-color: #5b9bd5;
  color: #5b9bd5;
}
.share-bar svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
