/* ==========================================================================
   kriokit — shared design system
   Tokens: ink navy bg, paper surface, kriokit green accent, amber highlight
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #0B1120;
  --ink-soft: #111a2e;
  --surface: #ffffff;
  --surface-dim: #f6f8fb;
  --border: #e4e9f1;
  --border-dark: #1e293b;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #e7ecf5;
  --green: #16a34a;
  --green-dark: #0f7a37;
  --green-tint: #e9f8ef;
  --amber: #f59e0b;
  --amber-tint: #fef3e0;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.15);
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --bottomnav-h: 62px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--surface-dim);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ---------- App shell: sidebar (desktop) ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(150deg, var(--green), var(--green-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #eafff1;
  flex-shrink: 0;
}

.sidebar-brand .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.sidebar-section-label {
  padding: 20px 22px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: #b6c0d4;
  font-size: 14.5px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}

.sidebar-link:hover { background: rgba(255,255,255,0.05); color: #fff; }

.sidebar-link.is-active {
  background: rgba(22, 163, 74, 0.16);
  color: #6ee7a0;
  font-weight: 600;
}

.sidebar-link .ico {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-link .ico svg { width: 100%; height: 100%; }

.sidebar-link .tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #475569;
}

.sidebar-footer-note {
  margin-top: auto;
  padding: 18px 22px 22px;
  font-size: 12.5px;
  color: #536078;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------- Main column ---------- */

.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: none; /* desktop: hidden, mobile: shown */
}

.page {
  flex: 1;
  width: 100%;
}

.page-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 40px 60px;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #9aa7bd;
  margin-top: auto;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 40px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}

.footer-brand-block .mark-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}

.footer-brand-block .mark-row .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(150deg, var(--green), var(--green-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 12px; color: #eafff1;
}

.footer-brand-block .mark-row .name {
  font-family: var(--font-display); font-weight: 700; font-size: 17px; color: #fff;
}

.footer-brand-block p {
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 260px;
  color: #8593ac;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 14px;
}

.footer-col ul { display: flex; flex-direction: column; gap: 10px; }

.footer-col a {
  font-size: 14px;
  color: #b7c1d4;
  transition: color .15s ease;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: #647089;
}

.footer-bottom .ad-slot-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #465065;
  border: 1px dashed #2a374d;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ---------- Reusable UI ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  border: none;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--green); color: var(--green-dark); }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-lg { padding: 15px 28px; font-size: 15.5px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-dark);
  background: var(--green-tint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}

/* ---------- Mobile bottom nav (app-like) ---------- */

.bottom-nav {
  display: none;
}

/* ==========================================================================
   Responsive: mobile → app shell
   ========================================================================== */

@media (max-width: 880px) {
  .app-shell { flex-direction: column; }

  .sidebar { display: none; }

  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--topbar-h);
    padding: 0 18px;
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .topbar .mark {
    width: 26px; height: 26px; border-radius: 7px;
    background: linear-gradient(150deg, var(--green), var(--green-dark));
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-weight: 700; font-size: 12px; color: #eafff1;
  }

  .topbar .name {
    font-family: var(--font-display); font-weight: 700; font-size: 16px;
  }

  .page-inner { padding: 22px 18px 100px; }

  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .footer-brand-block { grid-column: 1 / -1; }

  /* Bottom tab bar = the "app" feel */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottomnav-h);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 40;
  }

  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding-top: 6px;
  }

  .bottom-nav a .ico { width: 20px; height: 20px; }
  .bottom-nav a .ico svg { width: 100%; height: 100%; }

  .bottom-nav a.is-active { color: var(--green-dark); }

  body { padding-bottom: 0; }
  .site-footer { margin-bottom: var(--bottomnav-h); }
}

@media (max-width: 480px) {
  .page-inner { padding: 18px 14px 100px; }
  .footer-inner { padding: 36px 20px 22px; }
}
