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

:root {
  --black: #111111;
  --grey: #666666;
  --grey-light: #999999;
  --grey-pale: #e8e8e8;
  --grey-wash: #f5f5f5;
  --white: #ffffff;
  --red: #e63225;

  --bg: var(--white);
  --bg-elevated: var(--white);
  --bg-subtle: var(--grey-wash);
  --bg-hover: var(--grey-wash);
  --text: var(--black);
  --text-secondary: var(--grey);
  --text-muted: var(--grey-light);
  --border: var(--grey-pale);
  --accent: var(--red);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e;
    --bg-elevated: #181818;
    --bg-subtle: #1e1e1e;
    --bg-hover: #242424;
    --text: #e8e8e8;
    --text-secondary: #999999;
    --text-muted: #666666;
    --border: #2a2a2a;
    --accent: #e63225;
  }
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
}

::selection { background-color: var(--accent); color: var(--white); }

[hidden] { display: none !important; }

/* ─── Password gate ─── */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
  z-index: 100;
}

.gate-card {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gate-mark {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -1px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--white);
  margin-bottom: 24px;
}

.gate-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}

.gate-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 6px 0 24px;
}

.gate-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease;
}
.gate-input:focus { border-color: var(--accent); }

.gate-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--white);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.gate-btn:hover { opacity: 0.9; }

.gate-error {
  color: var(--accent);
  font-size: 13px;
  margin-top: 12px;
}

/* ─── App ─── */
.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.header-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1.5px;
}

.header-sub {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 2px;
}

.lock-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.lock-btn:hover { color: var(--text); border-color: var(--text-muted); }

/* ─── Sections ─── */
.section { margin-bottom: 40px; }
.section:last-of-type { margin-bottom: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.section-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ─── Grid ─── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card--disabled {
  opacity: 0.5;
  cursor: default;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.card-desc {
  flex: 1;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.card-url {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'SF Mono', ui-monospace, Menlo, monospace;
  word-break: break-all;
}

/* ─── Status pill ─── */
.pill {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.pill--live { color: #1a8a4a; border-color: #1a8a4a55; }
.pill--wip { color: var(--accent); border-color: #e6322555; }
.pill--local { color: var(--text-muted); }

/* ─── Footer ─── */
.footer {
  margin-top: 56px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
