/* Boxes'n'Lines shared visual language - same design tokens and structural classes as
   DiagramGenerator.Web's own site.css (dotnet.boxesnlines.com is a sibling product, not a new look),
   trimmed to what this smaller, static-content site actually uses: no dashboard/auth/playground
   styling, but the same header/footer/hero/feature-grid/buttons, plus diagram-pane/code-pane/code-line
   for the sample page's two-panel view. */
:root {
  --surface-base: #1a1a2e;
  --surface-card: #16213e;
  --surface-deep: #0f0f1a;
  --border-default: #374151;
  --text-primary: #ffffff;
  --text-muted: #9ca3af;
  --accent-cyan: #1ba1e2;
  --accent-cyan-hover: #0080c0;
  --accent-green: #008a00;
  --accent-green-hover: #005700;
  --status-success: #008a00;
  --status-error: #e51400;
  --radius-btn: 0.375rem;
  --radius-card: 0.5rem;
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --max-page: 1200px;
  --max-content: 960px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--accent-cyan);
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-cyan-hover);
}

.page {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 1rem;
}

.content {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 1rem;
}

header.site-header {
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-default);
}

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

header.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

header.site-header .brand:hover {
  color: var(--text-primary);
}

header.site-header .brand-pictograph {
  height: 1.75rem;
  width: 1.75rem;
}

header.site-header .brand-logo {
  height: 1.5rem;
  width: auto;
}

header.site-header .brand-tagline {
  padding-left: 0.75rem;
  margin-left: 0.25rem;
  border-left: 1px solid var(--border-default);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 900px) {
  header.site-header .brand-tagline {
    display: none;
  }
}

header.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.95rem;
}

header.site-header nav a:hover {
  color: var(--text-primary);
}

footer.site-footer {
  background: var(--surface-base);
  border-top: 1px solid var(--border-default);
  margin-top: 3rem;
}

footer.site-footer .page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

@media (min-width: 768px) {
  footer.site-footer .page {
    flex-direction: row;
  }
}

footer.site-footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

main {
  flex: 1 0 auto;
}

/* Buttons */
.btn {
  display: inline-block;
  border-radius: var(--radius-btn);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-green);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-green-hover);
  color: #ffffff;
}

.form-banner {
  border-radius: var(--radius-btn);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.form-banner.error {
  background: rgba(229, 20, 0, 0.1);
  color: var(--status-error);
}

.form-banner.success {
  background: rgba(0, 138, 0, 0.1);
  color: var(--status-success);
}

/* Homepage */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin: 0 0 1rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 40rem;
  margin: 0 auto 2rem;
}

.hero .btn {
  margin: 0 0.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.feature-card {
  background: var(--surface-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

.feature-card h2,
.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Install command box (homepage) */
.install-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 32rem;
  margin: 0 auto 2.5rem;
  background: var(--surface-deep);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  padding: 0.875rem 1rem;
}

.install-box code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  overflow-x: auto;
  white-space: nowrap;
}

.install-box button {
  flex: 0 0 auto;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.install-box button:hover {
  background: var(--surface-base);
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  align-items: start;
}

.pricing-card {
  background: var(--surface-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border: 1px solid var(--accent-cyan);
}

.pricing-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.pricing-card .price {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0 1rem;
}

.pricing-card .price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Monthly / annual choice on the Individual card */
.billing-toggle {
  display: inline-flex;
  margin: 0.5rem 0 0.25rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  overflow: hidden;
}

.toggle-option {
  background: transparent;
  color: var(--text-muted);
  border: 0;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.toggle-option + .toggle-option {
  border-left: 1px solid var(--border-default);
}

.toggle-option[aria-pressed="true"] {
  background: var(--accent-cyan);
  color: var(--text-primary);
}

.toggle-option:not([aria-pressed="true"]):hover {
  color: var(--text-primary);
}

.toggle-option .save {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  opacity: 0.9;
}

.pricing-card ul {
  color: var(--text-muted);
  line-height: 1.8;
  padding-left: 1.25rem;
  margin: 0 0 1.5rem;
  flex: 1 0 auto;
}

/* Sample page: code on the left, the diagram it produced on the right, both filling the same height */
/* Wider than other pages: the diagram needs the room */
.content.sample-page {
  max-width: 1400px;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.sample-intro {
  color: var(--text-muted);
  max-width: 52rem;
  margin: 0 0 1.25rem;
}

.sample-layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 1.25rem;
  height: clamp(32rem, 78vh, 50rem);
}

.sample-cta {
  margin: 1.5rem 0 0;
}

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

  .sample-code {
    height: 26rem;
  }

  .sample-diagram {
    height: 30rem;
  }
}

.sample-code,
.sample-diagram {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* One tab per source file, across the full width above both panes; choosing one switches the code on the left. */
.file-tabs {
  display: flex;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
}

.file-tabs button {
  flex: 1 1 0;
  min-width: max-content;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  border-right: 1px solid var(--border-default);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  white-space: nowrap;
}

.file-tabs button:last-child {
  border-right: none;
}

.file-tabs button:hover {
  color: var(--text-primary);
  background: var(--surface-card);
}

.file-tabs button.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-cyan);
  background: var(--surface-card);
}

.code-header {
  flex: 0 0 auto;
  padding: 0.55rem 0.9rem;
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-default);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.code-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--surface-deep);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  padding: 0.5rem 0;
}

.code-line {
  display: flex;
  padding: 0 1rem 0 0;
}

.code-line-number {
  flex: 0 0 3rem;
  padding-right: 0.75rem;
  text-align: right;
  color: var(--text-muted);
  opacity: 0.6;
  user-select: none;
}

.code-line-text {
  white-space: pre;
}

.diagram-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.55rem 0.9rem;
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-default);
  font-size: 0.8125rem;
}

.toolbar-btn {
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  padding: 0.2rem 0.7rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.toolbar-btn:hover {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.sample-diagram.expanded {
  position: fixed;
  inset: 1rem;
  z-index: 100;
  height: auto;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.75);
}

body.no-scroll {
  overflow: hidden;
}

.legend {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.swatch {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 0.2rem;
  border: 1px solid transparent;
}

.swatch.linked { background: #8764b8; border-color: #5c3d99; }
.swatch.external { background: #9aa0a6; border-color: #6b7280; border-style: dashed; }
.swatch.decision { background: none; border-color: #1ba1e2; }
.swatch.loop { background: #ffbf00; border-color: #b38600; }
.swatch.ret { background: #60a917; border-color: #2d7600; }

/* The diagram itself (also used, smaller, on the home page) */
.diagram-pane {
  height: 28rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border-default);
  background: var(--surface-deep);
}

.sample-diagram .diagram-pane {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  border: none;
  border-radius: 0;
  cursor: grab;
}

.sample-diagram .diagram-pane:active {
  cursor: grabbing;
}

.diagram-pane svg {
  width: 100%;
  height: 100%;
}

.diagram-controls {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.diagram-controls button {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  background: var(--surface-base);
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.diagram-controls button:hover {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* The generator's red "throw" node sets no text colour, so it would inherit the theme's light grey; pure white reads better on that red. */
.diagram-pane .node.Throw .nodeLabel,
.diagram-pane .node.Throw .nodeLabel p {
  color: #fff;
}

/* Docs */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-default);
  font-size: 0.875rem;
  vertical-align: top;
}

.docs-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.docs-table code,
.content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-deep);
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
}

.content pre {
  background: var(--surface-deep);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-btn);
  padding: 1rem;
  overflow-x: auto;
}

.content pre code {
  background: none;
  padding: 0;
}
