/* ---------- Tokens ---------- */
:root {
  --bg: #FDFCFB;
  --ink: #1C1B1A;
  --ink-soft: #55524E;
  --ink-faint: #8A867F;
  --rule: #ECE7E1;
  --rule-soft: #F4F0EB;

  --rose: #C4A4A8;
  --rose-deep: #A88A8E;
  --mint: #7ECEC1;
  --teal: #2A9D8F;
  --teal-deep: #22867A;

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --measure: 640px;
  --gutter: clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid rgba(42, 157, 143, 0.25);
  transition: border-color 160ms ease, color 160ms ease;
}
a:hover { border-bottom-color: var(--teal); }

::selection { background: #F2DDDF; color: var(--rose-deep); }

/* ---------- Layout shell ---------- */
.shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.nav {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.nav .brand {
  border: none;
  color: var(--ink);
  font-weight: 500;
}
.nav .brand-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--teal));
  margin-right: 10px;
  vertical-align: 1px;
}
.nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0; padding: 0;
}
.nav a {
  border: none;
  color: var(--ink-soft);
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); }

.footer {
  max-width: 720px;
  margin: 120px auto 48px;
  padding: 24px var(--gutter) 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer a { color: var(--ink-faint); border: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}
h1 { font-size: clamp(40px, 8vw, 72px); margin: 0 0 24px; }
h2 { font-size: 28px; margin: 56px 0 16px; letter-spacing: -0.01em; }
h3 { font-size: 20px; margin: 40px 0 12px; }

p { margin: 0 0 20px; }

small, .meta {
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, box-shadow 160ms ease;
  font-family: inherit;
}
.btn-teal {
  background: var(--teal);
  color: #fff;
  border: none;
}
.btn-teal:hover {
  background: var(--teal-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -8px rgba(42, 157, 143, 0.5);
}
.btn-rose {
  background: var(--rose);
  color: #fff;
  border: none;
}
.btn-rose:hover {
  background: var(--rose-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -8px rgba(183, 110, 121, 0.5);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.btn-ghost:hover { border-color: var(--ink-soft); }
a.btn { border-bottom: none; }

/* ---------- Name (homepage hero) ---------- */
.name-solid {
  font-size: clamp(52px, 11vw, 108px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 28px;
  color: var(--ink);
  display: inline-block;
  padding-bottom: 4px;
}

/* ---------- Subscribe form ---------- */
.subscribe {
  margin-top: 48px;
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #fff;
}
.subscribe h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
}
.subscribe p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 15px;
}
.subscribe form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.subscribe input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease;
}
.subscribe input[type="email"]:focus {
  border-color: var(--rose);
}
.subscribe input[type="email"]::placeholder { color: var(--ink-faint); }

.subscribe-success {
  font-size: 14px;
  color: var(--teal-deep);
  padding: 14px 18px;
  background: rgba(126, 206, 193, 0.15);
  border-radius: 10px;
  margin: 0;
}

/* ---------- Blog list ---------- */
.post-list {
  list-style: none;
  padding: 0;
  margin: 48px 0 0;
}
.post-list li {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.post-list li:last-child { border-bottom: 1px solid var(--rule); }
.post-list a.post-link {
  border: none;
  color: inherit;
  display: block;
}
.post-list a.post-link:hover h3 { color: var(--rose); }
.post-list h3 {
  margin: 4px 0 8px;
  font-size: 22px;
  transition: color 160ms ease;
}
.post-list .excerpt {
  color: var(--ink-soft);
  margin: 0 0 10px;
  font-size: 16px;
}
.post-list .post-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-faint);
}
.post-list .tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--rule-soft);
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ---------- Individual post ---------- */
article.post {
  padding-top: 48px;
}
article.post .post-header {
  margin-bottom: 40px;
}
article.post .post-header h1 {
  font-size: clamp(32px, 5.5vw, 48px);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
article.post .post-header .meta {
  display: flex;
  gap: 14px;
  align-items: center;
}

article.post p,
article.post ul,
article.post ol {
  max-width: var(--measure);
}
article.post ul, article.post ol {
  padding-left: 22px;
  margin: 0 0 22px;
}
article.post li { margin-bottom: 8px; }

article.post blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--mint);
  color: var(--ink-soft);
  font-style: italic;
  max-width: var(--measure);
}

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--rule-soft);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--rose-deep);
}

/* Code block */
pre {
  margin: 28px 0;
  padding: 20px 22px;
  background: #1C1B1A;
  color: #F4F0EB;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}
pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.tok-kw { color: #F4A6AF; }
.tok-str { color: #B7E4DC; }
.tok-com { color: #8A867F; font-style: italic; }
.tok-fn  { color: #F2DDDF; }
.tok-num { color: #E8C07D; }

/* Figures / screenshots */
figure {
  margin: 32px 0;
}
figure img,
figure .placeholder {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--rule);
}
figcaption {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

/* Placeholder images (striped, with monospace label) */
.placeholder {
  aspect-ratio: 16 / 10;
  background-image: repeating-linear-gradient(
    135deg,
    #F4F0EB 0px, #F4F0EB 12px,
    #ECE7E1 12px, #ECE7E1 24px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.placeholder.photo { aspect-ratio: 4 / 5; }
.placeholder.wide { aspect-ratio: 21 / 9; }
.placeholder.screenshot {
  aspect-ratio: 16 / 10;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0, transparent 39px,
      rgba(0,0,0,0.04) 39px, rgba(0,0,0,0.04) 40px
    ),
    linear-gradient(180deg, #FBFAF8, #F4F0EB);
}

/* Mushroom-photo grid on homepage */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 56px 0 12px;
}
.photo-strip .placeholder {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
}
.photo-strip .caption {
  grid-column: 1 / -1;
  margin-top: 4px;
}

/* Post navigation */
.post-nav {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
}
.post-nav a {
  border: none;
  color: var(--ink-soft);
}
.post-nav a:hover { color: var(--ink); }
.post-nav .arrow { color: var(--ink-faint); }

/* ---------- Hero block on homepage ---------- */
.hero {
  padding: 80px 0 40px;
}
.hero .bio {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 0 28px;
}
.hero .bio strong {
  color: var(--ink);
  font-weight: 600;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Section label */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 72px 0 8px;
}

/* Recent posts on homepage */
.recent-posts {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.recent-posts li {
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}
.recent-posts li:last-child { border-bottom: 1px solid var(--rule); }
.recent-posts a {
  border: none;
  color: var(--ink);
  flex: 1;
}
.recent-posts a:hover { color: var(--rose); }
.recent-posts .date {
  font-size: 13px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Post card (homepage) */
.post-card {
  margin: 48px 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.post-card img {
  width: 100%;
  display: block;
}
.post-card a img {
  border: none;
}
.post-card-content {
  padding: 24px 28px 28px;
}
.post-card-content .date {
  font-size: 13px;
  color: var(--ink-faint);
}
.post-card-content h2 {
  font-size: 28px;
  margin: 8px 0 12px;
}
.post-card-content h2 a {
  border: none;
  color: var(--ink);
}
.post-card-content h2 a:hover {
  color: var(--teal);
}
.post-card-content p {
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.post-card .read-more {
  font-size: 14px;
  font-weight: 500;
  color: var(--teal);
  border-bottom: 1px solid rgba(42, 157, 143, 0.3);
}
.post-card .read-more:hover {
  border-bottom-color: var(--teal);
}

/* Responsive */
@media (max-width: 560px) {
  .photo-strip { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 48px 0 24px; }
  h2 { margin-top: 44px; }
}
