/* Shared styles for the home page, blog index and posts. Kept in a file because the CSP allows style-src 'self' only. */
:root {
  color-scheme: light dark;
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3f0ea;
  --border: #e8e3da;
  --text: #1d1c1a;
  --text-muted: #57534c;
  --text-faint: #8a857b;
  --accent: #c2500f;
  --accent-strong: #a8430a;
  --accent-soft: #fbeadf;
  --on-accent: #ffffff;
  --header-bg: rgba(250, 248, 245, 0.8);
  --shadow: 0 1px 2px rgba(40, 30, 20, 0.04), 0 8px 24px rgba(40, 30, 20, 0.06);
  --shadow-hover: 0 2px 4px rgba(40, 30, 20, 0.05), 0 16px 40px rgba(40, 30, 20, 0.1);
  --glow: rgba(255, 159, 67, 0.22);
  --grid-line: rgba(40, 30, 20, 0.06);

  --vmware: #2f6fd6;
  --vmware-soft: #e5eefc;
  --windows: #0f8a9e;
  --windows-soft: #e0f3f5;
  --synology: #3e8a3a;
  --synology-soft: #e6f2e4;

  --wide: 68rem;
  --narrow: 44rem;
  --gutter: 20px;
  --radius: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --surface: #1b1a18;
    --surface-2: #23221f;
    --border: #2f2d2a;
    --text: #eeebe6;
    --text-muted: #b5b0a7;
    --text-faint: #8a857c;
    --accent: #ffa65c;
    --accent-strong: #ffbb85;
    --accent-soft: rgba(255, 159, 67, 0.12);
    --on-accent: #1d1206;
    --header-bg: rgba(19, 18, 17, 0.75);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.4);
    --glow: rgba(255, 159, 67, 0.14);
    --grid-line: rgba(255, 255, 255, 0.04);

    --vmware: #7fa9f0;
    --vmware-soft: rgba(127, 169, 240, 0.12);
    --windows: #5cc4d4;
    --windows-soft: rgba(92, 196, 212, 0.12);
    --synology: #8ccc86;
    --synology-soft: rgba(140, 204, 134, 0.12);
  }
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: clip;
}
main {
  flex: 1;
}
a {
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection {
  background: var(--accent-soft);
  color: var(--text);
}

/* Header — full-width bar, content centred with padding so every page can share the same markup */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem max(var(--gutter), calc((100% - var(--wide)) / 2));
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand::before {
  content: "";
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 7px;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(255, 255, 255, 0.35) 46% 54%, transparent 54%),
    linear-gradient(135deg, #ffb066, #e2591a);
  box-shadow: 0 2px 8px rgba(226, 89, 26, 0.35);
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}
.site-header nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--text-muted);
}
.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: var(--text);
  background: var(--surface-2);
}
.site-header nav a:last-child {
  color: var(--text);
  background: var(--surface-2);
}
.site-header nav a:last-child:hover,
.site-header nav a:last-child:focus-visible {
  background: var(--border);
}
@media (max-width: 640px) {
  .site-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .site-header nav {
    flex-wrap: nowrap;
    gap: 0;
    justify-content: flex-start;
    max-width: calc(100% + 0.6rem);
    margin-left: -0.6rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-header nav::-webkit-scrollbar {
    display: none;
  }
  .site-header nav a {
    padding: 0.3rem 0.55rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}

/* Footer */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  margin-top: 5rem;
  padding: 2rem max(var(--gutter), calc((100% - var(--wide)) / 2)) 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-faint);
}
.site-footer a {
  color: var(--text-muted);
}
.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
}
.site-footer p {
  margin: 0;
}
.site-footer .brand {
  color: var(--text);
}
.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* Shared type */
main {
  width: 100%;
  max-width: calc(var(--narrow) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
h1,
h2,
h3 {
  text-wrap: balance;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0.75rem 0 1rem;
}
p {
  text-wrap: pretty;
}
.meta,
.byline {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-faint);
}
.meta a {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
}
.meta a:hover,
.meta a:focus-visible {
  background: var(--accent);
  color: var(--on-accent);
}
.meta a[href="/#vmware"] { background: var(--vmware-soft); color: var(--vmware); }
.meta a[href="/#windows"] { background: var(--windows-soft); color: var(--windows); }
.meta a[href="/#synology"] { background: var(--synology-soft); color: var(--synology); }
.meta a[href="/#vmware"]:hover { background: var(--vmware); color: var(--surface); }
.meta a[href="/#windows"]:hover { background: var(--windows); color: var(--surface); }
.meta a[href="/#synology"]:hover { background: var(--synology); color: var(--surface); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.eyebrow .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lead {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 0 2rem;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  box-shadow: var(--shadow);
}
.button:hover,
.button:focus-visible {
  border-color: var(--text-faint);
  transform: translateY(-1px);
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.button.primary:hover,
.button.primary:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.arrow {
  transition: transform 0.2s ease;
}
a:hover .arrow,
a:focus-visible .arrow {
  transform: translateX(3px);
}

/* Home */
.home {
  max-width: calc(var(--wide) + 2 * var(--gutter));
}
.hero {
  position: relative;
  padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(50% - 50vw);
  background:
    radial-gradient(40rem 22rem at max(15%, calc(50vw - 30rem)) 20%, var(--glow), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask-image: linear-gradient(#000 40%, transparent);
  mask-image: linear-gradient(#000 40%, transparent);
}
.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 1.25rem 0 1.25rem;
  max-width: 14ch;
}
.hero h1 span {
  background: linear-gradient(120deg, #ff9f43, #e2591a 60%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-faint);
}
.stats strong {
  color: var(--text);
  font-weight: 650;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-head a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.latest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem 3rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 4.5rem;
  overflow: hidden;
}
.latest::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #ffb066, #e2591a);
}
.latest:hover {
  box-shadow: var(--shadow-hover);
}
.latest h2 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0.75rem 0 0.75rem;
}
.latest h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.latest .meta a {
  position: relative;
  z-index: 1;
}
.latest .excerpt {
  margin: 0;
  max-width: 40rem;
  color: var(--text-muted);
}
.latest .read-more {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.badge {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
@media (max-width: 640px) {
  .latest {
    grid-template-columns: 1fr;
  }
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.25rem;
  align-items: start;
}
.category {
  padding: 1.5rem;
  scroll-margin-top: 6rem;
  --tint: var(--accent);
  --tint-soft: var(--accent-soft);
}
.category:target {
  border-color: var(--tint);
  box-shadow: 0 0 0 3px var(--tint-soft), var(--shadow);
}
#vmware { --tint: var(--vmware); --tint-soft: var(--vmware-soft); }
#windows { --tint: var(--windows); --tint-soft: var(--windows-soft); }
#synology { --tint: var(--synology); --tint-soft: var(--synology-soft); }
.category > header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.category .icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--tint-soft);
  color: var(--tint);
}
.category .icon svg {
  width: 1.35rem;
  height: 1.35rem;
}
.category h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.category .count {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-faint);
}
.category .blurb {
  margin: 1rem 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.category-posts {
  list-style: none;
  margin: 0 -0.75rem;
  padding: 0;
}
.category-posts a {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
}
.category-posts a:hover,
.category-posts a:focus-visible {
  background: var(--surface-2);
}
.category-posts .title {
  display: block;
  font-weight: 550;
  font-size: 0.97rem;
  line-height: 1.45;
}
.category-posts a:hover .title {
  color: var(--tint);
}
.category-posts time {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* Blog index */
.blog-index {
  padding-top: clamp(2.5rem, 7vw, 4.5rem);
}
.blog-index h1 {
  margin-top: 1.25rem;
}
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.post-list li {
  position: relative;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.post-list li:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.post-list h2 {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.4;
  margin: 0.6rem 0 0.5rem;
}
.post-list h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.post-list li:hover h2 a {
  color: var(--accent);
}
.post-list .meta a {
  position: relative;
  z-index: 1;
}
.post-list li > p:last-child {
  margin: 0;
  font-size: 0.97rem;
  color: var(--text-muted);
}

/* Post */
.post {
  padding-top: clamp(2.5rem, 7vw, 4rem);
}
.post h1 {
  margin-top: 1rem;
}
.post .byline {
  padding-bottom: 2rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}
.content {
  font-size: 1.075rem;
  line-height: 1.8;
  color: var(--text-muted);
}
.content p,
.content ol,
.content ul,
.content blockquote,
.content table {
  margin: 0 0 1.4rem;
}
.content li + li {
  margin-top: 0.35rem;
}
.content h2,
.content h3,
.content h4 {
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 2.5rem 0 0.9rem;
}
.content strong {
  color: var(--text);
  font-weight: 650;
}
.content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.content a:hover,
.content a:focus-visible {
  text-decoration-color: currentColor;
}
.content blockquote {
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--text);
}
.content figure {
  margin: 2rem 0;
}
.content img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.content figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-faint);
}
.content pre {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.6;
}
.content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}
.content :not(pre) > code {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.content mark.highlight {
  background: none;
  color: var(--accent);
}

/* Notice pages (404, coming soon) */
.notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: clamp(4rem, 14vh, 8rem);
  padding-bottom: 2rem;
}
.notice h1 {
  font-size: clamp(2.5rem, 9vw, 4rem);
  letter-spacing: -0.04em;
  margin: 1.25rem 0 1rem;
}
.notice .lead {
  margin: 0 auto 2rem;
}
.notice .actions {
  justify-content: center;
}
.notice .eyebrow .dot {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

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