:root {
  color-scheme: light;
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-alt: #edf2ef;
  --text: #151a18;
  --muted: #5e6863;
  --line: #dce3df;
  --accent: #087e60;
  --accent-strong: #05664e;
  --accent-soft: #dff3eb;
  --shadow: 0 16px 44px rgba(22, 38, 31, 0.08);
  --radius: 8px;
  --max-width: 1180px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101614;
  --surface: #19201d;
  --surface-alt: #202b27;
  --text: #f0f4f2;
  --muted: #aeb8b3;
  --line: #314039;
  --accent: #49d2a2;
  --accent-strong: #78dfba;
  --accent-soft: #12372c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-size: 1rem;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.site-name {
  white-space: nowrap;
}

.site-nav {
  display: flex;
  justify-content: flex-start;
  gap: 28px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.site-nav a {
  position: relative;
  padding: 10px 0;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.icon-button,
.nav-toggle {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.icon-button:hover,
.nav-toggle:hover {
  border-color: var(--accent);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.nav-toggle {
  display: none;
  padding: 10px;
  border-radius: var(--radius);
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 20px;
  height: 2px;
  margin: 2px 0;
  border-radius: 2px;
  background: currentColor;
}

main {
  max-width: var(--max-width);
  min-height: calc(100vh - 180px);
  margin: 0 auto;
  padding: 0 24px 76px;
}

.page-heading {
  padding: 70px 0 42px;
  text-align: center;
}

.eyebrow,
.category {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.page-heading h1 {
  margin: 0 0 12px;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.page-heading > p:last-child {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.06rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  max-width: 900px;
  margin: 0 auto;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  min-height: 220px;
  place-content: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 1.15rem;
}

.post-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease;
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.post-card-link {
  display: grid;
  min-height: 100%;
  grid-template-rows: 250px 1fr;
}

.guide-cover {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 18px;
  min-height: 250px;
  overflow: hidden;
  padding: 30px;
}

.cover-arista {
  background: #d9f0ec;
  color: #0d5258;
}

.cover-cisco {
  background: #e8edf7;
  color: #154c7c;
}

:root[data-theme="dark"] .cover-arista {
  background: #175c61;
  color: #efffff;
}

:root[data-theme="dark"] .cover-cisco {
  background: #214d75;
  color: #f4f8ff;
}

.cover-title {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  align-content: center;
}

.cover-title span {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 0.95;
}

.cover-title strong {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.fabric-diagram {
  position: relative;
  z-index: 2;
  width: 150px;
  height: 135px;
  max-width: 100%;
}

.device {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 26px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  font-size: 0.65rem;
  font-weight: 900;
}

.spine-one { top: 4px; left: 24px; }
.spine-two { top: 4px; right: 24px; }
.leaf-one { bottom: 4px; left: 0; }
.leaf-two { bottom: 4px; left: 38px; }
.leaf-three { right: 38px; bottom: 4px; }
.leaf-four { right: 0; bottom: 4px; }

.fabric-line {
  position: absolute;
  top: 36px;
  left: 19px;
  width: 112px;
  height: 72px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  opacity: 0.55;
  transform: skewX(-18deg);
}

.line-two {
  transform: scaleX(-1) skewX(-18deg);
}

.post-card-body {
  display: grid;
  align-content: start;
  padding: 26px;
}

.post-card h2 {
  margin: 7px 0 10px;
  font-size: 1.4rem;
  line-height: 1.18;
}

.post-card p {
  margin-bottom: 24px;
  color: var(--muted);
}

.read-guide {
  align-self: end;
  margin-top: auto;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 800;
}

.detail-view {
  padding-top: 38px;
}

.privacy-view {
  max-width: 820px;
  margin: 0 auto;
  padding-top: 38px;
}

.back-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
  color: var(--muted);
  font-weight: 750;
}

.back-link:hover {
  color: var(--accent-strong);
}

.guide-article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.policy-article {
  padding: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.policy-article header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.policy-article h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.policy-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.policy-article section {
  padding-top: 30px;
}

.policy-article h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.policy-article section p {
  color: var(--muted);
}

.policy-article section p:last-child {
  margin-bottom: 0;
}

.policy-article section a {
  color: var(--accent-strong);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-header {
  max-width: 880px;
  padding: 52px;
}

.article-header h1 {
  max-width: 850px;
  margin: 8px 0 18px;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.article-header > p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.36fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.article-aside {
  display: grid;
  min-height: 520px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 34px;
  text-align: center;
}

.article-aside .fabric-diagram {
  margin-bottom: 30px;
}

.article-aside > span {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  line-height: 0.95;
}

.article-aside > strong {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.article-content {
  min-width: 0;
  padding: 46px;
}

.article-content h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.article-content h2:not(:first-child) {
  margin-top: 36px;
}

.deployment-steps {
  display: grid;
  gap: 13px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.deployment-steps li {
  padding-left: 5px;
}

.command-block {
  margin: 0 0 24px;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d1512;
  color: #d8eee5;
  font-size: 0.86rem;
  line-height: 1.75;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.repo-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 800;
}

.repo-action:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.repo-action.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 38px 24px 48px;
  border-top: 1px solid var(--line);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.site-footer a:hover {
  color: var(--accent-strong);
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .nav-toggle {
    display: block;
    order: 2;
  }

  .site-nav {
    position: fixed;
    inset: 76px 16px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }

  .site-nav a[aria-current="page"]::after {
    display: none;
  }

  .icon-button {
    order: 3;
    justify-self: end;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-aside {
    min-height: 280px;
  }
}

@media (max-width: 700px) {
  .site-header {
    gap: 10px;
    padding: 14px 16px;
  }

  .site-name {
    display: none;
  }

  main {
    padding: 0 16px 54px;
  }

  .page-heading {
    padding: 48px 0 30px;
    text-align: left;
  }

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

  .post-card-link {
    grid-template-rows: 220px 1fr;
  }

  .guide-cover {
    min-height: 220px;
    padding: 24px;
  }

  .article-header,
  .article-content,
  .policy-article {
    padding: 30px 24px;
  }

  .article-aside {
    min-height: 250px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 32px 16px 42px;
  }
}

@media (max-width: 420px) {
  .guide-cover {
    grid-template-columns: 1fr;
  }

  .fabric-diagram {
    height: 105px;
  }

  .cover-title span {
    font-size: 2rem;
  }

  .post-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
