/* ==========================================================================
   PLCConfig shared stylesheet
   ========================================================================== */

:root {
  --bg: #0b0f17;
  --bg-panel: #111827;
  --bg-panel-2: #161f30;
  --bg-elevated: #1c2537;
  --border: #263248;
  --border-light: #2f3d57;

  --text: #e7ebf3;
  --text-muted: #9aa7bd;
  --text-dim: #6b7891;

  --accent: #ff7a1a;
  --accent-dark: #d9600a;
  --accent-soft: rgba(255, 122, 26, 0.12);
  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.12);
  --green: #34d399;

  --radius: 10px;
  --radius-lg: 16px;
  --container: 1180px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--text-muted); }

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

section { padding: 88px 0; }
section.tight { padding: 56px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 122, 26, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #10131a;
}
.btn-primary:hover { background: #ff8f3d; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border-color: var(--border-light);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-light); }

.btn-block { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 23, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10131a;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
}
.brand small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { color: var(--accent); }

.nav-cta { display: flex; align-items: center; gap: 16px; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; background: var(--bg-panel); border-bottom: 1px solid var(--border); padding: 20px 24px; gap: 18px; display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .nav-cta .btn-outline { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 90px 0 70px;
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(900px 420px at 10% -10%, rgba(255, 122, 26, 0.14), transparent 60%);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.page-header {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 122, 26, 0.06), transparent 70%);
}
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 8px; }

/* ---------- Panels / diagrams ---------- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.panel-dark {
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-panel));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.node-diagram {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 32px 20px;
}
.node-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.node {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-muted);
  flex: 1;
  text-align: center;
}
.node.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.node-connector { height: 22px; width: 1px; background: var(--border-light); margin: 0 auto; }

/* ---------- Layer stack diagram ---------- */
.stack { padding: 0; overflow: hidden; }

.stack-list {
  list-style: none;
  margin: 0;
  padding: 22px 24px;
  position: relative;
}
/* vertical spine linking the tiers */
.stack-list::before {
  content: "";
  position: absolute;
  left: 51px;
  top: 40px;
  bottom: 40px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--blue));
  opacity: 0.3;
}
/* pulse travelling up the spine: data moving from field to cloud */
.stack-list::after {
  content: "";
  position: absolute;
  left: 51px;
  width: 1px;
  height: 54px;
  background: linear-gradient(180deg, transparent, var(--accent) 55%, transparent);
  animation: stack-pulse 4s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}
@keyframes stack-pulse {
  0%      { top: calc(100% - 40px); opacity: 0; }
  12%     { opacity: 1; }
  85%     { opacity: 1; }
  100%    { top: -14px; opacity: 0; }
}

.stack-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px 96px 1fr;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  animation: stack-in 0.55s ease-out backwards;
}
.stack-item:nth-child(1) { animation-delay: 0.05s; }
.stack-item:nth-child(2) { animation-delay: 0.13s; }
.stack-item:nth-child(3) { animation-delay: 0.21s; }
.stack-item:nth-child(4) { animation-delay: 0.29s; }
.stack-item:nth-child(5) { animation-delay: 0.37s; }
@keyframes stack-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.stack-item + .stack-item { border-top: 1px solid rgba(38, 50, 72, 0.7); }

.stack-idx {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}
/* node marker sitting on the spine */
.stack-name {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  padding-left: 18px;
}
.stack-name::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1.5px solid var(--accent);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.stack-item:nth-child(n + 4) .stack-name::before { border-color: var(--blue); }

.stack-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  transition: color 0.2s ease;
}

.stack-item:hover .stack-desc { color: var(--text); }
.stack-item:hover .stack-idx { color: var(--accent); }
.stack-item:hover .stack-name::before {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

@media (max-width: 560px) {
  .stack-list::before,
  .stack-list::after { display: none; }
  .stack-item { grid-template-columns: 26px 1fr; row-gap: 4px; }
  .stack-name { padding-left: 0; }
  .stack-name::before { display: none; }
  .stack-desc { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .stack-list::after { animation: none; opacity: 0; }
  .stack-item { animation: none; }
}

/* ---------- Grids / cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: 8px; }
.card p { margin-bottom: 0; font-size: 0.94rem; }
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.card.link-card { display: flex; flex-direction: column; height: 100%; }

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
}
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat-num {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text);
}
.stat-num span { color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }

/* ---------- Badges / tags ---------- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  margin: 0 8px 8px 0;
}
.tag.blue { color: var(--blue); border-color: rgba(56,189,248,0.3); background: var(--blue-soft); }
.tag.accent { color: var(--accent); border-color: rgba(255,122,26,0.3); background: var(--accent-soft); }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, #14202f, #1a1420);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-band h2 { margin-bottom: 8px; }
.cta-band p { margin-bottom: 0; }

/* ---------- Section heading helper ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}
.section-head p { margin-bottom: 0; }

/* ---------- Timeline / process ---------- */
.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .process { grid-template-columns: 1fr; } }
.process-step {
  position: relative;
  padding: 24px 20px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.process-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

/* ---------- Lists ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "✓";
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
th { color: var(--text); font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
input, select, textarea {
  background: var(--bg-panel-2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.8rem; color: var(--text-dim); margin-top: 14px; }
.form-success {
  display: none;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--green);
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.form-error {
  display: none;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
/* honeypot: off-screen for humans, still submitted by naive bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
button[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---------- Case studies ---------- */
.meta-row {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}
article.prose h2 { margin-top: 1.6em; }
article.prose h3 { margin-top: 1.4em; }
article.prose p, article.prose li { color: var(--text-muted); }
article.prose ul, article.prose ol { padding-left: 1.2em; }
article.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  color: var(--text);
  font-style: italic;
}
article.prose pre {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  background: var(--bg-panel);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: var(--text-muted); font-size: 0.9rem; }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
  width: 36px; height: 36px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.footer-socials a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
