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

:root {
  --brand:       #0f6ef0;
  --brand-dark:  #0a4eab;
  --accent:      #00c2a8;
  --text:        #1a1a2e;
  --text-light:  #5a5a72;
  --bg:          #fafafa;
  --surface:     #ffffff;
  --border:      #e4e4ef;
  --tag-bg:      #eef4ff;
  --tag-color:   #0f6ef0;
  --code-bg:     #f4f4f8;
  --radius:      8px;
  --max-w:       860px;
  --font:        'Inter', system-ui, sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Layout --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main.container { flex: 1; padding-top: 3rem; padding-bottom: 4rem; }

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-tox   { color: var(--brand); }
.logo-index { color: var(--text); }
.logo-blog  { color: var(--text-light); font-weight: 400; font-size: 0.9rem; margin-left: 0.25rem; }

nav { display: flex; gap: 1.5rem; }
nav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}
nav a:hover { color: var(--brand); }

/* --- Hero --- */
.home-hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.home-hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 540px;
}

/* --- Post list --- */
.post-list { display: flex; flex-direction: column; gap: 2rem; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.post-card:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 12px rgba(15, 110, 240, 0.08);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

.post-card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--brand); }

.post-excerpt {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.read-more {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
}
.read-more:hover { color: var(--brand-dark); }

/* --- Tags --- */
.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-color);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Post page --- */
.post { max-width: var(--max-w); }

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

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.separator { color: var(--border); }

.post-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.post-description {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* --- Post body typography --- */
.post-body { font-size: 1.05rem; line-height: 1.8; }

.post-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.75rem;
}

.post-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

.post-body p { margin-bottom: 1.25rem; }

.post-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: var(--brand-dark); }

.post-body ul, .post-body ol {
  margin: 0.5rem 0 1.25rem 1.5rem;
}
.post-body li { margin-bottom: 0.4rem; }

.post-body code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: #c7254e;
}

.post-body pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}
.post-body pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: #f0fdf9;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-light);
  font-style: italic;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.post-body th {
  background: var(--code-bg);
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}
.post-body td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.post-body tr:last-child td { border-bottom: none; }

/* Callout boxes */
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid transparent;
}
.callout-info { background: #eef4ff; border-color: #c0d4f5; }
.callout-info strong { color: var(--brand); }

/* --- Report version line --- */
.report-version-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  background: var(--code-bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--brand);
}

.report-version {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-light);
  flex: 1;
}

.report-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.report-link:hover { color: var(--brand-dark); }

/* --- Report screenshots --- */
.post-body figure {
  margin: 2rem -7rem;
}

.post-body figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: opacity 0.15s;
}

.post-body figure img:hover {
  opacity: 0.9;
}

.post-body figcaption {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
  font-style: italic;
  text-align: center;
}

@media (max-width: 1000px) {
  .post-body figure { margin-left: 0; margin-right: 0; }
}

/* --- Lightbox --- */
#img-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 20, 0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
}

#img-lightbox.open {
  display: flex;
}

#img-lightbox img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
  cursor: default;
}

#img-lightbox-caption {
  max-width: 72ch;
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  line-height: 1.5;
  font-style: italic;
  text-align: center;
}

#img-lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

#img-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* --- Claim cards --- */
.claim-cluster {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.claim-cluster-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.claim-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: var(--surface);
}

.claim-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.claim-id {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-light);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.claim-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.badge-yard    { background: #1d4ed8; color: #fff; }
.badge-crawler { background: #7c3aed; color: #fff; }

.claim-property {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-bottom: 0.2rem;
}

.claim-value {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.claim-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-light);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.claim-row-link {
  color: var(--brand);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.68rem;
}
.claim-row-link:hover { text-decoration: underline; }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  font-size: 0.85rem;
  color: var(--text-light);
  background: var(--surface);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .home-hero h1 { font-size: 1.7rem; }
  .post-title { font-size: 1.5rem; }
  .post-card { padding: 1.25rem; }
}
