* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  line-height: 1.6;
  background: #f4f4f4;
  color: #333;
}

header {
  background: #333;
  color: #fff;
  padding: 20px;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.header-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.header-text h1,
.header-text p {
  margin: 0;
  text-align: left;
}

.header-text p {
  font-size: 0.95em;
  opacity: 0.9;
}

@media (max-width: 600px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    padding: 0 8px;
  }

  .header-text h1 {
    font-size: 1.3em;
  }
}

nav {
  background: #444;
  padding: 10px;
  text-align: center;
}

nav a {
  color: #fff;
  margin: 0 15px;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

section {
  box-sizing: border-box;
  width: 100%;
  max-width: min(800px, calc(100% - 32px));
  padding: 20px clamp(16px, 4vw, 24px);
  margin: 20px auto;
  background: #fff;
  border-radius: 5px;
}

/* Blog index */
.blog-index-lead {
  margin-top: 0;
  color: #444;
}

.blog-list {
  list-style: none;
  margin: 1.25em 0 0;
  padding: 0;
}

.blog-list-item {
  border-bottom: 1px solid #eee;
}

.blog-list-item:last-child {
  border-bottom: none;
}

.blog-list-link {
  display: block;
  padding: 16px 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-radius: 6px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.blog-list-link:hover {
  background: #f5f5f5;
}

.blog-list-title {
  display: block;
  font-weight: 700;
  color: #222;
  font-size: 1.05em;
  margin-bottom: 4px;
}

.blog-list-link:hover .blog-list-title {
  text-decoration: underline;
}

.blog-list-meta {
  display: block;
  font-size: 0.9em;
  color: #666;
  margin-bottom: 8px;
}

.blog-list-excerpt {
  display: block;
  font-size: 0.95em;
  color: #555;
  line-height: 1.5;
}

/* Blog post layout — width cap includes side gutters so content isn’t flush to the viewport edge */
main.blog-page {
  box-sizing: border-box;
  width: 100%;
  max-width: min(800px, calc(100% - 32px));
  padding: 32px clamp(20px, 5vw, 40px);
  margin: 24px auto 28px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.blog-post {
  max-width: 680px;
  margin: 0 auto;
}

.blog-post-header h1 {
  margin-top: 0;
  margin-bottom: 0.35em;
  line-height: 1.3;
}

.blog-post-meta {
  color: #666;
  font-size: 0.95em;
  margin: 0 0 1.25em;
}

.blog-post-lede {
  font-size: 1.08em;
  color: #444;
  line-height: 1.65;
  margin: 0 0 1.5em;
}

.blog-post-body .lifecycle-step,
.blog-post-body .lifecycle-summary {
  margin-top: 1.5em;
}

.blog-post-body .lifecycle-step:first-of-type {
  margin-top: 0.5em;
}

.blog-post-body h2 {
  font-size: 1.12em;
  margin-bottom: 0.45em;
  margin-top: 0;
  color: #333;
}

.blog-post-body h2:not(:first-child) {
  margin-top: 1.5em;
}

.blog-post-body h3 {
  font-size: 1.05em;
  margin: 1em 0 0.35em;
  color: #444;
  font-weight: 600;
}

.blog-post-body ul {
  margin: 0.35em 0 0;
  padding-left: 1.4em;
}

.blog-post-body li {
  margin-bottom: 0.35em;
}

.blog-post-body ol {
  margin: 0.35em 0 1em;
  padding-left: 1.5em;
}

.blog-post-body .lifecycle-summary {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid #e0e0e0;
}

.blog-post-body .lifecycle-summary p {
  margin: 0.5em 0 0;
}

.blog-post-body p {
  margin-bottom: 1em;
}

.blog-post-body > p:last-child {
  margin-bottom: 0;
}

.blog-post-body a[href^="http"] {
  color: #2469a6;
  text-decoration: none;
}

.blog-post-body a[href^="http"]:hover {
  text-decoration: underline;
}

.blog-post-body code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid #e5e5e5;
}

/* Live apps (homepage) */
.live-apps-lead {
  margin-top: 0;
  color: #444;
}

.live-apps-list {
  list-style: none;
  margin: 1em 0 0;
  padding: 0;
}

.live-apps-list li {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.live-apps-list li:last-child {
  border-bottom: none;
}

.live-apps-list strong {
  display: block;
  margin-bottom: 4px;
  color: #222;
}

.live-apps-links {
  display: block;
  font-size: 0.95em;
  margin-top: 4px;
}

.live-apps-links a {
  color: #1a5f9e;
}

.live-apps-links a:hover {
  text-decoration: underline;
}

.live-apps-more {
  margin: 1em 0 0;
  font-size: 0.95em;
  color: #555;
}

.engagement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.stat-card {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 14px 16px;
}

.stat-label {
  margin: 0;
  color: #666;
  font-size: 0.9em;
}

.stat-value {
  margin: 6px 0 0;
  font-size: 1.5em;
  font-weight: 700;
  color: #333;
}

.like-btn {
  margin-top: 16px;
  border: 1px solid #333;
  background: #333;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95em;
}

.like-btn:hover {
  background: #222;
}

.like-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.engagement-message {
  margin: 8px 0 0;
  color: #666;
  min-height: 1.2em;
}

/* Subscribe form */
.subscribe-lead {
  margin-top: 0;
  color: #444;
}

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.subscribe-form input[type="email"],
.subscribe-form input[type="text"]:not(.subscribe-honeypot) {
  flex: 1 1 200px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.subscribe-form button {
  padding: 10px 18px;
  border: 1px solid #333;
  background: #333;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
}

.subscribe-form button:hover {
  background: #222;
}

.subscribe-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.subscribe-note {
  margin-top: 12px;
  font-size: 0.9em;
  color: #666;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  display: block;
  padding: 16px 18px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: 0.4em;
  color: #333;
}

.project-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.9em;
  color: #555;
}

.project-card:hover .project-link {
  color: #333;
  text-decoration: underline;
}

.project-card-placeholder {
  cursor: default;
}

.project-card-placeholder:hover {
  border-color: #e0e0e0;
  box-shadow: none;
}

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

@media (max-width: 600px) {
  section {
    max-width: min(800px, calc(100% - 24px));
    margin: 12px auto;
    padding: 16px clamp(14px, 5vw, 20px);
  }

  main.blog-page,
  main.project-page {
    max-width: min(800px, calc(100% - 24px));
    padding: 24px clamp(16px, 6vw, 24px);
    margin: 16px auto 20px;
  }

  .engagement-grid {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* Project detail page */
main.project-page {
  box-sizing: border-box;
  width: 100%;
  max-width: min(800px, calc(100% - 32px));
  padding: 32px clamp(20px, 5vw, 40px);
  margin: 24px auto 28px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.project-page .project-detail {
  max-width: 680px;
  margin: 0 auto;
}

.project-detail .back-link,
.blog-post .back-link {
  display: inline-block;
  margin-bottom: 28px;
  padding-left: 12px;
  border-left: 3px solid #ccc;
  color: #555;
  text-decoration: none;
  font-size: 0.95em;
  transition: border-color 0.2s, color 0.2s;
}

.project-detail .back-link:hover,
.blog-post .back-link:hover {
  border-left-color: #333;
  color: #333;
}

.project-detail h1 {
  margin-top: 0;
  margin-bottom: 0.25em;
  line-height: 1.3;
}

.project-meta {
  color: #666;
  font-size: 0.95em;
  margin-bottom: 1.75em;
}

.project-summary {
  font-size: 1.1em;
  color: #444;
  margin-bottom: 2em;
  line-height: 1.65;
}

.project-detail h2 {
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  font-size: 1.15em;
  color: #333;
}

.project-detail h2:first-of-type {
  margin-top: 0;
}

.project-detail p {
  margin-bottom: 1em;
}

.project-detail ul {
  margin: 0.5em 0 1.5em;
  padding-left: 1.5em;
}

.project-detail li {
  margin-bottom: 0.4em;
}

.project-detail li:last-child {
  margin-bottom: 0;
}

.project-detail code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid #e5e5e5;
}

.project-detail a[href^="http"] {
  color: #2469a6;
  text-decoration: none;
}

.project-detail a[href^="http"]:hover {
  text-decoration: underline;
}

footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 12px 16px;
  font-size: 0.95em;
  line-height: 1.5;
}

footer p {
  margin: 0;
  color: #fff;
}

footer p + p {
  margin-top: 0.5rem;
}

/* Same color as body text; override global :link / :visited */
footer a,
footer a:link,
footer a:visited {
  color: #fff;
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a:hover {
  color: #fff;
  opacity: 0.88;
}

footer .footer-cross-link {
  margin: 0;
  font-size: inherit;
  color: #fff;
}

.about-professional-site a[href^="http"] {
  color: #1a5f9e;
  text-decoration: none;
}

.about-professional-site a[href^="http"]:hover {
  text-decoration: underline;
}
