/* HomeLab Starter — base stylesheet
   Plain CSS, no framework, no build step. Mobile-first, system fonts only. */

:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-text: #1c2430;
  --color-text-muted: #5b6673;
  --color-accent: #1e6f5c;
  --color-accent-dark: #144c3f;
  --color-accent-light: #7fd6bd;
  --color-border: #e2e5ea;
  --color-header-bg: #10151c;
  --color-header-text: #f2f4f7;
  --color-callout-bg: #eef6f3;
  --color-ad-bg: #f1f0e8;
  --color-ad-border: #cfcabb;
  --max-width: 880px;
  --radius: 9px;
  --radius-lg: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 17px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* Accessible focus ring -- themed, not the bare browser default */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--color-accent-light);
}

::selection { background: var(--color-accent-light); color: var(--color-accent-dark); }

/* Scrollbar theming (Firefox + WebKit) so a browser default doesn't leak through */
html { scrollbar-color: var(--color-accent) var(--color-bg); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 20px;
  border: 3px solid var(--color-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-accent-dark); }

/* Skip link -- hidden until keyboard-focused */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--color-accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 100;
  transition: top 0.2s var(--ease-out);
}

.skip-link:focus { top: 12px; text-decoration: none; }

.icon {
  display: inline-flex;
  flex-shrink: 0;
  color: inherit;
}

.icon svg { display: block; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header / Nav */
.site-header {
  background: var(--color-header-bg);
  color: var(--color-header-text);
}

.site-header .container {
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-header-text);
  letter-spacing: -0.01em;
}

.site-title span { color: #7fd6bd; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--color-header-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s var(--ease-out);
}

.site-nav a:hover { color: var(--color-accent-light); text-decoration: none; }

/* Hero (homepage) */
.hero {
  position: relative;
  background: linear-gradient(180deg, #10151c 0%, #17202b 100%);
  color: var(--color-header-text);
  padding: 68px 0 76px;
  overflow: hidden;
}

.hero .container { max-width: 1100px; position: relative; z-index: 1; }

.hero-art {
  position: absolute;
  top: 50%;
  right: -40px;
  width: 420px;
  height: 420px;
  transform: translateY(-50%);
  color: var(--color-accent-light);
  opacity: 0.16;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.hero-art .dot { fill: currentColor; stroke: none; }

.hero h1 {
  font-size: 2.35rem;
  margin: 0 0 16px;
  max-width: 660px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero p {
  color: #c3cad4;
  max-width: 600px;
  font-size: 1.08rem;
  margin: 0 0 26px;
}

.hero .btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-accent);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.btn:hover { background: var(--color-accent-dark); text-decoration: none; transform: translateY(-1px); }

.btn .icon svg { transition: transform 0.15s var(--ease-out); }
.btn:hover .icon svg { transform: translateX(3px); }

.btn-outline {
  background: transparent;
  border: 1px solid #4a5563;
  color: var(--color-header-text);
}

.btn-outline:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }

/* Main content wrapper */
main { max-width: 1100px; margin: 0 auto; padding: 40px 20px 60px; }

/* Section headings on homepage */
.section-heading {
  font-size: 1.5rem;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--color-text-muted);
  margin: 0 0 26px;
}

/* Value strip -- three honest, factual claims (see about.html), not fabricated stats */
.value-strip {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  border-top: 1px solid #232d3a;
  padding: 22px 0 0;
  margin-top: 34px;
}

.value-strip .value-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c3cad4;
  font-size: 0.92rem;
  font-weight: 500;
}

.value-strip .icon { color: var(--color-accent-light); }

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
  box-shadow: 0 12px 28px -16px rgba(20, 76, 63, 0.35);
}

.card .category-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  background: var(--color-callout-bg);
  padding: 4px 10px 4px 8px;
  border-radius: 20px;
  margin-bottom: 12px;
  width: fit-content;
}

.card .category-tag .icon svg { width: 13px; height: 13px; }

.card h3 { margin: 0 0 8px; font-size: 1.12rem; line-height: 1.35; }
.card h3 a:hover { text-decoration: underline; }
.card p { color: var(--color-text-muted); font-size: 0.94rem; margin: 0 0 14px; flex-grow: 1; }
.card .read-more {
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card .read-more .icon svg { transition: transform 0.15s var(--ease-out); }
.card:hover .read-more .icon svg { transform: translateX(3px); }

/* "Why self-host?" replace-list -- recaps the tools already named in the prose, with icons */
.replace-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.replace-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 500;
}

.replace-list .icon { color: var(--color-accent); }

/* Article list page grouped by category */
.category-block { margin-bottom: 40px; }
.category-block h2 { font-size: 1.25rem; border-bottom: 2px solid var(--color-border); padding-bottom: 8px; }

/* Article page */
.article-header { max-width: var(--max-width); margin: 0 auto; padding: 40px 20px 0; }
.article-header .container { padding: 0; }

.breadcrumb { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--color-text-muted); }

.article-header h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin: 0 0 14px;
}

.article-meta {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 24px;
}

article.article-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 60px;
}

article.article-body h2 {
  font-size: 1.45rem;
  margin: 40px 0 14px;
  line-height: 1.35;
}

article.article-body h3 {
  font-size: 1.15rem;
  margin: 28px 0 10px;
}

article.article-body p { margin: 0 0 18px; }
article.article-body ul, article.article-body ol { margin: 0 0 18px; padding-left: 24px; }
article.article-body li { margin-bottom: 8px; }

article.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 24px;
  font-size: 0.94rem;
}

article.article-body th, article.article-body td {
  border: 1px solid var(--color-border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}

article.article-body th { background: #eef1f4; }

.callout {
  background: var(--color-callout-bg);
  border-left: 4px solid var(--color-accent);
  padding: 16px 18px;
  border-radius: 4px;
  margin: 0 0 24px;
  font-size: 0.96rem;
}

.callout strong { color: var(--color-accent-dark); }

.diagram {
  margin: 8px 0 28px;
  padding: 20px 18px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.diagram svg { width: 100%; height: auto; display: block; }

.diagram figcaption {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

code, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
}

code {
  background: #eceff2;
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: #1c2430;
  color: #e7ebef;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 24px;
}

pre code { background: none; padding: 0; color: inherit; }

/* Ad placeholder */
.ad-slot {
  border: 2px dashed var(--color-ad-border);
  background: var(--color-ad-bg);
  color: #7a7460;
  text-align: center;
  padding: 26px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 32px 0;
}

.ad-slot span { display: block; font-weight: 400; text-transform: none; margin-top: 4px; font-size: 0.8rem; }

/* Related articles box */
.related-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 40px 0;
}

.related-box h2 { margin-top: 0; font-size: 1.15rem; }
.related-box ul { margin: 0; padding-left: 20px; }
.related-box li { margin-bottom: 8px; }

/* Author box */
.author-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
  margin-top: 40px;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* Static pages (about/contact/privacy) */
.static-page { max-width: var(--max-width); margin: 0 auto; padding: 48px 20px 60px; }
.static-page h1 { font-size: 1.9rem; margin-bottom: 18px; }
.static-page h2 { font-size: 1.3rem; margin: 32px 0 12px; }
.static-page p { margin: 0 0 16px; }

/* Footer */
.site-footer {
  background: var(--color-header-bg);
  color: #9aa4b2;
  margin-top: 60px;
}

.site-footer .container {
  max-width: 1100px;
  padding-top: 34px;
  padding-bottom: 34px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
}

.site-footer a { color: #c3cad4; }
.footer-links ul { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-disclosure { max-width: 560px; color: #7c8798; font-size: 0.82rem; margin-top: 10px; }

@media (max-width: 780px) {
  .hero-art { display: none; }
}

@media (max-width: 640px) {
  :root { font-size: 16px; }
  .hero h1 { font-size: 1.7rem; }
  .article-header h1 { font-size: 1.6rem; }
  .site-footer .container { flex-direction: column; }
  .value-strip { gap: 16px 24px; }
  .card:hover { transform: none; }
}
