@font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-Black.otf) format("opentype");
    font-weight: 900;
    font-style: normal;
  }

/* === General & Apple Base === */
:root {
  --bg-light: #f5f5f7;
  --text-light-primary: #1d1d1f;
  --text-light-secondary: #636366;
  --text-light-tertiary: #8a8a8e;
  --card-bg-light: #ffffff;
  --card-shadow-light: 0 10px 30px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.05);
  --card-hover-shadow-light: 0 15px 40px rgba(0,0,0,0.1), 0 6px 15px rgba(0,0,0,0.07);
  --card-border-light: #e5e5e5;
  --accent-light: #007aff;
  --accent-hover-light: #0056b3;
  --tag-bg-light: #eef0f2;
  --tag-text-light: #3a3a3c;
  --code-bg-light: #f7f7f7;
  --inline-code-bg-light: #eef0f2;
  --inline-code-text-light: #c52b5d;
  --radius-md: 12px;
  --radius-lg: 20px;

  --bg-dark: #1c1c1e; /* Slightly off-black, common in Apple dark mode */
  --text-dark-primary: #f5f5f7; /* Light text for dark backgrounds */
  --text-dark-secondary: #a1a1a6;
  --text-dark-tertiary: #8e8e93;
  --card-bg-dark: #2c2c2e; /* Darker card background */
  --card-shadow-dark: 0 8px 25px rgba(0,0,0,0.25), 0 3px 8px rgba(0,0,0,0.2);
  --card-hover-shadow-dark: 0 12px 35px rgba(0,0,0,0.3), 0 5px 12px rgba(0,0,0,0.25);
  --card-border-dark: #38383a;
  --accent-dark: #0a84ff; /* Apple's vibrant blue for dark mode */
  --accent-hover-dark: #3395ff;
  --tag-bg-dark: #3a3a3c;
  --tag-text-dark: #e1e1e6;
  --code-bg-dark: #272729;
  --inline-code-bg-dark: #3a3a3c;
  --inline-code-text-dark: #ff80a6; /* A pinkish color for inline code on dark */
}

/* === Blog General & Apple Base === */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: var(--bg-light);
  color: var(--text-light-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--bg-dark);
    color: var(--text-dark-primary);
  }
}

body.blog-body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background-color: var(--bg-light) !important;
  color: var(--text-light-primary) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
  body.blog-body {
    background-color: var(--bg-dark) !important;
    color: var(--text-dark-primary) !important;
  }
}

/* === Blog List Page Styles === */
.blog-list-container {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 25px;
}

.blog-list-header h1 {
  font-size: 3rem;
  color: var(--text-light-primary);
  text-align: center;
  margin-bottom: 3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
@media (prefers-color-scheme: dark) {
  .blog-list-header h1 {
    color: var(--text-dark-primary);
  }
}

.post-item {
  background-color: var(--card-bg-light);
  border-radius: var(--radius-lg);
  padding: 30px 35px;
  margin-bottom: 2.5rem;
  box-shadow: var(--card-shadow-light);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
  border: 1px solid transparent; /* for dark mode border */
}

@media (prefers-color-scheme: dark) {
  .post-item {
    background-color: var(--card-bg-dark);
    box-shadow: var(--card-shadow-dark);
    border: 1px solid var(--card-border-dark);
  }
}

.post-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow-light);
}

@media (prefers-color-scheme: dark) {
  .post-item:hover {
    box-shadow: var(--card-hover-shadow-dark);
  }
}

.post-item h2 {
  margin-top: 0;
  margin-bottom: 0.75rem; /* More space below title */
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-light-primary);
}
@media (prefers-color-scheme: dark) {
  .post-item h2 {
    color: var(--text-dark-primary);
  }
}

.post-item h2 a {
  text-decoration: none;
  color: inherit; /* Inherit color from parent h2 */
  transition: color 0.2s ease;
}

.post-item h2 a:hover {
  color: var(--accent-light);
}
@media (prefers-color-scheme: dark) {
  .post-item h2 a:hover {
    color: var(--accent-dark);
  }
}

.post-item .description {
  color: var(--text-light-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.65;
}
@media (prefers-color-scheme: dark) {
  .post-item .description {
    color: var(--text-dark-secondary);
  }
}

.post-item .tags {
  margin-top: 1.25rem;
}

.post-item .tag {
  display: inline-block;
  background-color: var(--tag-bg-light);
  color: var(--tag-text-light);
  padding: 7px 15px;
  border-radius: 18px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-right: 10px;
  margin-bottom: 10px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
@media (prefers-color-scheme: dark) {
  .post-item .tag {
    background-color: var(--tag-bg-dark);
    color: var(--tag-text-dark);
  }
}

.post-item .tag:hover {
  background-color: var(--accent-light);
  color: #ffffff;
}
@media (prefers-color-scheme: dark) {
  .post-item .tag:hover {
    background-color: var(--accent-dark);
    color: var(--text-dark-primary); /* Or #ffffff if preferred on dark accent */
  }
}

.no-posts {
  text-align: center;
  font-size: 1.15rem;
  color: var(--text-light-secondary);
  padding: 3.5rem 0;
}
@media (prefers-color-scheme: dark) {
  .no-posts {
    color: var(--text-dark-secondary);
  }
}

/* === End Blog Post Page Styles === */

/* === Blog Post Embed Card (used by [elem:blogpost:...]) === */
.blogpost-embed-card {
  display: block;
  background-color: var(--card-bg-light);
  border-radius: var(--radius-lg);
  margin: 2rem 0;
  box-shadow: var(--card-shadow-light);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
  border: 1px solid transparent; 
}

.blogpost-embed-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow-light);
}

.blogpost-embed-link {
    display: flex;
    text-decoration: none;
}

.blogpost-embed-image-container {
    width: 150px; /* Fixed width for image */
    flex-shrink: 0;
    overflow: hidden;
}

.blogpost-embed-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blogpost-embed-content {
    padding: 20px 25px;
    flex-grow: 1;
}

.blogpost-embed-title {
    font-size: 1.5rem; /* Slightly smaller than main post-item title */
    font-weight: 600;
    color: var(--text-light-primary);
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.blogpost-embed-description {
    font-size: 0.95rem;
    color: var(--text-light-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    /* Clamp description to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

.blogpost-embed-footer {
    font-size: 0.85rem;
    color: var(--accent-light);
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .blogpost-embed-card {
    background-color: var(--card-bg-dark);
    box-shadow: var(--card-shadow-dark);
    border: 1px solid var(--card-border-dark);
  }
  .blogpost-embed-card:hover {
    box-shadow: var(--card-hover-shadow-dark);
  }
  .blogpost-embed-title {
    color: var(--text-dark-primary);
  }
  .blogpost-embed-description {
    color: var(--text-dark-secondary);
  }
  .blogpost-embed-footer {
    color: var(--accent-dark);
  }
}

/* === Site Embed Card (used by [elem:siteembed:...]) === */
.site-embed-card {
  display: block;
  background-color: var(--card-bg-light);
  border-radius: var(--radius-md); /* Slightly smaller radius for embeds */
  margin: 1.5rem 0;
  box-shadow: 0 5px 15px rgba(0,0,0,0.07), 0 2px 5px rgba(0,0,0,0.04);
  overflow: hidden;
  border: 1px solid var(--card-border-light);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.site-embed-link {
  display: flex;
  text-decoration: none;
  align-items: center; /* Vertically align items if image is shorter */
}

.site-embed-image {
  width: 100px; /* Smaller image for site embeds */
  height: 100px;
  object-fit: cover;
  flex-shrink: 0;
  border-right: 1px solid var(--card-border-light);
  transition: border-color 0.3s ease;
}

.site-embed-content {
  padding: 15px 20px;
  flex-grow: 1;
  overflow: hidden; /* Prevent text overflow issues */
}

.site-embed-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-light-primary);
  margin-top: 0;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-embed-description {
  font-size: 0.85rem;
  color: var(--text-light-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}

.site-embed-footer {
  font-size: 0.75rem;
  color: var(--text-light-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-color-scheme: dark) {
  .site-embed-card {
    background-color: var(--card-bg-dark);
    border-color: var(--card-border-dark);
  }
  .site-embed-image {
    border-right-color: var(--card-border-dark);
  }
  .site-embed-title {
    color: var(--text-dark-primary);
  }
  .site-embed-description {
    color: var(--text-dark-secondary);
  }
  .site-embed-footer {
    color: var(--text-dark-tertiary);
  }
}

/* More Like This Section */
.more-like-this {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border-light);
}

.more-like-this h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-light-primary);
    margin-bottom: 1.5rem;
}

.similar-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Use .post-item styles for similar posts, already defined */

@media (prefers-color-scheme: dark) {
    .more-like-this {
        border-top-color: var(--card-border-dark);
    }
    .more-like-this h3 {
        color: var(--text-dark-primary);
    }
}

/* === Contact Form Styles === */
main form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

main form label {
  font-weight: 500;
  color: var(--text-light-secondary);
  margin-bottom: var(--spacing-xs);
}

main form input[type="text"],
main form input[type="email"],
main form textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border-light);
  background-color: var(--card-bg-light);
  color: var(--text-light-primary);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

main form input[type="text"]:focus,
main form input[type="email"]:focus,
main form textarea:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
  outline: none;
}

main form textarea {
  min-height: 120px;
  resize: vertical;
}

main form button[type="submit"] {
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-xl);
  background: var(--accent-light);
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  align-self: flex-start;
}

main form button[type="submit"]:hover {
  background: var(--accent-hover-light);
}

@media (prefers-color-scheme: dark) {
  main form label {
    color: var(--text-dark-secondary);
  }

  main form input[type="text"],
  main form input[type="email"],
  main form textarea {
    border: 1px solid var(--card-border-dark);
    background-color: var(--card-bg-dark);
    color: var(--text-dark-primary);
  }

  main form input[type="text"]:focus,
  main form input[type="email"]:focus,
  main form textarea:focus {
    border-color: var(--accent-dark);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.3);
  }

  main form button[type="submit"] {
    background: var(--accent-dark);
    color: var(--text-dark-primary);
  }

  main form button[type="submit"]:hover {
    background: var(--accent-hover-dark);
  }
}
/* === End Contact Form Styles === */

.blog-post-container {
  max-width: 800px;
  margin: 3rem auto;
  padding: 35px 40px;
  background-color: var(--card-bg-light);
  border-radius: var(--radius-lg); /* Consistent with post-item or slightly larger */
  box-shadow: var(--card-shadow-light); /* Refined shadow */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid transparent; /* for dark mode border */
}

@media (prefers-color-scheme: dark) {
  .blog-post-container {
    background-color: var(--card-bg-dark);
    box-shadow: var(--card-shadow-dark);
    border: 1px solid var(--card-border-dark);
  }
}

.blog-post-header h1 {
  font-size: 2.8rem;
  color: var(--text-dark-primary);
  margin-bottom: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
@media (prefers-color-scheme: dark) {
  .blog-post-header h1 {
    color: var(--text-dark-primary);
  }
}

.post-meta {
  font-size: 0.95rem;
  color: var(--text-light-tertiary);
  margin-bottom: 2.5rem;
}
@media (prefers-color-scheme: dark) {
  .post-meta {
    color: var(--text-dark-tertiary);
  }
}

.post-meta .tags .tag {
  display: inline-block;
  background-color: var(--tag-bg-light);
  color: var(--tag-text-light);
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 8px;
  margin-top: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
@media (prefers-color-scheme: dark) {
  .post-meta .tags .tag {
    background-color: var(--tag-bg-dark);
    color: var(--tag-text-dark);
  }
}

.post-meta .tags .tag:hover {
  background-color: var(--accent-light);
  color: #ffffff;
}
@media (prefers-color-scheme: dark) {
  .post-meta .tags .tag:hover {
    background-color: var(--accent-dark);
    color: var(--text-dark-primary);
  }
}

.blog-post-content {
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-light-primary); /* Main content text color */
}
@media (prefers-color-scheme: dark) {
  .blog-post-content {
    color: var(--text-dark-primary);
  }
}

.blog-post-content h2, .blog-post-content h3, .blog-post-content h4 {
  font-weight: 600;
  margin-top: 2.2em;
  margin-bottom: 1em;
  color: var(--text-light-primary);
  line-height: 1.3;
}
@media (prefers-color-scheme: dark) {
  .blog-post-content h2, .blog-post-content h3, .blog-post-content h4 {
    color: var(--text-dark-primary);
  }
}

.blog-post-content h2 { font-size: 1.9em; letter-spacing: -0.01em; }
.blog-post-content h3 { font-size: 1.6em; letter-spacing: -0.005em; }
.blog-post-content h4 { font-size: 1.3em; }

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

.blog-post-content a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}
@media (prefers-color-scheme: dark) {
  .blog-post-content a {
    color: var(--accent-dark);
  }
}

.blog-post-content a:hover {
  color: var(--accent-hover-light);
  text-decoration: underline;
}
@media (prefers-color-scheme: dark) {
  .blog-post-content a:hover {
    color: var(--accent-hover-dark);
  }
}

.blog-post-content pre {
  background-color: var(--code-bg-light);
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: 'SF Mono', 'Menlo', 'Monaco', Consolas, 'Courier New', monospace;
  font-size: 0.925em;
  line-height: 1.6;
  border: 1px solid var(--card-border-light);
}
@media (prefers-color-scheme: dark) {
  .blog-post-content pre {
    background-color: var(--code-bg-dark);
    border: 1px solid var(--card-border-dark);
  }
  .blog-post-content pre code {
    color: var(--text-dark-primary); /* Ensure code inside pre also adapts */
  }
}

.blog-post-content code {
  font-family: 'SF Mono', 'Menlo', 'Monaco', Consolas, 'Courier New', monospace;
  background-color: var(--inline-code-bg-light);
  padding: 0.25em 0.5em;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--inline-code-text-light);
}
@media (prefers-color-scheme: dark) {
  .blog-post-content code {
    background-color: var(--inline-code-bg-dark);
    color: var(--inline-code-text-dark);
  }
}

.blog-post-content pre code {
  background-color: transparent; /* Already handled by parent pre */
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit; /* Inherit color from pre block */
  padding: 0;
  font-size: inherit;
  color: inherit; /* Inherit color from pre for syntax highlighting */
  border: none;
}

.blog-post-content blockquote {
  border-left: 3px solid #007aff;
  padding-left: 1.5rem;
  margin-left: 0;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  color: var(--text-dark-primary);
  font-style: italic;
  font-size: 1.05em;
}

.blog-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.8em;
  border: 1px solid #e0e0e0;
  border-radius: 8px; /* Rounded table corners */
  overflow: hidden; /* To make border-radius work on table */
}

.blog-post-content th, .blog-post-content td {
  border: 1px solid #e0e0e0;
  padding: 12px 15px;
  text-align: left;
}

.blog-post-content th {
  background-color: #f9f9f9;
  font-weight: 600;
  color: #1d1d1f;
}

.blog-post-content ul, .blog-post-content ol {
  margin-bottom: 1.2em;
  padding-left: 2em;
}

.blog-post-content li {
  margin-bottom: 0.5em;
}

/* === Site Embed Card Styles (Apple-like) === */
.site-embed-card {
  background-color: #fdfdfd; /* Very light, almost white background */
  border: 1px solid #e1e1e1; /* Softer border */
  border-radius: 16px; /* Consistent rounding */
  margin: 2.5rem 0;
  overflow: hidden;
  display: block; /* Changed from flex to block for simpler structure if link wraps all */
  box-shadow: 0 6px 18px rgba(0,0,0,0.06); /* Softer, more diffused shadow */
  transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-embed-card:hover {
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.site-embed-link {
  text-decoration: none;
  color: inherit;
  display: flex; /* Use flex for layout within the link */
  align-items: stretch;
}

.site-embed-image-container {
    width: 150px; /* Fixed width for image container */
    min-height: 150px;
    flex-shrink: 0;
    background-color: #f0f0f0; /* Placeholder background */
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-embed-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cover ensures image fills container */
}

.site-embed-content {
  padding: 20px 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0; /* Important for text truncation */
}

.site-embed-title {
  font-size: 1.1rem; 
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 8px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-embed-description {
  font-size: 0.9rem;
  color: #636366;
  margin-bottom: 12px;
  line-height: 1.5;
  /* Multi-line truncation */
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Show up to 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.5em * 3); /* Fallback for non-webkit, approx 3 lines */
}

.site-embed-footer {
  font-size: 0.825rem;
  color: #8a8a8e;
  margin-top: auto; /* Pushes footer to bottom */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === More Like This Section === */
.more-like-this {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid #e5e5e5;
}

.more-like-this h3 {
  font-size: 1.7rem;
  color: #1d1d1f;
  margin-bottom: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.more-like-this ul {
  list-style: none;
  padding: 0;
}

.more-like-this li {
  margin-bottom: 1rem;
}

.more-like-this li a {
  font-size: 1.1rem;
  color: #007aff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.more-like-this li a:hover {
  color: #0056b3;
  text-decoration: underline;
}

  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-BlackItalic.otf) format("opentype");
    font-weight: 900;
    font-style: italic;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-Heavy.otf) format("opentype");
    font-weight: 800;
    font-style: normal;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-HeavyItalic.otf) format("opentype");
    font-weight: 800;
    font-style: italic;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-Bold.otf) format("opentype");
    font-weight: 700;
    font-style: normal;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-BoldItalic.otf) format("opentype");
    font-weight: 700;
    font-style: italic;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-Semibold.otf) format("opentype");
    font-weight: 600;
    font-style: normal;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-SemiboldItalic.otf) format("opentype");
    font-weight: 600;
    font-style: italic;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-Medium.otf) format("opentype");
    font-weight: 500;
    font-style: normal;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-MediumItalic.otf) format("opentype");
    font-weight: 500;
    font-style: italic;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-Regular.otf) format("opentype");
    font-weight: 400;
    font-style: normal;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-RegularItalic.otf) format("opentype");
    font-weight: 400;
    font-style: italic;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-Light.otf) format("opentype");
    font-weight: 300;
    font-style: normal;
  }
  @font-face {
    font-family: SFProDisplay;
    src: url(/static/fonts/SF-Pro-Display-LightItalic.otf) format("opentype");
    font-weight: 300;
    font-style: italic;
  }

  :root {
    /* Apple's signature color palette */
    --bg: #000000;
    --bg-secondary: #0d1117;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-elevated: rgba(255, 255, 255, 0.08);
    --surface-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f5f5f7;
    --text-secondary: rgba(245, 245, 247, 0.86);
    --text-tertiary: rgba(245, 245, 247, 0.6);
    --accent: #007AFF;
    --accent-hover: #0051D5;
    --accent-gradient: linear-gradient(135deg, #007AFF 0%, #5856D6 50%, #AF52DE 100%);
    --purple-gradient: linear-gradient(135deg, #5856D6 0%, #AF52DE 100%);
    --blue-gradient: linear-gradient(135deg, #007AFF 0%, #34AADC 100%);
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    --spacing-3xl: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-xxl: 28px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.16), 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3), 0 6px 10px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.2);
    --backdrop-blur: blur(20px);
    --backdrop-blur-heavy: blur(40px);
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: SFProDisplay, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
  }

  nav.nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-xl);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  nav.nav:hover {
    background: rgba(0, 0, 0, 0.9);
  }

  nav .logo {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: all 0.3s ease;
  }

  nav .nav-links {
    list-style: none;
    display: flex;
    gap: var(--spacing-xl);
    align-items: center;
  }

  nav .nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
  }

  nav .nav-links a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-hover);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-md);
  }

  nav .nav-links a:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
  }

  nav .nav-links a:hover::before {
    opacity: 1;
  }

  nav .nav-links a span {
    position: relative;
    z-index: 1;
  }

  main {
    padding: var(--spacing-xxl) var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
  }

  .hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 70vh;
    background: radial-gradient(ellipse at center, rgba(0, 122, 255, 0.1) 0%, transparent 70%);
    border-radius: var(--radius-xxl);
    margin-bottom: var(--spacing-3xl);
    padding: var(--spacing-3xl);
    position: relative;
    overflow: hidden;
  }

  .hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-radius: var(--radius-xxl);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .hero > * {
    position: relative;
    z-index: 1;
  }

  .hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.9;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .hero-tagline {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    max-width: 600px;
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 1s 0.2s both cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-xl);
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    min-width: 160px;
    animation: fadeInUp 1s 0.4s both cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  .btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
  }

  .btn:hover::before {
    opacity: 1;
  }

  .btn:active {
    transform: translateY(0) scale(0.98);
  }

  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-3xl);
  }

  .card {
    background: var(--surface);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
  }

  .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.2);
  }

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

  .card.big {
    grid-column: span 2;
    padding: var(--spacing-xxl);
  }

  .card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
  }

  .card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
  }

  .filters {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    justify-content: center;
  }

  .filters button {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
  }

 .tech-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
   gap: var(--spacing-md);
   margin-top: var(--spacing-lg);
 }

 .tech-grid > div {
   background: var(--surface-elevated);
   backdrop-filter: var(--backdrop-blur);
   -webkit-backdrop-filter: var(--backdrop-blur);
   border: 1px solid rgba(255, 255, 255, 0.1);
   border-radius: var(--radius-lg);
   padding: var(--spacing-sm) var(--spacing-md);
   text-align: center;
   font-size: 1rem;
   font-weight: 600;
   color: var(--text-primary);
   transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
 }

 .tech-grid > div:hover {
   background: var(--surface-hover);
   transform: translateY(-3px);
   box-shadow: var(--shadow-sm);
 }

/* Improved Site Embed Styling */
.site-embed-card {
  display: flex;
  align-items: stretch;
  gap: var(--spacing-md);
  background-color: var(--surface-elevated);
  border: 1px solid var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: var(--spacing-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.site-embed-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  background-color: var(--surface-hover);
}

.site-embed-image-container {
  flex: 0 0 120px;
  height: 120px;
  background-color: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.site-embed-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-embed-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.site-embed-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-embed-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-embed-footer {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: var(--spacing-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-color-scheme: dark) {
  .site-embed-card {
    background-color: var(--surface-elevated);
    border-color: var(--surface);
  }
  .site-embed-image-container {
    background-color: var(--surface);
  }
  .site-embed-title {
    color: var(--text-primary);
  }
  .site-embed-description {
    color: var(--text-secondary);
  }
  .site-embed-footer {
    color: var(--text-tertiary);
  }
}

/* static/styles.css */

/* 1. Card layout */
.site-embed-card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  background-color: var(--surface-elevated);
  border: 1px solid var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: var(--spacing-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* 2. Title */
.site-embed-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. URL */
.site-embed-url {
  font-size: 0.875rem;
  color: var(--accent);
  word-break: break-all;
}
.site-embed-url a {
  text-decoration: none;
  color: inherit;
}

/* 4. Image */
.site-embed-image-container {
  width: 100%;
  height: auto;
  background-color: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.site-embed-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}
/* static/styles.css */
.fun-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.fun-facts .fact {
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fun-facts .fact:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.fun-facts .icon {
  font-size: 2rem;
  display: block;
  margin-bottom: var(--spacing-sm);
}

.fun-facts .fact p {
  margin: 0;
  font-weight: 500;
  color: var(--text-primary);
}

/* === Mobile Responsiveness === */
@media (max-width: 768px) {
  nav.nav {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  nav .nav-links {
    gap: var(--spacing-md);
  }

  nav .nav-links a {
    font-size: 0.9rem;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  main {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .hero {
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xxl);
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .hero-tagline {
    font-size: 1.2rem;
  }

  .btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .card.big {
    grid-column: span 1;
    padding: var(--spacing-lg);
  }

  .card h3 {
    font-size: 1.3rem;
  }

  .filters {
    gap: var(--spacing-xs);
  }

  .filters button {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
  }

  .blog-list-container {
    margin: 2rem auto;
    padding: 0 15px;
  }

  .blog-list-header h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
  }

  .post-item {
    padding: 20px 25px;
    margin-bottom: 2rem;
  }

  .post-item h2 {
    font-size: 1.8rem;
  }

  .post-item .description {
    font-size: 1rem;
  }

  .blog-post-container {
    margin: 2rem auto;
    padding: 25px 20px;
  }

  .blog-post-header h1 {
    font-size: 2.2rem;
  }

  .blog-post-content {
    font-size: 1rem;
  }

  .blog-post-content h2 { font-size: 1.7em; }
  .blog-post-content h3 { font-size: 1.4em; }
  .blog-post-content h4 { font-size: 1.2em; }

  .site-embed-card {
    flex-direction: column;
  }

  .site-embed-image-container {
    width: 100%;
    height: 150px; /* Or aspect-ratio if supported */
  }

  .blogpost-embed-link {
    flex-direction: column;
  }

  .blogpost-embed-image-container {
    width: 100%;
    height: 180px; /* Adjust as needed */
  }

  .similar-posts-grid {
    grid-template-columns: 1fr;
  }

  .fun-facts {
    grid-template-columns: 1fr;
  }

  /* General content improvements for mobile (768px) */
  main p, main li {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  main h1 { /* For page titles within main, if not hero */
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
  }

  main h2 {
    font-size: 1.6rem;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
  }

  main h3 {
    font-size: 1.3rem;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
  }

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

  /* Form adjustments for 768px */
  main form {
    gap: var(--spacing-sm); /* Slightly reduced gap for forms */
  }

  main form input[type="text"],
  main form input[type="email"],
  main form textarea,
  main form button[type="submit"] {
    font-size: 0.95rem; /* Slightly smaller font for form elements */
    padding: var(--spacing-sm) var(--spacing-md); /* Adjust padding if needed */
  }

  main form button[type="submit"] {
    width: 100%; /* Make button full width on mobile */
    text-align: center;
  }
}

@media (max-width: 480px) {
  nav .logo {
    font-size: 1.5rem;
  }

  nav .nav-links {
    /* Consider a hamburger menu for very small screens if needed */
    display: none; /* Simplest for now, or implement hamburger */
  }

  .hero-title {
    font-size: clamp(1.8rem, 12vw, 3rem);
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .btn {
    width: 100%;
  }

  .blog-list-header h1 {
    font-size: 2rem;
  }

  .post-item h2 {
    font-size: 1.5rem;
  }

  .blog-post-header h1 {
    font-size: 1.8rem;
  }

  .post-meta .tags .tag {
    padding: 4px 10px;
    font-size: 0.8rem;
  }

  .blog-post-content pre {
    padding: 15px;
    font-size: 0.85em;
  }

  /* Further refinements for very small screens (480px) */
  main p, main li {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  main h1 {
    font-size: 1.8rem;
  }

  main h2 {
    font-size: 1.4rem;
  }

  main h3 {
    font-size: 1.2rem;
  }

  /* Form adjustments for 480px */
  main form input[type="text"],
  main form input[type="email"],
  main form textarea {
    padding: var(--spacing-sm); /* Consistent padding */
    font-size: 0.9rem; /* Further reduce font size for form elements */
  }
   main form button[type="submit"] {
    font-size: 0.95rem; /* Ensure button text is readable */
    padding: var(--spacing-sm);
  }
}