:root {
  color-scheme: light;
  --bg: #f5f7f5;
  --surface: #ffffff;
  --surface-2: #edf2ee;
  --ink: #17211b;
  --muted: #5f6d65;
  --line: #d8e0da;
  --accent: #168a56;
  --accent-2: #255ca8;
  --accent-soft: #e4f4ec;
  --danger: #9c2f2f;
  --danger-soft: #fff1ef;
  --warning: #8a6100;
  --warning-soft: #fff7dc;
  --shadow: 0 14px 40px rgba(28, 43, 34, 0.12);
  --shadow-hover: 0 20px 52px rgba(28, 43, 34, 0.18);
  --radius: 8px;
  --radius-lg: 18px;
  --transition: border-color 0.18s ease, background 0.18s ease,
    box-shadow 0.18s ease, transform 0.14s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.75;
}

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

a:hover {
  text-decoration: underline;
}

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

code {
  padding: 0.08rem 0.32rem;
  border-radius: 4px;
  background: #e8eee9;
  color: #0f3122;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.94em;
}

/* ─── Header ─── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(216, 224, 218, 0.86);
  background: rgba(245, 247, 245, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 34px;
  border: 1px solid #a8d8bf;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
}

/* ─── Navigation ─── */

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.top-nav a,
.top-nav summary {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.top-nav a:hover,
.top-nav summary:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}

.top-nav a.active,
.top-nav summary.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.nav-group {
  position: relative;
}

.nav-group summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  color: var(--muted);
  content: "▾";
  font-size: 0.72rem;
}

.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  display: grid;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 32px rgba(28, 43, 34, 0.14);
}

.nav-group:not([open]) .nav-menu {
  display: none;
}

.nav-menu a {
  white-space: nowrap;
}

/* ─── Hamburger (mobile) ─── */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Layout ─── */

.section,
.section-band {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 42px 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

/* ─── Hero band (index only) ─── */

.hero-band-wrapper {
  background: linear-gradient(155deg, #0b1810 0%, #0f2118 50%, #0a1a13 100%);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(260px, 0.55fr);
  gap: 34px;
  align-items: center;
  padding: 60px 0 48px;
}

.hero-copy {
  min-width: 0;
}

.title-with-icon {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 18px;
  min-width: 0;
}

.title-with-icon h1,
.title-with-icon h2 {
  margin: 0;
}

.title-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(23, 168, 114, 0.24);
  flex: 0 0 auto;
  object-fit: cover;
}

.projectbuilder-title-icon {
  background: #101416;
}

/* Text colors inside dark hero */
.hero-band-wrapper h1 {
  color: #f2f9f5;
}

.hero-band-wrapper .lead {
  color: #8bbea4;
}

.hero-band-wrapper .eyebrow {
  color: #4dc886;
}

/* ─── Platform badges ─── */

.platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  color: #c8e8d8;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ─── Typography ─── */

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

h1 {
  max-width: 820px;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

h3 {
  margin-top: 22px;
  font-size: 1.12rem;
}

p {
  margin: 12px 0 0;
}

ul,
ol {
  margin: 14px 0 0;
  padding-left: 1.35rem;
}

li + li {
  margin-top: 6px;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.2rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.meta-row span,
.quick-links a,
.menu-order li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.meta-row span {
  padding: 8px 11px;
  color: var(--muted);
  font-size: 0.94rem;
}

/* ─── Hero shot ─── */

.hero-shot {
  margin: 0;
  border-radius: var(--radius-lg);
  background: #10171a;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.45),
    0 8px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.hero-shot img {
  width: 100%;
  max-height: 620px;
  object-fit: cover;
  object-position: top center;
}

/* ─── Quick links ─── */

.quick-links {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.quick-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
  transition: var(--transition);
}

.quick-links a:hover {
  border-color: #a8d8bf;
  background: var(--accent-soft);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ─── Doc pages ─── */

.doc-page {
  padding-bottom: 24px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span::before {
  margin-right: 8px;
  color: #9aa7a0;
  content: "/";
}

.page-hero {
  padding-top: 28px;
  padding-bottom: 34px;
}

.page-hero h1 {
  font-size: clamp(2rem, 4.8vw, 3.6rem);
}

/* ─── Page grid & cards ─── */

.page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.page-card {
  display: grid;
  gap: 8px;
  min-height: 162px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(28, 43, 34, 0.05);
  transition: var(--transition);
}

.page-card:hover {
  border-color: #a8d8bf;
  background: var(--accent-soft);
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(28, 43, 34, 0.11);
  transform: translateY(-2px);
}

.page-card span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.page-card strong {
  font-size: 1.12rem;
}

.page-card small {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ─── Section headings ─── */

.section-heading {
  max-width: 820px;
  margin-bottom: 22px;
}

.section-heading h2 {
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}

/* ─── Content grids ─── */

.feature-grid,
.content-grid,
.tab-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature,
.content-grid article,
.tab-list article,
.notice,
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature,
.content-grid article,
.tab-list article {
  padding: 18px;
}

.feature h3,
.content-grid h3,
.tab-list h3 {
  margin-top: 0;
}

.content-grid h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.notice {
  padding: 22px;
}

.notice h2,
.notice h3 {
  margin-top: 0;
}

.notice.danger {
  border-color: #f1c1bb;
  background: var(--danger-soft);
}

.notice.danger h2,
.notice.danger h3 {
  color: var(--danger);
}

/* ─── Two-column layout ─── */

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 24px;
  align-items: start;
}

.inline-shot {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.inline-shot img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  object-position: top center;
}

.projectbuilder-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.projectbuilder-logo img {
  display: block;
  width: min(180px, 60vw);
  height: auto;
  max-height: none;
  aspect-ratio: 1;
  border: 1px solid rgba(23, 168, 114, 0.24);
  border-radius: 36px;
  box-shadow: 0 18px 42px rgba(17, 24, 22, 0.2);
  object-fit: cover;
}

.projectbuilder-logo figcaption {
  padding: 0;
  border-top: 0;
  text-align: center;
}

figcaption {
  padding: 9px 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

/* ─── Tab list ─── */

.tab-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
}

/* ─── Steps ─── */

.steps {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 220px) 1fr;
  gap: 14px;
  align-items: center;
  min-height: 70px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  counter-increment: step;
}

.steps li::before {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  content: counter(step);
}

.steps strong {
  display: block;
}

.steps span {
  color: var(--muted);
}

.steps.compact li {
  grid-template-columns: 48px minmax(0, 180px) 1fr;
}

/* ─── Info table ─── */

.info-table {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.info-table > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr);
}

.info-table > div + div {
  border-top: 1px solid var(--line);
}

.info-table [role="cell"] {
  padding: 13px 15px;
}

.info-table [role="cell"]:first-child {
  background: var(--surface-2);
  font-weight: 800;
}

/* ─── Image grid ─── */

.image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.image-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10171a;
  overflow: hidden;
}

.image-grid img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: top center;
}

.plc-screenshot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.plc-screenshot-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.plc-screenshot-grid img {
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  background: #f8faf8;
}

.projectbuilder-shot {
  margin-top: 18px;
}

.projectbuilder-shot img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: #f8faf8;
}

/* ─── FAQ ─── */

.faq {
  display: grid;
  gap: 10px;
}

.faq details {
  padding: 0;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 15px 18px;
  font-weight: 800;
}

.faq details p {
  margin: 0;
  padding: 0 18px 17px;
  color: var(--muted);
}

/* ─── Menu order ─── */

.menu-order {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  list-style-position: inside;
}

.menu-order li {
  margin: 0;
  padding: 10px 12px;
  font-weight: 700;
}

.small-note {
  color: var(--muted);
  font-size: 0.94rem;
}

/* ─── Footer ─── */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 40px 0 28px;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: start;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.footer-brand:hover {
  text-decoration: none;
}

.footer-brand .brand-mark {
  width: 36px;
  height: 30px;
  font-size: 0.78rem;
}

.footer-brand strong,
.footer-brand small {
  display: block;
  line-height: 1.2;
}

.footer-brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.footer-copy {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.84rem;
}

/* Inner-page footer (single <p> fallback) */
.site-footer > p {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  font-size: 0.88rem;
}

/* Simple footer for inner pages */
.footer-simple {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-simple .brand-mark {
  width: 32px;
  height: 26px;
  font-size: 0.72rem;
  flex-shrink: 0;
}

/* ─── Next/Prev links ─── */

.next-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  width: min(1180px, calc(100% - 32px));
  margin: 10px auto 34px;
}

.next-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  transition: var(--transition);
}

.next-links a:hover {
  border-color: #a8d8bf;
  background: var(--accent-soft);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ─── Responsive: tablet ─── */

@media (max-width: 980px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .hero,
  .two-column {
    grid-template-columns: 1fr;
  }

  .title-with-icon {
    gap: 14px;
  }

  .title-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }

  .hero-shot {
    max-width: 420px;
  }

  .quick-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .page-grid,
  .feature-grid,
  .content-grid,
  .tab-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-order {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ─── Responsive: mobile ─── */

@media (max-width: 680px) {
  .section,
  .section-band,
  .breadcrumb,
  .next-links,
  .header-inner,
  .footer-inner {
    width: min(100% - 24px, 1180px);
  }

  .hero {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  /* Hamburger visible; nav hidden until toggled */
  .nav-toggle {
    display: flex;
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    padding: 10px 0;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 2px;
    padding: 10px 16px 16px;
    background: rgba(245, 247, 245, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(28, 43, 34, 0.10);
    overflow-y: auto;
    max-height: calc(100vh - 60px);
  }

  .top-nav.is-open {
    display: flex;
  }

  .nav-group {
    flex: 0 0 auto;
    width: 100%;
  }

  .nav-group summary {
    width: 100%;
    padding: 10px 8px;
    font-size: 1rem;
    font-weight: 700;
  }

  .nav-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--surface-2);
    border-radius: 8px;
    margin: 4px 0 8px;
    padding: 6px;
  }

  .nav-menu a {
    display: block;
    padding: 9px 12px;
    font-size: 0.95rem;
  }

  .quick-links,
  .page-grid,
  .feature-grid,
  .content-grid,
  .image-grid,
  .plc-screenshot-grid,
  .tab-list,
  .menu-order {
    grid-template-columns: 1fr;
  }

  .steps li,
  .steps.compact li {
    grid-template-columns: 42px 1fr;
  }

  .steps li span {
    grid-column: 2;
  }

  .info-table > div {
    grid-template-columns: 1fr;
  }

  .info-table [role="cell"]:first-child {
    padding-bottom: 5px;
  }

  .info-table [role="cell"] + [role="cell"] {
    padding-top: 5px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .platform-badges {
    margin-top: 18px;
  }
}
