:root {
  --bg: #0d100c;
  --bg-elev: #151b14;
  --border: #2b332a;
  --text: #e9ebe1;
  --muted: #97a189;
  --accent: #4a8f56;
  --accent-soft: rgba(74, 143, 86, 0.15);
  --up: #63b06a;
  --down: #cf6a4d;
  --unknown: #97a189;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(74, 143, 86, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* Sticky site navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(13, 16, 12, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
}
.topbar-brand .mark {
  width: 30px;
  height: 30px;
}

/* Brand emblem image (nav + footer). Transparent PNG, tinted to --text. */
.mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.navsel { position: relative; }

.navsel-btn {
  width: auto;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
}
.navsel-btn:hover { filter: none; border-color: var(--muted); }
.navsel-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.caret { transition: transform 0.15s ease; color: var(--muted); }

.navsel-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  flex-direction: column;
  gap: 2px;
  display: none;            /* closed by default */
}
.navsel-menu.open { display: flex; }   /* opened by nav.js */

.navsel-menu a,
.navsel-signout {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  margin: 0;
  cursor: pointer;
}
.navsel-menu a:hover,
.navsel-signout:hover { background: var(--accent-soft); filter: none; }
.navsel-menu a.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.navsel-signout { color: var(--down); }

.navsel-sep {
  height: 1px;
  background: var(--border);
  margin: 5px 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}

.brand .mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #8a6a3a);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 6px 24px rgba(74, 143, 86, 0.35);
}

.brand h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.3px;
}

.hero h2 {
  font-size: 34px;
  line-height: 1.25;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}

.hero p {
  color: var(--muted);
  font-size: 17px;
  max-width: 60ch;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.login {
  margin-top: 48px;
  max-width: 420px;
}

.login h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.login p.sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="password"],
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #10140e;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input[type="password"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field { margin-bottom: 16px; }
.field:last-of-type { margin-bottom: 0; }

/* Off-screen honeypot — real users never see or fill it. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact { margin-top: 28px; max-width: 560px; }
.contact h3 { margin: 0 0 6px; font-size: 18px; }
.contact p.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

.note {
  font-size: 14px;
  margin-top: 14px;
  min-height: 20px;
}
.note.ok { color: var(--up); }
.note.err { color: var(--down); }

button {
  width: 100%;
  margin-top: 16px;
  padding: 13px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.6; cursor: default; }

.btn-link {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 13px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: filter 0.15s ease;
}
.btn-link:hover { filter: brightness(1.08); }

#signed-in .logout {
  width: 100%;
  margin-top: 12px;
}

.error {
  color: var(--down);
  font-size: 14px;
  margin-top: 14px;
  min-height: 20px;
}

/* Dashboard */
.logout {
  width: auto;
  margin: 0;
  padding: 9px 16px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
}
.logout:hover { color: var(--text); border-color: var(--muted); filter: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.project:hover { border-color: var(--accent); transform: translateY(-2px); }

.project .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project h3 { margin: 0; font-size: 17px; }
.project p { margin: 0; color: var(--muted); font-size: 14px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--unknown);
  box-shadow: 0 0 0 3px transparent;
}
.dot.up { background: var(--up); box-shadow: 0 0 10px rgba(99, 176, 106, 0.6); }
.dot.down { background: var(--down); box-shadow: 0 0 10px rgba(207, 106, 77, 0.5); }

.link-hint { color: var(--accent); font-size: 13px; margin-top: auto; }

/* ---- Marketing / content pages ---- */

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-lg h2 { font-size: 40px; }
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.hero-actions .btn-link { width: auto; padding: 12px 20px; }

.btn-link.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-link.ghost:hover { border-color: var(--accent); filter: none; }

.section { margin-top: 64px; }
.section-head { margin-bottom: 24px; }
.section-head h3 { font-size: 26px; margin: 0 0 8px; }
.section-head p { color: var(--muted); margin: 0; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.feature {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.feature h4 { margin: 0 0 8px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.project-card { display: flex; flex-direction: column; gap: 12px; }
.project-card h3 { margin: 0; font-size: 18px; }
.project-card p { margin: 0; color: var(--muted); font-size: 14px; }
.project-card .btn-link { margin-top: auto; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

.muted-note {
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.muted-note a { color: var(--accent); text-decoration: none; }
.muted-note a:hover { text-decoration: underline; }

.owner-access { margin-top: 64px; }

/* Settings page cards */
.settings-card { max-width: 560px; margin-bottom: 18px; }
.settings-card h3 { margin: 0 0 6px; font-size: 18px; }
.settings-card p.sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

/* ---- Prose (about / legal) ---- */
.prose { margin-top: 28px; }
.prose h3 { font-size: 18px; margin: 26px 0 8px; }
.prose h3:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--accent); }

.cta {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.cta h3 { margin: 0 0 4px; }
.cta p { margin: 0; color: var(--muted); }
.cta .btn-link { width: auto; padding: 12px 20px; }

/* ---- FAQ accordion ---- */
.faq { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.faq details {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 20px;
}
.faq summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; color: var(--muted); }
.faq a { color: var(--accent); }

/* ---- Shared site footer ---- */
.site-foot {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 40px 24px;
}
.site-foot-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-foot-brand .brandline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.site-foot-brand .mark {
  width: 26px; height: 26px;
}
.site-foot-brand p { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.site-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-content: flex-start;
}
.site-foot-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.site-foot-links a:hover { color: var(--text); }
.site-foot-legal {
  max-width: 880px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: 12px;
}
