:root {
  --bg-deep: #0a1018;
  --bg-deep2: #0d1c24;
  --ink: #eef3f6;
  --muted: #9fb0bc;
  --card-bg: rgba(255,255,255,0.04);
  --card-bg-solid: #ffffff;
  --border: rgba(255,255,255,0.10);
  --border-solid: #e4e8ec;
  --active: #34d399;
  --development: #fbbf24;
  --planned: #94a3b8;
  --gov: #2dd4bf;
  --apps: #fb923c;
  --web: #c084fc;
  --glow-gov: rgba(45,212,191,0.35);
  --glow-apps: rgba(251,146,60,0.35);
  --glow-web: rgba(192,132,252,0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg-deep);
}

body {
  font-family: "Inter", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
}

h1, h2, h3, .logo-text, .nav-btn {
  font-family: "Sora", "Inter", sans-serif;
}

/* ---------- Glowing hexagon backdrop ---------- */
.hex-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 18%, rgba(45,212,191,0.18), transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(192,132,252,0.16), transparent 42%),
    radial-gradient(circle at 75% 85%, rgba(251,146,60,0.14), transparent 40%),
    linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-deep2) 55%, #0a1420 100%);
}
.hex-field::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(60deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(-60deg, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 64px);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 75%);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(10,16,24,0.65);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  flex-wrap: wrap;
  gap: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #0a1018;
  background: linear-gradient(135deg, var(--gov), var(--web));
  box-shadow: 0 0 18px rgba(192,132,252,0.45);
}
.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.2px;
}
.logo-text span { color: var(--muted); font-weight: 400; }

.main-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.nav-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-1px); }
.nav-btn.active {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
  box-shadow: 0 0 24px rgba(255,255,255,0.08);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.dot-gov { background: var(--gov); color: var(--gov); }
.dot-apps { background: var(--apps); color: var(--apps); }
.dot-web { background: var(--web); color: var(--web); }

main#content {
  max-width: 1140px;
  margin: 0 auto;
  padding: 56px 28px 90px;
  min-height: 60vh;
  position: relative;
}

/* ---------- Home / hero ---------- */
.hero {
  text-align: center;
  padding: 70px 20px 30px;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gov);
  padding: 6px 16px;
  border: 1px solid rgba(45,212,191,0.4);
  border-radius: 999px;
  background: rgba(45,212,191,0.08);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #fff 30%, var(--gov) 70%, var(--web) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lede {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 48px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 20px;
}
@media (max-width: 800px) {
  .home-grid { grid-template-columns: 1fr; }
}

.home-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 26px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}
.home-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(circle at 30% 0%, var(--glow), transparent 65%);
}
.home-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,255,255,0.25);
}
.home-card:hover::before { opacity: 1; }
.home-card.governance { --glow: var(--glow-gov); }
.home-card.apps { --glow: var(--glow-apps); }
.home-card.websites { --glow: var(--glow-web); }

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.home-card.governance .card-icon { background: rgba(45,212,191,0.15); color: var(--gov); }
.home-card.apps .card-icon { background: rgba(251,146,60,0.15); color: var(--apps); }
.home-card.websites .card-icon { background: rgba(192,132,252,0.15); color: var(--web); }

.home-card h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  position: relative;
  z-index: 1;
}
.home-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}
.card-arrow {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-card.governance .card-arrow { color: var(--gov); }
.home-card.apps .card-arrow { color: var(--apps); }
.home-card.websites .card-arrow { color: var(--web); }
.home-card:hover .card-arrow { gap: 10px; }
.card-arrow span { transition: transform 0.2s ease; }

/* ---------- Section view ---------- */
.section-head {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 {
  font-size: 2.1rem;
  font-weight: 800;
  margin: 0 0 8px;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.item-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 760px) {
  .item-list { grid-template-columns: 1fr; }
}

.item-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 26px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.item-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  opacity: 0.8;
}
.item-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.22);
}

.item-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.item-card h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
}
.item-card h3 a { color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--muted); }
.item-card h3 a:hover { color: var(--gov); }

.item-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.badge.active { background: rgba(52,211,153,0.12); color: var(--active); border: 1px solid rgba(52,211,153,0.3); }
.badge.development { background: rgba(251,191,36,0.12); color: var(--development); border: 1px solid rgba(251,191,36,0.3); }
.badge.planned { background: rgba(148,163,184,0.12); color: var(--planned); border: 1px solid rgba(148,163,184,0.3); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.back-link:hover { color: var(--ink); }

.site-footer {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  position: relative;
}

/* ---------- Markdown to Word tool (md-to-word.html) ---------- */

.tool-page main#content {
  max-width: 1320px;
  padding: 40px 28px 70px;
}
/* nav pills are anchors on this page, buttons on the SPA - normalise */
.main-nav a.nav-btn { text-decoration: none; }

.tool-head { text-align: center; margin-bottom: 30px; }
.tool-head h1 {
  font-family: "Sora", "Inter", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin: 0 0 10px;
}
.tool-head p.lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 720px;
  margin: 0 auto;
}

/* Two framed panes */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}
.tool-pane { min-width: 0; }
.pane-label {
  text-align: center;
  font-family: "Sora", "Inter", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.pane-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 12px;
  min-height: 1em;
}
#mdHint { cursor: pointer; }
#mdHint:hover { color: var(--ink); }

.pane-frame {
  height: 60vh;
  min-height: 440px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card-bg);
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#input {
  width: 100%;
  height: 100%;
  resize: none;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  color: var(--ink);
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  tab-size: 2;
}
#input:focus { outline: none; border-color: rgba(45,212,191,0.5); }
#input::placeholder { color: rgba(159,176,188,0.45); }

/* The white "paper" the Word output is previewed on */
.paper-wrap {
  height: 100%;
  overflow: auto;
  border-radius: 12px;
  background: #ffffff;
}
.paper {
  min-height: 100%;
  padding: 30px 34px;
  background: #ffffff;
  color: #000000;
}
.paper:focus { outline: 2px solid rgba(45,212,191,0.5); outline-offset: -2px; }
.paper table { display: table; }

.tool-foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 28px 0 0;
}

/* Drag state highlights both frames */
body.dragging .pane-frame {
  border-color: rgba(45,212,191,0.6);
  box-shadow: 0 0 30px rgba(45,212,191,0.18);
}

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr; gap: 26px; }
  .pane-frame { height: auto; min-height: 340px; }
}

.site-footer p { margin: 0; }
.footer-links { margin-top: 8px; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.footer-links a:hover { color: var(--gov); border-color: var(--gov); }
