:root {
  /* Paletă calmă, placută — slate + teal + sage */
  --bg: #0f1419;
  --bg-soft: #141b22;
  --card: #1a222c;
  --card-hover: #1f2936;
  --border: #2a3544;
  --border-soft: #243040;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #5b9fd4;
  --accent-soft: rgba(91, 159, 212, 0.14);
  --accent-strong: #4a8fc4;
  --teal: #5eb8a8;
  --sage: #8fbc8f;
  --amber: #d4a574;
  --pink: #d4849a;
  --green: #6bbf8a;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  /* fundal lin — două nuanțe foarte blânde */
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(91, 159, 212, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 95% 5%, rgba(94, 184, 168, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 35% at 50% 100%, rgba(143, 188, 143, 0.05), transparent 55%);
  background-attachment: fixed;
}

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

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 48px;
  position: relative;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(145deg, #6baed9 0%, #5b9fd4 45%, #5eb8a8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 159, 212, 0.28);
}
.back-link { color: var(--muted); font-size: 0.9rem; }

/* ── Hub hero ── */
.hero {
  text-align: center;
  padding: 12px 0 6px;
  position: relative;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #e8eef4 0%, #b8d4ea 55%, #a8d8ce 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@supports not (background-clip: text) {
  .hero h1 { color: var(--text); background: none; }
}
.hero p {
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 28em;
  line-height: 1.55;
}

/* Number box */
.num-box {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 20px 16px 16px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.num-box label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
  text-align: center;
}
.num-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.num-row input {
  flex: 1;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.65);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.num-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.num-row input::placeholder { color: #4a5a6a; letter-spacing: 0.14em; }
.num-row button {
  min-width: 110px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, #6baed9, var(--accent-strong));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 16px;
  box-shadow: 0 4px 14px rgba(91, 159, 212, 0.25);
  transition: filter 0.15s, transform 0.12s;
}
.num-row button:hover { filter: brightness(1.06); }
.num-row button:active { transform: scale(0.98); }
.num-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: #6b7c8e;
}
.num-error {
  margin: 10px 0 0;
  text-align: center;
  color: var(--pink);
  font-size: 0.9rem;
  display: none;
}
.num-error.show { display: block; }

/* Project cards */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 4px 0 14px;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.list { display: flex; flex-direction: column; gap: 12px; }

.card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 16px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s, transform 0.18s, background 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.card:hover {
  border-color: rgba(91, 159, 212, 0.35);
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}
.badge-num {
  flex-shrink: 0;
  min-width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.92rem;
  background: linear-gradient(160deg, rgba(91, 159, 212, 0.18), rgba(94, 184, 168, 0.1));
  color: #a8cfe8;
  border: 1px solid rgba(91, 159, 212, 0.25);
}
.card-body { flex: 1; min-width: 0; }
.card h2 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--text);
}
.card p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.card .meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tag-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(94, 184, 168, 0.1);
  color: #9ecfc4;
  border: 1px solid rgba(94, 184, 168, 0.18);
}
.tag-pill.board {
  background: var(--accent-soft);
  color: #a8cfe8;
  border-color: rgba(91, 159, 212, 0.2);
}

/* Project page */
.proj-head { margin-bottom: 16px; }
.proj-num {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #a8cfe8;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 159, 212, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.proj-head h1 { margin: 0 0 6px; font-size: 1.45rem; }
.proj-head .sub { margin: 0; color: var(--muted); }

.panel {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 1.02rem;
  color: #d0dbe6;
}
.schema-img-wrap {
  margin: 0 0 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f1419;
}
.schema-img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #0f1419;
}
.panel h3 {
  margin: 14px 0 8px;
  font-size: 0.92rem;
  color: #c5d0db;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th, td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
th { background: rgba(15, 20, 25, 0.55); color: #c5d0db; }
code, td code { color: #8ec8e8; font-size: 0.86rem; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li {
  counter-increment: s;
  position: relative;
  padding: 10px 10px 10px 44px;
  margin: 6px 0;
  background: rgba(15, 20, 25, 0.45);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6baed9, var(--accent-strong));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.note {
  margin-top: 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.warn {
  border-left-color: var(--pink);
  background: rgba(212, 132, 154, 0.1);
}

.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(145deg, #6baed9, var(--accent-strong));
  color: #fff;
  font-size: 0.88rem;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(91, 159, 212, 0.4);
  color: var(--accent);
}
pre {
  margin: 0;
  background: #0a0e12;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  overflow-x: auto;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #c5d0db;
  max-height: 420px;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tab {
  border: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.5);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
}
.tab.active {
  border-color: var(--accent);
  color: #a8cfe8;
  background: var(--accent-soft);
}
.hidden { display: none !important; }
.view { display: none; }
.view.active { display: block; }

.foot {
  margin-top: 32px;
  text-align: center;
  color: #5a6b7c;
  font-size: 0.8rem;
  padding-top: 8px;
}

/* soft reduce motion */
@media (prefers-reduced-motion: reduce) {
  .card, .num-row button {
    transition: none;
  }
}
