/* jonlip blog — global styles */

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

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #0A0A0A;
  --surface:      #111111;
  --surface-alt:  #1A1A1A;
  --fg:           #F5F5F5;
  --muted:        #A3A3A3;
  --subtle:       rgba(255,255,255,0.25);
  --cyan:         #00E5FF;
  --cyan-glow:    rgba(0,229,255,0.4);
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);
}

html {
  font-size: 17px;
  line-height: 1.75;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

::selection {
  background: rgba(0,229,255,0.3);
  color: var(--cyan);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--fg);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,229,255,0.3);
  transition: border-color 0.1s;
}

a:hover {
  border-color: var(--cyan);
}

p {
  margin-bottom: 1.5em;
}

p:last-child {
  margin-bottom: 0;
}

/* ── Layout ── */
.site-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ── */
.site-header {
  padding: 2rem 0;
  margin-bottom: 4rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: none;
  white-space: nowrap;
}

.wordmark:hover {
  border-bottom: none;
}

.wordmark .dot {
  color: var(--cyan);
}

.header-nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
  white-space: nowrap;
}

.header-nav-link:hover {
  color: var(--fg);
  border-bottom: none;
}

.wordmark-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-left: 0.5rem;
  border-left: 1px solid var(--border);
  padding-left: 0.5rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.1s;
}

.header-nav a:hover {
  color: var(--fg);
  border-bottom: none;
}

/* ── Home — Hero ── */
.home-hero {
  margin-bottom: 4rem;
}

.eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 1rem;
  display: block;
}

.eyebrow-cyan {
  color: rgba(0,229,255,0.5);
}

.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--fg);
}

.home-hero p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.6;
}

/* ── Post List ── */
.post-list-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 1.5rem;
  display: block;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-list-item {
  border-bottom: 1px solid var(--border);
}

.post-list-item:first-child {
  border-top: none;
}

.post-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.5rem 0;
  text-decoration: none;
  border-bottom: none;
  transition: none;
}

.post-link:hover {
  border-bottom: none;
}

.post-link:hover .post-title {
  color: var(--fg);
}

.post-link:hover .post-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.post-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.post-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
  transition: color 0.1s;
}

.post-tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0,229,255,0.5);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-excerpt {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 0.25rem;
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--subtle);
  white-space: nowrap;
}

.post-arrow {
  color: var(--cyan);
  opacity: 0.4;
  font-size: 0.875rem;
  transition: opacity 0.1s, transform 0.1s;
}

/* ── Article Page ── */
.article-back {
  margin-bottom: 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.1s;
}

.back-link:hover {
  color: var(--fg);
  border-bottom: none;
}

.back-link svg {
  flex-shrink: 0;
}

.article-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-header .eyebrow {
  margin-bottom: 1.25rem;
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 1.25rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--subtle);
  flex-wrap: wrap;
}

.article-meta .sep {
  opacity: 0.3;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.article-tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.25rem 0.5rem;
}

/* ── Article Body ── */
.article-body {
  max-width: 68ch;
}

.article-body p {
  margin-bottom: 1.5em;
  color: var(--fg);
  line-height: 1.75;
}

.article-body h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin-top: 3em;
  margin-bottom: 0.75em;
  color: var(--fg);
}

.article-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.5em;
  color: var(--fg);
}

.article-body blockquote {
  border-left: 2px solid var(--cyan);
  padding-left: 1.25rem;
  margin: 2em 0;
  color: var(--muted);
  font-style: normal;
}

.article-body blockquote p {
  color: var(--muted);
  margin-bottom: 0;
}

.article-body code {
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.875em;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
}

.article-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 2em 0;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5em;
  color: var(--fg);
}

.article-body li {
  margin-bottom: 0.5em;
  line-height: 1.7;
}

.article-body a {
  color: var(--cyan);
  border-bottom: 1px solid rgba(0,229,255,0.3);
  transition: border-color 0.1s;
}

.article-body a:hover {
  border-color: var(--cyan);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3em 0;
}

/* ── Article Footer ── */
.article-footer {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.article-footer-back {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.1s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-footer-back:hover {
  color: var(--fg);
  border-bottom: none;
}

.article-footer-author {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--subtle);
}

/* ── Site Footer ── */
.site-footer {
  margin-top: 6rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copy {
  font-size: 12px;
  color: var(--subtle);
}

.footer-copy a {
  color: var(--subtle);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.1s;
}

.footer-copy a:hover {
  color: var(--muted);
  border-bottom: none;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 12px;
  color: var(--subtle);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.1s;
}

.footer-links a:hover {
  color: var(--muted);
  border-bottom: none;
}

.footer-icon {
  width: 15px;
  height: 15px;
  display: block;
  fill: currentColor;
}

/* ── No-posts state ── */
.empty-state {
  padding: 4rem 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ── RSS badge ── */
.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--subtle);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.1s;
}

.rss-link:hover {
  color: var(--muted);
  border-bottom: none;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .post-link {
    grid-template-columns: 1fr;
  }

  .post-meta-row {
    margin-top: 0.5rem;
  }

  .article-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Post list thumbnail ── */
.post-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  display: block;
  margin-bottom: 1rem;
}

/* ── Instagram reel embed ── */
.ig-reel-wrap {
  display: flex;
  justify-content: center;
  margin: 2.5rem 0;
}

.ig-reel {
  width: 340px;
  height: 700px;
  border: none;
  border-radius: 8px;
  display: block;
}

@media (max-width: 400px) {
  .ig-reel {
    width: 100%;
    height: 600px;
  }
}

/* ── Post video ── */
.post-video {
  width: 100%;
  border-radius: 6px;
  display: block;
  margin: 2.5rem 0;
  background: #000;
}

/* ── Post checklist ── */
.post-checklist {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.post-checklist li {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--fg);
  padding-left: 0.25rem;
}

/* ── Post images ── */
.post-figure {
  margin: 2.5rem 0;
}

.post-figure img {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.post-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
}

/* Square-crop single image */
.post-figure.square img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
}

/* 3-up image grid */
.post-figure-grid {
  margin: 2.5rem 0;
}

.post-figure-grid .grid-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.post-figure-grid .grid-images img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  display: block;
}

.post-figure-grid figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
}
