/* ==========================================================================
   getcore.cloud — design tokens
   Structured shadcn/ui-style, so a tweakcn export can drop straight into
   the :root / [data-theme="dark"] blocks below with nothing else changing.
   ========================================================================== */

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

:root,
[data-theme="light"] {
  --background: oklch(0.98 0.005 260);
  --foreground: oklch(0.18 0.02 260);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.18 0.02 260);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.18 0.02 260);
  --primary: oklch(0.62 0.17 65);
  --primary-foreground: oklch(0.98 0.01 260);
  --secondary: oklch(0.94 0.01 260);
  --secondary-foreground: oklch(0.22 0.02 260);
  --muted: oklch(0.95 0.005 260);
  --muted-foreground: oklch(0.45 0.02 260);
  --accent: oklch(0.55 0.13 200);
  --accent-foreground: oklch(0.98 0.01 260);
  --destructive: oklch(0.55 0.22 25);
  --border: oklch(0.88 0.01 260);
  --input: oklch(0.88 0.01 260);
  --ring: oklch(0.62 0.17 65);
  --radius: 0.65rem;

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
}

[data-theme="dark"] {
  --background: oklch(0.16 0.02 260);
  --foreground: oklch(0.94 0.01 260);
  --card: oklch(0.205 0.02 260);
  --card-foreground: oklch(0.94 0.01 260);
  --popover: oklch(0.205 0.02 260);
  --popover-foreground: oklch(0.94 0.01 260);
  --primary: oklch(0.78 0.16 70);
  --primary-foreground: oklch(0.16 0.02 260);
  --secondary: oklch(0.27 0.02 260);
  --secondary-foreground: oklch(0.94 0.01 260);
  --muted: oklch(0.24 0.015 260);
  --muted-foreground: oklch(0.64 0.02 260);
  --accent: oklch(0.58 0.13 200);
  --accent-foreground: oklch(0.97 0.01 260);
  --destructive: oklch(0.62 0.21 25);
  --border: oklch(0.29 0.015 260);
  --input: oklch(0.29 0.015 260);
  --ring: oklch(0.78 0.16 70);
}

/* ==========================================================================
   Reset + base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

a { color: inherit; }
button { font-family: inherit; }

::selection { background: var(--primary); color: var(--primary-foreground); }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.accent { color: var(--primary); }
code { font-family: var(--font-mono); }

/* ==========================================================================
   Status strip — the signature element. A dispatch-console header.
   ========================================================================== */

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 20;
}

.statusbar-left, .statusbar-right { display: flex; align-items: center; gap: 0.75rem; }
.statusbar-label { color: var(--muted-foreground); }
.statusbar-mono { color: var(--foreground); }
.statusbar-dim { color: var(--muted-foreground); display: none; }
.statusbar-logout {
  color: var(--muted-foreground);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.35rem);
  padding: 0.2rem 0.55rem;
}
.statusbar-logout:hover { color: var(--foreground); border-color: var(--foreground); }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--primary) 60%, transparent);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.pulse-dot--locked { background: var(--destructive); animation: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklch, var(--primary) 55%, transparent); }
  70%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (min-width: 640px) {
  .statusbar-dim { display: inline; }
}

/* ==========================================================================
   Shell / nav
   ========================================================================== */

.shell { display: flex; min-height: calc(100vh - 41px); }

.nav {
  display: none;
}

.brand { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.25rem 1.25rem; }
.brand-mark {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-foreground);
  border-radius: calc(var(--radius) - 0.3rem);
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
}
.brand-name { font-size: 0.95rem; }

.nav-tabs { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-tab {
  display: flex; align-items: center; gap: 0.6rem;
  background: none; border: none; color: var(--muted-foreground);
  padding: 0.55rem 0.7rem; border-radius: calc(var(--radius) - 0.2rem);
  font-size: 0.85rem; text-align: left; cursor: pointer;
}
.nav-tab .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-tab:hover { background: var(--secondary); color: var(--foreground); }
.nav-tab.is-active { background: var(--secondary); color: var(--foreground); }

@media (min-width: 900px) {
  .nav {
    display: block;
    width: 220px;
    flex-shrink: 0;
    padding: 1.25rem 0.9rem;
    border-right: 1px solid var(--border);
  }
}

/* ==========================================================================
   Content / panels
   ========================================================================== */

.content { flex: 1; padding: 1.1rem 1rem 5.5rem; max-width: 1100px; }
@media (min-width: 900px) { .content { padding: 1.75rem 2rem 2rem; } }

.panel { display: none; }
.panel.is-active { display: block; }

.panel-head {
  display: flex; flex-direction: column; gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.panel-head h1 { font-size: 1.3rem; }

@media (min-width: 640px) {
  .panel-head { flex-direction: row; align-items: center; justify-content: space-between; }
}

.search, .tool-input {
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--foreground);
  border-radius: calc(var(--radius) - 0.2rem);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  width: 100%;
}
@media (min-width: 640px) { .search { width: 240px; } }

/* ==========================================================================
   Project grid / cards
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.card-head h3 { font-size: 0.98rem; }
.card-desc { color: var(--muted-foreground); font-size: 0.85rem; margin: 0; flex: 1; }

.badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-active { background: color-mix(in oklch, var(--primary) 18%, transparent); color: var(--primary); }
.badge-dev    { background: color-mix(in oklch, var(--accent) 18%, transparent); color: var(--accent); }
.badge-paused { background: var(--muted); color: var(--muted-foreground); }

.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
}

.card-actions { display: flex; gap: 0.5rem; margin-top: 0.2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: calc(var(--radius) - 0.25rem);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-ghost:hover { background: var(--secondary); }
.btn-disabled { color: var(--muted-foreground); font-size: 0.78rem; }

/* ==========================================================================
   Dev tools panel
   ========================================================================== */

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}
@media (min-width: 720px)  { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.tool-card h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); margin-bottom: 0.7rem; }
.tool-card--wide { grid-column: 1 / -1; }

.linklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.linklist a { font-size: 0.85rem; text-decoration: none; color: var(--foreground); }
.linklist a:hover { color: var(--primary); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 0.75rem; margin: 0; }
.kv dt { color: var(--muted-foreground); font-size: 0.78rem; }
.kv dd { margin: 0; font-family: var(--font-mono); font-size: 0.78rem; word-break: break-all; }

.mono-area {
  width: 100%; min-height: 140px; resize: vertical;
  background: var(--input); color: var(--foreground);
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.2rem);
  font-family: var(--font-mono); font-size: 0.78rem;
  padding: 0.6rem; margin-bottom: 0.6rem;
}
.mono-area--sm { min-height: 80px; }

.tool-row { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.tool-row .tool-input { flex: 1; }
.tool-row input[type="color"] {
  width: 42px; height: 38px; padding: 0; border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 0.3rem); background: none;
}

.tool-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.tool-status { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground); margin: 0.5rem 0 0; word-break: break-all; }

/* ==========================================================================
   Mobile bottom tab bar
   ========================================================================== */

.mobile-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
  z-index: 20;
}
.mobile-tabbar .nav-tab { flex: 1; flex-direction: column; gap: 0.2rem; font-size: 0.68rem; text-align: center; }
.mobile-tabbar .icon { width: 20px; height: 20px; }

@media (min-width: 900px) {
  .mobile-tabbar { display: none; }
}

/* ==========================================================================
   Gate page
   ========================================================================== */

.gate-body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  padding: 1.5rem;
}

.gate-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.gate-mark { margin-bottom: 0.75rem; display: flex; justify-content: center; }
.gate-title { font-size: 1.4rem; margin-bottom: 0.2rem; }
.gate-sub { color: var(--muted-foreground); font-size: 0.85rem; margin: 0 0 1.5rem; }
.gate-error { color: var(--destructive); font-size: 0.8rem; margin: -0.75rem 0 1rem; }

.pin-display {
  width: 100%;
  text-align: center;
  letter-spacing: 0.6em;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--foreground);
  border-radius: var(--radius);
  padding: 0.8rem 0.5rem 0.8rem 0.9em;
  margin-bottom: 1.25rem;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}
.key {
  padding: 0.9rem 0;
  font-size: 1.05rem;
  font-family: var(--font-mono);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  border-radius: calc(var(--radius) - 0.15rem);
  cursor: pointer;
}
.key:active { background: var(--secondary); }
.key-primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); font-family: var(--font-body); font-weight: 600; }
.key-ghost { font-family: var(--font-body); font-size: 0.75rem; color: var(--muted-foreground); }
.key:disabled { opacity: 0.4; cursor: not-allowed; }

.hash-output {
  width: 100%; min-height: 70px;
  font-family: var(--font-mono); font-size: 0.75rem;
  background: var(--input); color: var(--foreground);
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 0.2rem);
  padding: 0.6rem;
}
